diff --git a/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/INSTALLER b/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/METADATA b/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..61b6e3ee620bb606cf5b99646c8fcb84ee128419 --- /dev/null +++ b/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/METADATA @@ -0,0 +1,291 @@ +Metadata-Version: 2.1 +Name: aiofiles +Version: 23.2.1 +Summary: File support for asyncio. +Project-URL: Changelog, https://github.com/Tinche/aiofiles#history +Project-URL: Bug Tracker, https://github.com/Tinche/aiofiles/issues +Project-URL: repository, https://github.com/Tinche/aiofiles +Author-email: Tin Tvrtkovic +License: Apache-2.0 +License-File: LICENSE +License-File: NOTICE +Classifier: Development Status :: 5 - Production/Stable +Classifier: Framework :: AsyncIO +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Requires-Python: >=3.7 +Description-Content-Type: text/markdown + +# aiofiles: file support for asyncio + +[![PyPI](https://img.shields.io/pypi/v/aiofiles.svg)](https://pypi.python.org/pypi/aiofiles) +[![Build](https://github.com/Tinche/aiofiles/workflows/CI/badge.svg)](https://github.com/Tinche/aiofiles/actions) +[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/Tinche/882f02e3df32136c847ba90d2688f06e/raw/covbadge.json)](https://github.com/Tinche/aiofiles/actions/workflows/main.yml) +[![Supported Python versions](https://img.shields.io/pypi/pyversions/aiofiles.svg)](https://github.com/Tinche/aiofiles) +[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) + +**aiofiles** is an Apache2 licensed library, written in Python, for handling local +disk files in asyncio applications. + +Ordinary local file IO is blocking, and cannot easily and portably be made +asynchronous. This means doing file IO may interfere with asyncio applications, +which shouldn't block the executing thread. aiofiles helps with this by +introducing asynchronous versions of files that support delegating operations to +a separate thread pool. + +```python +async with aiofiles.open('filename', mode='r') as f: + contents = await f.read() +print(contents) +'My file contents' +``` + +Asynchronous iteration is also supported. + +```python +async with aiofiles.open('filename') as f: + async for line in f: + ... +``` + +Asynchronous interface to tempfile module. + +```python +async with aiofiles.tempfile.TemporaryFile('wb') as f: + await f.write(b'Hello, World!') +``` + +## Features + +- a file API very similar to Python's standard, blocking API +- support for buffered and unbuffered binary files, and buffered text files +- support for `async`/`await` ([PEP 492](https://peps.python.org/pep-0492/)) constructs +- async interface to tempfile module + +## Installation + +To install aiofiles, simply: + +```bash +$ pip install aiofiles +``` + +## Usage + +Files are opened using the `aiofiles.open()` coroutine, which in addition to +mirroring the builtin `open` accepts optional `loop` and `executor` +arguments. If `loop` is absent, the default loop will be used, as per the +set asyncio policy. If `executor` is not specified, the default event loop +executor will be used. + +In case of success, an asynchronous file object is returned with an +API identical to an ordinary file, except the following methods are coroutines +and delegate to an executor: + +- `close` +- `flush` +- `isatty` +- `read` +- `readall` +- `read1` +- `readinto` +- `readline` +- `readlines` +- `seek` +- `seekable` +- `tell` +- `truncate` +- `writable` +- `write` +- `writelines` + +In case of failure, one of the usual exceptions will be raised. + +`aiofiles.stdin`, `aiofiles.stdout`, `aiofiles.stderr`, +`aiofiles.stdin_bytes`, `aiofiles.stdout_bytes`, and +`aiofiles.stderr_bytes` provide async access to `sys.stdin`, +`sys.stdout`, `sys.stderr`, and their corresponding `.buffer` properties. + +The `aiofiles.os` module contains executor-enabled coroutine versions of +several useful `os` functions that deal with files: + +- `stat` +- `statvfs` +- `sendfile` +- `rename` +- `renames` +- `replace` +- `remove` +- `unlink` +- `mkdir` +- `makedirs` +- `rmdir` +- `removedirs` +- `link` +- `symlink` +- `readlink` +- `listdir` +- `scandir` +- `access` +- `path.exists` +- `path.isfile` +- `path.isdir` +- `path.islink` +- `path.ismount` +- `path.getsize` +- `path.getatime` +- `path.getctime` +- `path.samefile` +- `path.sameopenfile` + +### Tempfile + +**aiofiles.tempfile** implements the following interfaces: + +- TemporaryFile +- NamedTemporaryFile +- SpooledTemporaryFile +- TemporaryDirectory + +Results return wrapped with a context manager allowing use with async with and async for. + +```python +async with aiofiles.tempfile.NamedTemporaryFile('wb+') as f: + await f.write(b'Line1\n Line2') + await f.seek(0) + async for line in f: + print(line) + +async with aiofiles.tempfile.TemporaryDirectory() as d: + filename = os.path.join(d, "file.ext") +``` + +### Writing tests for aiofiles + +Real file IO can be mocked by patching `aiofiles.threadpool.sync_open` +as desired. The return type also needs to be registered with the +`aiofiles.threadpool.wrap` dispatcher: + +```python +aiofiles.threadpool.wrap.register(mock.MagicMock)( + lambda *args, **kwargs: threadpool.AsyncBufferedIOBase(*args, **kwargs)) + +async def test_stuff(): + data = 'data' + mock_file = mock.MagicMock() + + with mock.patch('aiofiles.threadpool.sync_open', return_value=mock_file) as mock_open: + async with aiofiles.open('filename', 'w') as f: + await f.write(data) + + mock_file.write.assert_called_once_with(data) +``` + +### History + +#### 23.2.1 (2023-08-09) + +- Import `os.statvfs` conditionally to fix importing on non-UNIX systems. + [#171](https://github.com/Tinche/aiofiles/issues/171) [#172](https://github.com/Tinche/aiofiles/pull/172) + +#### 23.2.0 (2023-08-09) + +- aiofiles is now tested on Python 3.12 too. + [#166](https://github.com/Tinche/aiofiles/issues/166) [#168](https://github.com/Tinche/aiofiles/pull/168) +- On Python 3.12, `aiofiles.tempfile.NamedTemporaryFile` now accepts a `delete_on_close` argument, just like the stdlib version. +- On Python 3.12, `aiofiles.tempfile.NamedTemporaryFile` no longer exposes a `delete` attribute, just like the stdlib version. +- Added `aiofiles.os.statvfs` and `aiofiles.os.path.ismount`. + [#162](https://github.com/Tinche/aiofiles/pull/162) +- Use [PDM](https://pdm.fming.dev/latest/) instead of Poetry. + [#169](https://github.com/Tinche/aiofiles/pull/169) + +#### 23.1.0 (2023-02-09) + +- Added `aiofiles.os.access`. + [#146](https://github.com/Tinche/aiofiles/pull/146) +- Removed `aiofiles.tempfile.temptypes.AsyncSpooledTemporaryFile.softspace`. + [#151](https://github.com/Tinche/aiofiles/pull/151) +- Added `aiofiles.stdin`, `aiofiles.stdin_bytes`, and other stdio streams. + [#154](https://github.com/Tinche/aiofiles/pull/154) +- Transition to `asyncio.get_running_loop` (vs `asyncio.get_event_loop`) internally. + +#### 22.1.0 (2022-09-04) + +- Added `aiofiles.os.path.islink`. + [#126](https://github.com/Tinche/aiofiles/pull/126) +- Added `aiofiles.os.readlink`. + [#125](https://github.com/Tinche/aiofiles/pull/125) +- Added `aiofiles.os.symlink`. + [#124](https://github.com/Tinche/aiofiles/pull/124) +- Added `aiofiles.os.unlink`. + [#123](https://github.com/Tinche/aiofiles/pull/123) +- Added `aiofiles.os.link`. + [#121](https://github.com/Tinche/aiofiles/pull/121) +- Added `aiofiles.os.renames`. + [#120](https://github.com/Tinche/aiofiles/pull/120) +- Added `aiofiles.os.{listdir, scandir}`. + [#143](https://github.com/Tinche/aiofiles/pull/143) +- Switched to CalVer. +- Dropped Python 3.6 support. If you require it, use version 0.8.0. +- aiofiles is now tested on Python 3.11. + +#### 0.8.0 (2021-11-27) + +- aiofiles is now tested on Python 3.10. +- Added `aiofiles.os.replace`. + [#107](https://github.com/Tinche/aiofiles/pull/107) +- Added `aiofiles.os.{makedirs, removedirs}`. +- Added `aiofiles.os.path.{exists, isfile, isdir, getsize, getatime, getctime, samefile, sameopenfile}`. + [#63](https://github.com/Tinche/aiofiles/pull/63) +- Added `suffix`, `prefix`, `dir` args to `aiofiles.tempfile.TemporaryDirectory`. + [#116](https://github.com/Tinche/aiofiles/pull/116) + +#### 0.7.0 (2021-05-17) + +- Added the `aiofiles.tempfile` module for async temporary files. + [#56](https://github.com/Tinche/aiofiles/pull/56) +- Switched to Poetry and GitHub actions. +- Dropped 3.5 support. + +#### 0.6.0 (2020-10-27) + +- `aiofiles` is now tested on ppc64le. +- Added `name` and `mode` properties to async file objects. + [#82](https://github.com/Tinche/aiofiles/pull/82) +- Fixed a DeprecationWarning internally. + [#75](https://github.com/Tinche/aiofiles/pull/75) +- Python 3.9 support and tests. + +#### 0.5.0 (2020-04-12) + +- Python 3.8 support. Code base modernization (using `async/await` instead of `asyncio.coroutine`/`yield from`). +- Added `aiofiles.os.remove`, `aiofiles.os.rename`, `aiofiles.os.mkdir`, `aiofiles.os.rmdir`. + [#62](https://github.com/Tinche/aiofiles/pull/62) + +#### 0.4.0 (2018-08-11) + +- Python 3.7 support. +- Removed Python 3.3/3.4 support. If you use these versions, stick to aiofiles 0.3.x. + +#### 0.3.2 (2017-09-23) + +- The LICENSE is now included in the sdist. + [#31](https://github.com/Tinche/aiofiles/pull/31) + +#### 0.3.1 (2017-03-10) + +- Introduced a changelog. +- `aiofiles.os.sendfile` will now work if the standard `os` module contains a `sendfile` function. + +### Contributing + +Contributions are very welcome. Tests can be run with `tox`, please ensure +the coverage at least stays the same before you submit a pull request. diff --git a/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/RECORD b/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..216d8ec97714d622876695c51213fa52bb91fbd9 --- /dev/null +++ b/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/RECORD @@ -0,0 +1,26 @@ +aiofiles-23.2.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +aiofiles-23.2.1.dist-info/METADATA,sha256=cot28p_PNjdl_MK--l9Qu2e6QOv9OxdHrKbjLmYf9Uw,9673 +aiofiles-23.2.1.dist-info/RECORD,, +aiofiles-23.2.1.dist-info/WHEEL,sha256=KGYbc1zXlYddvwxnNty23BeaKzh7YuoSIvIMO4jEhvw,87 +aiofiles-23.2.1.dist-info/licenses/LICENSE,sha256=y16Ofl9KOYjhBjwULGDcLfdWBfTEZRXnduOspt-XbhQ,11325 +aiofiles-23.2.1.dist-info/licenses/NOTICE,sha256=EExY0dRQvWR0wJ2LZLwBgnM6YKw9jCU-M0zegpRSD_E,55 +aiofiles/__init__.py,sha256=1iAMJQyJtX3LGIS0AoFTJeO1aJ_RK2jpBSBhg0VoIrE,344 +aiofiles/__pycache__/__init__.cpython-39.pyc,, +aiofiles/__pycache__/base.cpython-39.pyc,, +aiofiles/__pycache__/os.cpython-39.pyc,, +aiofiles/__pycache__/ospath.cpython-39.pyc,, +aiofiles/base.py,sha256=rZwA151Ji8XlBkzvDmcF1CgDTY2iKNuJMfvNlM0s0E0,2684 +aiofiles/os.py,sha256=zuFGaIyGCGUuFb7trFFEm6SLdCRqTFsSV0mY6SO8z3M,970 +aiofiles/ospath.py,sha256=zqG2VFzRb6yYiIOWipqsdgvZmoMTFvZmBdkxkAl1FT4,764 +aiofiles/tempfile/__init__.py,sha256=hFSNTOjOUv371Ozdfy6FIxeln46Nm3xOVh4ZR3Q94V0,10244 +aiofiles/tempfile/__pycache__/__init__.cpython-39.pyc,, +aiofiles/tempfile/__pycache__/temptypes.cpython-39.pyc,, +aiofiles/tempfile/temptypes.py,sha256=ddEvNjMLVlr7WUILCe6ypTqw77yREeIonTk16Uw_NVs,2093 +aiofiles/threadpool/__init__.py,sha256=c_aexl1t193iKdPZaolPEEbHDrQ0RrsH_HTAToMPQBo,3171 +aiofiles/threadpool/__pycache__/__init__.cpython-39.pyc,, +aiofiles/threadpool/__pycache__/binary.cpython-39.pyc,, +aiofiles/threadpool/__pycache__/text.cpython-39.pyc,, +aiofiles/threadpool/__pycache__/utils.cpython-39.pyc,, +aiofiles/threadpool/binary.py,sha256=hp-km9VCRu0MLz_wAEUfbCz7OL7xtn9iGAawabpnp5U,2315 +aiofiles/threadpool/text.py,sha256=fNmpw2PEkj0BZSldipJXAgZqVGLxALcfOMiuDQ54Eas,1223 +aiofiles/threadpool/utils.py,sha256=B59dSZwO_WZs2dFFycKeA91iD2Xq2nNw1EFF8YMBI5k,1868 diff --git a/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/WHEEL b/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..9a7c9d3aa0dbdfb11d17aa156b7fc731dcd4a038 --- /dev/null +++ b/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: hatchling 1.17.1 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/licenses/LICENSE b/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..e06d2081865a766a8668acc12878f98b27fc9ea0 --- /dev/null +++ b/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/licenses/LICENSE @@ -0,0 +1,202 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/licenses/NOTICE b/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/licenses/NOTICE new file mode 100644 index 0000000000000000000000000000000000000000..d134f281ef732a3697f32b24b42ce8c4c07f9019 --- /dev/null +++ b/runtime/Lib/site-packages/aiofiles-23.2.1.dist-info/licenses/NOTICE @@ -0,0 +1,2 @@ +Asyncio support for files +Copyright 2016 Tin Tvrtkovic diff --git a/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/INSTALLER b/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/LICENSE.txt b/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..aa2bc24043c1dddac90e74eba3ff92b848515898 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/LICENSE.txt @@ -0,0 +1,13 @@ + Copyright aio-libs contributors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/METADATA b/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..36469595e15287fc859eb9c250554a2f5e049845 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/METADATA @@ -0,0 +1,253 @@ +Metadata-Version: 2.1 +Name: aiohttp +Version: 3.8.3 +Summary: Async http client/server framework (asyncio) +Home-page: https://github.com/aio-libs/aiohttp +Maintainer: aiohttp team +Maintainer-email: team@aiohttp.org +License: Apache 2 +Project-URL: Chat: Gitter, https://gitter.im/aio-libs/Lobby +Project-URL: CI: GitHub Actions, https://github.com/aio-libs/aiohttp/actions?query=workflow%3ACI +Project-URL: Coverage: codecov, https://codecov.io/github/aio-libs/aiohttp +Project-URL: Docs: Changelog, https://docs.aiohttp.org/en/stable/changes.html +Project-URL: Docs: RTD, https://docs.aiohttp.org +Project-URL: GitHub: issues, https://github.com/aio-libs/aiohttp/issues +Project-URL: GitHub: repo, https://github.com/aio-libs/aiohttp +Classifier: Development Status :: 5 - Production/Stable +Classifier: Framework :: AsyncIO +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Operating System :: POSIX +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Operating System :: Microsoft :: Windows +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Topic :: Internet :: WWW/HTTP +Requires-Python: >=3.6 +Description-Content-Type: text/x-rst +License-File: LICENSE.txt +Requires-Dist: attrs (>=17.3.0) +Requires-Dist: charset-normalizer (<3.0,>=2.0) +Requires-Dist: multidict (<7.0,>=4.5) +Requires-Dist: async-timeout (<5.0,>=4.0.0a3) +Requires-Dist: yarl (<2.0,>=1.0) +Requires-Dist: frozenlist (>=1.1.1) +Requires-Dist: aiosignal (>=1.1.2) +Requires-Dist: idna-ssl (>=1.0) ; python_version < "3.7" +Requires-Dist: asynctest (==0.13.0) ; python_version < "3.8" +Requires-Dist: typing-extensions (>=3.7.4) ; python_version < "3.8" +Provides-Extra: speedups +Requires-Dist: aiodns ; extra == 'speedups' +Requires-Dist: Brotli ; extra == 'speedups' +Requires-Dist: cchardet ; (python_version < "3.10") and extra == 'speedups' + +================================== +Async http client/server framework +================================== + +.. image:: https://raw.githubusercontent.com/aio-libs/aiohttp/master/docs/aiohttp-plain.svg + :height: 64px + :width: 64px + :alt: aiohttp logo + +| + +.. image:: https://github.com/aio-libs/aiohttp/workflows/CI/badge.svg + :target: https://github.com/aio-libs/aiohttp/actions?query=workflow%3ACI + :alt: GitHub Actions status for master branch + +.. image:: https://codecov.io/gh/aio-libs/aiohttp/branch/master/graph/badge.svg + :target: https://codecov.io/gh/aio-libs/aiohttp + :alt: codecov.io status for master branch + +.. image:: https://badge.fury.io/py/aiohttp.svg + :target: https://pypi.org/project/aiohttp + :alt: Latest PyPI package version + +.. image:: https://readthedocs.org/projects/aiohttp/badge/?version=latest + :target: https://docs.aiohttp.org/ + :alt: Latest Read The Docs + +.. image:: https://img.shields.io/discourse/status?server=https%3A%2F%2Faio-libs.discourse.group + :target: https://aio-libs.discourse.group + :alt: Discourse status + +.. image:: https://badges.gitter.im/Join%20Chat.svg + :target: https://gitter.im/aio-libs/Lobby + :alt: Chat on Gitter + + +Key Features +============ + +- Supports both client and server side of HTTP protocol. +- Supports both client and server Web-Sockets out-of-the-box and avoids + Callback Hell. +- Provides Web-server with middlewares and plugable routing. + + +Getting started +=============== + +Client +------ + +To get something from the web: + +.. code-block:: python + + import aiohttp + import asyncio + + async def main(): + + async with aiohttp.ClientSession() as session: + async with session.get('http://python.org') as response: + + print("Status:", response.status) + print("Content-type:", response.headers['content-type']) + + html = await response.text() + print("Body:", html[:15], "...") + + asyncio.run(main()) + +This prints: + +.. code-block:: + + Status: 200 + Content-type: text/html; charset=utf-8 + Body: ... + +Coming from `requests `_ ? Read `why we need so many lines `_. + +Server +------ + +An example using a simple server: + +.. code-block:: python + + # examples/server_simple.py + from aiohttp import web + + async def handle(request): + name = request.match_info.get('name', "Anonymous") + text = "Hello, " + name + return web.Response(text=text) + + async def wshandle(request): + ws = web.WebSocketResponse() + await ws.prepare(request) + + async for msg in ws: + if msg.type == web.WSMsgType.text: + await ws.send_str("Hello, {}".format(msg.data)) + elif msg.type == web.WSMsgType.binary: + await ws.send_bytes(msg.data) + elif msg.type == web.WSMsgType.close: + break + + return ws + + + app = web.Application() + app.add_routes([web.get('/', handle), + web.get('/echo', wshandle), + web.get('/{name}', handle)]) + + if __name__ == '__main__': + web.run_app(app) + + +Documentation +============= + +https://aiohttp.readthedocs.io/ + + +Demos +===== + +https://github.com/aio-libs/aiohttp-demos + + +External links +============== + +* `Third party libraries + `_ +* `Built with aiohttp + `_ +* `Powered by aiohttp + `_ + +Feel free to make a Pull Request for adding your link to these pages! + + +Communication channels +====================== + +*aio-libs discourse group*: https://aio-libs.discourse.group + +*gitter chat* https://gitter.im/aio-libs/Lobby + +We support `Stack Overflow +`_. +Please add *aiohttp* tag to your question there. + +Requirements +============ + +- Python >= 3.6 +- async-timeout_ +- attrs_ +- charset-normalizer_ +- multidict_ +- yarl_ +- frozenlist_ + +Optionally you may install the cChardet_ and aiodns_ libraries (highly +recommended for sake of speed). + +.. _charset-normalizer: https://pypi.org/project/charset-normalizer +.. _aiodns: https://pypi.python.org/pypi/aiodns +.. _attrs: https://github.com/python-attrs/attrs +.. _multidict: https://pypi.python.org/pypi/multidict +.. _frozenlist: https://pypi.org/project/frozenlist/ +.. _yarl: https://pypi.python.org/pypi/yarl +.. _async-timeout: https://pypi.python.org/pypi/async_timeout +.. _cChardet: https://pypi.python.org/pypi/cchardet + +License +======= + +``aiohttp`` is offered under the Apache 2 license. + + +Keepsafe +======== + +The aiohttp community would like to thank Keepsafe +(https://www.getkeepsafe.com) for its support in the early days of +the project. + + +Source code +=========== + +The latest developer version is available in a GitHub repository: +https://github.com/aio-libs/aiohttp + +Benchmarks +========== + +If you are interested in efficiency, the AsyncIO community maintains a +list of benchmarks on the official wiki: +https://github.com/python/asyncio/wiki/Benchmarks diff --git a/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/RECORD b/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..8f361e8049a7292926a2514d4b0cb7f15ed84477 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/RECORD @@ -0,0 +1,117 @@ +aiohttp-3.8.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +aiohttp-3.8.3.dist-info/LICENSE.txt,sha256=wUk-nxDVnR-6n53ygAjhVX4zz5-6yM4SY6ozk5goA94,601 +aiohttp-3.8.3.dist-info/METADATA,sha256=tGcxB-KseArVRgBQmGjX9g9YQehDdkqeIAeueYZI4-I,7355 +aiohttp-3.8.3.dist-info/RECORD,, +aiohttp-3.8.3.dist-info/WHEEL,sha256=fVcVlLzi8CGi_Ul8vjMdn8gER25dn5GBg9E6k9z41-Y,100 +aiohttp-3.8.3.dist-info/top_level.txt,sha256=iv-JIaacmTl-hSho3QmphcKnbRRYx1st47yjz_178Ro,8 +aiohttp/.hash/_cparser.pxd.hash,sha256=1tLMUc3IzMppOVKW99LKG1TD6szTXGSaCfHgiPOL9aA,108 +aiohttp/.hash/_find_header.pxd.hash,sha256=TxG5w4etbVd6sfm5JWbdf5PW6LnuXRQnlMoFBVGKN2E,112 +aiohttp/.hash/_helpers.pyi.hash,sha256=D1pTrCkUaJ3by1XeGH_nE-amt7XdjfRHcm9oRtoGhHQ,108 +aiohttp/.hash/_helpers.pyx.hash,sha256=MA4zlNd5xukP4VDAbnoId0Azv8HxCpwLWie2gSMPLsw,108 +aiohttp/.hash/_http_parser.pyx.hash,sha256=H1bEygSJvt4Oc3GhF_yMpoO4ZYENKF9uqxK8Qtuz_w4,112 +aiohttp/.hash/_http_writer.pyx.hash,sha256=oqW0CdYfKNwSX0PKREN8Qz_Mi4aaioGCIPbEvsaEgaM,112 +aiohttp/.hash/_websocket.pyx.hash,sha256=8AcsJ5Tb8lZ9_QVXor_1Xbtl5igK1iP5rtEZZ0iA2AE,110 +aiohttp/.hash/hdrs.py.hash,sha256=Vfr7WRlz3YbkgRFBfXksCI8mA7PXUMhs37jnv0kiqWQ,103 +aiohttp/__init__.py,sha256=gxZp0SS_nojwQuZlN2VCg-_hnKTRo0V5cerhuI5YGfM,7086 +aiohttp/__pycache__/__init__.cpython-39.pyc,, +aiohttp/__pycache__/abc.cpython-39.pyc,, +aiohttp/__pycache__/base_protocol.cpython-39.pyc,, +aiohttp/__pycache__/client.cpython-39.pyc,, +aiohttp/__pycache__/client_exceptions.cpython-39.pyc,, +aiohttp/__pycache__/client_proto.cpython-39.pyc,, +aiohttp/__pycache__/client_reqrep.cpython-39.pyc,, +aiohttp/__pycache__/client_ws.cpython-39.pyc,, +aiohttp/__pycache__/connector.cpython-39.pyc,, +aiohttp/__pycache__/cookiejar.cpython-39.pyc,, +aiohttp/__pycache__/formdata.cpython-39.pyc,, +aiohttp/__pycache__/hdrs.cpython-39.pyc,, +aiohttp/__pycache__/helpers.cpython-39.pyc,, +aiohttp/__pycache__/http.cpython-39.pyc,, +aiohttp/__pycache__/http_exceptions.cpython-39.pyc,, +aiohttp/__pycache__/http_parser.cpython-39.pyc,, +aiohttp/__pycache__/http_websocket.cpython-39.pyc,, +aiohttp/__pycache__/http_writer.cpython-39.pyc,, +aiohttp/__pycache__/locks.cpython-39.pyc,, +aiohttp/__pycache__/log.cpython-39.pyc,, +aiohttp/__pycache__/multipart.cpython-39.pyc,, +aiohttp/__pycache__/payload.cpython-39.pyc,, +aiohttp/__pycache__/payload_streamer.cpython-39.pyc,, +aiohttp/__pycache__/pytest_plugin.cpython-39.pyc,, +aiohttp/__pycache__/resolver.cpython-39.pyc,, +aiohttp/__pycache__/streams.cpython-39.pyc,, +aiohttp/__pycache__/tcp_helpers.cpython-39.pyc,, +aiohttp/__pycache__/test_utils.cpython-39.pyc,, +aiohttp/__pycache__/tracing.cpython-39.pyc,, +aiohttp/__pycache__/typedefs.cpython-39.pyc,, +aiohttp/__pycache__/web.cpython-39.pyc,, +aiohttp/__pycache__/web_app.cpython-39.pyc,, +aiohttp/__pycache__/web_exceptions.cpython-39.pyc,, +aiohttp/__pycache__/web_fileresponse.cpython-39.pyc,, +aiohttp/__pycache__/web_log.cpython-39.pyc,, +aiohttp/__pycache__/web_middlewares.cpython-39.pyc,, +aiohttp/__pycache__/web_protocol.cpython-39.pyc,, +aiohttp/__pycache__/web_request.cpython-39.pyc,, +aiohttp/__pycache__/web_response.cpython-39.pyc,, +aiohttp/__pycache__/web_routedef.cpython-39.pyc,, +aiohttp/__pycache__/web_runner.cpython-39.pyc,, +aiohttp/__pycache__/web_server.cpython-39.pyc,, +aiohttp/__pycache__/web_urldispatcher.cpython-39.pyc,, +aiohttp/__pycache__/web_ws.cpython-39.pyc,, +aiohttp/__pycache__/worker.cpython-39.pyc,, +aiohttp/_cparser.pxd,sha256=rEtEshtn54wSf_ZCJ0EBjRyVBkIOv_oh17BcaNOd6V8,5188 +aiohttp/_find_header.pxd,sha256=BFUSmxhemBtblqxzjzH3x03FfxaWlTyuAIOz8YZ5_nM,70 +aiohttp/_headers.pxi,sha256=1MhCe6Un_KI1tpO85HnDfzVO94BhcirLanAOys5FIHA,2090 +aiohttp/_helpers.cp39-win_amd64.pyd,sha256=gp6JR4Aq7ASFjtDMZtHeRmPJqsx8BAcmHJO2FvDbl-s,39936 +aiohttp/_helpers.pyi,sha256=2Hd5IC0Zf4YTEJ412suyyhsh1kVyVDv5g4stgyo2Ksc,208 +aiohttp/_helpers.pyx,sha256=tgl7fZh0QMT6cjf4jSJ8iaO6DdQD3GON2-SH4N5_ETg,1084 +aiohttp/_http_parser.cp39-win_amd64.pyd,sha256=nI7VbDlSEaS1JDb3nxKUTRpBOegQ7_lrPNNXdTq8-4U,215552 +aiohttp/_http_parser.pyx,sha256=1AHorYdvPR_sEjQSnCWT9kwGZKWFapVRZT910TUx7OM,28168 +aiohttp/_http_writer.cp39-win_amd64.pyd,sha256=HWVHF1eexC1jSC23fwNSkDRaPXMzD87sNVpQ6NbAMxc,35840 +aiohttp/_http_writer.pyx,sha256=8CBLytO2rx1kdpWe9HYSznhLXdeZWyE-3xI7jaGasag,4738 +aiohttp/_websocket.cp39-win_amd64.pyd,sha256=DeqLzmD7z0deDznivKGkpUG4r-wOiJ4UHGh1MTes8Dg,24064 +aiohttp/_websocket.pyx,sha256=o9J7yi9c2-jTBjE3dUkXxhDWKvRWJz5GZfyLsgJQa38,1617 +aiohttp/abc.py,sha256=h_4OTYoks0wu64YIpvNPMFkFaVqh1cJ7HdygN1fAKp8,5712 +aiohttp/base_protocol.py,sha256=27NXvLdbmi-e4JHwV3OjOCsRnq7W799LMulG3t2Ok0Q,2763 +aiohttp/client.py,sha256=vP-rZMty2GJbMeWqnwITHZQjdqtFTTGEJGGW9Ndv1gg,46342 +aiohttp/client_exceptions.py,sha256=k-ys_A4QQW-IH4-fQIAYgBj6Zjjf2METxILp2cElMuk,9612 +aiohttp/client_proto.py,sha256=3Cx_gH0ZZNNkVCzhnysBe09zbLhnN9jZX3gvqsp_SbE,8421 +aiohttp/client_reqrep.py,sha256=DKI4Wq2DyHgr6k1IVnKbRoOwvHQXxo3emKYJEy8oIa0,38107 +aiohttp/client_ws.py,sha256=70XQ5cWdvbwgA6tko-1GfhbSJ70bAHjm1OE4mWtWDw4,10816 +aiohttp/connector.py,sha256=h5hT-7KZ02NUBQ2OT3wCvyO0h7TZfl7ENFNBgRJUKEM,52630 +aiohttp/cookiejar.py,sha256=Y4wGOTP86Cnl90mQtuts0DLuYdSVmZK1_wzsjMnvIyw,13925 +aiohttp/formdata.py,sha256=iySnD63XJwo4l1TT_KZiJGNzzmn0RtvvF2_FnJM32Uo,6278 +aiohttp/hdrs.py,sha256=ygDnAqYCot8NMQyjck2r9CzpTspAOXpHknNl-yxIybY,4838 +aiohttp/helpers.py,sha256=knT9IHBgmIqMuF2BuGR_rS7aAfw3lrkkVzVwv3Rm1Cw,27238 +aiohttp/http.py,sha256=YPu2yu8TQAiQfIiu9JpE4ICmE0D4ljADgLXtNFlEJnc,1870 +aiohttp/http_exceptions.py,sha256=rLwhCbFrOpQ_ntr3GnxaxD3oRnTTNM1utmDDBUbdVTU,2691 +aiohttp/http_parser.py,sha256=gokMNEZeTCHfA52a7LwiGxEShLHAOfSxbCq-8QWh9QU,34061 +aiohttp/http_websocket.py,sha256=a7yQM4cQcM-DxhRITp8dT_0jfWxqbU-yTWTgqH8Zfpc,26000 +aiohttp/http_writer.py,sha256=VFpYiYZ41yj8lEjYGCB6C3WeGyuRgs8Tx2uJhiBuCdU,6152 +aiohttp/locks.py,sha256=vp1Z4zx0SvooSffw88dkZ-7qpk2CqRf5vWh2dpKagTA,1177 +aiohttp/log.py,sha256=zYUTvXsMQ9Sz1yNN8kXwd5Qxu49a1FzjZ_wQqriEc8M,333 +aiohttp/multipart.py,sha256=DqB2JIhnmhpmC3x5KuYaDGPfS6a1yMixnyVRsVSOcDI,33274 +aiohttp/payload.py,sha256=5RuKdJJj1WYwIo_vp-4Jdcn5ZoTzrAYna90DG0xNpXQ,14099 +aiohttp/payload_streamer.py,sha256=6bbqsfgysHzfUTJIUlqad1wRklVuLmNHVtScv_mWhGY,2187 +aiohttp/py.typed,sha256=3VVwXUAWVEVX7sDwyYDnW5ZdBC9_Z9AJAFfLCleUW0k,8 +aiohttp/pytest_plugin.py,sha256=26CllzLUw-JGrwfXYIK-XGbDMCDwbIaomV7Sk4WZVG4,12163 +aiohttp/resolver.py,sha256=UWM-6HJkOLwkGveoesBnGv-pJePtpE7js6ujYi7XHoc,5252 +aiohttp/streams.py,sha256=yWdQ0wIGIQCfI9OGdhzImtQKcUBRNfQ9Dw2pzXm-dCM,21418 +aiohttp/tcp_helpers.py,sha256=K-hhGh3jd6qCEnHJo8LvFyfJwBjh99UKI7A0aSRVhj4,998 +aiohttp/test_utils.py,sha256=gs74TWcysSMuhfAvae0Dy-jKkWVKBWKp2nLt_qfi3x0,22140 +aiohttp/tracing.py,sha256=qOwPt4vyGRVlebUUSuOJ5Vc9cc4ZGOOPr5TuweOSoVE,15649 +aiohttp/typedefs.py,sha256=E-iS7tNE3CrcMAjz5uiwr_Zlp4CKpCU99hzAKw08g14,1830 +aiohttp/web.py,sha256=lzB4xbNvgULFAN6uxb1Yg63qAyIFgapIHYGk3z7uZeU,18669 +aiohttp/web_app.py,sha256=QEkoioPMr8vLTFGgzGEdOWkX5xM9b44neR-cYyfjs6c,17727 +aiohttp/web_exceptions.py,sha256=ZhwkxigtA1hmmxkVQTH9cTRgU_cz5wb-0Enm-dlj_v4,10539 +aiohttp/web_fileresponse.py,sha256=tRRZyBNPL579Ac8Q2mSF7qjHIkV42z9VyVEkvQLOJlQ,11072 +aiohttp/web_log.py,sha256=IxdzjN1glBIssfpWBv6cS9TtyyAaJF0hJHCqt7IxEtE,7765 +aiohttp/web_middlewares.py,sha256=qmHNhOdhTtJZjChDiBlF9M-SGxF3vz2koDnxMPrlNCA,4256 +aiohttp/web_protocol.py,sha256=VVlY1FBTEg5JxtDhYO7bvfamylBEpKffdJFSN9_6cC8,23078 +aiohttp/web_request.py,sha256=nOKHoJdzco_41mfGHUclYrdoZKazD8dCiAbd0UOwQzU,29069 +aiohttp/web_response.py,sha256=Ont7UsoFinG6fpLwuVTOLHHZDWZ5VM0uGFCOiUII-pk,28296 +aiohttp/web_routedef.py,sha256=KrQtG7OzlE1ylPZf54yDJjBLl36nGvYl8Z9mA6SWayk,6368 +aiohttp/web_runner.py,sha256=OGDcOLBeCZuOPNeTa7wi8bLll_7kzviMAx7vRgKs4UE,11538 +aiohttp/web_server.py,sha256=peGS1H8OvZEd4LuB_hqTA_6HQhc4stFeYQIh4XCmZ2A,2112 +aiohttp/web_urldispatcher.py,sha256=r6lC1U7puKU45VHcvQW5mJ6ienTBCi01ouz077kiJHQ,40703 +aiohttp/web_ws.py,sha256=MqL1XuwXeh_xf3X9oAwvNGvVA3zvxcykR_O26EKkL0A,17631 +aiohttp/worker.py,sha256=WlC9ItbJ3NPCHUFIJcbEGOQkC9kWcumURyxfcKYtqws,9032 diff --git a/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/WHEEL b/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..d5a98374e27e610e1b9b96bd43954d22ff48a4c2 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.37.1) +Root-Is-Purelib: false +Tag: cp39-cp39-win_amd64 + diff --git a/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/top_level.txt b/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..ee4ba4f3d739e094878215c84eb41ba85c80e4a8 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp-3.8.3.dist-info/top_level.txt @@ -0,0 +1 @@ +aiohttp diff --git a/runtime/Lib/site-packages/aiohttp/.hash/_cparser.pxd.hash b/runtime/Lib/site-packages/aiohttp/.hash/_cparser.pxd.hash new file mode 100644 index 0000000000000000000000000000000000000000..cd588d0f0fd2188729f22c96966ebe42e67fa2e0 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/.hash/_cparser.pxd.hash @@ -0,0 +1 @@ +ac4b44b21b67e78c127ff6422741018d1c9506420ebffa21d7b05c68d39de95f *D:/a/aiohttp/aiohttp/aiohttp/_cparser.pxd diff --git a/runtime/Lib/site-packages/aiohttp/.hash/_find_header.pxd.hash b/runtime/Lib/site-packages/aiohttp/.hash/_find_header.pxd.hash new file mode 100644 index 0000000000000000000000000000000000000000..8af9f81d71e4e4ee436f4bf3e6f95940e5f3666e --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/.hash/_find_header.pxd.hash @@ -0,0 +1 @@ +0455129b185e981b5b96ac738f31f7c74dc57f1696953cae0083b3f18679fe73 *D:/a/aiohttp/aiohttp/aiohttp/_find_header.pxd diff --git a/runtime/Lib/site-packages/aiohttp/.hash/_helpers.pyi.hash b/runtime/Lib/site-packages/aiohttp/.hash/_helpers.pyi.hash new file mode 100644 index 0000000000000000000000000000000000000000..82a670d95ec595b1e48345f83be50b09bc397495 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/.hash/_helpers.pyi.hash @@ -0,0 +1 @@ +d87779202d197f8613109e35dacbb2ca1b21d64572543bf9838b2d832a362ac7 *D:/a/aiohttp/aiohttp/aiohttp/_helpers.pyi diff --git a/runtime/Lib/site-packages/aiohttp/.hash/_helpers.pyx.hash b/runtime/Lib/site-packages/aiohttp/.hash/_helpers.pyx.hash new file mode 100644 index 0000000000000000000000000000000000000000..251b846c1e64bcbbce927d73c36eec022016c7ca --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/.hash/_helpers.pyx.hash @@ -0,0 +1 @@ +b6097b7d987440c4fa7237f88d227c89a3ba0dd403dc638ddbe487e0de7f1138 *D:/a/aiohttp/aiohttp/aiohttp/_helpers.pyx diff --git a/runtime/Lib/site-packages/aiohttp/.hash/_http_parser.pyx.hash b/runtime/Lib/site-packages/aiohttp/.hash/_http_parser.pyx.hash new file mode 100644 index 0000000000000000000000000000000000000000..d4d56f3427cb64d4619144ff1fafde87595466d1 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/.hash/_http_parser.pyx.hash @@ -0,0 +1 @@ +d401e8ad876f3d1fec1234129c2593f64c0664a5856a9551653f75d13531ece3 *D:/a/aiohttp/aiohttp/aiohttp/_http_parser.pyx diff --git a/runtime/Lib/site-packages/aiohttp/.hash/_http_writer.pyx.hash b/runtime/Lib/site-packages/aiohttp/.hash/_http_writer.pyx.hash new file mode 100644 index 0000000000000000000000000000000000000000..11278aaaf2b6663b90f31040410df2339b6b696e --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/.hash/_http_writer.pyx.hash @@ -0,0 +1 @@ +f0204bcad3b6af1d6476959ef47612ce784b5dd7995b213edf123b8da19ab1a8 *D:/a/aiohttp/aiohttp/aiohttp/_http_writer.pyx diff --git a/runtime/Lib/site-packages/aiohttp/.hash/_websocket.pyx.hash b/runtime/Lib/site-packages/aiohttp/.hash/_websocket.pyx.hash new file mode 100644 index 0000000000000000000000000000000000000000..1a3346e3a287febe71fd7f09bd1ae267a7437058 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/.hash/_websocket.pyx.hash @@ -0,0 +1 @@ +a3d27bca2f5cdbe8d3063137754917c610d62af456273e4665fc8bb202506b7f *D:/a/aiohttp/aiohttp/aiohttp/_websocket.pyx diff --git a/runtime/Lib/site-packages/aiohttp/.hash/hdrs.py.hash b/runtime/Lib/site-packages/aiohttp/.hash/hdrs.py.hash new file mode 100644 index 0000000000000000000000000000000000000000..7b005e770a303102d177b3894a29e50155e344df --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/.hash/hdrs.py.hash @@ -0,0 +1 @@ +ca00e702a602a2df0d310ca3724dabf42ce94eca40397a47927365fb2c48c9b6 *D:/a/aiohttp/aiohttp/aiohttp/hdrs.py diff --git a/runtime/Lib/site-packages/aiohttp/__init__.py b/runtime/Lib/site-packages/aiohttp/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0a29158217d4ac3b946e606e08be84f3c3699ab2 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/__init__.py @@ -0,0 +1,216 @@ +__version__ = "3.8.3" + +from typing import Tuple + +from . import hdrs as hdrs +from .client import ( + BaseConnector as BaseConnector, + ClientConnectionError as ClientConnectionError, + ClientConnectorCertificateError as ClientConnectorCertificateError, + ClientConnectorError as ClientConnectorError, + ClientConnectorSSLError as ClientConnectorSSLError, + ClientError as ClientError, + ClientHttpProxyError as ClientHttpProxyError, + ClientOSError as ClientOSError, + ClientPayloadError as ClientPayloadError, + ClientProxyConnectionError as ClientProxyConnectionError, + ClientRequest as ClientRequest, + ClientResponse as ClientResponse, + ClientResponseError as ClientResponseError, + ClientSession as ClientSession, + ClientSSLError as ClientSSLError, + ClientTimeout as ClientTimeout, + ClientWebSocketResponse as ClientWebSocketResponse, + ContentTypeError as ContentTypeError, + Fingerprint as Fingerprint, + InvalidURL as InvalidURL, + NamedPipeConnector as NamedPipeConnector, + RequestInfo as RequestInfo, + ServerConnectionError as ServerConnectionError, + ServerDisconnectedError as ServerDisconnectedError, + ServerFingerprintMismatch as ServerFingerprintMismatch, + ServerTimeoutError as ServerTimeoutError, + TCPConnector as TCPConnector, + TooManyRedirects as TooManyRedirects, + UnixConnector as UnixConnector, + WSServerHandshakeError as WSServerHandshakeError, + request as request, +) +from .cookiejar import CookieJar as CookieJar, DummyCookieJar as DummyCookieJar +from .formdata import FormData as FormData +from .helpers import BasicAuth, ChainMapProxy, ETag +from .http import ( + HttpVersion as HttpVersion, + HttpVersion10 as HttpVersion10, + HttpVersion11 as HttpVersion11, + WebSocketError as WebSocketError, + WSCloseCode as WSCloseCode, + WSMessage as WSMessage, + WSMsgType as WSMsgType, +) +from .multipart import ( + BadContentDispositionHeader as BadContentDispositionHeader, + BadContentDispositionParam as BadContentDispositionParam, + BodyPartReader as BodyPartReader, + MultipartReader as MultipartReader, + MultipartWriter as MultipartWriter, + content_disposition_filename as content_disposition_filename, + parse_content_disposition as parse_content_disposition, +) +from .payload import ( + PAYLOAD_REGISTRY as PAYLOAD_REGISTRY, + AsyncIterablePayload as AsyncIterablePayload, + BufferedReaderPayload as BufferedReaderPayload, + BytesIOPayload as BytesIOPayload, + BytesPayload as BytesPayload, + IOBasePayload as IOBasePayload, + JsonPayload as JsonPayload, + Payload as Payload, + StringIOPayload as StringIOPayload, + StringPayload as StringPayload, + TextIOPayload as TextIOPayload, + get_payload as get_payload, + payload_type as payload_type, +) +from .payload_streamer import streamer as streamer +from .resolver import ( + AsyncResolver as AsyncResolver, + DefaultResolver as DefaultResolver, + ThreadedResolver as ThreadedResolver, +) +from .streams import ( + EMPTY_PAYLOAD as EMPTY_PAYLOAD, + DataQueue as DataQueue, + EofStream as EofStream, + FlowControlDataQueue as FlowControlDataQueue, + StreamReader as StreamReader, +) +from .tracing import ( + TraceConfig as TraceConfig, + TraceConnectionCreateEndParams as TraceConnectionCreateEndParams, + TraceConnectionCreateStartParams as TraceConnectionCreateStartParams, + TraceConnectionQueuedEndParams as TraceConnectionQueuedEndParams, + TraceConnectionQueuedStartParams as TraceConnectionQueuedStartParams, + TraceConnectionReuseconnParams as TraceConnectionReuseconnParams, + TraceDnsCacheHitParams as TraceDnsCacheHitParams, + TraceDnsCacheMissParams as TraceDnsCacheMissParams, + TraceDnsResolveHostEndParams as TraceDnsResolveHostEndParams, + TraceDnsResolveHostStartParams as TraceDnsResolveHostStartParams, + TraceRequestChunkSentParams as TraceRequestChunkSentParams, + TraceRequestEndParams as TraceRequestEndParams, + TraceRequestExceptionParams as TraceRequestExceptionParams, + TraceRequestRedirectParams as TraceRequestRedirectParams, + TraceRequestStartParams as TraceRequestStartParams, + TraceResponseChunkReceivedParams as TraceResponseChunkReceivedParams, +) + +__all__: Tuple[str, ...] = ( + "hdrs", + # client + "BaseConnector", + "ClientConnectionError", + "ClientConnectorCertificateError", + "ClientConnectorError", + "ClientConnectorSSLError", + "ClientError", + "ClientHttpProxyError", + "ClientOSError", + "ClientPayloadError", + "ClientProxyConnectionError", + "ClientResponse", + "ClientRequest", + "ClientResponseError", + "ClientSSLError", + "ClientSession", + "ClientTimeout", + "ClientWebSocketResponse", + "ContentTypeError", + "Fingerprint", + "InvalidURL", + "RequestInfo", + "ServerConnectionError", + "ServerDisconnectedError", + "ServerFingerprintMismatch", + "ServerTimeoutError", + "TCPConnector", + "TooManyRedirects", + "UnixConnector", + "NamedPipeConnector", + "WSServerHandshakeError", + "request", + # cookiejar + "CookieJar", + "DummyCookieJar", + # formdata + "FormData", + # helpers + "BasicAuth", + "ChainMapProxy", + "ETag", + # http + "HttpVersion", + "HttpVersion10", + "HttpVersion11", + "WSMsgType", + "WSCloseCode", + "WSMessage", + "WebSocketError", + # multipart + "BadContentDispositionHeader", + "BadContentDispositionParam", + "BodyPartReader", + "MultipartReader", + "MultipartWriter", + "content_disposition_filename", + "parse_content_disposition", + # payload + "AsyncIterablePayload", + "BufferedReaderPayload", + "BytesIOPayload", + "BytesPayload", + "IOBasePayload", + "JsonPayload", + "PAYLOAD_REGISTRY", + "Payload", + "StringIOPayload", + "StringPayload", + "TextIOPayload", + "get_payload", + "payload_type", + # payload_streamer + "streamer", + # resolver + "AsyncResolver", + "DefaultResolver", + "ThreadedResolver", + # streams + "DataQueue", + "EMPTY_PAYLOAD", + "EofStream", + "FlowControlDataQueue", + "StreamReader", + # tracing + "TraceConfig", + "TraceConnectionCreateEndParams", + "TraceConnectionCreateStartParams", + "TraceConnectionQueuedEndParams", + "TraceConnectionQueuedStartParams", + "TraceConnectionReuseconnParams", + "TraceDnsCacheHitParams", + "TraceDnsCacheMissParams", + "TraceDnsResolveHostEndParams", + "TraceDnsResolveHostStartParams", + "TraceRequestChunkSentParams", + "TraceRequestEndParams", + "TraceRequestExceptionParams", + "TraceRequestRedirectParams", + "TraceRequestStartParams", + "TraceResponseChunkReceivedParams", +) + +try: + from .worker import GunicornUVLoopWebWorker, GunicornWebWorker + + __all__ += ("GunicornWebWorker", "GunicornUVLoopWebWorker") +except ImportError: # pragma: no cover + pass diff --git a/runtime/Lib/site-packages/aiohttp/_cparser.pxd b/runtime/Lib/site-packages/aiohttp/_cparser.pxd new file mode 100644 index 0000000000000000000000000000000000000000..4b5fcff18ce61d98e509181f9d298c46d64c9972 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/_cparser.pxd @@ -0,0 +1,190 @@ +from libc.stdint cimport ( + int8_t, + int16_t, + int32_t, + int64_t, + uint8_t, + uint16_t, + uint32_t, + uint64_t, +) + + +cdef extern from "../vendor/llhttp/build/llhttp.h": + + struct llhttp__internal_s: + int32_t _index + void* _span_pos0 + void* _span_cb0 + int32_t error + const char* reason + const char* error_pos + void* data + void* _current + uint64_t content_length + uint8_t type + uint8_t method + uint8_t http_major + uint8_t http_minor + uint8_t header_state + uint8_t lenient_flags + uint8_t upgrade + uint8_t finish + uint16_t flags + uint16_t status_code + void* settings + + ctypedef llhttp__internal_s llhttp__internal_t + ctypedef llhttp__internal_t llhttp_t + + ctypedef int (*llhttp_data_cb)(llhttp_t*, const char *at, size_t length) except -1 + ctypedef int (*llhttp_cb)(llhttp_t*) except -1 + + struct llhttp_settings_s: + llhttp_cb on_message_begin + llhttp_data_cb on_url + llhttp_data_cb on_status + llhttp_data_cb on_header_field + llhttp_data_cb on_header_value + llhttp_cb on_headers_complete + llhttp_data_cb on_body + llhttp_cb on_message_complete + llhttp_cb on_chunk_header + llhttp_cb on_chunk_complete + + llhttp_cb on_url_complete + llhttp_cb on_status_complete + llhttp_cb on_header_field_complete + llhttp_cb on_header_value_complete + + ctypedef llhttp_settings_s llhttp_settings_t + + enum llhttp_errno: + HPE_OK, + HPE_INTERNAL, + HPE_STRICT, + HPE_LF_EXPECTED, + HPE_UNEXPECTED_CONTENT_LENGTH, + HPE_CLOSED_CONNECTION, + HPE_INVALID_METHOD, + HPE_INVALID_URL, + HPE_INVALID_CONSTANT, + HPE_INVALID_VERSION, + HPE_INVALID_HEADER_TOKEN, + HPE_INVALID_CONTENT_LENGTH, + HPE_INVALID_CHUNK_SIZE, + HPE_INVALID_STATUS, + HPE_INVALID_EOF_STATE, + HPE_INVALID_TRANSFER_ENCODING, + HPE_CB_MESSAGE_BEGIN, + HPE_CB_HEADERS_COMPLETE, + HPE_CB_MESSAGE_COMPLETE, + HPE_CB_CHUNK_HEADER, + HPE_CB_CHUNK_COMPLETE, + HPE_PAUSED, + HPE_PAUSED_UPGRADE, + HPE_USER + + ctypedef llhttp_errno llhttp_errno_t + + enum llhttp_flags: + F_CONNECTION_KEEP_ALIVE, + F_CONNECTION_CLOSE, + F_CONNECTION_UPGRADE, + F_CHUNKED, + F_UPGRADE, + F_CONTENT_LENGTH, + F_SKIPBODY, + F_TRAILING, + F_TRANSFER_ENCODING + + enum llhttp_lenient_flags: + LENIENT_HEADERS, + LENIENT_CHUNKED_LENGTH + + enum llhttp_type: + HTTP_REQUEST, + HTTP_RESPONSE, + HTTP_BOTH + + enum llhttp_finish_t: + HTTP_FINISH_SAFE, + HTTP_FINISH_SAFE_WITH_CB, + HTTP_FINISH_UNSAFE + + enum llhttp_method: + HTTP_DELETE, + HTTP_GET, + HTTP_HEAD, + HTTP_POST, + HTTP_PUT, + HTTP_CONNECT, + HTTP_OPTIONS, + HTTP_TRACE, + HTTP_COPY, + HTTP_LOCK, + HTTP_MKCOL, + HTTP_MOVE, + HTTP_PROPFIND, + HTTP_PROPPATCH, + HTTP_SEARCH, + HTTP_UNLOCK, + HTTP_BIND, + HTTP_REBIND, + HTTP_UNBIND, + HTTP_ACL, + HTTP_REPORT, + HTTP_MKACTIVITY, + HTTP_CHECKOUT, + HTTP_MERGE, + HTTP_MSEARCH, + HTTP_NOTIFY, + HTTP_SUBSCRIBE, + HTTP_UNSUBSCRIBE, + HTTP_PATCH, + HTTP_PURGE, + HTTP_MKCALENDAR, + HTTP_LINK, + HTTP_UNLINK, + HTTP_SOURCE, + HTTP_PRI, + HTTP_DESCRIBE, + HTTP_ANNOUNCE, + HTTP_SETUP, + HTTP_PLAY, + HTTP_PAUSE, + HTTP_TEARDOWN, + HTTP_GET_PARAMETER, + HTTP_SET_PARAMETER, + HTTP_REDIRECT, + HTTP_RECORD, + HTTP_FLUSH + + ctypedef llhttp_method llhttp_method_t; + + void llhttp_settings_init(llhttp_settings_t* settings) + void llhttp_init(llhttp_t* parser, llhttp_type type, + const llhttp_settings_t* settings) + + llhttp_errno_t llhttp_execute(llhttp_t* parser, const char* data, size_t len) + llhttp_errno_t llhttp_finish(llhttp_t* parser) + + int llhttp_message_needs_eof(const llhttp_t* parser) + + int llhttp_should_keep_alive(const llhttp_t* parser) + + void llhttp_pause(llhttp_t* parser) + void llhttp_resume(llhttp_t* parser) + + void llhttp_resume_after_upgrade(llhttp_t* parser) + + llhttp_errno_t llhttp_get_errno(const llhttp_t* parser) + const char* llhttp_get_error_reason(const llhttp_t* parser) + void llhttp_set_error_reason(llhttp_t* parser, const char* reason) + const char* llhttp_get_error_pos(const llhttp_t* parser) + const char* llhttp_errno_name(llhttp_errno_t err) + + const char* llhttp_method_name(llhttp_method_t method) + + void llhttp_set_lenient_headers(llhttp_t* parser, int enabled) + void llhttp_set_lenient_chunked_length(llhttp_t* parser, int enabled) diff --git a/runtime/Lib/site-packages/aiohttp/_find_header.pxd b/runtime/Lib/site-packages/aiohttp/_find_header.pxd new file mode 100644 index 0000000000000000000000000000000000000000..9305cb61da27a827c280b3c7ea3ca65e96c8793b --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/_find_header.pxd @@ -0,0 +1,2 @@ +cdef extern from "_find_header.h": + int find_header(char *, int) diff --git a/runtime/Lib/site-packages/aiohttp/_headers.pxi b/runtime/Lib/site-packages/aiohttp/_headers.pxi new file mode 100644 index 0000000000000000000000000000000000000000..45c50f15e8c5e77996bf29315c13027b7b8f66ef --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/_headers.pxi @@ -0,0 +1,83 @@ +# The file is autogenerated from aiohttp/hdrs.py +# Run ./tools/gen.py to update it after the origin changing. + +from . import hdrs +cdef tuple headers = ( + hdrs.ACCEPT, + hdrs.ACCEPT_CHARSET, + hdrs.ACCEPT_ENCODING, + hdrs.ACCEPT_LANGUAGE, + hdrs.ACCEPT_RANGES, + hdrs.ACCESS_CONTROL_ALLOW_CREDENTIALS, + hdrs.ACCESS_CONTROL_ALLOW_HEADERS, + hdrs.ACCESS_CONTROL_ALLOW_METHODS, + hdrs.ACCESS_CONTROL_ALLOW_ORIGIN, + hdrs.ACCESS_CONTROL_EXPOSE_HEADERS, + hdrs.ACCESS_CONTROL_MAX_AGE, + hdrs.ACCESS_CONTROL_REQUEST_HEADERS, + hdrs.ACCESS_CONTROL_REQUEST_METHOD, + hdrs.AGE, + hdrs.ALLOW, + hdrs.AUTHORIZATION, + hdrs.CACHE_CONTROL, + hdrs.CONNECTION, + hdrs.CONTENT_DISPOSITION, + hdrs.CONTENT_ENCODING, + hdrs.CONTENT_LANGUAGE, + hdrs.CONTENT_LENGTH, + hdrs.CONTENT_LOCATION, + hdrs.CONTENT_MD5, + hdrs.CONTENT_RANGE, + hdrs.CONTENT_TRANSFER_ENCODING, + hdrs.CONTENT_TYPE, + hdrs.COOKIE, + hdrs.DATE, + hdrs.DESTINATION, + hdrs.DIGEST, + hdrs.ETAG, + hdrs.EXPECT, + hdrs.EXPIRES, + hdrs.FORWARDED, + hdrs.FROM, + hdrs.HOST, + hdrs.IF_MATCH, + hdrs.IF_MODIFIED_SINCE, + hdrs.IF_NONE_MATCH, + hdrs.IF_RANGE, + hdrs.IF_UNMODIFIED_SINCE, + hdrs.KEEP_ALIVE, + hdrs.LAST_EVENT_ID, + hdrs.LAST_MODIFIED, + hdrs.LINK, + hdrs.LOCATION, + hdrs.MAX_FORWARDS, + hdrs.ORIGIN, + hdrs.PRAGMA, + hdrs.PROXY_AUTHENTICATE, + hdrs.PROXY_AUTHORIZATION, + hdrs.RANGE, + hdrs.REFERER, + hdrs.RETRY_AFTER, + hdrs.SEC_WEBSOCKET_ACCEPT, + hdrs.SEC_WEBSOCKET_EXTENSIONS, + hdrs.SEC_WEBSOCKET_KEY, + hdrs.SEC_WEBSOCKET_KEY1, + hdrs.SEC_WEBSOCKET_PROTOCOL, + hdrs.SEC_WEBSOCKET_VERSION, + hdrs.SERVER, + hdrs.SET_COOKIE, + hdrs.TE, + hdrs.TRAILER, + hdrs.TRANSFER_ENCODING, + hdrs.URI, + hdrs.UPGRADE, + hdrs.USER_AGENT, + hdrs.VARY, + hdrs.VIA, + hdrs.WWW_AUTHENTICATE, + hdrs.WANT_DIGEST, + hdrs.WARNING, + hdrs.X_FORWARDED_FOR, + hdrs.X_FORWARDED_HOST, + hdrs.X_FORWARDED_PROTO, +) diff --git a/runtime/Lib/site-packages/aiohttp/_helpers.cp39-win_amd64.pyd b/runtime/Lib/site-packages/aiohttp/_helpers.cp39-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..ccf60d9f2671374cb7417479df271fdabe88c1aa Binary files /dev/null and b/runtime/Lib/site-packages/aiohttp/_helpers.cp39-win_amd64.pyd differ diff --git a/runtime/Lib/site-packages/aiohttp/_helpers.pyi b/runtime/Lib/site-packages/aiohttp/_helpers.pyi new file mode 100644 index 0000000000000000000000000000000000000000..6dda40d032ab4c1f6b85c9d6d52b79c020875e67 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/_helpers.pyi @@ -0,0 +1,6 @@ +from typing import Any + +class reify: + def __init__(self, wrapped: Any) -> None: ... + def __get__(self, inst: Any, owner: Any) -> Any: ... + def __set__(self, inst: Any, value: Any) -> None: ... diff --git a/runtime/Lib/site-packages/aiohttp/_helpers.pyx b/runtime/Lib/site-packages/aiohttp/_helpers.pyx new file mode 100644 index 0000000000000000000000000000000000000000..cccb332cea6ed9eeab585a0c632e7a67f700973a --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/_helpers.pyx @@ -0,0 +1,35 @@ +cdef class reify: + """Use as a class method decorator. It operates almost exactly like + the Python `@property` decorator, but it puts the result of the + method it decorates into the instance dict after the first call, + effectively replacing the function it decorates with an instance + variable. It is, in Python parlance, a data descriptor. + + """ + + cdef object wrapped + cdef object name + + def __init__(self, wrapped): + self.wrapped = wrapped + self.name = wrapped.__name__ + + @property + def __doc__(self): + return self.wrapped.__doc__ + + def __get__(self, inst, owner): + try: + try: + return inst._cache[self.name] + except KeyError: + val = self.wrapped(inst) + inst._cache[self.name] = val + return val + except AttributeError: + if inst is None: + return self + raise + + def __set__(self, inst, value): + raise AttributeError("reified property is read-only") diff --git a/runtime/Lib/site-packages/aiohttp/_http_parser.cp39-win_amd64.pyd b/runtime/Lib/site-packages/aiohttp/_http_parser.cp39-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..93d2de0d786eb9ea3307975c198c0de1628500b2 Binary files /dev/null and b/runtime/Lib/site-packages/aiohttp/_http_parser.cp39-win_amd64.pyd differ diff --git a/runtime/Lib/site-packages/aiohttp/_http_parser.pyx b/runtime/Lib/site-packages/aiohttp/_http_parser.pyx new file mode 100644 index 0000000000000000000000000000000000000000..17bfee826c7d664dd077d1c040698489bdbbcc92 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/_http_parser.pyx @@ -0,0 +1,832 @@ +#cython: language_level=3 +# +# Based on https://github.com/MagicStack/httptools +# +from __future__ import absolute_import, print_function + +from cpython cimport ( + Py_buffer, + PyBUF_SIMPLE, + PyBuffer_Release, + PyBytes_AsString, + PyBytes_AsStringAndSize, + PyObject_GetBuffer, +) +from cpython.mem cimport PyMem_Free, PyMem_Malloc +from libc.limits cimport ULLONG_MAX +from libc.string cimport memcpy + +from multidict import CIMultiDict as _CIMultiDict, CIMultiDictProxy as _CIMultiDictProxy +from yarl import URL as _URL + +from aiohttp import hdrs + +from .http_exceptions import ( + BadHttpMessage, + BadStatusLine, + ContentLengthError, + InvalidHeader, + InvalidURLError, + LineTooLong, + PayloadEncodingError, + TransferEncodingError, +) +from .http_parser import DeflateBuffer as _DeflateBuffer +from .http_writer import ( + HttpVersion as _HttpVersion, + HttpVersion10 as _HttpVersion10, + HttpVersion11 as _HttpVersion11, +) +from .streams import EMPTY_PAYLOAD as _EMPTY_PAYLOAD, StreamReader as _StreamReader + +cimport cython + +from aiohttp cimport _cparser as cparser + +include "_headers.pxi" + +from aiohttp cimport _find_header + +DEF DEFAULT_FREELIST_SIZE = 250 + +cdef extern from "Python.h": + int PyByteArray_Resize(object, Py_ssize_t) except -1 + Py_ssize_t PyByteArray_Size(object) except -1 + char* PyByteArray_AsString(object) + +__all__ = ('HttpRequestParser', 'HttpResponseParser', + 'RawRequestMessage', 'RawResponseMessage') + +cdef object URL = _URL +cdef object URL_build = URL.build +cdef object CIMultiDict = _CIMultiDict +cdef object CIMultiDictProxy = _CIMultiDictProxy +cdef object HttpVersion = _HttpVersion +cdef object HttpVersion10 = _HttpVersion10 +cdef object HttpVersion11 = _HttpVersion11 +cdef object SEC_WEBSOCKET_KEY1 = hdrs.SEC_WEBSOCKET_KEY1 +cdef object CONTENT_ENCODING = hdrs.CONTENT_ENCODING +cdef object EMPTY_PAYLOAD = _EMPTY_PAYLOAD +cdef object StreamReader = _StreamReader +cdef object DeflateBuffer = _DeflateBuffer + + +cdef inline object extend(object buf, const char* at, size_t length): + cdef Py_ssize_t s + cdef char* ptr + s = PyByteArray_Size(buf) + PyByteArray_Resize(buf, s + length) + ptr = PyByteArray_AsString(buf) + memcpy(ptr + s, at, length) + + +DEF METHODS_COUNT = 46; + +cdef list _http_method = [] + +for i in range(METHODS_COUNT): + _http_method.append( + cparser.llhttp_method_name( i).decode('ascii')) + + +cdef inline str http_method_str(int i): + if i < METHODS_COUNT: + return _http_method[i] + else: + return "" + +cdef inline object find_header(bytes raw_header): + cdef Py_ssize_t size + cdef char *buf + cdef int idx + PyBytes_AsStringAndSize(raw_header, &buf, &size) + idx = _find_header.find_header(buf, size) + if idx == -1: + return raw_header.decode('utf-8', 'surrogateescape') + return headers[idx] + + +@cython.freelist(DEFAULT_FREELIST_SIZE) +cdef class RawRequestMessage: + cdef readonly str method + cdef readonly str path + cdef readonly object version # HttpVersion + cdef readonly object headers # CIMultiDict + cdef readonly object raw_headers # tuple + cdef readonly object should_close + cdef readonly object compression + cdef readonly object upgrade + cdef readonly object chunked + cdef readonly object url # yarl.URL + + def __init__(self, method, path, version, headers, raw_headers, + should_close, compression, upgrade, chunked, url): + self.method = method + self.path = path + self.version = version + self.headers = headers + self.raw_headers = raw_headers + self.should_close = should_close + self.compression = compression + self.upgrade = upgrade + self.chunked = chunked + self.url = url + + def __repr__(self): + info = [] + info.append(("method", self.method)) + info.append(("path", self.path)) + info.append(("version", self.version)) + info.append(("headers", self.headers)) + info.append(("raw_headers", self.raw_headers)) + info.append(("should_close", self.should_close)) + info.append(("compression", self.compression)) + info.append(("upgrade", self.upgrade)) + info.append(("chunked", self.chunked)) + info.append(("url", self.url)) + sinfo = ', '.join(name + '=' + repr(val) for name, val in info) + return '' + + def _replace(self, **dct): + cdef RawRequestMessage ret + ret = _new_request_message(self.method, + self.path, + self.version, + self.headers, + self.raw_headers, + self.should_close, + self.compression, + self.upgrade, + self.chunked, + self.url) + if "method" in dct: + ret.method = dct["method"] + if "path" in dct: + ret.path = dct["path"] + if "version" in dct: + ret.version = dct["version"] + if "headers" in dct: + ret.headers = dct["headers"] + if "raw_headers" in dct: + ret.raw_headers = dct["raw_headers"] + if "should_close" in dct: + ret.should_close = dct["should_close"] + if "compression" in dct: + ret.compression = dct["compression"] + if "upgrade" in dct: + ret.upgrade = dct["upgrade"] + if "chunked" in dct: + ret.chunked = dct["chunked"] + if "url" in dct: + ret.url = dct["url"] + return ret + +cdef _new_request_message(str method, + str path, + object version, + object headers, + object raw_headers, + bint should_close, + object compression, + bint upgrade, + bint chunked, + object url): + cdef RawRequestMessage ret + ret = RawRequestMessage.__new__(RawRequestMessage) + ret.method = method + ret.path = path + ret.version = version + ret.headers = headers + ret.raw_headers = raw_headers + ret.should_close = should_close + ret.compression = compression + ret.upgrade = upgrade + ret.chunked = chunked + ret.url = url + return ret + + +@cython.freelist(DEFAULT_FREELIST_SIZE) +cdef class RawResponseMessage: + cdef readonly object version # HttpVersion + cdef readonly int code + cdef readonly str reason + cdef readonly object headers # CIMultiDict + cdef readonly object raw_headers # tuple + cdef readonly object should_close + cdef readonly object compression + cdef readonly object upgrade + cdef readonly object chunked + + def __init__(self, version, code, reason, headers, raw_headers, + should_close, compression, upgrade, chunked): + self.version = version + self.code = code + self.reason = reason + self.headers = headers + self.raw_headers = raw_headers + self.should_close = should_close + self.compression = compression + self.upgrade = upgrade + self.chunked = chunked + + def __repr__(self): + info = [] + info.append(("version", self.version)) + info.append(("code", self.code)) + info.append(("reason", self.reason)) + info.append(("headers", self.headers)) + info.append(("raw_headers", self.raw_headers)) + info.append(("should_close", self.should_close)) + info.append(("compression", self.compression)) + info.append(("upgrade", self.upgrade)) + info.append(("chunked", self.chunked)) + sinfo = ', '.join(name + '=' + repr(val) for name, val in info) + return '' + + +cdef _new_response_message(object version, + int code, + str reason, + object headers, + object raw_headers, + bint should_close, + object compression, + bint upgrade, + bint chunked): + cdef RawResponseMessage ret + ret = RawResponseMessage.__new__(RawResponseMessage) + ret.version = version + ret.code = code + ret.reason = reason + ret.headers = headers + ret.raw_headers = raw_headers + ret.should_close = should_close + ret.compression = compression + ret.upgrade = upgrade + ret.chunked = chunked + return ret + + +@cython.internal +cdef class HttpParser: + + cdef: + cparser.llhttp_t* _cparser + cparser.llhttp_settings_t* _csettings + + bytearray _raw_name + bytearray _raw_value + bint _has_value + + object _protocol + object _loop + object _timer + + size_t _max_line_size + size_t _max_field_size + size_t _max_headers + bint _response_with_body + bint _read_until_eof + + bint _started + object _url + bytearray _buf + str _path + str _reason + object _headers + list _raw_headers + bint _upgraded + list _messages + object _payload + bint _payload_error + object _payload_exception + object _last_error + bint _auto_decompress + int _limit + + str _content_encoding + + Py_buffer py_buf + + def __cinit__(self): + self._cparser = \ + PyMem_Malloc(sizeof(cparser.llhttp_t)) + if self._cparser is NULL: + raise MemoryError() + + self._csettings = \ + PyMem_Malloc(sizeof(cparser.llhttp_settings_t)) + if self._csettings is NULL: + raise MemoryError() + + def __dealloc__(self): + PyMem_Free(self._cparser) + PyMem_Free(self._csettings) + + cdef _init( + self, cparser.llhttp_type mode, + object protocol, object loop, int limit, + object timer=None, + size_t max_line_size=8190, size_t max_headers=32768, + size_t max_field_size=8190, payload_exception=None, + bint response_with_body=True, bint read_until_eof=False, + bint auto_decompress=True, + ): + cparser.llhttp_settings_init(self._csettings) + cparser.llhttp_init(self._cparser, mode, self._csettings) + self._cparser.data = self + self._cparser.content_length = 0 + + self._protocol = protocol + self._loop = loop + self._timer = timer + + self._buf = bytearray() + self._payload = None + self._payload_error = 0 + self._payload_exception = payload_exception + self._messages = [] + + self._raw_name = bytearray() + self._raw_value = bytearray() + self._has_value = False + + self._max_line_size = max_line_size + self._max_headers = max_headers + self._max_field_size = max_field_size + self._response_with_body = response_with_body + self._read_until_eof = read_until_eof + self._upgraded = False + self._auto_decompress = auto_decompress + self._content_encoding = None + + self._csettings.on_url = cb_on_url + self._csettings.on_status = cb_on_status + self._csettings.on_header_field = cb_on_header_field + self._csettings.on_header_value = cb_on_header_value + self._csettings.on_headers_complete = cb_on_headers_complete + self._csettings.on_body = cb_on_body + self._csettings.on_message_begin = cb_on_message_begin + self._csettings.on_message_complete = cb_on_message_complete + self._csettings.on_chunk_header = cb_on_chunk_header + self._csettings.on_chunk_complete = cb_on_chunk_complete + + self._last_error = None + self._limit = limit + + cdef _process_header(self): + if self._raw_name: + raw_name = bytes(self._raw_name) + raw_value = bytes(self._raw_value) + + name = find_header(raw_name) + value = raw_value.decode('utf-8', 'surrogateescape') + + self._headers.add(name, value) + + if name is CONTENT_ENCODING: + self._content_encoding = value + + PyByteArray_Resize(self._raw_name, 0) + PyByteArray_Resize(self._raw_value, 0) + self._has_value = False + self._raw_headers.append((raw_name, raw_value)) + + cdef _on_header_field(self, char* at, size_t length): + cdef Py_ssize_t size + cdef char *buf + if self._has_value: + self._process_header() + + size = PyByteArray_Size(self._raw_name) + PyByteArray_Resize(self._raw_name, size + length) + buf = PyByteArray_AsString(self._raw_name) + memcpy(buf + size, at, length) + + cdef _on_header_value(self, char* at, size_t length): + cdef Py_ssize_t size + cdef char *buf + + size = PyByteArray_Size(self._raw_value) + PyByteArray_Resize(self._raw_value, size + length) + buf = PyByteArray_AsString(self._raw_value) + memcpy(buf + size, at, length) + self._has_value = True + + cdef _on_headers_complete(self): + self._process_header() + + method = http_method_str(self._cparser.method) + should_close = not cparser.llhttp_should_keep_alive(self._cparser) + upgrade = self._cparser.upgrade + chunked = self._cparser.flags & cparser.F_CHUNKED + + raw_headers = tuple(self._raw_headers) + headers = CIMultiDictProxy(self._headers) + + if upgrade or self._cparser.method == cparser.HTTP_CONNECT: + self._upgraded = True + + # do not support old websocket spec + if SEC_WEBSOCKET_KEY1 in headers: + raise InvalidHeader(SEC_WEBSOCKET_KEY1) + + encoding = None + enc = self._content_encoding + if enc is not None: + self._content_encoding = None + enc = enc.lower() + if enc in ('gzip', 'deflate', 'br'): + encoding = enc + + if self._cparser.type == cparser.HTTP_REQUEST: + msg = _new_request_message( + method, self._path, + self.http_version(), headers, raw_headers, + should_close, encoding, upgrade, chunked, self._url) + else: + msg = _new_response_message( + self.http_version(), self._cparser.status_code, self._reason, + headers, raw_headers, should_close, encoding, + upgrade, chunked) + + if ( + ULLONG_MAX > self._cparser.content_length > 0 or chunked or + self._cparser.method == cparser.HTTP_CONNECT or + (self._cparser.status_code >= 199 and + self._cparser.content_length == 0 and + self._read_until_eof) + ): + payload = StreamReader( + self._protocol, timer=self._timer, loop=self._loop, + limit=self._limit) + else: + payload = EMPTY_PAYLOAD + + self._payload = payload + if encoding is not None and self._auto_decompress: + self._payload = DeflateBuffer(payload, encoding) + + if not self._response_with_body: + payload = EMPTY_PAYLOAD + + self._messages.append((msg, payload)) + + cdef _on_message_complete(self): + self._payload.feed_eof() + self._payload = None + + cdef _on_chunk_header(self): + self._payload.begin_http_chunk_receiving() + + cdef _on_chunk_complete(self): + self._payload.end_http_chunk_receiving() + + cdef object _on_status_complete(self): + pass + + cdef inline http_version(self): + cdef cparser.llhttp_t* parser = self._cparser + + if parser.http_major == 1: + if parser.http_minor == 0: + return HttpVersion10 + elif parser.http_minor == 1: + return HttpVersion11 + + return HttpVersion(parser.http_major, parser.http_minor) + + ### Public API ### + + def feed_eof(self): + cdef bytes desc + + if self._payload is not None: + if self._cparser.flags & cparser.F_CHUNKED: + raise TransferEncodingError( + "Not enough data for satisfy transfer length header.") + elif self._cparser.flags & cparser.F_CONTENT_LENGTH: + raise ContentLengthError( + "Not enough data for satisfy content length header.") + elif cparser.llhttp_get_errno(self._cparser) != cparser.HPE_OK: + desc = cparser.llhttp_get_error_reason(self._cparser) + raise PayloadEncodingError(desc.decode('latin-1')) + else: + self._payload.feed_eof() + elif self._started: + self._on_headers_complete() + if self._messages: + return self._messages[-1][0] + + def feed_data(self, data): + cdef: + size_t data_len + size_t nb + cdef cparser.llhttp_errno_t errno + + PyObject_GetBuffer(data, &self.py_buf, PyBUF_SIMPLE) + data_len = self.py_buf.len + + errno = cparser.llhttp_execute( + self._cparser, + self.py_buf.buf, + data_len) + + if errno is cparser.HPE_PAUSED_UPGRADE: + cparser.llhttp_resume_after_upgrade(self._cparser) + + nb = cparser.llhttp_get_error_pos(self._cparser) - self.py_buf.buf + + PyBuffer_Release(&self.py_buf) + + if errno not in (cparser.HPE_OK, cparser.HPE_PAUSED_UPGRADE): + if self._payload_error == 0: + if self._last_error is not None: + ex = self._last_error + self._last_error = None + else: + ex = parser_error_from_errno(self._cparser) + self._payload = None + raise ex + + if self._messages: + messages = self._messages + self._messages = [] + else: + messages = () + + if self._upgraded: + return messages, True, data[nb:] + else: + return messages, False, b'' + + def set_upgraded(self, val): + self._upgraded = val + + +cdef class HttpRequestParser(HttpParser): + + def __init__( + self, protocol, loop, int limit, timer=None, + size_t max_line_size=8190, size_t max_headers=32768, + size_t max_field_size=8190, payload_exception=None, + bint response_with_body=True, bint read_until_eof=False, + bint auto_decompress=True, + ): + self._init(cparser.HTTP_REQUEST, protocol, loop, limit, timer, + max_line_size, max_headers, max_field_size, + payload_exception, response_with_body, read_until_eof, + auto_decompress) + + cdef object _on_status_complete(self): + cdef int idx1, idx2 + if not self._buf: + return + self._path = self._buf.decode('utf-8', 'surrogateescape') + try: + idx3 = len(self._path) + if self._cparser.method == cparser.HTTP_CONNECT: + # authority-form, + # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.3 + self._url = URL.build(authority=self._path, encoded=True) + elif idx3 > 1 and self._path[0] == '/': + # origin-form, + # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1 + idx1 = self._path.find("?") + if idx1 == -1: + query = "" + idx2 = self._path.find("#") + if idx2 == -1: + path = self._path + fragment = "" + else: + path = self._path[0: idx2] + fragment = self._path[idx2+1:] + + else: + path = self._path[0:idx1] + idx1 += 1 + idx2 = self._path.find("#", idx1+1) + if idx2 == -1: + query = self._path[idx1:] + fragment = "" + else: + query = self._path[idx1: idx2] + fragment = self._path[idx2+1:] + + self._url = URL.build( + path=path, + query_string=query, + fragment=fragment, + encoded=True, + ) + else: + # absolute-form for proxy maybe, + # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.2 + self._url = URL(self._path, encoded=True) + finally: + PyByteArray_Resize(self._buf, 0) + + +cdef class HttpResponseParser(HttpParser): + + def __init__( + self, protocol, loop, int limit, timer=None, + size_t max_line_size=8190, size_t max_headers=32768, + size_t max_field_size=8190, payload_exception=None, + bint response_with_body=True, bint read_until_eof=False, + bint auto_decompress=True + ): + self._init(cparser.HTTP_RESPONSE, protocol, loop, limit, timer, + max_line_size, max_headers, max_field_size, + payload_exception, response_with_body, read_until_eof, + auto_decompress) + + cdef object _on_status_complete(self): + if self._buf: + self._reason = self._buf.decode('utf-8', 'surrogateescape') + PyByteArray_Resize(self._buf, 0) + else: + self._reason = self._reason or '' + +cdef int cb_on_message_begin(cparser.llhttp_t* parser) except -1: + cdef HttpParser pyparser = parser.data + + pyparser._started = True + pyparser._headers = CIMultiDict() + pyparser._raw_headers = [] + PyByteArray_Resize(pyparser._buf, 0) + pyparser._path = None + pyparser._reason = None + return 0 + + +cdef int cb_on_url(cparser.llhttp_t* parser, + const char *at, size_t length) except -1: + cdef HttpParser pyparser = parser.data + try: + if length > pyparser._max_line_size: + raise LineTooLong( + 'Status line is too long', pyparser._max_line_size, length) + extend(pyparser._buf, at, length) + except BaseException as ex: + pyparser._last_error = ex + return -1 + else: + return 0 + + +cdef int cb_on_status(cparser.llhttp_t* parser, + const char *at, size_t length) except -1: + cdef HttpParser pyparser = parser.data + cdef str reason + try: + if length > pyparser._max_line_size: + raise LineTooLong( + 'Status line is too long', pyparser._max_line_size, length) + extend(pyparser._buf, at, length) + except BaseException as ex: + pyparser._last_error = ex + return -1 + else: + return 0 + + +cdef int cb_on_header_field(cparser.llhttp_t* parser, + const char *at, size_t length) except -1: + cdef HttpParser pyparser = parser.data + cdef Py_ssize_t size + try: + pyparser._on_status_complete() + size = len(pyparser._raw_name) + length + if size > pyparser._max_field_size: + raise LineTooLong( + 'Header name is too long', pyparser._max_field_size, size) + pyparser._on_header_field(at, length) + except BaseException as ex: + pyparser._last_error = ex + return -1 + else: + return 0 + + +cdef int cb_on_header_value(cparser.llhttp_t* parser, + const char *at, size_t length) except -1: + cdef HttpParser pyparser = parser.data + cdef Py_ssize_t size + try: + size = len(pyparser._raw_value) + length + if size > pyparser._max_field_size: + raise LineTooLong( + 'Header value is too long', pyparser._max_field_size, size) + pyparser._on_header_value(at, length) + except BaseException as ex: + pyparser._last_error = ex + return -1 + else: + return 0 + + +cdef int cb_on_headers_complete(cparser.llhttp_t* parser) except -1: + cdef HttpParser pyparser = parser.data + try: + pyparser._on_status_complete() + pyparser._on_headers_complete() + except BaseException as exc: + pyparser._last_error = exc + return -1 + else: + if ( + pyparser._cparser.upgrade or + pyparser._cparser.method == cparser.HTTP_CONNECT + ): + return 2 + else: + return 0 + + +cdef int cb_on_body(cparser.llhttp_t* parser, + const char *at, size_t length) except -1: + cdef HttpParser pyparser = parser.data + cdef bytes body = at[:length] + try: + pyparser._payload.feed_data(body, length) + except BaseException as exc: + if pyparser._payload_exception is not None: + pyparser._payload.set_exception(pyparser._payload_exception(str(exc))) + else: + pyparser._payload.set_exception(exc) + pyparser._payload_error = 1 + return -1 + else: + return 0 + + +cdef int cb_on_message_complete(cparser.llhttp_t* parser) except -1: + cdef HttpParser pyparser = parser.data + try: + pyparser._started = False + pyparser._on_message_complete() + except BaseException as exc: + pyparser._last_error = exc + return -1 + else: + return 0 + + +cdef int cb_on_chunk_header(cparser.llhttp_t* parser) except -1: + cdef HttpParser pyparser = parser.data + try: + pyparser._on_chunk_header() + except BaseException as exc: + pyparser._last_error = exc + return -1 + else: + return 0 + + +cdef int cb_on_chunk_complete(cparser.llhttp_t* parser) except -1: + cdef HttpParser pyparser = parser.data + try: + pyparser._on_chunk_complete() + except BaseException as exc: + pyparser._last_error = exc + return -1 + else: + return 0 + + +cdef parser_error_from_errno(cparser.llhttp_t* parser): + cdef cparser.llhttp_errno_t errno = cparser.llhttp_get_errno(parser) + cdef bytes desc = cparser.llhttp_get_error_reason(parser) + + if errno in (cparser.HPE_CB_MESSAGE_BEGIN, + cparser.HPE_CB_HEADERS_COMPLETE, + cparser.HPE_CB_MESSAGE_COMPLETE, + cparser.HPE_CB_CHUNK_HEADER, + cparser.HPE_CB_CHUNK_COMPLETE, + cparser.HPE_INVALID_CONSTANT, + cparser.HPE_INVALID_HEADER_TOKEN, + cparser.HPE_INVALID_CONTENT_LENGTH, + cparser.HPE_INVALID_CHUNK_SIZE, + cparser.HPE_INVALID_EOF_STATE, + cparser.HPE_INVALID_TRANSFER_ENCODING): + cls = BadHttpMessage + + elif errno == cparser.HPE_INVALID_STATUS: + cls = BadStatusLine + + elif errno == cparser.HPE_INVALID_METHOD: + cls = BadStatusLine + + elif errno == cparser.HPE_INVALID_VERSION: + cls = BadStatusLine + + elif errno == cparser.HPE_INVALID_URL: + cls = InvalidURLError + + else: + cls = BadHttpMessage + + return cls(desc.decode('latin-1')) diff --git a/runtime/Lib/site-packages/aiohttp/_http_writer.cp39-win_amd64.pyd b/runtime/Lib/site-packages/aiohttp/_http_writer.cp39-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..3fc8c79196a83323d00cbf3f498d47cf55e48a78 Binary files /dev/null and b/runtime/Lib/site-packages/aiohttp/_http_writer.cp39-win_amd64.pyd differ diff --git a/runtime/Lib/site-packages/aiohttp/_http_writer.pyx b/runtime/Lib/site-packages/aiohttp/_http_writer.pyx new file mode 100644 index 0000000000000000000000000000000000000000..2f9e9f91a5179188467bc3d1c28f6e43e78060a5 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/_http_writer.pyx @@ -0,0 +1,163 @@ +from cpython.bytes cimport PyBytes_FromStringAndSize +from cpython.exc cimport PyErr_NoMemory +from cpython.mem cimport PyMem_Free, PyMem_Malloc, PyMem_Realloc +from cpython.object cimport PyObject_Str +from libc.stdint cimport uint8_t, uint64_t +from libc.string cimport memcpy + +from multidict import istr + +DEF BUF_SIZE = 16 * 1024 # 16KiB +cdef char BUFFER[BUF_SIZE] + +cdef object _istr = istr + + +# ----------------- writer --------------------------- + +cdef struct Writer: + char *buf + Py_ssize_t size + Py_ssize_t pos + + +cdef inline void _init_writer(Writer* writer): + writer.buf = &BUFFER[0] + writer.size = BUF_SIZE + writer.pos = 0 + + +cdef inline void _release_writer(Writer* writer): + if writer.buf != BUFFER: + PyMem_Free(writer.buf) + + +cdef inline int _write_byte(Writer* writer, uint8_t ch): + cdef char * buf + cdef Py_ssize_t size + + if writer.pos == writer.size: + # reallocate + size = writer.size + BUF_SIZE + if writer.buf == BUFFER: + buf = PyMem_Malloc(size) + if buf == NULL: + PyErr_NoMemory() + return -1 + memcpy(buf, writer.buf, writer.size) + else: + buf = PyMem_Realloc(writer.buf, size) + if buf == NULL: + PyErr_NoMemory() + return -1 + writer.buf = buf + writer.size = size + writer.buf[writer.pos] = ch + writer.pos += 1 + return 0 + + +cdef inline int _write_utf8(Writer* writer, Py_UCS4 symbol): + cdef uint64_t utf = symbol + + if utf < 0x80: + return _write_byte(writer, utf) + elif utf < 0x800: + if _write_byte(writer, (0xc0 | (utf >> 6))) < 0: + return -1 + return _write_byte(writer, (0x80 | (utf & 0x3f))) + elif 0xD800 <= utf <= 0xDFFF: + # surogate pair, ignored + return 0 + elif utf < 0x10000: + if _write_byte(writer, (0xe0 | (utf >> 12))) < 0: + return -1 + if _write_byte(writer, (0x80 | ((utf >> 6) & 0x3f))) < 0: + return -1 + return _write_byte(writer, (0x80 | (utf & 0x3f))) + elif utf > 0x10FFFF: + # symbol is too large + return 0 + else: + if _write_byte(writer, (0xf0 | (utf >> 18))) < 0: + return -1 + if _write_byte(writer, + (0x80 | ((utf >> 12) & 0x3f))) < 0: + return -1 + if _write_byte(writer, + (0x80 | ((utf >> 6) & 0x3f))) < 0: + return -1 + return _write_byte(writer, (0x80 | (utf & 0x3f))) + + +cdef inline int _write_str(Writer* writer, str s): + cdef Py_UCS4 ch + for ch in s: + if _write_utf8(writer, ch) < 0: + return -1 + + +# --------------- _serialize_headers ---------------------- + +cdef str to_str(object s): + typ = type(s) + if typ is str: + return s + elif typ is _istr: + return PyObject_Str(s) + elif not isinstance(s, str): + raise TypeError("Cannot serialize non-str key {!r}".format(s)) + else: + return str(s) + + +cdef void _safe_header(str string) except *: + if "\r" in string or "\n" in string: + raise ValueError( + "Newline or carriage return character detected in HTTP status message or " + "header. This is a potential security issue." + ) + + +def _serialize_headers(str status_line, headers): + cdef Writer writer + cdef object key + cdef object val + cdef bytes ret + + _init_writer(&writer) + + for key, val in headers.items(): + _safe_header(to_str(key)) + _safe_header(to_str(val)) + + try: + if _write_str(&writer, status_line) < 0: + raise + if _write_byte(&writer, b'\r') < 0: + raise + if _write_byte(&writer, b'\n') < 0: + raise + + for key, val in headers.items(): + if _write_str(&writer, to_str(key)) < 0: + raise + if _write_byte(&writer, b':') < 0: + raise + if _write_byte(&writer, b' ') < 0: + raise + if _write_str(&writer, to_str(val)) < 0: + raise + if _write_byte(&writer, b'\r') < 0: + raise + if _write_byte(&writer, b'\n') < 0: + raise + + if _write_byte(&writer, b'\r') < 0: + raise + if _write_byte(&writer, b'\n') < 0: + raise + + return PyBytes_FromStringAndSize(writer.buf, writer.pos) + finally: + _release_writer(&writer) diff --git a/runtime/Lib/site-packages/aiohttp/_websocket.cp39-win_amd64.pyd b/runtime/Lib/site-packages/aiohttp/_websocket.cp39-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..8b15053b5e418ed1d42a741394be40dd16e44295 Binary files /dev/null and b/runtime/Lib/site-packages/aiohttp/_websocket.cp39-win_amd64.pyd differ diff --git a/runtime/Lib/site-packages/aiohttp/_websocket.pyx b/runtime/Lib/site-packages/aiohttp/_websocket.pyx new file mode 100644 index 0000000000000000000000000000000000000000..6f036b24fc171e771d084aa2049f1b73964e3e9f --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/_websocket.pyx @@ -0,0 +1,56 @@ +from cpython cimport PyBytes_AsString + + +#from cpython cimport PyByteArray_AsString # cython still not exports that +cdef extern from "Python.h": + char* PyByteArray_AsString(bytearray ba) except NULL + +from libc.stdint cimport uint32_t, uint64_t, uintmax_t + + +def _websocket_mask_cython(object mask, object data): + """Note, this function mutates its `data` argument + """ + cdef: + Py_ssize_t data_len, i + # bit operations on signed integers are implementation-specific + unsigned char * in_buf + const unsigned char * mask_buf + uint32_t uint32_msk + uint64_t uint64_msk + + assert len(mask) == 4 + + if not isinstance(mask, bytes): + mask = bytes(mask) + + if isinstance(data, bytearray): + data = data + else: + data = bytearray(data) + + data_len = len(data) + in_buf = PyByteArray_AsString(data) + mask_buf = PyBytes_AsString(mask) + uint32_msk = (mask_buf)[0] + + # TODO: align in_data ptr to achieve even faster speeds + # does it need in python ?! malloc() always aligns to sizeof(long) bytes + + if sizeof(size_t) >= 8: + uint64_msk = uint32_msk + uint64_msk = (uint64_msk << 32) | uint32_msk + + while data_len >= 8: + (in_buf)[0] ^= uint64_msk + in_buf += 8 + data_len -= 8 + + + while data_len >= 4: + (in_buf)[0] ^= uint32_msk + in_buf += 4 + data_len -= 4 + + for i in range(0, data_len): + in_buf[i] ^= mask_buf[i] diff --git a/runtime/Lib/site-packages/aiohttp/abc.py b/runtime/Lib/site-packages/aiohttp/abc.py new file mode 100644 index 0000000000000000000000000000000000000000..decac0ab449a693527a72f475c256b0d3ef6be0a --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/abc.py @@ -0,0 +1,207 @@ +import asyncio +import logging +from abc import ABC, abstractmethod +from collections.abc import Sized +from http.cookies import BaseCookie, Morsel +from typing import ( + TYPE_CHECKING, + Any, + Awaitable, + Callable, + Dict, + Generator, + Iterable, + List, + Optional, + Tuple, +) + +from multidict import CIMultiDict +from yarl import URL + +from .helpers import get_running_loop +from .typedefs import LooseCookies + +if TYPE_CHECKING: # pragma: no cover + from .web_app import Application + from .web_exceptions import HTTPException + from .web_request import BaseRequest, Request + from .web_response import StreamResponse +else: + BaseRequest = Request = Application = StreamResponse = None + HTTPException = None + + +class AbstractRouter(ABC): + def __init__(self) -> None: + self._frozen = False + + def post_init(self, app: Application) -> None: + """Post init stage. + + Not an abstract method for sake of backward compatibility, + but if the router wants to be aware of the application + it can override this. + """ + + @property + def frozen(self) -> bool: + return self._frozen + + def freeze(self) -> None: + """Freeze router.""" + self._frozen = True + + @abstractmethod + async def resolve(self, request: Request) -> "AbstractMatchInfo": + """Return MATCH_INFO for given request""" + + +class AbstractMatchInfo(ABC): + @property # pragma: no branch + @abstractmethod + def handler(self) -> Callable[[Request], Awaitable[StreamResponse]]: + """Execute matched request handler""" + + @property + @abstractmethod + def expect_handler(self) -> Callable[[Request], Awaitable[None]]: + """Expect handler for 100-continue processing""" + + @property # pragma: no branch + @abstractmethod + def http_exception(self) -> Optional[HTTPException]: + """HTTPException instance raised on router's resolving, or None""" + + @abstractmethod # pragma: no branch + def get_info(self) -> Dict[str, Any]: + """Return a dict with additional info useful for introspection""" + + @property # pragma: no branch + @abstractmethod + def apps(self) -> Tuple[Application, ...]: + """Stack of nested applications. + + Top level application is left-most element. + + """ + + @abstractmethod + def add_app(self, app: Application) -> None: + """Add application to the nested apps stack.""" + + @abstractmethod + def freeze(self) -> None: + """Freeze the match info. + + The method is called after route resolution. + + After the call .add_app() is forbidden. + + """ + + +class AbstractView(ABC): + """Abstract class based view.""" + + def __init__(self, request: Request) -> None: + self._request = request + + @property + def request(self) -> Request: + """Request instance.""" + return self._request + + @abstractmethod + def __await__(self) -> Generator[Any, None, StreamResponse]: + """Execute the view handler.""" + + +class AbstractResolver(ABC): + """Abstract DNS resolver.""" + + @abstractmethod + async def resolve(self, host: str, port: int, family: int) -> List[Dict[str, Any]]: + """Return IP address for given hostname""" + + @abstractmethod + async def close(self) -> None: + """Release resolver""" + + +if TYPE_CHECKING: # pragma: no cover + IterableBase = Iterable[Morsel[str]] +else: + IterableBase = Iterable + + +ClearCookiePredicate = Callable[["Morsel[str]"], bool] + + +class AbstractCookieJar(Sized, IterableBase): + """Abstract Cookie Jar.""" + + def __init__(self, *, loop: Optional[asyncio.AbstractEventLoop] = None) -> None: + self._loop = get_running_loop(loop) + + @abstractmethod + def clear(self, predicate: Optional[ClearCookiePredicate] = None) -> None: + """Clear all cookies if no predicate is passed.""" + + @abstractmethod + def clear_domain(self, domain: str) -> None: + """Clear all cookies for domain and all subdomains.""" + + @abstractmethod + def update_cookies(self, cookies: LooseCookies, response_url: URL = URL()) -> None: + """Update cookies.""" + + @abstractmethod + def filter_cookies(self, request_url: URL) -> "BaseCookie[str]": + """Return the jar's cookies filtered by their attributes.""" + + +class AbstractStreamWriter(ABC): + """Abstract stream writer.""" + + buffer_size = 0 + output_size = 0 + length: Optional[int] = 0 + + @abstractmethod + async def write(self, chunk: bytes) -> None: + """Write chunk into stream.""" + + @abstractmethod + async def write_eof(self, chunk: bytes = b"") -> None: + """Write last chunk.""" + + @abstractmethod + async def drain(self) -> None: + """Flush the write buffer.""" + + @abstractmethod + def enable_compression(self, encoding: str = "deflate") -> None: + """Enable HTTP body compression""" + + @abstractmethod + def enable_chunking(self) -> None: + """Enable HTTP chunked mode""" + + @abstractmethod + async def write_headers( + self, status_line: str, headers: "CIMultiDict[str]" + ) -> None: + """Write HTTP headers""" + + +class AbstractAccessLogger(ABC): + """Abstract writer to access log.""" + + def __init__(self, logger: logging.Logger, log_format: str) -> None: + self.logger = logger + self.log_format = log_format + + @abstractmethod + def log(self, request: BaseRequest, response: StreamResponse, time: float) -> None: + """Emit log to logger.""" diff --git a/runtime/Lib/site-packages/aiohttp/base_protocol.py b/runtime/Lib/site-packages/aiohttp/base_protocol.py new file mode 100644 index 0000000000000000000000000000000000000000..3a788ed658aa653338e893603cf8fc0dfb07ea8d --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/base_protocol.py @@ -0,0 +1,87 @@ +import asyncio +from typing import Optional, cast + +from .tcp_helpers import tcp_nodelay + + +class BaseProtocol(asyncio.Protocol): + __slots__ = ( + "_loop", + "_paused", + "_drain_waiter", + "_connection_lost", + "_reading_paused", + "transport", + ) + + def __init__(self, loop: asyncio.AbstractEventLoop) -> None: + self._loop: asyncio.AbstractEventLoop = loop + self._paused = False + self._drain_waiter: Optional[asyncio.Future[None]] = None + self._connection_lost = False + self._reading_paused = False + + self.transport: Optional[asyncio.Transport] = None + + def pause_writing(self) -> None: + assert not self._paused + self._paused = True + + def resume_writing(self) -> None: + assert self._paused + self._paused = False + + waiter = self._drain_waiter + if waiter is not None: + self._drain_waiter = None + if not waiter.done(): + waiter.set_result(None) + + def pause_reading(self) -> None: + if not self._reading_paused and self.transport is not None: + try: + self.transport.pause_reading() + except (AttributeError, NotImplementedError, RuntimeError): + pass + self._reading_paused = True + + def resume_reading(self) -> None: + if self._reading_paused and self.transport is not None: + try: + self.transport.resume_reading() + except (AttributeError, NotImplementedError, RuntimeError): + pass + self._reading_paused = False + + def connection_made(self, transport: asyncio.BaseTransport) -> None: + tr = cast(asyncio.Transport, transport) + tcp_nodelay(tr, True) + self.transport = tr + + def connection_lost(self, exc: Optional[BaseException]) -> None: + self._connection_lost = True + # Wake up the writer if currently paused. + self.transport = None + if not self._paused: + return + waiter = self._drain_waiter + if waiter is None: + return + self._drain_waiter = None + if waiter.done(): + return + if exc is None: + waiter.set_result(None) + else: + waiter.set_exception(exc) + + async def _drain_helper(self) -> None: + if self._connection_lost: + raise ConnectionResetError("Connection lost") + if not self._paused: + return + waiter = self._drain_waiter + if waiter is None: + waiter = self._loop.create_future() + self._drain_waiter = waiter + await asyncio.shield(waiter) diff --git a/runtime/Lib/site-packages/aiohttp/client.py b/runtime/Lib/site-packages/aiohttp/client.py new file mode 100644 index 0000000000000000000000000000000000000000..0719674ebbc1677060b59df13f3eb044ed4b3e35 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/client.py @@ -0,0 +1,1305 @@ +"""HTTP Client for asyncio.""" + +import asyncio +import base64 +import hashlib +import json +import os +import sys +import traceback +import warnings +from contextlib import suppress +from types import SimpleNamespace, TracebackType +from typing import ( + Any, + Awaitable, + Callable, + Coroutine, + FrozenSet, + Generator, + Generic, + Iterable, + List, + Mapping, + Optional, + Set, + Tuple, + Type, + TypeVar, + Union, +) + +import attr +from multidict import CIMultiDict, MultiDict, MultiDictProxy, istr +from yarl import URL + +from . import hdrs, http, payload +from .abc import AbstractCookieJar +from .client_exceptions import ( + ClientConnectionError as ClientConnectionError, + ClientConnectorCertificateError as ClientConnectorCertificateError, + ClientConnectorError as ClientConnectorError, + ClientConnectorSSLError as ClientConnectorSSLError, + ClientError as ClientError, + ClientHttpProxyError as ClientHttpProxyError, + ClientOSError as ClientOSError, + ClientPayloadError as ClientPayloadError, + ClientProxyConnectionError as ClientProxyConnectionError, + ClientResponseError as ClientResponseError, + ClientSSLError as ClientSSLError, + ContentTypeError as ContentTypeError, + InvalidURL as InvalidURL, + ServerConnectionError as ServerConnectionError, + ServerDisconnectedError as ServerDisconnectedError, + ServerFingerprintMismatch as ServerFingerprintMismatch, + ServerTimeoutError as ServerTimeoutError, + TooManyRedirects as TooManyRedirects, + WSServerHandshakeError as WSServerHandshakeError, +) +from .client_reqrep import ( + ClientRequest as ClientRequest, + ClientResponse as ClientResponse, + Fingerprint as Fingerprint, + RequestInfo as RequestInfo, + _merge_ssl_params, +) +from .client_ws import ClientWebSocketResponse as ClientWebSocketResponse +from .connector import ( + BaseConnector as BaseConnector, + NamedPipeConnector as NamedPipeConnector, + TCPConnector as TCPConnector, + UnixConnector as UnixConnector, +) +from .cookiejar import CookieJar +from .helpers import ( + DEBUG, + PY_36, + BasicAuth, + TimeoutHandle, + ceil_timeout, + get_env_proxy_for_url, + get_running_loop, + sentinel, + strip_auth_from_url, +) +from .http import WS_KEY, HttpVersion, WebSocketReader, WebSocketWriter +from .http_websocket import WSHandshakeError, WSMessage, ws_ext_gen, ws_ext_parse +from .streams import FlowControlDataQueue +from .tracing import Trace, TraceConfig +from .typedefs import Final, JSONEncoder, LooseCookies, LooseHeaders, StrOrURL + +__all__ = ( + # client_exceptions + "ClientConnectionError", + "ClientConnectorCertificateError", + "ClientConnectorError", + "ClientConnectorSSLError", + "ClientError", + "ClientHttpProxyError", + "ClientOSError", + "ClientPayloadError", + "ClientProxyConnectionError", + "ClientResponseError", + "ClientSSLError", + "ContentTypeError", + "InvalidURL", + "ServerConnectionError", + "ServerDisconnectedError", + "ServerFingerprintMismatch", + "ServerTimeoutError", + "TooManyRedirects", + "WSServerHandshakeError", + # client_reqrep + "ClientRequest", + "ClientResponse", + "Fingerprint", + "RequestInfo", + # connector + "BaseConnector", + "TCPConnector", + "UnixConnector", + "NamedPipeConnector", + # client_ws + "ClientWebSocketResponse", + # client + "ClientSession", + "ClientTimeout", + "request", +) + + +try: + from ssl import SSLContext +except ImportError: # pragma: no cover + SSLContext = object # type: ignore[misc,assignment] + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class ClientTimeout: + total: Optional[float] = None + connect: Optional[float] = None + sock_read: Optional[float] = None + sock_connect: Optional[float] = None + + # pool_queue_timeout: Optional[float] = None + # dns_resolution_timeout: Optional[float] = None + # socket_connect_timeout: Optional[float] = None + # connection_acquiring_timeout: Optional[float] = None + # new_connection_timeout: Optional[float] = None + # http_header_timeout: Optional[float] = None + # response_body_timeout: Optional[float] = None + + # to create a timeout specific for a single request, either + # - create a completely new one to overwrite the default + # - or use http://www.attrs.org/en/stable/api.html#attr.evolve + # to overwrite the defaults + + +# 5 Minute default read timeout +DEFAULT_TIMEOUT: Final[ClientTimeout] = ClientTimeout(total=5 * 60) + +_RetType = TypeVar("_RetType") + + +class ClientSession: + """First-class interface for making HTTP requests.""" + + ATTRS = frozenset( + [ + "_base_url", + "_source_traceback", + "_connector", + "requote_redirect_url", + "_loop", + "_cookie_jar", + "_connector_owner", + "_default_auth", + "_version", + "_json_serialize", + "_requote_redirect_url", + "_timeout", + "_raise_for_status", + "_auto_decompress", + "_trust_env", + "_default_headers", + "_skip_auto_headers", + "_request_class", + "_response_class", + "_ws_response_class", + "_trace_configs", + "_read_bufsize", + ] + ) + + _source_traceback = None # type: Optional[traceback.StackSummary] + _connector = None # type: Optional[BaseConnector] + + def __init__( + self, + base_url: Optional[StrOrURL] = None, + *, + connector: Optional[BaseConnector] = None, + loop: Optional[asyncio.AbstractEventLoop] = None, + cookies: Optional[LooseCookies] = None, + headers: Optional[LooseHeaders] = None, + skip_auto_headers: Optional[Iterable[str]] = None, + auth: Optional[BasicAuth] = None, + json_serialize: JSONEncoder = json.dumps, + request_class: Type[ClientRequest] = ClientRequest, + response_class: Type[ClientResponse] = ClientResponse, + ws_response_class: Type[ClientWebSocketResponse] = ClientWebSocketResponse, + version: HttpVersion = http.HttpVersion11, + cookie_jar: Optional[AbstractCookieJar] = None, + connector_owner: bool = True, + raise_for_status: bool = False, + read_timeout: Union[float, object] = sentinel, + conn_timeout: Optional[float] = None, + timeout: Union[object, ClientTimeout] = sentinel, + auto_decompress: bool = True, + trust_env: bool = False, + requote_redirect_url: bool = True, + trace_configs: Optional[List[TraceConfig]] = None, + read_bufsize: int = 2**16, + ) -> None: + if loop is None: + if connector is not None: + loop = connector._loop + + loop = get_running_loop(loop) + + if base_url is None or isinstance(base_url, URL): + self._base_url: Optional[URL] = base_url + else: + self._base_url = URL(base_url) + assert ( + self._base_url.origin() == self._base_url + ), "Only absolute URLs without path part are supported" + + if connector is None: + connector = TCPConnector(loop=loop) + + if connector._loop is not loop: + raise RuntimeError("Session and connector has to use same event loop") + + self._loop = loop + + if loop.get_debug(): + self._source_traceback = traceback.extract_stack(sys._getframe(1)) + + if cookie_jar is None: + cookie_jar = CookieJar(loop=loop) + self._cookie_jar = cookie_jar + + if cookies is not None: + self._cookie_jar.update_cookies(cookies) + + self._connector = connector + self._connector_owner = connector_owner + self._default_auth = auth + self._version = version + self._json_serialize = json_serialize + if timeout is sentinel: + self._timeout = DEFAULT_TIMEOUT + if read_timeout is not sentinel: + warnings.warn( + "read_timeout is deprecated, " "use timeout argument instead", + DeprecationWarning, + stacklevel=2, + ) + self._timeout = attr.evolve(self._timeout, total=read_timeout) + if conn_timeout is not None: + self._timeout = attr.evolve(self._timeout, connect=conn_timeout) + warnings.warn( + "conn_timeout is deprecated, " "use timeout argument instead", + DeprecationWarning, + stacklevel=2, + ) + else: + self._timeout = timeout # type: ignore[assignment] + if read_timeout is not sentinel: + raise ValueError( + "read_timeout and timeout parameters " + "conflict, please setup " + "timeout.read" + ) + if conn_timeout is not None: + raise ValueError( + "conn_timeout and timeout parameters " + "conflict, please setup " + "timeout.connect" + ) + self._raise_for_status = raise_for_status + self._auto_decompress = auto_decompress + self._trust_env = trust_env + self._requote_redirect_url = requote_redirect_url + self._read_bufsize = read_bufsize + + # Convert to list of tuples + if headers: + real_headers: CIMultiDict[str] = CIMultiDict(headers) + else: + real_headers = CIMultiDict() + self._default_headers: CIMultiDict[str] = real_headers + if skip_auto_headers is not None: + self._skip_auto_headers = frozenset(istr(i) for i in skip_auto_headers) + else: + self._skip_auto_headers = frozenset() + + self._request_class = request_class + self._response_class = response_class + self._ws_response_class = ws_response_class + + self._trace_configs = trace_configs or [] + for trace_config in self._trace_configs: + trace_config.freeze() + + def __init_subclass__(cls: Type["ClientSession"]) -> None: + warnings.warn( + "Inheritance class {} from ClientSession " + "is discouraged".format(cls.__name__), + DeprecationWarning, + stacklevel=2, + ) + + if DEBUG: + + def __setattr__(self, name: str, val: Any) -> None: + if name not in self.ATTRS: + warnings.warn( + "Setting custom ClientSession.{} attribute " + "is discouraged".format(name), + DeprecationWarning, + stacklevel=2, + ) + super().__setattr__(name, val) + + def __del__(self, _warnings: Any = warnings) -> None: + if not self.closed: + if PY_36: + kwargs = {"source": self} + else: + kwargs = {} + _warnings.warn( + f"Unclosed client session {self!r}", ResourceWarning, **kwargs + ) + context = {"client_session": self, "message": "Unclosed client session"} + if self._source_traceback is not None: + context["source_traceback"] = self._source_traceback + self._loop.call_exception_handler(context) + + def request( + self, method: str, url: StrOrURL, **kwargs: Any + ) -> "_RequestContextManager": + """Perform HTTP request.""" + return _RequestContextManager(self._request(method, url, **kwargs)) + + def _build_url(self, str_or_url: StrOrURL) -> URL: + url = URL(str_or_url) + if self._base_url is None: + return url + else: + assert not url.is_absolute() and url.path.startswith("/") + return self._base_url.join(url) + + async def _request( + self, + method: str, + str_or_url: StrOrURL, + *, + params: Optional[Mapping[str, str]] = None, + data: Any = None, + json: Any = None, + cookies: Optional[LooseCookies] = None, + headers: Optional[LooseHeaders] = None, + skip_auto_headers: Optional[Iterable[str]] = None, + auth: Optional[BasicAuth] = None, + allow_redirects: bool = True, + max_redirects: int = 10, + compress: Optional[str] = None, + chunked: Optional[bool] = None, + expect100: bool = False, + raise_for_status: Optional[bool] = None, + read_until_eof: bool = True, + proxy: Optional[StrOrURL] = None, + proxy_auth: Optional[BasicAuth] = None, + timeout: Union[ClientTimeout, object] = sentinel, + verify_ssl: Optional[bool] = None, + fingerprint: Optional[bytes] = None, + ssl_context: Optional[SSLContext] = None, + ssl: Optional[Union[SSLContext, bool, Fingerprint]] = None, + proxy_headers: Optional[LooseHeaders] = None, + trace_request_ctx: Optional[SimpleNamespace] = None, + read_bufsize: Optional[int] = None, + ) -> ClientResponse: + + # NOTE: timeout clamps existing connect and read timeouts. We cannot + # set the default to None because we need to detect if the user wants + # to use the existing timeouts by setting timeout to None. + + if self.closed: + raise RuntimeError("Session is closed") + + ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint) + + if data is not None and json is not None: + raise ValueError( + "data and json parameters can not be used at the same time" + ) + elif json is not None: + data = payload.JsonPayload(json, dumps=self._json_serialize) + + if not isinstance(chunked, bool) and chunked is not None: + warnings.warn("Chunk size is deprecated #1615", DeprecationWarning) + + redirects = 0 + history = [] + version = self._version + + # Merge with default headers and transform to CIMultiDict + headers = self._prepare_headers(headers) + proxy_headers = self._prepare_headers(proxy_headers) + + try: + url = self._build_url(str_or_url) + except ValueError as e: + raise InvalidURL(str_or_url) from e + + skip_headers = set(self._skip_auto_headers) + if skip_auto_headers is not None: + for i in skip_auto_headers: + skip_headers.add(istr(i)) + + if proxy is not None: + try: + proxy = URL(proxy) + except ValueError as e: + raise InvalidURL(proxy) from e + + if timeout is sentinel: + real_timeout: ClientTimeout = self._timeout + else: + if not isinstance(timeout, ClientTimeout): + real_timeout = ClientTimeout(total=timeout) # type: ignore[arg-type] + else: + real_timeout = timeout + # timeout is cumulative for all request operations + # (request, redirects, responses, data consuming) + tm = TimeoutHandle(self._loop, real_timeout.total) + handle = tm.start() + + if read_bufsize is None: + read_bufsize = self._read_bufsize + + traces = [ + Trace( + self, + trace_config, + trace_config.trace_config_ctx(trace_request_ctx=trace_request_ctx), + ) + for trace_config in self._trace_configs + ] + + for trace in traces: + await trace.send_request_start(method, url.update_query(params), headers) + + timer = tm.timer() + try: + with timer: + while True: + url, auth_from_url = strip_auth_from_url(url) + if auth and auth_from_url: + raise ValueError( + "Cannot combine AUTH argument with " + "credentials encoded in URL" + ) + + if auth is None: + auth = auth_from_url + if auth is None: + auth = self._default_auth + # It would be confusing if we support explicit + # Authorization header with auth argument + if ( + headers is not None + and auth is not None + and hdrs.AUTHORIZATION in headers + ): + raise ValueError( + "Cannot combine AUTHORIZATION header " + "with AUTH argument or credentials " + "encoded in URL" + ) + + all_cookies = self._cookie_jar.filter_cookies(url) + + if cookies is not None: + tmp_cookie_jar = CookieJar() + tmp_cookie_jar.update_cookies(cookies) + req_cookies = tmp_cookie_jar.filter_cookies(url) + if req_cookies: + all_cookies.load(req_cookies) + + if proxy is not None: + proxy = URL(proxy) + elif self._trust_env: + with suppress(LookupError): + proxy, proxy_auth = get_env_proxy_for_url(url) + + req = self._request_class( + method, + url, + params=params, + headers=headers, + skip_auto_headers=skip_headers, + data=data, + cookies=all_cookies, + auth=auth, + version=version, + compress=compress, + chunked=chunked, + expect100=expect100, + loop=self._loop, + response_class=self._response_class, + proxy=proxy, + proxy_auth=proxy_auth, + timer=timer, + session=self, + ssl=ssl, + proxy_headers=proxy_headers, + traces=traces, + ) + + # connection timeout + try: + async with ceil_timeout(real_timeout.connect): + assert self._connector is not None + conn = await self._connector.connect( + req, traces=traces, timeout=real_timeout + ) + except asyncio.TimeoutError as exc: + raise ServerTimeoutError( + "Connection timeout " "to host {}".format(url) + ) from exc + + assert conn.transport is not None + + assert conn.protocol is not None + conn.protocol.set_response_params( + timer=timer, + skip_payload=method.upper() == "HEAD", + read_until_eof=read_until_eof, + auto_decompress=self._auto_decompress, + read_timeout=real_timeout.sock_read, + read_bufsize=read_bufsize, + ) + + try: + try: + resp = await req.send(conn) + try: + await resp.start(conn) + except BaseException: + resp.close() + raise + except BaseException: + conn.close() + raise + except ClientError: + raise + except OSError as exc: + if exc.errno is None and isinstance(exc, asyncio.TimeoutError): + raise + raise ClientOSError(*exc.args) from exc + + self._cookie_jar.update_cookies(resp.cookies, resp.url) + + # redirects + if resp.status in (301, 302, 303, 307, 308) and allow_redirects: + + for trace in traces: + await trace.send_request_redirect( + method, url.update_query(params), headers, resp + ) + + redirects += 1 + history.append(resp) + if max_redirects and redirects >= max_redirects: + resp.close() + raise TooManyRedirects( + history[0].request_info, tuple(history) + ) + + # For 301 and 302, mimic IE, now changed in RFC + # https://github.com/kennethreitz/requests/pull/269 + if (resp.status == 303 and resp.method != hdrs.METH_HEAD) or ( + resp.status in (301, 302) and resp.method == hdrs.METH_POST + ): + method = hdrs.METH_GET + data = None + if headers.get(hdrs.CONTENT_LENGTH): + headers.pop(hdrs.CONTENT_LENGTH) + + r_url = resp.headers.get(hdrs.LOCATION) or resp.headers.get( + hdrs.URI + ) + if r_url is None: + # see github.com/aio-libs/aiohttp/issues/2022 + break + else: + # reading from correct redirection + # response is forbidden + resp.release() + + try: + parsed_url = URL( + r_url, encoded=not self._requote_redirect_url + ) + + except ValueError as e: + raise InvalidURL(r_url) from e + + scheme = parsed_url.scheme + if scheme not in ("http", "https", ""): + resp.close() + raise ValueError("Can redirect only to http or https") + elif not scheme: + parsed_url = url.join(parsed_url) + + if url.origin() != parsed_url.origin(): + auth = None + headers.pop(hdrs.AUTHORIZATION, None) + + url = parsed_url + params = None + resp.release() + continue + + break + + # check response status + if raise_for_status is None: + raise_for_status = self._raise_for_status + if raise_for_status: + resp.raise_for_status() + + # register connection + if handle is not None: + if resp.connection is not None: + resp.connection.add_callback(handle.cancel) + else: + handle.cancel() + + resp._history = tuple(history) + + for trace in traces: + await trace.send_request_end( + method, url.update_query(params), headers, resp + ) + return resp + + except BaseException as e: + # cleanup timer + tm.close() + if handle: + handle.cancel() + handle = None + + for trace in traces: + await trace.send_request_exception( + method, url.update_query(params), headers, e + ) + raise + + def ws_connect( + self, + url: StrOrURL, + *, + method: str = hdrs.METH_GET, + protocols: Iterable[str] = (), + timeout: float = 10.0, + receive_timeout: Optional[float] = None, + autoclose: bool = True, + autoping: bool = True, + heartbeat: Optional[float] = None, + auth: Optional[BasicAuth] = None, + origin: Optional[str] = None, + params: Optional[Mapping[str, str]] = None, + headers: Optional[LooseHeaders] = None, + proxy: Optional[StrOrURL] = None, + proxy_auth: Optional[BasicAuth] = None, + ssl: Union[SSLContext, bool, None, Fingerprint] = None, + verify_ssl: Optional[bool] = None, + fingerprint: Optional[bytes] = None, + ssl_context: Optional[SSLContext] = None, + proxy_headers: Optional[LooseHeaders] = None, + compress: int = 0, + max_msg_size: int = 4 * 1024 * 1024, + ) -> "_WSRequestContextManager": + """Initiate websocket connection.""" + return _WSRequestContextManager( + self._ws_connect( + url, + method=method, + protocols=protocols, + timeout=timeout, + receive_timeout=receive_timeout, + autoclose=autoclose, + autoping=autoping, + heartbeat=heartbeat, + auth=auth, + origin=origin, + params=params, + headers=headers, + proxy=proxy, + proxy_auth=proxy_auth, + ssl=ssl, + verify_ssl=verify_ssl, + fingerprint=fingerprint, + ssl_context=ssl_context, + proxy_headers=proxy_headers, + compress=compress, + max_msg_size=max_msg_size, + ) + ) + + async def _ws_connect( + self, + url: StrOrURL, + *, + method: str = hdrs.METH_GET, + protocols: Iterable[str] = (), + timeout: float = 10.0, + receive_timeout: Optional[float] = None, + autoclose: bool = True, + autoping: bool = True, + heartbeat: Optional[float] = None, + auth: Optional[BasicAuth] = None, + origin: Optional[str] = None, + params: Optional[Mapping[str, str]] = None, + headers: Optional[LooseHeaders] = None, + proxy: Optional[StrOrURL] = None, + proxy_auth: Optional[BasicAuth] = None, + ssl: Union[SSLContext, bool, None, Fingerprint] = None, + verify_ssl: Optional[bool] = None, + fingerprint: Optional[bytes] = None, + ssl_context: Optional[SSLContext] = None, + proxy_headers: Optional[LooseHeaders] = None, + compress: int = 0, + max_msg_size: int = 4 * 1024 * 1024, + ) -> ClientWebSocketResponse: + + if headers is None: + real_headers: CIMultiDict[str] = CIMultiDict() + else: + real_headers = CIMultiDict(headers) + + default_headers = { + hdrs.UPGRADE: "websocket", + hdrs.CONNECTION: "upgrade", + hdrs.SEC_WEBSOCKET_VERSION: "13", + } + + for key, value in default_headers.items(): + real_headers.setdefault(key, value) + + sec_key = base64.b64encode(os.urandom(16)) + real_headers[hdrs.SEC_WEBSOCKET_KEY] = sec_key.decode() + + if protocols: + real_headers[hdrs.SEC_WEBSOCKET_PROTOCOL] = ",".join(protocols) + if origin is not None: + real_headers[hdrs.ORIGIN] = origin + if compress: + extstr = ws_ext_gen(compress=compress) + real_headers[hdrs.SEC_WEBSOCKET_EXTENSIONS] = extstr + + ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint) + + # send request + resp = await self.request( + method, + url, + params=params, + headers=real_headers, + read_until_eof=False, + auth=auth, + proxy=proxy, + proxy_auth=proxy_auth, + ssl=ssl, + proxy_headers=proxy_headers, + ) + + try: + # check handshake + if resp.status != 101: + raise WSServerHandshakeError( + resp.request_info, + resp.history, + message="Invalid response status", + status=resp.status, + headers=resp.headers, + ) + + if resp.headers.get(hdrs.UPGRADE, "").lower() != "websocket": + raise WSServerHandshakeError( + resp.request_info, + resp.history, + message="Invalid upgrade header", + status=resp.status, + headers=resp.headers, + ) + + if resp.headers.get(hdrs.CONNECTION, "").lower() != "upgrade": + raise WSServerHandshakeError( + resp.request_info, + resp.history, + message="Invalid connection header", + status=resp.status, + headers=resp.headers, + ) + + # key calculation + r_key = resp.headers.get(hdrs.SEC_WEBSOCKET_ACCEPT, "") + match = base64.b64encode(hashlib.sha1(sec_key + WS_KEY).digest()).decode() + if r_key != match: + raise WSServerHandshakeError( + resp.request_info, + resp.history, + message="Invalid challenge response", + status=resp.status, + headers=resp.headers, + ) + + # websocket protocol + protocol = None + if protocols and hdrs.SEC_WEBSOCKET_PROTOCOL in resp.headers: + resp_protocols = [ + proto.strip() + for proto in resp.headers[hdrs.SEC_WEBSOCKET_PROTOCOL].split(",") + ] + + for proto in resp_protocols: + if proto in protocols: + protocol = proto + break + + # websocket compress + notakeover = False + if compress: + compress_hdrs = resp.headers.get(hdrs.SEC_WEBSOCKET_EXTENSIONS) + if compress_hdrs: + try: + compress, notakeover = ws_ext_parse(compress_hdrs) + except WSHandshakeError as exc: + raise WSServerHandshakeError( + resp.request_info, + resp.history, + message=exc.args[0], + status=resp.status, + headers=resp.headers, + ) from exc + else: + compress = 0 + notakeover = False + + conn = resp.connection + assert conn is not None + conn_proto = conn.protocol + assert conn_proto is not None + transport = conn.transport + assert transport is not None + reader: FlowControlDataQueue[WSMessage] = FlowControlDataQueue( + conn_proto, 2**16, loop=self._loop + ) + conn_proto.set_parser(WebSocketReader(reader, max_msg_size), reader) + writer = WebSocketWriter( + conn_proto, + transport, + use_mask=True, + compress=compress, + notakeover=notakeover, + ) + except BaseException: + resp.close() + raise + else: + return self._ws_response_class( + reader, + writer, + protocol, + resp, + timeout, + autoclose, + autoping, + self._loop, + receive_timeout=receive_timeout, + heartbeat=heartbeat, + compress=compress, + client_notakeover=notakeover, + ) + + def _prepare_headers(self, headers: Optional[LooseHeaders]) -> "CIMultiDict[str]": + """Add default headers and transform it to CIMultiDict""" + # Convert headers to MultiDict + result = CIMultiDict(self._default_headers) + if headers: + if not isinstance(headers, (MultiDictProxy, MultiDict)): + headers = CIMultiDict(headers) + added_names: Set[str] = set() + for key, value in headers.items(): + if key in added_names: + result.add(key, value) + else: + result[key] = value + added_names.add(key) + return result + + def get( + self, url: StrOrURL, *, allow_redirects: bool = True, **kwargs: Any + ) -> "_RequestContextManager": + """Perform HTTP GET request.""" + return _RequestContextManager( + self._request(hdrs.METH_GET, url, allow_redirects=allow_redirects, **kwargs) + ) + + def options( + self, url: StrOrURL, *, allow_redirects: bool = True, **kwargs: Any + ) -> "_RequestContextManager": + """Perform HTTP OPTIONS request.""" + return _RequestContextManager( + self._request( + hdrs.METH_OPTIONS, url, allow_redirects=allow_redirects, **kwargs + ) + ) + + def head( + self, url: StrOrURL, *, allow_redirects: bool = False, **kwargs: Any + ) -> "_RequestContextManager": + """Perform HTTP HEAD request.""" + return _RequestContextManager( + self._request( + hdrs.METH_HEAD, url, allow_redirects=allow_redirects, **kwargs + ) + ) + + def post( + self, url: StrOrURL, *, data: Any = None, **kwargs: Any + ) -> "_RequestContextManager": + """Perform HTTP POST request.""" + return _RequestContextManager( + self._request(hdrs.METH_POST, url, data=data, **kwargs) + ) + + def put( + self, url: StrOrURL, *, data: Any = None, **kwargs: Any + ) -> "_RequestContextManager": + """Perform HTTP PUT request.""" + return _RequestContextManager( + self._request(hdrs.METH_PUT, url, data=data, **kwargs) + ) + + def patch( + self, url: StrOrURL, *, data: Any = None, **kwargs: Any + ) -> "_RequestContextManager": + """Perform HTTP PATCH request.""" + return _RequestContextManager( + self._request(hdrs.METH_PATCH, url, data=data, **kwargs) + ) + + def delete(self, url: StrOrURL, **kwargs: Any) -> "_RequestContextManager": + """Perform HTTP DELETE request.""" + return _RequestContextManager(self._request(hdrs.METH_DELETE, url, **kwargs)) + + async def close(self) -> None: + """Close underlying connector. + + Release all acquired resources. + """ + if not self.closed: + if self._connector is not None and self._connector_owner: + await self._connector.close() + self._connector = None + + @property + def closed(self) -> bool: + """Is client session closed. + + A readonly property. + """ + return self._connector is None or self._connector.closed + + @property + def connector(self) -> Optional[BaseConnector]: + """Connector instance used for the session.""" + return self._connector + + @property + def cookie_jar(self) -> AbstractCookieJar: + """The session cookies.""" + return self._cookie_jar + + @property + def version(self) -> Tuple[int, int]: + """The session HTTP protocol version.""" + return self._version + + @property + def requote_redirect_url(self) -> bool: + """Do URL requoting on redirection handling.""" + return self._requote_redirect_url + + @requote_redirect_url.setter + def requote_redirect_url(self, val: bool) -> None: + """Do URL requoting on redirection handling.""" + warnings.warn( + "session.requote_redirect_url modification " "is deprecated #2778", + DeprecationWarning, + stacklevel=2, + ) + self._requote_redirect_url = val + + @property + def loop(self) -> asyncio.AbstractEventLoop: + """Session's loop.""" + warnings.warn( + "client.loop property is deprecated", DeprecationWarning, stacklevel=2 + ) + return self._loop + + @property + def timeout(self) -> ClientTimeout: + """Timeout for the session.""" + return self._timeout + + @property + def headers(self) -> "CIMultiDict[str]": + """The default headers of the client session.""" + return self._default_headers + + @property + def skip_auto_headers(self) -> FrozenSet[istr]: + """Headers for which autogeneration should be skipped""" + return self._skip_auto_headers + + @property + def auth(self) -> Optional[BasicAuth]: + """An object that represents HTTP Basic Authorization""" + return self._default_auth + + @property + def json_serialize(self) -> JSONEncoder: + """Json serializer callable""" + return self._json_serialize + + @property + def connector_owner(self) -> bool: + """Should connector be closed on session closing""" + return self._connector_owner + + @property + def raise_for_status( + self, + ) -> Union[bool, Callable[[ClientResponse], Awaitable[None]]]: + """Should `ClientResponse.raise_for_status()` be called for each response.""" + return self._raise_for_status + + @property + def auto_decompress(self) -> bool: + """Should the body response be automatically decompressed.""" + return self._auto_decompress + + @property + def trust_env(self) -> bool: + """ + Should proxies information from environment or netrc be trusted. + + Information is from HTTP_PROXY / HTTPS_PROXY environment variables + or ~/.netrc file if present. + """ + return self._trust_env + + @property + def trace_configs(self) -> List[TraceConfig]: + """A list of TraceConfig instances used for client tracing""" + return self._trace_configs + + def detach(self) -> None: + """Detach connector from session without closing the former. + + Session is switched to closed state anyway. + """ + self._connector = None + + def __enter__(self) -> None: + raise TypeError("Use async with instead") + + def __exit__( + self, + exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType], + ) -> None: + # __exit__ should exist in pair with __enter__ but never executed + pass # pragma: no cover + + async def __aenter__(self) -> "ClientSession": + return self + + async def __aexit__( + self, + exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType], + ) -> None: + await self.close() + + +class _BaseRequestContextManager(Coroutine[Any, Any, _RetType], Generic[_RetType]): + + __slots__ = ("_coro", "_resp") + + def __init__(self, coro: Coroutine["asyncio.Future[Any]", None, _RetType]) -> None: + self._coro = coro + + def send(self, arg: None) -> "asyncio.Future[Any]": + return self._coro.send(arg) + + def throw(self, arg: BaseException) -> None: # type: ignore[arg-type,override] + self._coro.throw(arg) + + def close(self) -> None: + return self._coro.close() + + def __await__(self) -> Generator[Any, None, _RetType]: + ret = self._coro.__await__() + return ret + + def __iter__(self) -> Generator[Any, None, _RetType]: + return self.__await__() + + async def __aenter__(self) -> _RetType: + self._resp = await self._coro + return self._resp + + +class _RequestContextManager(_BaseRequestContextManager[ClientResponse]): + __slots__ = () + + async def __aexit__( + self, + exc_type: Optional[Type[BaseException]], + exc: Optional[BaseException], + tb: Optional[TracebackType], + ) -> None: + # We're basing behavior on the exception as it can be caused by + # user code unrelated to the status of the connection. If you + # would like to close a connection you must do that + # explicitly. Otherwise connection error handling should kick in + # and close/recycle the connection as required. + self._resp.release() + + +class _WSRequestContextManager(_BaseRequestContextManager[ClientWebSocketResponse]): + __slots__ = () + + async def __aexit__( + self, + exc_type: Optional[Type[BaseException]], + exc: Optional[BaseException], + tb: Optional[TracebackType], + ) -> None: + await self._resp.close() + + +class _SessionRequestContextManager: + + __slots__ = ("_coro", "_resp", "_session") + + def __init__( + self, + coro: Coroutine["asyncio.Future[Any]", None, ClientResponse], + session: ClientSession, + ) -> None: + self._coro = coro + self._resp: Optional[ClientResponse] = None + self._session = session + + async def __aenter__(self) -> ClientResponse: + try: + self._resp = await self._coro + except BaseException: + await self._session.close() + raise + else: + return self._resp + + async def __aexit__( + self, + exc_type: Optional[Type[BaseException]], + exc: Optional[BaseException], + tb: Optional[TracebackType], + ) -> None: + assert self._resp is not None + self._resp.close() + await self._session.close() + + +def request( + method: str, + url: StrOrURL, + *, + params: Optional[Mapping[str, str]] = None, + data: Any = None, + json: Any = None, + headers: Optional[LooseHeaders] = None, + skip_auto_headers: Optional[Iterable[str]] = None, + auth: Optional[BasicAuth] = None, + allow_redirects: bool = True, + max_redirects: int = 10, + compress: Optional[str] = None, + chunked: Optional[bool] = None, + expect100: bool = False, + raise_for_status: Optional[bool] = None, + read_until_eof: bool = True, + proxy: Optional[StrOrURL] = None, + proxy_auth: Optional[BasicAuth] = None, + timeout: Union[ClientTimeout, object] = sentinel, + cookies: Optional[LooseCookies] = None, + version: HttpVersion = http.HttpVersion11, + connector: Optional[BaseConnector] = None, + read_bufsize: Optional[int] = None, + loop: Optional[asyncio.AbstractEventLoop] = None, +) -> _SessionRequestContextManager: + """Constructs and sends a request. + + Returns response object. + method - HTTP method + url - request url + params - (optional) Dictionary or bytes to be sent in the query + string of the new request + data - (optional) Dictionary, bytes, or file-like object to + send in the body of the request + json - (optional) Any json compatible python object + headers - (optional) Dictionary of HTTP Headers to send with + the request + cookies - (optional) Dict object to send with the request + auth - (optional) BasicAuth named tuple represent HTTP Basic Auth + auth - aiohttp.helpers.BasicAuth + allow_redirects - (optional) If set to False, do not follow + redirects + version - Request HTTP version. + compress - Set to True if request has to be compressed + with deflate encoding. + chunked - Set to chunk size for chunked transfer encoding. + expect100 - Expect 100-continue response from server. + connector - BaseConnector sub-class instance to support + connection pooling. + read_until_eof - Read response until eof if response + does not have Content-Length header. + loop - Optional event loop. + timeout - Optional ClientTimeout settings structure, 5min + total timeout by default. + Usage:: + >>> import aiohttp + >>> resp = await aiohttp.request('GET', 'http://python.org/') + >>> resp + + >>> data = await resp.read() + """ + connector_owner = False + if connector is None: + connector_owner = True + connector = TCPConnector(loop=loop, force_close=True) + + session = ClientSession( + loop=loop, + cookies=cookies, + version=version, + timeout=timeout, + connector=connector, + connector_owner=connector_owner, + ) + + return _SessionRequestContextManager( + session._request( + method, + url, + params=params, + data=data, + json=json, + headers=headers, + skip_auto_headers=skip_auto_headers, + auth=auth, + allow_redirects=allow_redirects, + max_redirects=max_redirects, + compress=compress, + chunked=chunked, + expect100=expect100, + raise_for_status=raise_for_status, + read_until_eof=read_until_eof, + proxy=proxy, + proxy_auth=proxy_auth, + read_bufsize=read_bufsize, + ), + session, + ) diff --git a/runtime/Lib/site-packages/aiohttp/client_exceptions.py b/runtime/Lib/site-packages/aiohttp/client_exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..1523b300d0d4e7fc7f494355f1397627df75d3d7 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/client_exceptions.py @@ -0,0 +1,342 @@ +"""HTTP related errors.""" + +import asyncio +import warnings +from typing import TYPE_CHECKING, Any, Optional, Tuple, Union + +from .http_parser import RawResponseMessage +from .typedefs import LooseHeaders + +try: + import ssl + + SSLContext = ssl.SSLContext +except ImportError: # pragma: no cover + ssl = SSLContext = None # type: ignore[assignment] + + +if TYPE_CHECKING: # pragma: no cover + from .client_reqrep import ClientResponse, ConnectionKey, Fingerprint, RequestInfo +else: + RequestInfo = ClientResponse = ConnectionKey = None + +__all__ = ( + "ClientError", + "ClientConnectionError", + "ClientOSError", + "ClientConnectorError", + "ClientProxyConnectionError", + "ClientSSLError", + "ClientConnectorSSLError", + "ClientConnectorCertificateError", + "ServerConnectionError", + "ServerTimeoutError", + "ServerDisconnectedError", + "ServerFingerprintMismatch", + "ClientResponseError", + "ClientHttpProxyError", + "WSServerHandshakeError", + "ContentTypeError", + "ClientPayloadError", + "InvalidURL", +) + + +class ClientError(Exception): + """Base class for client connection errors.""" + + +class ClientResponseError(ClientError): + """Connection error during reading response. + + request_info: instance of RequestInfo + """ + + def __init__( + self, + request_info: RequestInfo, + history: Tuple[ClientResponse, ...], + *, + code: Optional[int] = None, + status: Optional[int] = None, + message: str = "", + headers: Optional[LooseHeaders] = None, + ) -> None: + self.request_info = request_info + if code is not None: + if status is not None: + raise ValueError( + "Both code and status arguments are provided; " + "code is deprecated, use status instead" + ) + warnings.warn( + "code argument is deprecated, use status instead", + DeprecationWarning, + stacklevel=2, + ) + if status is not None: + self.status = status + elif code is not None: + self.status = code + else: + self.status = 0 + self.message = message + self.headers = headers + self.history = history + self.args = (request_info, history) + + def __str__(self) -> str: + return "{}, message={!r}, url={!r}".format( + self.status, + self.message, + self.request_info.real_url, + ) + + def __repr__(self) -> str: + args = f"{self.request_info!r}, {self.history!r}" + if self.status != 0: + args += f", status={self.status!r}" + if self.message != "": + args += f", message={self.message!r}" + if self.headers is not None: + args += f", headers={self.headers!r}" + return f"{type(self).__name__}({args})" + + @property + def code(self) -> int: + warnings.warn( + "code property is deprecated, use status instead", + DeprecationWarning, + stacklevel=2, + ) + return self.status + + @code.setter + def code(self, value: int) -> None: + warnings.warn( + "code property is deprecated, use status instead", + DeprecationWarning, + stacklevel=2, + ) + self.status = value + + +class ContentTypeError(ClientResponseError): + """ContentType found is not valid.""" + + +class WSServerHandshakeError(ClientResponseError): + """websocket server handshake error.""" + + +class ClientHttpProxyError(ClientResponseError): + """HTTP proxy error. + + Raised in :class:`aiohttp.connector.TCPConnector` if + proxy responds with status other than ``200 OK`` + on ``CONNECT`` request. + """ + + +class TooManyRedirects(ClientResponseError): + """Client was redirected too many times.""" + + +class ClientConnectionError(ClientError): + """Base class for client socket errors.""" + + +class ClientOSError(ClientConnectionError, OSError): + """OSError error.""" + + +class ClientConnectorError(ClientOSError): + """Client connector error. + + Raised in :class:`aiohttp.connector.TCPConnector` if + a connection can not be established. + """ + + def __init__(self, connection_key: ConnectionKey, os_error: OSError) -> None: + self._conn_key = connection_key + self._os_error = os_error + super().__init__(os_error.errno, os_error.strerror) + self.args = (connection_key, os_error) + + @property + def os_error(self) -> OSError: + return self._os_error + + @property + def host(self) -> str: + return self._conn_key.host + + @property + def port(self) -> Optional[int]: + return self._conn_key.port + + @property + def ssl(self) -> Union[SSLContext, None, bool, "Fingerprint"]: + return self._conn_key.ssl + + def __str__(self) -> str: + return "Cannot connect to host {0.host}:{0.port} ssl:{1} [{2}]".format( + self, self.ssl if self.ssl is not None else "default", self.strerror + ) + + # OSError.__reduce__ does too much black magick + __reduce__ = BaseException.__reduce__ + + +class ClientProxyConnectionError(ClientConnectorError): + """Proxy connection error. + + Raised in :class:`aiohttp.connector.TCPConnector` if + connection to proxy can not be established. + """ + + +class UnixClientConnectorError(ClientConnectorError): + """Unix connector error. + + Raised in :py:class:`aiohttp.connector.UnixConnector` + if connection to unix socket can not be established. + """ + + def __init__( + self, path: str, connection_key: ConnectionKey, os_error: OSError + ) -> None: + self._path = path + super().__init__(connection_key, os_error) + + @property + def path(self) -> str: + return self._path + + def __str__(self) -> str: + return "Cannot connect to unix socket {0.path} ssl:{1} [{2}]".format( + self, self.ssl if self.ssl is not None else "default", self.strerror + ) + + +class ServerConnectionError(ClientConnectionError): + """Server connection errors.""" + + +class ServerDisconnectedError(ServerConnectionError): + """Server disconnected.""" + + def __init__(self, message: Union[RawResponseMessage, str, None] = None) -> None: + if message is None: + message = "Server disconnected" + + self.args = (message,) + self.message = message + + +class ServerTimeoutError(ServerConnectionError, asyncio.TimeoutError): + """Server timeout error.""" + + +class ServerFingerprintMismatch(ServerConnectionError): + """SSL certificate does not match expected fingerprint.""" + + def __init__(self, expected: bytes, got: bytes, host: str, port: int) -> None: + self.expected = expected + self.got = got + self.host = host + self.port = port + self.args = (expected, got, host, port) + + def __repr__(self) -> str: + return "<{} expected={!r} got={!r} host={!r} port={!r}>".format( + self.__class__.__name__, self.expected, self.got, self.host, self.port + ) + + +class ClientPayloadError(ClientError): + """Response payload error.""" + + +class InvalidURL(ClientError, ValueError): + """Invalid URL. + + URL used for fetching is malformed, e.g. it doesn't contains host + part. + """ + + # Derive from ValueError for backward compatibility + + def __init__(self, url: Any) -> None: + # The type of url is not yarl.URL because the exception can be raised + # on URL(url) call + super().__init__(url) + + @property + def url(self) -> Any: + return self.args[0] + + def __repr__(self) -> str: + return f"<{self.__class__.__name__} {self.url}>" + + +class ClientSSLError(ClientConnectorError): + """Base error for ssl.*Errors.""" + + +if ssl is not None: + cert_errors = (ssl.CertificateError,) + cert_errors_bases = ( + ClientSSLError, + ssl.CertificateError, + ) + + ssl_errors = (ssl.SSLError,) + ssl_error_bases = (ClientSSLError, ssl.SSLError) +else: # pragma: no cover + cert_errors = tuple() + cert_errors_bases = ( + ClientSSLError, + ValueError, + ) + + ssl_errors = tuple() + ssl_error_bases = (ClientSSLError,) + + +class ClientConnectorSSLError(*ssl_error_bases): # type: ignore[misc] + """Response ssl error.""" + + +class ClientConnectorCertificateError(*cert_errors_bases): # type: ignore[misc] + """Response certificate error.""" + + def __init__( + self, connection_key: ConnectionKey, certificate_error: Exception + ) -> None: + self._conn_key = connection_key + self._certificate_error = certificate_error + self.args = (connection_key, certificate_error) + + @property + def certificate_error(self) -> Exception: + return self._certificate_error + + @property + def host(self) -> str: + return self._conn_key.host + + @property + def port(self) -> Optional[int]: + return self._conn_key.port + + @property + def ssl(self) -> bool: + return self._conn_key.is_ssl + + def __str__(self) -> str: + return ( + "Cannot connect to host {0.host}:{0.port} ssl:{0.ssl} " + "[{0.certificate_error.__class__.__name__}: " + "{0.certificate_error.args}]".format(self) + ) diff --git a/runtime/Lib/site-packages/aiohttp/client_proto.py b/runtime/Lib/site-packages/aiohttp/client_proto.py new file mode 100644 index 0000000000000000000000000000000000000000..b1e7ef0debfdb058ce8fcf393f3c57caf3d381c9 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/client_proto.py @@ -0,0 +1,251 @@ +import asyncio +from contextlib import suppress +from typing import Any, Optional, Tuple + +from .base_protocol import BaseProtocol +from .client_exceptions import ( + ClientOSError, + ClientPayloadError, + ServerDisconnectedError, + ServerTimeoutError, +) +from .helpers import BaseTimerContext +from .http import HttpResponseParser, RawResponseMessage +from .streams import EMPTY_PAYLOAD, DataQueue, StreamReader + + +class ResponseHandler(BaseProtocol, DataQueue[Tuple[RawResponseMessage, StreamReader]]): + """Helper class to adapt between Protocol and StreamReader.""" + + def __init__(self, loop: asyncio.AbstractEventLoop) -> None: + BaseProtocol.__init__(self, loop=loop) + DataQueue.__init__(self, loop) + + self._should_close = False + + self._payload: Optional[StreamReader] = None + self._skip_payload = False + self._payload_parser = None + + self._timer = None + + self._tail = b"" + self._upgraded = False + self._parser: Optional[HttpResponseParser] = None + + self._read_timeout: Optional[float] = None + self._read_timeout_handle: Optional[asyncio.TimerHandle] = None + + @property + def upgraded(self) -> bool: + return self._upgraded + + @property + def should_close(self) -> bool: + if self._payload is not None and not self._payload.is_eof() or self._upgraded: + return True + + return ( + self._should_close + or self._upgraded + or self.exception() is not None + or self._payload_parser is not None + or len(self) > 0 + or bool(self._tail) + ) + + def force_close(self) -> None: + self._should_close = True + + def close(self) -> None: + transport = self.transport + if transport is not None: + transport.close() + self.transport = None + self._payload = None + self._drop_timeout() + + def is_connected(self) -> bool: + return self.transport is not None and not self.transport.is_closing() + + def connection_lost(self, exc: Optional[BaseException]) -> None: + self._drop_timeout() + + if self._payload_parser is not None: + with suppress(Exception): + self._payload_parser.feed_eof() + + uncompleted = None + if self._parser is not None: + try: + uncompleted = self._parser.feed_eof() + except Exception: + if self._payload is not None: + self._payload.set_exception( + ClientPayloadError("Response payload is not completed") + ) + + if not self.is_eof(): + if isinstance(exc, OSError): + exc = ClientOSError(*exc.args) + if exc is None: + exc = ServerDisconnectedError(uncompleted) + # assigns self._should_close to True as side effect, + # we do it anyway below + self.set_exception(exc) + + self._should_close = True + self._parser = None + self._payload = None + self._payload_parser = None + self._reading_paused = False + + super().connection_lost(exc) + + def eof_received(self) -> None: + # should call parser.feed_eof() most likely + self._drop_timeout() + + def pause_reading(self) -> None: + super().pause_reading() + self._drop_timeout() + + def resume_reading(self) -> None: + super().resume_reading() + self._reschedule_timeout() + + def set_exception(self, exc: BaseException) -> None: + self._should_close = True + self._drop_timeout() + super().set_exception(exc) + + def set_parser(self, parser: Any, payload: Any) -> None: + # TODO: actual types are: + # parser: WebSocketReader + # payload: FlowControlDataQueue + # but they are not generi enough + # Need an ABC for both types + self._payload = payload + self._payload_parser = parser + + self._drop_timeout() + + if self._tail: + data, self._tail = self._tail, b"" + self.data_received(data) + + def set_response_params( + self, + *, + timer: Optional[BaseTimerContext] = None, + skip_payload: bool = False, + read_until_eof: bool = False, + auto_decompress: bool = True, + read_timeout: Optional[float] = None, + read_bufsize: int = 2**16, + ) -> None: + self._skip_payload = skip_payload + + self._read_timeout = read_timeout + self._reschedule_timeout() + + self._parser = HttpResponseParser( + self, + self._loop, + read_bufsize, + timer=timer, + payload_exception=ClientPayloadError, + response_with_body=not skip_payload, + read_until_eof=read_until_eof, + auto_decompress=auto_decompress, + ) + + if self._tail: + data, self._tail = self._tail, b"" + self.data_received(data) + + def _drop_timeout(self) -> None: + if self._read_timeout_handle is not None: + self._read_timeout_handle.cancel() + self._read_timeout_handle = None + + def _reschedule_timeout(self) -> None: + timeout = self._read_timeout + if self._read_timeout_handle is not None: + self._read_timeout_handle.cancel() + + if timeout: + self._read_timeout_handle = self._loop.call_later( + timeout, self._on_read_timeout + ) + else: + self._read_timeout_handle = None + + def _on_read_timeout(self) -> None: + exc = ServerTimeoutError("Timeout on reading data from socket") + self.set_exception(exc) + if self._payload is not None: + self._payload.set_exception(exc) + + def data_received(self, data: bytes) -> None: + self._reschedule_timeout() + + if not data: + return + + # custom payload parser + if self._payload_parser is not None: + eof, tail = self._payload_parser.feed_data(data) + if eof: + self._payload = None + self._payload_parser = None + + if tail: + self.data_received(tail) + return + else: + if self._upgraded or self._parser is None: + # i.e. websocket connection, websocket parser is not set yet + self._tail += data + else: + # parse http messages + try: + messages, upgraded, tail = self._parser.feed_data(data) + except BaseException as exc: + if self.transport is not None: + # connection.release() could be called BEFORE + # data_received(), the transport is already + # closed in this case + self.transport.close() + # should_close is True after the call + self.set_exception(exc) + return + + self._upgraded = upgraded + + payload: Optional[StreamReader] = None + for message, payload in messages: + if message.should_close: + self._should_close = True + + self._payload = payload + + if self._skip_payload or message.code in (204, 304): + self.feed_data((message, EMPTY_PAYLOAD), 0) + else: + self.feed_data((message, payload), 0) + if payload is not None: + # new message(s) was processed + # register timeout handler unsubscribing + # either on end-of-stream or immediately for + # EMPTY_PAYLOAD + if payload is not EMPTY_PAYLOAD: + payload.on_eof(self._drop_timeout) + else: + self._drop_timeout() + + if tail: + if upgraded: + self.data_received(tail) + else: + self._tail = tail diff --git a/runtime/Lib/site-packages/aiohttp/client_reqrep.py b/runtime/Lib/site-packages/aiohttp/client_reqrep.py new file mode 100644 index 0000000000000000000000000000000000000000..ca379d53eb3e920ccc1b9925283a40e4175e7943 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/client_reqrep.py @@ -0,0 +1,1134 @@ +import asyncio +import codecs +import functools +import io +import re +import sys +import traceback +import warnings +from hashlib import md5, sha1, sha256 +from http.cookies import CookieError, Morsel, SimpleCookie +from types import MappingProxyType, TracebackType +from typing import ( + TYPE_CHECKING, + Any, + Dict, + Iterable, + List, + Mapping, + Optional, + Tuple, + Type, + Union, + cast, +) + +import attr +from multidict import CIMultiDict, CIMultiDictProxy, MultiDict, MultiDictProxy +from yarl import URL + +from . import hdrs, helpers, http, multipart, payload +from .abc import AbstractStreamWriter +from .client_exceptions import ( + ClientConnectionError, + ClientOSError, + ClientResponseError, + ContentTypeError, + InvalidURL, + ServerFingerprintMismatch, +) +from .formdata import FormData +from .helpers import ( + PY_36, + BaseTimerContext, + BasicAuth, + HeadersMixin, + TimerNoop, + noop, + reify, + set_result, +) +from .http import SERVER_SOFTWARE, HttpVersion10, HttpVersion11, StreamWriter +from .log import client_logger +from .streams import StreamReader +from .typedefs import ( + DEFAULT_JSON_DECODER, + JSONDecoder, + LooseCookies, + LooseHeaders, + RawHeaders, +) + +try: + import ssl + from ssl import SSLContext +except ImportError: # pragma: no cover + ssl = None # type: ignore[assignment] + SSLContext = object # type: ignore[misc,assignment] + +try: + import cchardet as chardet +except ImportError: # pragma: no cover + import charset_normalizer as chardet # type: ignore[no-redef] + + +__all__ = ("ClientRequest", "ClientResponse", "RequestInfo", "Fingerprint") + + +if TYPE_CHECKING: # pragma: no cover + from .client import ClientSession + from .connector import Connection + from .tracing import Trace + + +json_re = re.compile(r"^application/(?:[\w.+-]+?\+)?json") + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class ContentDisposition: + type: Optional[str] + parameters: "MappingProxyType[str, str]" + filename: Optional[str] + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class RequestInfo: + url: URL + method: str + headers: "CIMultiDictProxy[str]" + real_url: URL = attr.ib() + + @real_url.default + def real_url_default(self) -> URL: + return self.url + + +class Fingerprint: + HASHFUNC_BY_DIGESTLEN = { + 16: md5, + 20: sha1, + 32: sha256, + } + + def __init__(self, fingerprint: bytes) -> None: + digestlen = len(fingerprint) + hashfunc = self.HASHFUNC_BY_DIGESTLEN.get(digestlen) + if not hashfunc: + raise ValueError("fingerprint has invalid length") + elif hashfunc is md5 or hashfunc is sha1: + raise ValueError( + "md5 and sha1 are insecure and " "not supported. Use sha256." + ) + self._hashfunc = hashfunc + self._fingerprint = fingerprint + + @property + def fingerprint(self) -> bytes: + return self._fingerprint + + def check(self, transport: asyncio.Transport) -> None: + if not transport.get_extra_info("sslcontext"): + return + sslobj = transport.get_extra_info("ssl_object") + cert = sslobj.getpeercert(binary_form=True) + got = self._hashfunc(cert).digest() + if got != self._fingerprint: + host, port, *_ = transport.get_extra_info("peername") + raise ServerFingerprintMismatch(self._fingerprint, got, host, port) + + +if ssl is not None: + SSL_ALLOWED_TYPES = (ssl.SSLContext, bool, Fingerprint, type(None)) +else: # pragma: no cover + SSL_ALLOWED_TYPES = type(None) + + +def _merge_ssl_params( + ssl: Union["SSLContext", bool, Fingerprint, None], + verify_ssl: Optional[bool], + ssl_context: Optional["SSLContext"], + fingerprint: Optional[bytes], +) -> Union["SSLContext", bool, Fingerprint, None]: + if verify_ssl is not None and not verify_ssl: + warnings.warn( + "verify_ssl is deprecated, use ssl=False instead", + DeprecationWarning, + stacklevel=3, + ) + if ssl is not None: + raise ValueError( + "verify_ssl, ssl_context, fingerprint and ssl " + "parameters are mutually exclusive" + ) + else: + ssl = False + if ssl_context is not None: + warnings.warn( + "ssl_context is deprecated, use ssl=context instead", + DeprecationWarning, + stacklevel=3, + ) + if ssl is not None: + raise ValueError( + "verify_ssl, ssl_context, fingerprint and ssl " + "parameters are mutually exclusive" + ) + else: + ssl = ssl_context + if fingerprint is not None: + warnings.warn( + "fingerprint is deprecated, " "use ssl=Fingerprint(fingerprint) instead", + DeprecationWarning, + stacklevel=3, + ) + if ssl is not None: + raise ValueError( + "verify_ssl, ssl_context, fingerprint and ssl " + "parameters are mutually exclusive" + ) + else: + ssl = Fingerprint(fingerprint) + if not isinstance(ssl, SSL_ALLOWED_TYPES): + raise TypeError( + "ssl should be SSLContext, bool, Fingerprint or None, " + "got {!r} instead.".format(ssl) + ) + return ssl + + +@attr.s(auto_attribs=True, slots=True, frozen=True) +class ConnectionKey: + # the key should contain an information about used proxy / TLS + # to prevent reusing wrong connections from a pool + host: str + port: Optional[int] + is_ssl: bool + ssl: Union[SSLContext, None, bool, Fingerprint] + proxy: Optional[URL] + proxy_auth: Optional[BasicAuth] + proxy_headers_hash: Optional[int] # hash(CIMultiDict) + + +def _is_expected_content_type( + response_content_type: str, expected_content_type: str +) -> bool: + if expected_content_type == "application/json": + return json_re.match(response_content_type) is not None + return expected_content_type in response_content_type + + +class ClientRequest: + GET_METHODS = { + hdrs.METH_GET, + hdrs.METH_HEAD, + hdrs.METH_OPTIONS, + hdrs.METH_TRACE, + } + POST_METHODS = {hdrs.METH_PATCH, hdrs.METH_POST, hdrs.METH_PUT} + ALL_METHODS = GET_METHODS.union(POST_METHODS).union({hdrs.METH_DELETE}) + + DEFAULT_HEADERS = { + hdrs.ACCEPT: "*/*", + hdrs.ACCEPT_ENCODING: "gzip, deflate", + } + + body = b"" + auth = None + response = None + + _writer = None # async task for streaming data + _continue = None # waiter future for '100 Continue' response + + # N.B. + # Adding __del__ method with self._writer closing doesn't make sense + # because _writer is instance method, thus it keeps a reference to self. + # Until writer has finished finalizer will not be called. + + def __init__( + self, + method: str, + url: URL, + *, + params: Optional[Mapping[str, str]] = None, + headers: Optional[LooseHeaders] = None, + skip_auto_headers: Iterable[str] = frozenset(), + data: Any = None, + cookies: Optional[LooseCookies] = None, + auth: Optional[BasicAuth] = None, + version: http.HttpVersion = http.HttpVersion11, + compress: Optional[str] = None, + chunked: Optional[bool] = None, + expect100: bool = False, + loop: Optional[asyncio.AbstractEventLoop] = None, + response_class: Optional[Type["ClientResponse"]] = None, + proxy: Optional[URL] = None, + proxy_auth: Optional[BasicAuth] = None, + timer: Optional[BaseTimerContext] = None, + session: Optional["ClientSession"] = None, + ssl: Union[SSLContext, bool, Fingerprint, None] = None, + proxy_headers: Optional[LooseHeaders] = None, + traces: Optional[List["Trace"]] = None, + ): + + if loop is None: + loop = asyncio.get_event_loop() + + assert isinstance(url, URL), url + assert isinstance(proxy, (URL, type(None))), proxy + # FIXME: session is None in tests only, need to fix tests + # assert session is not None + self._session = cast("ClientSession", session) + if params: + q = MultiDict(url.query) + url2 = url.with_query(params) + q.extend(url2.query) + url = url.with_query(q) + self.original_url = url + self.url = url.with_fragment(None) + self.method = method.upper() + self.chunked = chunked + self.compress = compress + self.loop = loop + self.length = None + if response_class is None: + real_response_class = ClientResponse + else: + real_response_class = response_class + self.response_class: Type[ClientResponse] = real_response_class + self._timer = timer if timer is not None else TimerNoop() + self._ssl = ssl + + if loop.get_debug(): + self._source_traceback = traceback.extract_stack(sys._getframe(1)) + + self.update_version(version) + self.update_host(url) + self.update_headers(headers) + self.update_auto_headers(skip_auto_headers) + self.update_cookies(cookies) + self.update_content_encoding(data) + self.update_auth(auth) + self.update_proxy(proxy, proxy_auth, proxy_headers) + + self.update_body_from_data(data) + if data is not None or self.method not in self.GET_METHODS: + self.update_transfer_encoding() + self.update_expect_continue(expect100) + if traces is None: + traces = [] + self._traces = traces + + def is_ssl(self) -> bool: + return self.url.scheme in ("https", "wss") + + @property + def ssl(self) -> Union["SSLContext", None, bool, Fingerprint]: + return self._ssl + + @property + def connection_key(self) -> ConnectionKey: + proxy_headers = self.proxy_headers + if proxy_headers: + h: Optional[int] = hash(tuple((k, v) for k, v in proxy_headers.items())) + else: + h = None + return ConnectionKey( + self.host, + self.port, + self.is_ssl(), + self.ssl, + self.proxy, + self.proxy_auth, + h, + ) + + @property + def host(self) -> str: + ret = self.url.raw_host + assert ret is not None + return ret + + @property + def port(self) -> Optional[int]: + return self.url.port + + @property + def request_info(self) -> RequestInfo: + headers: CIMultiDictProxy[str] = CIMultiDictProxy(self.headers) + return RequestInfo(self.url, self.method, headers, self.original_url) + + def update_host(self, url: URL) -> None: + """Update destination host, port and connection type (ssl).""" + # get host/port + if not url.raw_host: + raise InvalidURL(url) + + # basic auth info + username, password = url.user, url.password + if username: + self.auth = helpers.BasicAuth(username, password or "") + + def update_version(self, version: Union[http.HttpVersion, str]) -> None: + """Convert request version to two elements tuple. + + parser HTTP version '1.1' => (1, 1) + """ + if isinstance(version, str): + v = [part.strip() for part in version.split(".", 1)] + try: + version = http.HttpVersion(int(v[0]), int(v[1])) + except ValueError: + raise ValueError( + f"Can not parse http version number: {version}" + ) from None + self.version = version + + def update_headers(self, headers: Optional[LooseHeaders]) -> None: + """Update request headers.""" + self.headers: CIMultiDict[str] = CIMultiDict() + + # add host + netloc = cast(str, self.url.raw_host) + if helpers.is_ipv6_address(netloc): + netloc = f"[{netloc}]" + if self.url.port is not None and not self.url.is_default_port(): + netloc += ":" + str(self.url.port) + self.headers[hdrs.HOST] = netloc + + if headers: + if isinstance(headers, (dict, MultiDictProxy, MultiDict)): + headers = headers.items() # type: ignore[assignment] + + for key, value in headers: # type: ignore[misc] + # A special case for Host header + if key.lower() == "host": + self.headers[key] = value + else: + self.headers.add(key, value) + + def update_auto_headers(self, skip_auto_headers: Iterable[str]) -> None: + self.skip_auto_headers = CIMultiDict( + (hdr, None) for hdr in sorted(skip_auto_headers) + ) + used_headers = self.headers.copy() + used_headers.extend(self.skip_auto_headers) # type: ignore[arg-type] + + for hdr, val in self.DEFAULT_HEADERS.items(): + if hdr not in used_headers: + self.headers.add(hdr, val) + + if hdrs.USER_AGENT not in used_headers: + self.headers[hdrs.USER_AGENT] = SERVER_SOFTWARE + + def update_cookies(self, cookies: Optional[LooseCookies]) -> None: + """Update request cookies header.""" + if not cookies: + return + + c: SimpleCookie[str] = SimpleCookie() + if hdrs.COOKIE in self.headers: + c.load(self.headers.get(hdrs.COOKIE, "")) + del self.headers[hdrs.COOKIE] + + if isinstance(cookies, Mapping): + iter_cookies = cookies.items() + else: + iter_cookies = cookies # type: ignore[assignment] + for name, value in iter_cookies: + if isinstance(value, Morsel): + # Preserve coded_value + mrsl_val = value.get(value.key, Morsel()) + mrsl_val.set(value.key, value.value, value.coded_value) + c[name] = mrsl_val + else: + c[name] = value # type: ignore[assignment] + + self.headers[hdrs.COOKIE] = c.output(header="", sep=";").strip() + + def update_content_encoding(self, data: Any) -> None: + """Set request content encoding.""" + if data is None: + return + + enc = self.headers.get(hdrs.CONTENT_ENCODING, "").lower() + if enc: + if self.compress: + raise ValueError( + "compress can not be set " "if Content-Encoding header is set" + ) + elif self.compress: + if not isinstance(self.compress, str): + self.compress = "deflate" + self.headers[hdrs.CONTENT_ENCODING] = self.compress + self.chunked = True # enable chunked, no need to deal with length + + def update_transfer_encoding(self) -> None: + """Analyze transfer-encoding header.""" + te = self.headers.get(hdrs.TRANSFER_ENCODING, "").lower() + + if "chunked" in te: + if self.chunked: + raise ValueError( + "chunked can not be set " + 'if "Transfer-Encoding: chunked" header is set' + ) + + elif self.chunked: + if hdrs.CONTENT_LENGTH in self.headers: + raise ValueError( + "chunked can not be set " "if Content-Length header is set" + ) + + self.headers[hdrs.TRANSFER_ENCODING] = "chunked" + else: + if hdrs.CONTENT_LENGTH not in self.headers: + self.headers[hdrs.CONTENT_LENGTH] = str(len(self.body)) + + def update_auth(self, auth: Optional[BasicAuth]) -> None: + """Set basic auth.""" + if auth is None: + auth = self.auth + if auth is None: + return + + if not isinstance(auth, helpers.BasicAuth): + raise TypeError("BasicAuth() tuple is required instead") + + self.headers[hdrs.AUTHORIZATION] = auth.encode() + + def update_body_from_data(self, body: Any) -> None: + if body is None: + return + + # FormData + if isinstance(body, FormData): + body = body() + + try: + body = payload.PAYLOAD_REGISTRY.get(body, disposition=None) + except payload.LookupError: + body = FormData(body)() + + self.body = body + + # enable chunked encoding if needed + if not self.chunked: + if hdrs.CONTENT_LENGTH not in self.headers: + size = body.size + if size is None: + self.chunked = True + else: + if hdrs.CONTENT_LENGTH not in self.headers: + self.headers[hdrs.CONTENT_LENGTH] = str(size) + + # copy payload headers + assert body.headers + for (key, value) in body.headers.items(): + if key in self.headers: + continue + if key in self.skip_auto_headers: + continue + self.headers[key] = value + + def update_expect_continue(self, expect: bool = False) -> None: + if expect: + self.headers[hdrs.EXPECT] = "100-continue" + elif self.headers.get(hdrs.EXPECT, "").lower() == "100-continue": + expect = True + + if expect: + self._continue = self.loop.create_future() + + def update_proxy( + self, + proxy: Optional[URL], + proxy_auth: Optional[BasicAuth], + proxy_headers: Optional[LooseHeaders], + ) -> None: + if proxy_auth and not isinstance(proxy_auth, helpers.BasicAuth): + raise ValueError("proxy_auth must be None or BasicAuth() tuple") + self.proxy = proxy + self.proxy_auth = proxy_auth + self.proxy_headers = proxy_headers + + def keep_alive(self) -> bool: + if self.version < HttpVersion10: + # keep alive not supported at all + return False + if self.version == HttpVersion10: + if self.headers.get(hdrs.CONNECTION) == "keep-alive": + return True + else: # no headers means we close for Http 1.0 + return False + elif self.headers.get(hdrs.CONNECTION) == "close": + return False + + return True + + async def write_bytes( + self, writer: AbstractStreamWriter, conn: "Connection" + ) -> None: + """Support coroutines that yields bytes objects.""" + # 100 response + if self._continue is not None: + await writer.drain() + await self._continue + + protocol = conn.protocol + assert protocol is not None + try: + if isinstance(self.body, payload.Payload): + await self.body.write(writer) + else: + if isinstance(self.body, (bytes, bytearray)): + self.body = (self.body,) # type: ignore[assignment] + + for chunk in self.body: + await writer.write(chunk) # type: ignore[arg-type] + + await writer.write_eof() + except OSError as exc: + if exc.errno is None and isinstance(exc, asyncio.TimeoutError): + protocol.set_exception(exc) + else: + new_exc = ClientOSError( + exc.errno, "Can not write request body for %s" % self.url + ) + new_exc.__context__ = exc + new_exc.__cause__ = exc + protocol.set_exception(new_exc) + except asyncio.CancelledError as exc: + if not conn.closed: + protocol.set_exception(exc) + except Exception as exc: + protocol.set_exception(exc) + finally: + self._writer = None + + async def send(self, conn: "Connection") -> "ClientResponse": + # Specify request target: + # - CONNECT request must send authority form URI + # - not CONNECT proxy must send absolute form URI + # - most common is origin form URI + if self.method == hdrs.METH_CONNECT: + connect_host = self.url.raw_host + assert connect_host is not None + if helpers.is_ipv6_address(connect_host): + connect_host = f"[{connect_host}]" + path = f"{connect_host}:{self.url.port}" + elif self.proxy and not self.is_ssl(): + path = str(self.url) + else: + path = self.url.raw_path + if self.url.raw_query_string: + path += "?" + self.url.raw_query_string + + protocol = conn.protocol + assert protocol is not None + writer = StreamWriter( + protocol, + self.loop, + on_chunk_sent=functools.partial( + self._on_chunk_request_sent, self.method, self.url + ), + on_headers_sent=functools.partial( + self._on_headers_request_sent, self.method, self.url + ), + ) + + if self.compress: + writer.enable_compression(self.compress) + + if self.chunked is not None: + writer.enable_chunking() + + # set default content-type + if ( + self.method in self.POST_METHODS + and hdrs.CONTENT_TYPE not in self.skip_auto_headers + and hdrs.CONTENT_TYPE not in self.headers + ): + self.headers[hdrs.CONTENT_TYPE] = "application/octet-stream" + + # set the connection header + connection = self.headers.get(hdrs.CONNECTION) + if not connection: + if self.keep_alive(): + if self.version == HttpVersion10: + connection = "keep-alive" + else: + if self.version == HttpVersion11: + connection = "close" + + if connection is not None: + self.headers[hdrs.CONNECTION] = connection + + # status + headers + status_line = "{0} {1} HTTP/{2[0]}.{2[1]}".format( + self.method, path, self.version + ) + await writer.write_headers(status_line, self.headers) + + self._writer = self.loop.create_task(self.write_bytes(writer, conn)) + + response_class = self.response_class + assert response_class is not None + self.response = response_class( + self.method, + self.original_url, + writer=self._writer, + continue100=self._continue, + timer=self._timer, + request_info=self.request_info, + traces=self._traces, + loop=self.loop, + session=self._session, + ) + return self.response + + async def close(self) -> None: + if self._writer is not None: + try: + await self._writer + finally: + self._writer = None + + def terminate(self) -> None: + if self._writer is not None: + if not self.loop.is_closed(): + self._writer.cancel() + self._writer = None + + async def _on_chunk_request_sent(self, method: str, url: URL, chunk: bytes) -> None: + for trace in self._traces: + await trace.send_request_chunk_sent(method, url, chunk) + + async def _on_headers_request_sent( + self, method: str, url: URL, headers: "CIMultiDict[str]" + ) -> None: + for trace in self._traces: + await trace.send_request_headers(method, url, headers) + + +class ClientResponse(HeadersMixin): + + # from the Status-Line of the response + version = None # HTTP-Version + status: int = None # type: ignore[assignment] # Status-Code + reason = None # Reason-Phrase + + content: StreamReader = None # type: ignore[assignment] # Payload stream + _headers: "CIMultiDictProxy[str]" = None # type: ignore[assignment] + _raw_headers: RawHeaders = None # type: ignore[assignment] # Response raw headers + + _connection = None # current connection + _source_traceback = None + # setted up by ClientRequest after ClientResponse object creation + # post-init stage allows to not change ctor signature + _closed = True # to allow __del__ for non-initialized properly response + _released = False + + def __init__( + self, + method: str, + url: URL, + *, + writer: "asyncio.Task[None]", + continue100: Optional["asyncio.Future[bool]"], + timer: BaseTimerContext, + request_info: RequestInfo, + traces: List["Trace"], + loop: asyncio.AbstractEventLoop, + session: "ClientSession", + ) -> None: + assert isinstance(url, URL) + + self.method = method + self.cookies: SimpleCookie[str] = SimpleCookie() + + self._real_url = url + self._url = url.with_fragment(None) + self._body: Any = None + self._writer: Optional[asyncio.Task[None]] = writer + self._continue = continue100 # None by default + self._closed = True + self._history: Tuple[ClientResponse, ...] = () + self._request_info = request_info + self._timer = timer if timer is not None else TimerNoop() + self._cache: Dict[str, Any] = {} + self._traces = traces + self._loop = loop + # store a reference to session #1985 + self._session: Optional[ClientSession] = session + if loop.get_debug(): + self._source_traceback = traceback.extract_stack(sys._getframe(1)) + + @reify + def url(self) -> URL: + return self._url + + @reify + def url_obj(self) -> URL: + warnings.warn("Deprecated, use .url #1654", DeprecationWarning, stacklevel=2) + return self._url + + @reify + def real_url(self) -> URL: + return self._real_url + + @reify + def host(self) -> str: + assert self._url.host is not None + return self._url.host + + @reify + def headers(self) -> "CIMultiDictProxy[str]": + return self._headers + + @reify + def raw_headers(self) -> RawHeaders: + return self._raw_headers + + @reify + def request_info(self) -> RequestInfo: + return self._request_info + + @reify + def content_disposition(self) -> Optional[ContentDisposition]: + raw = self._headers.get(hdrs.CONTENT_DISPOSITION) + if raw is None: + return None + disposition_type, params_dct = multipart.parse_content_disposition(raw) + params = MappingProxyType(params_dct) + filename = multipart.content_disposition_filename(params) + return ContentDisposition(disposition_type, params, filename) + + def __del__(self, _warnings: Any = warnings) -> None: + if self._closed: + return + + if self._connection is not None: + self._connection.release() + self._cleanup_writer() + + if self._loop.get_debug(): + if PY_36: + kwargs = {"source": self} + else: + kwargs = {} + _warnings.warn(f"Unclosed response {self!r}", ResourceWarning, **kwargs) + context = {"client_response": self, "message": "Unclosed response"} + if self._source_traceback: + context["source_traceback"] = self._source_traceback + self._loop.call_exception_handler(context) + + def __repr__(self) -> str: + out = io.StringIO() + ascii_encodable_url = str(self.url) + if self.reason: + ascii_encodable_reason = self.reason.encode( + "ascii", "backslashreplace" + ).decode("ascii") + else: + ascii_encodable_reason = self.reason + print( + "".format( + ascii_encodable_url, self.status, ascii_encodable_reason + ), + file=out, + ) + print(self.headers, file=out) + return out.getvalue() + + @property + def connection(self) -> Optional["Connection"]: + return self._connection + + @reify + def history(self) -> Tuple["ClientResponse", ...]: + """A sequence of of responses, if redirects occurred.""" + return self._history + + @reify + def links(self) -> "MultiDictProxy[MultiDictProxy[Union[str, URL]]]": + links_str = ", ".join(self.headers.getall("link", [])) + + if not links_str: + return MultiDictProxy(MultiDict()) + + links: MultiDict[MultiDictProxy[Union[str, URL]]] = MultiDict() + + for val in re.split(r",(?=\s*<)", links_str): + match = re.match(r"\s*<(.*)>(.*)", val) + if match is None: # pragma: no cover + # the check exists to suppress mypy error + continue + url, params_str = match.groups() + params = params_str.split(";")[1:] + + link: MultiDict[Union[str, URL]] = MultiDict() + + for param in params: + match = re.match(r"^\s*(\S*)\s*=\s*(['\"]?)(.*?)(\2)\s*$", param, re.M) + if match is None: # pragma: no cover + # the check exists to suppress mypy error + continue + key, _, value, _ = match.groups() + + link.add(key, value) + + key = link.get("rel", url) # type: ignore[assignment] + + link.add("url", self.url.join(URL(url))) + + links.add(key, MultiDictProxy(link)) + + return MultiDictProxy(links) + + async def start(self, connection: "Connection") -> "ClientResponse": + """Start response processing.""" + self._closed = False + self._protocol = connection.protocol + self._connection = connection + + with self._timer: + while True: + # read response + try: + protocol = self._protocol + message, payload = await protocol.read() # type: ignore[union-attr] + except http.HttpProcessingError as exc: + raise ClientResponseError( + self.request_info, + self.history, + status=exc.code, + message=exc.message, + headers=exc.headers, + ) from exc + + if message.code < 100 or message.code > 199 or message.code == 101: + break + + if self._continue is not None: + set_result(self._continue, True) + self._continue = None + + # payload eof handler + payload.on_eof(self._response_eof) + + # response status + self.version = message.version + self.status = message.code + self.reason = message.reason + + # headers + self._headers = message.headers # type is CIMultiDictProxy + self._raw_headers = message.raw_headers # type is Tuple[bytes, bytes] + + # payload + self.content = payload + + # cookies + for hdr in self.headers.getall(hdrs.SET_COOKIE, ()): + try: + self.cookies.load(hdr) + except CookieError as exc: + client_logger.warning("Can not load response cookies: %s", exc) + return self + + def _response_eof(self) -> None: + if self._closed: + return + + if self._connection is not None: + # websocket, protocol could be None because + # connection could be detached + if ( + self._connection.protocol is not None + and self._connection.protocol.upgraded + ): + return + + self._connection.release() + self._connection = None + + self._closed = True + self._cleanup_writer() + + @property + def closed(self) -> bool: + return self._closed + + def close(self) -> None: + if not self._released: + self._notify_content() + if self._closed: + return + + self._closed = True + if self._loop is None or self._loop.is_closed(): + return + + if self._connection is not None: + self._connection.close() + self._connection = None + self._cleanup_writer() + + def release(self) -> Any: + if not self._released: + self._notify_content() + if self._closed: + return noop() + + self._closed = True + if self._connection is not None: + self._connection.release() + self._connection = None + + self._cleanup_writer() + return noop() + + @property + def ok(self) -> bool: + """Returns ``True`` if ``status`` is less than ``400``, ``False`` if not. + + This is **not** a check for ``200 OK`` but a check that the response + status is under 400. + """ + return 400 > self.status + + def raise_for_status(self) -> None: + if not self.ok: + # reason should always be not None for a started response + assert self.reason is not None + self.release() + raise ClientResponseError( + self.request_info, + self.history, + status=self.status, + message=self.reason, + headers=self.headers, + ) + + def _cleanup_writer(self) -> None: + if self._writer is not None: + self._writer.cancel() + self._writer = None + self._session = None + + def _notify_content(self) -> None: + content = self.content + if content and content.exception() is None: + content.set_exception(ClientConnectionError("Connection closed")) + self._released = True + + async def wait_for_close(self) -> None: + if self._writer is not None: + try: + await self._writer + finally: + self._writer = None + self.release() + + async def read(self) -> bytes: + """Read response payload.""" + if self._body is None: + try: + self._body = await self.content.read() + for trace in self._traces: + await trace.send_response_chunk_received( + self.method, self.url, self._body + ) + except BaseException: + self.close() + raise + elif self._released: + raise ClientConnectionError("Connection closed") + + return self._body # type: ignore[no-any-return] + + def get_encoding(self) -> str: + ctype = self.headers.get(hdrs.CONTENT_TYPE, "").lower() + mimetype = helpers.parse_mimetype(ctype) + + encoding = mimetype.parameters.get("charset") + if encoding: + try: + codecs.lookup(encoding) + except LookupError: + encoding = None + if not encoding: + if mimetype.type == "application" and ( + mimetype.subtype == "json" or mimetype.subtype == "rdap" + ): + # RFC 7159 states that the default encoding is UTF-8. + # RFC 7483 defines application/rdap+json + encoding = "utf-8" + elif self._body is None: + raise RuntimeError( + "Cannot guess the encoding of " "a not yet read body" + ) + else: + encoding = chardet.detect(self._body)["encoding"] + if not encoding: + encoding = "utf-8" + + return encoding + + async def text(self, encoding: Optional[str] = None, errors: str = "strict") -> str: + """Read response payload and decode.""" + if self._body is None: + await self.read() + + if encoding is None: + encoding = self.get_encoding() + + return self._body.decode( # type: ignore[no-any-return,union-attr] + encoding, errors=errors + ) + + async def json( + self, + *, + encoding: Optional[str] = None, + loads: JSONDecoder = DEFAULT_JSON_DECODER, + content_type: Optional[str] = "application/json", + ) -> Any: + """Read and decodes JSON response.""" + if self._body is None: + await self.read() + + if content_type: + ctype = self.headers.get(hdrs.CONTENT_TYPE, "").lower() + if not _is_expected_content_type(ctype, content_type): + raise ContentTypeError( + self.request_info, + self.history, + message=( + "Attempt to decode JSON with " "unexpected mimetype: %s" % ctype + ), + headers=self.headers, + ) + + stripped = self._body.strip() # type: ignore[union-attr] + if not stripped: + return None + + if encoding is None: + encoding = self.get_encoding() + + return loads(stripped.decode(encoding)) + + async def __aenter__(self) -> "ClientResponse": + return self + + async def __aexit__( + self, + exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType], + ) -> None: + # similar to _RequestContextManager, we do not need to check + # for exceptions, response object can close connection + # if state is broken + self.release() diff --git a/runtime/Lib/site-packages/aiohttp/client_ws.py b/runtime/Lib/site-packages/aiohttp/client_ws.py new file mode 100644 index 0000000000000000000000000000000000000000..173530be7095b4e3b677df29917f196fcfd05ec6 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/client_ws.py @@ -0,0 +1,300 @@ +"""WebSocket client for asyncio.""" + +import asyncio +from typing import Any, Optional, cast + +import async_timeout + +from .client_exceptions import ClientError +from .client_reqrep import ClientResponse +from .helpers import call_later, set_result +from .http import ( + WS_CLOSED_MESSAGE, + WS_CLOSING_MESSAGE, + WebSocketError, + WSCloseCode, + WSMessage, + WSMsgType, +) +from .http_websocket import WebSocketWriter # WSMessage +from .streams import EofStream, FlowControlDataQueue +from .typedefs import ( + DEFAULT_JSON_DECODER, + DEFAULT_JSON_ENCODER, + JSONDecoder, + JSONEncoder, +) + + +class ClientWebSocketResponse: + def __init__( + self, + reader: "FlowControlDataQueue[WSMessage]", + writer: WebSocketWriter, + protocol: Optional[str], + response: ClientResponse, + timeout: float, + autoclose: bool, + autoping: bool, + loop: asyncio.AbstractEventLoop, + *, + receive_timeout: Optional[float] = None, + heartbeat: Optional[float] = None, + compress: int = 0, + client_notakeover: bool = False, + ) -> None: + self._response = response + self._conn = response.connection + + self._writer = writer + self._reader = reader + self._protocol = protocol + self._closed = False + self._closing = False + self._close_code: Optional[int] = None + self._timeout = timeout + self._receive_timeout = receive_timeout + self._autoclose = autoclose + self._autoping = autoping + self._heartbeat = heartbeat + self._heartbeat_cb: Optional[asyncio.TimerHandle] = None + if heartbeat is not None: + self._pong_heartbeat = heartbeat / 2.0 + self._pong_response_cb: Optional[asyncio.TimerHandle] = None + self._loop = loop + self._waiting: Optional[asyncio.Future[bool]] = None + self._exception: Optional[BaseException] = None + self._compress = compress + self._client_notakeover = client_notakeover + + self._reset_heartbeat() + + def _cancel_heartbeat(self) -> None: + if self._pong_response_cb is not None: + self._pong_response_cb.cancel() + self._pong_response_cb = None + + if self._heartbeat_cb is not None: + self._heartbeat_cb.cancel() + self._heartbeat_cb = None + + def _reset_heartbeat(self) -> None: + self._cancel_heartbeat() + + if self._heartbeat is not None: + self._heartbeat_cb = call_later( + self._send_heartbeat, self._heartbeat, self._loop + ) + + def _send_heartbeat(self) -> None: + if self._heartbeat is not None and not self._closed: + # fire-and-forget a task is not perfect but maybe ok for + # sending ping. Otherwise we need a long-living heartbeat + # task in the class. + self._loop.create_task(self._writer.ping()) + + if self._pong_response_cb is not None: + self._pong_response_cb.cancel() + self._pong_response_cb = call_later( + self._pong_not_received, self._pong_heartbeat, self._loop + ) + + def _pong_not_received(self) -> None: + if not self._closed: + self._closed = True + self._close_code = WSCloseCode.ABNORMAL_CLOSURE + self._exception = asyncio.TimeoutError() + self._response.close() + + @property + def closed(self) -> bool: + return self._closed + + @property + def close_code(self) -> Optional[int]: + return self._close_code + + @property + def protocol(self) -> Optional[str]: + return self._protocol + + @property + def compress(self) -> int: + return self._compress + + @property + def client_notakeover(self) -> bool: + return self._client_notakeover + + def get_extra_info(self, name: str, default: Any = None) -> Any: + """extra info from connection transport""" + conn = self._response.connection + if conn is None: + return default + transport = conn.transport + if transport is None: + return default + return transport.get_extra_info(name, default) + + def exception(self) -> Optional[BaseException]: + return self._exception + + async def ping(self, message: bytes = b"") -> None: + await self._writer.ping(message) + + async def pong(self, message: bytes = b"") -> None: + await self._writer.pong(message) + + async def send_str(self, data: str, compress: Optional[int] = None) -> None: + if not isinstance(data, str): + raise TypeError("data argument must be str (%r)" % type(data)) + await self._writer.send(data, binary=False, compress=compress) + + async def send_bytes(self, data: bytes, compress: Optional[int] = None) -> None: + if not isinstance(data, (bytes, bytearray, memoryview)): + raise TypeError("data argument must be byte-ish (%r)" % type(data)) + await self._writer.send(data, binary=True, compress=compress) + + async def send_json( + self, + data: Any, + compress: Optional[int] = None, + *, + dumps: JSONEncoder = DEFAULT_JSON_ENCODER, + ) -> None: + await self.send_str(dumps(data), compress=compress) + + async def close(self, *, code: int = WSCloseCode.OK, message: bytes = b"") -> bool: + # we need to break `receive()` cycle first, + # `close()` may be called from different task + if self._waiting is not None and not self._closed: + self._reader.feed_data(WS_CLOSING_MESSAGE, 0) + await self._waiting + + if not self._closed: + self._cancel_heartbeat() + self._closed = True + try: + await self._writer.close(code, message) + except asyncio.CancelledError: + self._close_code = WSCloseCode.ABNORMAL_CLOSURE + self._response.close() + raise + except Exception as exc: + self._close_code = WSCloseCode.ABNORMAL_CLOSURE + self._exception = exc + self._response.close() + return True + + if self._closing: + self._response.close() + return True + + while True: + try: + async with async_timeout.timeout(self._timeout): + msg = await self._reader.read() + except asyncio.CancelledError: + self._close_code = WSCloseCode.ABNORMAL_CLOSURE + self._response.close() + raise + except Exception as exc: + self._close_code = WSCloseCode.ABNORMAL_CLOSURE + self._exception = exc + self._response.close() + return True + + if msg.type == WSMsgType.CLOSE: + self._close_code = msg.data + self._response.close() + return True + else: + return False + + async def receive(self, timeout: Optional[float] = None) -> WSMessage: + while True: + if self._waiting is not None: + raise RuntimeError("Concurrent call to receive() is not allowed") + + if self._closed: + return WS_CLOSED_MESSAGE + elif self._closing: + await self.close() + return WS_CLOSED_MESSAGE + + try: + self._waiting = self._loop.create_future() + try: + async with async_timeout.timeout(timeout or self._receive_timeout): + msg = await self._reader.read() + self._reset_heartbeat() + finally: + waiter = self._waiting + self._waiting = None + set_result(waiter, True) + except (asyncio.CancelledError, asyncio.TimeoutError): + self._close_code = WSCloseCode.ABNORMAL_CLOSURE + raise + except EofStream: + self._close_code = WSCloseCode.OK + await self.close() + return WSMessage(WSMsgType.CLOSED, None, None) + except ClientError: + self._closed = True + self._close_code = WSCloseCode.ABNORMAL_CLOSURE + return WS_CLOSED_MESSAGE + except WebSocketError as exc: + self._close_code = exc.code + await self.close(code=exc.code) + return WSMessage(WSMsgType.ERROR, exc, None) + except Exception as exc: + self._exception = exc + self._closing = True + self._close_code = WSCloseCode.ABNORMAL_CLOSURE + await self.close() + return WSMessage(WSMsgType.ERROR, exc, None) + + if msg.type == WSMsgType.CLOSE: + self._closing = True + self._close_code = msg.data + if not self._closed and self._autoclose: + await self.close() + elif msg.type == WSMsgType.CLOSING: + self._closing = True + elif msg.type == WSMsgType.PING and self._autoping: + await self.pong(msg.data) + continue + elif msg.type == WSMsgType.PONG and self._autoping: + continue + + return msg + + async def receive_str(self, *, timeout: Optional[float] = None) -> str: + msg = await self.receive(timeout) + if msg.type != WSMsgType.TEXT: + raise TypeError(f"Received message {msg.type}:{msg.data!r} is not str") + return cast(str, msg.data) + + async def receive_bytes(self, *, timeout: Optional[float] = None) -> bytes: + msg = await self.receive(timeout) + if msg.type != WSMsgType.BINARY: + raise TypeError(f"Received message {msg.type}:{msg.data!r} is not bytes") + return cast(bytes, msg.data) + + async def receive_json( + self, + *, + loads: JSONDecoder = DEFAULT_JSON_DECODER, + timeout: Optional[float] = None, + ) -> Any: + data = await self.receive_str(timeout=timeout) + return loads(data) + + def __aiter__(self) -> "ClientWebSocketResponse": + return self + + async def __anext__(self) -> WSMessage: + msg = await self.receive() + if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSING, WSMsgType.CLOSED): + raise StopAsyncIteration + return msg diff --git a/runtime/Lib/site-packages/aiohttp/connector.py b/runtime/Lib/site-packages/aiohttp/connector.py new file mode 100644 index 0000000000000000000000000000000000000000..3157a500f1039b317cda163204af8237b3576e21 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/connector.py @@ -0,0 +1,1453 @@ +import asyncio +import functools +import random +import sys +import traceback +import warnings +from collections import defaultdict, deque +from contextlib import suppress +from http.cookies import SimpleCookie +from itertools import cycle, islice +from time import monotonic +from types import TracebackType +from typing import ( + TYPE_CHECKING, + Any, + Awaitable, + Callable, + DefaultDict, + Dict, + Iterator, + List, + Optional, + Set, + Tuple, + Type, + Union, + cast, +) + +import attr + +from . import hdrs, helpers +from .abc import AbstractResolver +from .client_exceptions import ( + ClientConnectionError, + ClientConnectorCertificateError, + ClientConnectorError, + ClientConnectorSSLError, + ClientHttpProxyError, + ClientProxyConnectionError, + ServerFingerprintMismatch, + UnixClientConnectorError, + cert_errors, + ssl_errors, +) +from .client_proto import ResponseHandler +from .client_reqrep import ClientRequest, Fingerprint, _merge_ssl_params +from .helpers import ( + PY_36, + ceil_timeout, + get_running_loop, + is_ip_address, + noop, + sentinel, +) +from .http import RESPONSES +from .locks import EventResultOrError +from .resolver import DefaultResolver + +try: + import ssl + + SSLContext = ssl.SSLContext +except ImportError: # pragma: no cover + ssl = None # type: ignore[assignment] + SSLContext = object # type: ignore[misc,assignment] + + +__all__ = ("BaseConnector", "TCPConnector", "UnixConnector", "NamedPipeConnector") + + +if TYPE_CHECKING: # pragma: no cover + from .client import ClientTimeout + from .client_reqrep import ConnectionKey + from .tracing import Trace + + +class _DeprecationWaiter: + __slots__ = ("_awaitable", "_awaited") + + def __init__(self, awaitable: Awaitable[Any]) -> None: + self._awaitable = awaitable + self._awaited = False + + def __await__(self) -> Any: + self._awaited = True + return self._awaitable.__await__() + + def __del__(self) -> None: + if not self._awaited: + warnings.warn( + "Connector.close() is a coroutine, " + "please use await connector.close()", + DeprecationWarning, + ) + + +class Connection: + + _source_traceback = None + _transport = None + + def __init__( + self, + connector: "BaseConnector", + key: "ConnectionKey", + protocol: ResponseHandler, + loop: asyncio.AbstractEventLoop, + ) -> None: + self._key = key + self._connector = connector + self._loop = loop + self._protocol: Optional[ResponseHandler] = protocol + self._callbacks: List[Callable[[], None]] = [] + + if loop.get_debug(): + self._source_traceback = traceback.extract_stack(sys._getframe(1)) + + def __repr__(self) -> str: + return f"Connection<{self._key}>" + + def __del__(self, _warnings: Any = warnings) -> None: + if self._protocol is not None: + if PY_36: + kwargs = {"source": self} + else: + kwargs = {} + _warnings.warn(f"Unclosed connection {self!r}", ResourceWarning, **kwargs) + if self._loop.is_closed(): + return + + self._connector._release(self._key, self._protocol, should_close=True) + + context = {"client_connection": self, "message": "Unclosed connection"} + if self._source_traceback is not None: + context["source_traceback"] = self._source_traceback + self._loop.call_exception_handler(context) + + @property + def loop(self) -> asyncio.AbstractEventLoop: + warnings.warn( + "connector.loop property is deprecated", DeprecationWarning, stacklevel=2 + ) + return self._loop + + @property + def transport(self) -> Optional[asyncio.Transport]: + if self._protocol is None: + return None + return self._protocol.transport + + @property + def protocol(self) -> Optional[ResponseHandler]: + return self._protocol + + def add_callback(self, callback: Callable[[], None]) -> None: + if callback is not None: + self._callbacks.append(callback) + + def _notify_release(self) -> None: + callbacks, self._callbacks = self._callbacks[:], [] + + for cb in callbacks: + with suppress(Exception): + cb() + + def close(self) -> None: + self._notify_release() + + if self._protocol is not None: + self._connector._release(self._key, self._protocol, should_close=True) + self._protocol = None + + def release(self) -> None: + self._notify_release() + + if self._protocol is not None: + self._connector._release( + self._key, self._protocol, should_close=self._protocol.should_close + ) + self._protocol = None + + @property + def closed(self) -> bool: + return self._protocol is None or not self._protocol.is_connected() + + +class _TransportPlaceholder: + """placeholder for BaseConnector.connect function""" + + def close(self) -> None: + pass + + +class BaseConnector: + """Base connector class. + + keepalive_timeout - (optional) Keep-alive timeout. + force_close - Set to True to force close and do reconnect + after each request (and between redirects). + limit - The total number of simultaneous connections. + limit_per_host - Number of simultaneous connections to one host. + enable_cleanup_closed - Enables clean-up closed ssl transports. + Disabled by default. + loop - Optional event loop. + """ + + _closed = True # prevent AttributeError in __del__ if ctor was failed + _source_traceback = None + + # abort transport after 2 seconds (cleanup broken connections) + _cleanup_closed_period = 2.0 + + def __init__( + self, + *, + keepalive_timeout: Union[object, None, float] = sentinel, + force_close: bool = False, + limit: int = 100, + limit_per_host: int = 0, + enable_cleanup_closed: bool = False, + loop: Optional[asyncio.AbstractEventLoop] = None, + ) -> None: + + if force_close: + if keepalive_timeout is not None and keepalive_timeout is not sentinel: + raise ValueError( + "keepalive_timeout cannot " "be set if force_close is True" + ) + else: + if keepalive_timeout is sentinel: + keepalive_timeout = 15.0 + + loop = get_running_loop(loop) + + self._closed = False + if loop.get_debug(): + self._source_traceback = traceback.extract_stack(sys._getframe(1)) + + self._conns: Dict[ConnectionKey, List[Tuple[ResponseHandler, float]]] = {} + self._limit = limit + self._limit_per_host = limit_per_host + self._acquired: Set[ResponseHandler] = set() + self._acquired_per_host: DefaultDict[ + ConnectionKey, Set[ResponseHandler] + ] = defaultdict(set) + self._keepalive_timeout = cast(float, keepalive_timeout) + self._force_close = force_close + + # {host_key: FIFO list of waiters} + self._waiters = defaultdict(deque) # type: ignore[var-annotated] + + self._loop = loop + self._factory = functools.partial(ResponseHandler, loop=loop) + + self.cookies: SimpleCookie[str] = SimpleCookie() + + # start keep-alive connection cleanup task + self._cleanup_handle: Optional[asyncio.TimerHandle] = None + + # start cleanup closed transports task + self._cleanup_closed_handle: Optional[asyncio.TimerHandle] = None + self._cleanup_closed_disabled = not enable_cleanup_closed + self._cleanup_closed_transports: List[Optional[asyncio.Transport]] = [] + self._cleanup_closed() + + def __del__(self, _warnings: Any = warnings) -> None: + if self._closed: + return + if not self._conns: + return + + conns = [repr(c) for c in self._conns.values()] + + self._close() + + if PY_36: + kwargs = {"source": self} + else: + kwargs = {} + _warnings.warn(f"Unclosed connector {self!r}", ResourceWarning, **kwargs) + context = { + "connector": self, + "connections": conns, + "message": "Unclosed connector", + } + if self._source_traceback is not None: + context["source_traceback"] = self._source_traceback + self._loop.call_exception_handler(context) + + def __enter__(self) -> "BaseConnector": + warnings.warn( + '"with Connector():" is deprecated, ' + 'use "async with Connector():" instead', + DeprecationWarning, + ) + return self + + def __exit__(self, *exc: Any) -> None: + self._close() + + async def __aenter__(self) -> "BaseConnector": + return self + + async def __aexit__( + self, + exc_type: Optional[Type[BaseException]] = None, + exc_value: Optional[BaseException] = None, + exc_traceback: Optional[TracebackType] = None, + ) -> None: + await self.close() + + @property + def force_close(self) -> bool: + """Ultimately close connection on releasing if True.""" + return self._force_close + + @property + def limit(self) -> int: + """The total number for simultaneous connections. + + If limit is 0 the connector has no limit. + The default limit size is 100. + """ + return self._limit + + @property + def limit_per_host(self) -> int: + """The limit for simultaneous connections to the same endpoint. + + Endpoints are the same if they are have equal + (host, port, is_ssl) triple. + """ + return self._limit_per_host + + def _cleanup(self) -> None: + """Cleanup unused transports.""" + if self._cleanup_handle: + self._cleanup_handle.cancel() + # _cleanup_handle should be unset, otherwise _release() will not + # recreate it ever! + self._cleanup_handle = None + + now = self._loop.time() + timeout = self._keepalive_timeout + + if self._conns: + connections = {} + deadline = now - timeout + for key, conns in self._conns.items(): + alive = [] + for proto, use_time in conns: + if proto.is_connected(): + if use_time - deadline < 0: + transport = proto.transport + proto.close() + if key.is_ssl and not self._cleanup_closed_disabled: + self._cleanup_closed_transports.append(transport) + else: + alive.append((proto, use_time)) + else: + transport = proto.transport + proto.close() + if key.is_ssl and not self._cleanup_closed_disabled: + self._cleanup_closed_transports.append(transport) + + if alive: + connections[key] = alive + + self._conns = connections + + if self._conns: + self._cleanup_handle = helpers.weakref_handle( + self, "_cleanup", timeout, self._loop + ) + + def _drop_acquired_per_host( + self, key: "ConnectionKey", val: ResponseHandler + ) -> None: + acquired_per_host = self._acquired_per_host + if key not in acquired_per_host: + return + conns = acquired_per_host[key] + conns.remove(val) + if not conns: + del self._acquired_per_host[key] + + def _cleanup_closed(self) -> None: + """Double confirmation for transport close. + + Some broken ssl servers may leave socket open without proper close. + """ + if self._cleanup_closed_handle: + self._cleanup_closed_handle.cancel() + + for transport in self._cleanup_closed_transports: + if transport is not None: + transport.abort() + + self._cleanup_closed_transports = [] + + if not self._cleanup_closed_disabled: + self._cleanup_closed_handle = helpers.weakref_handle( + self, "_cleanup_closed", self._cleanup_closed_period, self._loop + ) + + def close(self) -> Awaitable[None]: + """Close all opened transports.""" + self._close() + return _DeprecationWaiter(noop()) + + def _close(self) -> None: + if self._closed: + return + + self._closed = True + + try: + if self._loop.is_closed(): + return + + # cancel cleanup task + if self._cleanup_handle: + self._cleanup_handle.cancel() + + # cancel cleanup close task + if self._cleanup_closed_handle: + self._cleanup_closed_handle.cancel() + + for data in self._conns.values(): + for proto, t0 in data: + proto.close() + + for proto in self._acquired: + proto.close() + + for transport in self._cleanup_closed_transports: + if transport is not None: + transport.abort() + + finally: + self._conns.clear() + self._acquired.clear() + self._waiters.clear() + self._cleanup_handle = None + self._cleanup_closed_transports.clear() + self._cleanup_closed_handle = None + + @property + def closed(self) -> bool: + """Is connector closed. + + A readonly property. + """ + return self._closed + + def _available_connections(self, key: "ConnectionKey") -> int: + """ + Return number of available connections. + + The limit, limit_per_host and the connection key are taken into account. + + If it returns less than 1 means that there are no connections + available. + """ + if self._limit: + # total calc available connections + available = self._limit - len(self._acquired) + + # check limit per host + if ( + self._limit_per_host + and available > 0 + and key in self._acquired_per_host + ): + acquired = self._acquired_per_host.get(key) + assert acquired is not None + available = self._limit_per_host - len(acquired) + + elif self._limit_per_host and key in self._acquired_per_host: + # check limit per host + acquired = self._acquired_per_host.get(key) + assert acquired is not None + available = self._limit_per_host - len(acquired) + else: + available = 1 + + return available + + async def connect( + self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout" + ) -> Connection: + """Get from pool or create new connection.""" + key = req.connection_key + available = self._available_connections(key) + + # Wait if there are no available connections or if there are/were + # waiters (i.e. don't steal connection from a waiter about to wake up) + if available <= 0 or key in self._waiters: + fut = self._loop.create_future() + + # This connection will now count towards the limit. + self._waiters[key].append(fut) + + if traces: + for trace in traces: + await trace.send_connection_queued_start() + + try: + await fut + except BaseException as e: + if key in self._waiters: + # remove a waiter even if it was cancelled, normally it's + # removed when it's notified + try: + self._waiters[key].remove(fut) + except ValueError: # fut may no longer be in list + pass + + raise e + finally: + if key in self._waiters and not self._waiters[key]: + del self._waiters[key] + + if traces: + for trace in traces: + await trace.send_connection_queued_end() + + proto = self._get(key) + if proto is None: + placeholder = cast(ResponseHandler, _TransportPlaceholder()) + self._acquired.add(placeholder) + self._acquired_per_host[key].add(placeholder) + + if traces: + for trace in traces: + await trace.send_connection_create_start() + + try: + proto = await self._create_connection(req, traces, timeout) + if self._closed: + proto.close() + raise ClientConnectionError("Connector is closed.") + except BaseException: + if not self._closed: + self._acquired.remove(placeholder) + self._drop_acquired_per_host(key, placeholder) + self._release_waiter() + raise + else: + if not self._closed: + self._acquired.remove(placeholder) + self._drop_acquired_per_host(key, placeholder) + + if traces: + for trace in traces: + await trace.send_connection_create_end() + else: + if traces: + # Acquire the connection to prevent race conditions with limits + placeholder = cast(ResponseHandler, _TransportPlaceholder()) + self._acquired.add(placeholder) + self._acquired_per_host[key].add(placeholder) + for trace in traces: + await trace.send_connection_reuseconn() + self._acquired.remove(placeholder) + self._drop_acquired_per_host(key, placeholder) + + self._acquired.add(proto) + self._acquired_per_host[key].add(proto) + return Connection(self, key, proto, self._loop) + + def _get(self, key: "ConnectionKey") -> Optional[ResponseHandler]: + try: + conns = self._conns[key] + except KeyError: + return None + + t1 = self._loop.time() + while conns: + proto, t0 = conns.pop() + if proto.is_connected(): + if t1 - t0 > self._keepalive_timeout: + transport = proto.transport + proto.close() + # only for SSL transports + if key.is_ssl and not self._cleanup_closed_disabled: + self._cleanup_closed_transports.append(transport) + else: + if not conns: + # The very last connection was reclaimed: drop the key + del self._conns[key] + return proto + else: + transport = proto.transport + proto.close() + if key.is_ssl and not self._cleanup_closed_disabled: + self._cleanup_closed_transports.append(transport) + + # No more connections: drop the key + del self._conns[key] + return None + + def _release_waiter(self) -> None: + """ + Iterates over all waiters until one to be released is found. + + The one to be released is not finsihed and + belongs to a host that has available connections. + """ + if not self._waiters: + return + + # Having the dict keys ordered this avoids to iterate + # at the same order at each call. + queues = list(self._waiters.keys()) + random.shuffle(queues) + + for key in queues: + if self._available_connections(key) < 1: + continue + + waiters = self._waiters[key] + while waiters: + waiter = waiters.popleft() + if not waiter.done(): + waiter.set_result(None) + return + + def _release_acquired(self, key: "ConnectionKey", proto: ResponseHandler) -> None: + if self._closed: + # acquired connection is already released on connector closing + return + + try: + self._acquired.remove(proto) + self._drop_acquired_per_host(key, proto) + except KeyError: # pragma: no cover + # this may be result of undetermenistic order of objects + # finalization due garbage collection. + pass + else: + self._release_waiter() + + def _release( + self, + key: "ConnectionKey", + protocol: ResponseHandler, + *, + should_close: bool = False, + ) -> None: + if self._closed: + # acquired connection is already released on connector closing + return + + self._release_acquired(key, protocol) + + if self._force_close: + should_close = True + + if should_close or protocol.should_close: + transport = protocol.transport + protocol.close() + + if key.is_ssl and not self._cleanup_closed_disabled: + self._cleanup_closed_transports.append(transport) + else: + conns = self._conns.get(key) + if conns is None: + conns = self._conns[key] = [] + conns.append((protocol, self._loop.time())) + + if self._cleanup_handle is None: + self._cleanup_handle = helpers.weakref_handle( + self, "_cleanup", self._keepalive_timeout, self._loop + ) + + async def _create_connection( + self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout" + ) -> ResponseHandler: + raise NotImplementedError() + + +class _DNSCacheTable: + def __init__(self, ttl: Optional[float] = None) -> None: + self._addrs_rr: Dict[Tuple[str, int], Tuple[Iterator[Dict[str, Any]], int]] = {} + self._timestamps: Dict[Tuple[str, int], float] = {} + self._ttl = ttl + + def __contains__(self, host: object) -> bool: + return host in self._addrs_rr + + def add(self, key: Tuple[str, int], addrs: List[Dict[str, Any]]) -> None: + self._addrs_rr[key] = (cycle(addrs), len(addrs)) + + if self._ttl: + self._timestamps[key] = monotonic() + + def remove(self, key: Tuple[str, int]) -> None: + self._addrs_rr.pop(key, None) + + if self._ttl: + self._timestamps.pop(key, None) + + def clear(self) -> None: + self._addrs_rr.clear() + self._timestamps.clear() + + def next_addrs(self, key: Tuple[str, int]) -> List[Dict[str, Any]]: + loop, length = self._addrs_rr[key] + addrs = list(islice(loop, length)) + # Consume one more element to shift internal state of `cycle` + next(loop) + return addrs + + def expired(self, key: Tuple[str, int]) -> bool: + if self._ttl is None: + return False + + return self._timestamps[key] + self._ttl < monotonic() + + +class TCPConnector(BaseConnector): + """TCP connector. + + verify_ssl - Set to True to check ssl certifications. + fingerprint - Pass the binary sha256 + digest of the expected certificate in DER format to verify + that the certificate the server presents matches. See also + https://en.wikipedia.org/wiki/Transport_Layer_Security#Certificate_pinning + resolver - Enable DNS lookups and use this + resolver + use_dns_cache - Use memory cache for DNS lookups. + ttl_dns_cache - Max seconds having cached a DNS entry, None forever. + family - socket address family + local_addr - local tuple of (host, port) to bind socket to + + keepalive_timeout - (optional) Keep-alive timeout. + force_close - Set to True to force close and do reconnect + after each request (and between redirects). + limit - The total number of simultaneous connections. + limit_per_host - Number of simultaneous connections to one host. + enable_cleanup_closed - Enables clean-up closed ssl transports. + Disabled by default. + loop - Optional event loop. + """ + + def __init__( + self, + *, + verify_ssl: bool = True, + fingerprint: Optional[bytes] = None, + use_dns_cache: bool = True, + ttl_dns_cache: Optional[int] = 10, + family: int = 0, + ssl_context: Optional[SSLContext] = None, + ssl: Union[None, bool, Fingerprint, SSLContext] = None, + local_addr: Optional[Tuple[str, int]] = None, + resolver: Optional[AbstractResolver] = None, + keepalive_timeout: Union[None, float, object] = sentinel, + force_close: bool = False, + limit: int = 100, + limit_per_host: int = 0, + enable_cleanup_closed: bool = False, + loop: Optional[asyncio.AbstractEventLoop] = None, + ): + super().__init__( + keepalive_timeout=keepalive_timeout, + force_close=force_close, + limit=limit, + limit_per_host=limit_per_host, + enable_cleanup_closed=enable_cleanup_closed, + loop=loop, + ) + + self._ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint) + if resolver is None: + resolver = DefaultResolver(loop=self._loop) + self._resolver = resolver + + self._use_dns_cache = use_dns_cache + self._cached_hosts = _DNSCacheTable(ttl=ttl_dns_cache) + self._throttle_dns_events: Dict[Tuple[str, int], EventResultOrError] = {} + self._family = family + self._local_addr = local_addr + + def close(self) -> Awaitable[None]: + """Close all ongoing DNS calls.""" + for ev in self._throttle_dns_events.values(): + ev.cancel() + + return super().close() + + @property + def family(self) -> int: + """Socket family like AF_INET.""" + return self._family + + @property + def use_dns_cache(self) -> bool: + """True if local DNS caching is enabled.""" + return self._use_dns_cache + + def clear_dns_cache( + self, host: Optional[str] = None, port: Optional[int] = None + ) -> None: + """Remove specified host/port or clear all dns local cache.""" + if host is not None and port is not None: + self._cached_hosts.remove((host, port)) + elif host is not None or port is not None: + raise ValueError("either both host and port " "or none of them are allowed") + else: + self._cached_hosts.clear() + + async def _resolve_host( + self, host: str, port: int, traces: Optional[List["Trace"]] = None + ) -> List[Dict[str, Any]]: + if is_ip_address(host): + return [ + { + "hostname": host, + "host": host, + "port": port, + "family": self._family, + "proto": 0, + "flags": 0, + } + ] + + if not self._use_dns_cache: + + if traces: + for trace in traces: + await trace.send_dns_resolvehost_start(host) + + res = await self._resolver.resolve(host, port, family=self._family) + + if traces: + for trace in traces: + await trace.send_dns_resolvehost_end(host) + + return res + + key = (host, port) + + if (key in self._cached_hosts) and (not self._cached_hosts.expired(key)): + # get result early, before any await (#4014) + result = self._cached_hosts.next_addrs(key) + + if traces: + for trace in traces: + await trace.send_dns_cache_hit(host) + return result + + if key in self._throttle_dns_events: + # get event early, before any await (#4014) + event = self._throttle_dns_events[key] + if traces: + for trace in traces: + await trace.send_dns_cache_hit(host) + await event.wait() + else: + # update dict early, before any await (#4014) + self._throttle_dns_events[key] = EventResultOrError(self._loop) + if traces: + for trace in traces: + await trace.send_dns_cache_miss(host) + try: + + if traces: + for trace in traces: + await trace.send_dns_resolvehost_start(host) + + addrs = await self._resolver.resolve(host, port, family=self._family) + if traces: + for trace in traces: + await trace.send_dns_resolvehost_end(host) + + self._cached_hosts.add(key, addrs) + self._throttle_dns_events[key].set() + except BaseException as e: + # any DNS exception, independently of the implementation + # is set for the waiters to raise the same exception. + self._throttle_dns_events[key].set(exc=e) + raise + finally: + self._throttle_dns_events.pop(key) + + return self._cached_hosts.next_addrs(key) + + async def _create_connection( + self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout" + ) -> ResponseHandler: + """Create connection. + + Has same keyword arguments as BaseEventLoop.create_connection. + """ + if req.proxy: + _, proto = await self._create_proxy_connection(req, traces, timeout) + else: + _, proto = await self._create_direct_connection(req, traces, timeout) + + return proto + + @staticmethod + @functools.lru_cache(None) + def _make_ssl_context(verified: bool) -> SSLContext: + if verified: + return ssl.create_default_context() + else: + sslcontext = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) + sslcontext.options |= ssl.OP_NO_SSLv2 + sslcontext.options |= ssl.OP_NO_SSLv3 + sslcontext.check_hostname = False + sslcontext.verify_mode = ssl.CERT_NONE + try: + sslcontext.options |= ssl.OP_NO_COMPRESSION + except AttributeError as attr_err: + warnings.warn( + "{!s}: The Python interpreter is compiled " + "against OpenSSL < 1.0.0. Ref: " + "https://docs.python.org/3/library/ssl.html" + "#ssl.OP_NO_COMPRESSION".format(attr_err), + ) + sslcontext.set_default_verify_paths() + return sslcontext + + def _get_ssl_context(self, req: "ClientRequest") -> Optional[SSLContext]: + """Logic to get the correct SSL context + + 0. if req.ssl is false, return None + + 1. if ssl_context is specified in req, use it + 2. if _ssl_context is specified in self, use it + 3. otherwise: + 1. if verify_ssl is not specified in req, use self.ssl_context + (will generate a default context according to self.verify_ssl) + 2. if verify_ssl is True in req, generate a default SSL context + 3. if verify_ssl is False in req, generate a SSL context that + won't verify + """ + if req.is_ssl(): + if ssl is None: # pragma: no cover + raise RuntimeError("SSL is not supported.") + sslcontext = req.ssl + if isinstance(sslcontext, ssl.SSLContext): + return sslcontext + if sslcontext is not None: + # not verified or fingerprinted + return self._make_ssl_context(False) + sslcontext = self._ssl + if isinstance(sslcontext, ssl.SSLContext): + return sslcontext + if sslcontext is not None: + # not verified or fingerprinted + return self._make_ssl_context(False) + return self._make_ssl_context(True) + else: + return None + + def _get_fingerprint(self, req: "ClientRequest") -> Optional["Fingerprint"]: + ret = req.ssl + if isinstance(ret, Fingerprint): + return ret + ret = self._ssl + if isinstance(ret, Fingerprint): + return ret + return None + + async def _wrap_create_connection( + self, + *args: Any, + req: "ClientRequest", + timeout: "ClientTimeout", + client_error: Type[Exception] = ClientConnectorError, + **kwargs: Any, + ) -> Tuple[asyncio.Transport, ResponseHandler]: + try: + async with ceil_timeout(timeout.sock_connect): + return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa + except cert_errors as exc: + raise ClientConnectorCertificateError(req.connection_key, exc) from exc + except ssl_errors as exc: + raise ClientConnectorSSLError(req.connection_key, exc) from exc + except OSError as exc: + if exc.errno is None and isinstance(exc, asyncio.TimeoutError): + raise + raise client_error(req.connection_key, exc) from exc + + def _fail_on_no_start_tls(self, req: "ClientRequest") -> None: + """Raise a :py:exc:`RuntimeError` on missing ``start_tls()``. + + One case is that :py:meth:`asyncio.loop.start_tls` is not yet + implemented under Python 3.6. It is necessary for TLS-in-TLS so + that it is possible to send HTTPS queries through HTTPS proxies. + + This doesn't affect regular HTTP requests, though. + """ + if not req.is_ssl(): + return + + proxy_url = req.proxy + assert proxy_url is not None + if proxy_url.scheme != "https": + return + + self._check_loop_for_start_tls() + + def _check_loop_for_start_tls(self) -> None: + try: + self._loop.start_tls + except AttributeError as attr_exc: + raise RuntimeError( + "An HTTPS request is being sent through an HTTPS proxy. " + "This needs support for TLS in TLS but it is not implemented " + "in your runtime for the stdlib asyncio.\n\n" + "Please upgrade to Python 3.7 or higher. For more details, " + "please see:\n" + "* https://bugs.python.org/issue37179\n" + "* https://github.com/python/cpython/pull/28073\n" + "* https://docs.aiohttp.org/en/stable/" + "client_advanced.html#proxy-support\n" + "* https://github.com/aio-libs/aiohttp/discussions/6044\n", + ) from attr_exc + + def _loop_supports_start_tls(self) -> bool: + try: + self._check_loop_for_start_tls() + except RuntimeError: + return False + else: + return True + + def _warn_about_tls_in_tls( + self, + underlying_transport: asyncio.Transport, + req: "ClientRequest", + ) -> None: + """Issue a warning if the requested URL has HTTPS scheme.""" + if req.request_info.url.scheme != "https": + return + + asyncio_supports_tls_in_tls = getattr( + underlying_transport, + "_start_tls_compatible", + False, + ) + + if asyncio_supports_tls_in_tls: + return + + warnings.warn( + "An HTTPS request is being sent through an HTTPS proxy. " + "This support for TLS in TLS is known to be disabled " + "in the stdlib asyncio. This is why you'll probably see " + "an error in the log below.\n\n" + "It is possible to enable it via monkeypatching under " + "Python 3.7 or higher. For more details, see:\n" + "* https://bugs.python.org/issue37179\n" + "* https://github.com/python/cpython/pull/28073\n\n" + "You can temporarily patch this as follows:\n" + "* https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support\n" + "* https://github.com/aio-libs/aiohttp/discussions/6044\n", + RuntimeWarning, + source=self, + # Why `4`? At least 3 of the calls in the stack originate + # from the methods in this class. + stacklevel=3, + ) + + async def _start_tls_connection( + self, + underlying_transport: asyncio.Transport, + req: "ClientRequest", + timeout: "ClientTimeout", + client_error: Type[Exception] = ClientConnectorError, + ) -> Tuple[asyncio.BaseTransport, ResponseHandler]: + """Wrap the raw TCP transport with TLS.""" + tls_proto = self._factory() # Create a brand new proto for TLS + + # Safety of the `cast()` call here is based on the fact that + # internally `_get_ssl_context()` only returns `None` when + # `req.is_ssl()` evaluates to `False` which is never gonna happen + # in this code path. Of course, it's rather fragile + # maintainability-wise but this is to be solved separately. + sslcontext = cast(ssl.SSLContext, self._get_ssl_context(req)) + + try: + async with ceil_timeout(timeout.sock_connect): + try: + tls_transport = await self._loop.start_tls( + underlying_transport, + tls_proto, + sslcontext, + server_hostname=req.host, + ssl_handshake_timeout=timeout.total, + ) + except BaseException: + # We need to close the underlying transport since + # `start_tls()` probably failed before it had a + # chance to do this: + underlying_transport.close() + raise + except cert_errors as exc: + raise ClientConnectorCertificateError(req.connection_key, exc) from exc + except ssl_errors as exc: + raise ClientConnectorSSLError(req.connection_key, exc) from exc + except OSError as exc: + if exc.errno is None and isinstance(exc, asyncio.TimeoutError): + raise + raise client_error(req.connection_key, exc) from exc + except TypeError as type_err: + # Example cause looks like this: + # TypeError: transport is not supported by start_tls() + + raise ClientConnectionError( + "Cannot initialize a TLS-in-TLS connection to host " + f"{req.host!s}:{req.port:d} through an underlying connection " + f"to an HTTPS proxy {req.proxy!s} ssl:{req.ssl or 'default'} " + f"[{type_err!s}]" + ) from type_err + else: + tls_proto.connection_made( + tls_transport + ) # Kick the state machine of the new TLS protocol + + return tls_transport, tls_proto + + async def _create_direct_connection( + self, + req: "ClientRequest", + traces: List["Trace"], + timeout: "ClientTimeout", + *, + client_error: Type[Exception] = ClientConnectorError, + ) -> Tuple[asyncio.Transport, ResponseHandler]: + sslcontext = self._get_ssl_context(req) + fingerprint = self._get_fingerprint(req) + + host = req.url.raw_host + assert host is not None + port = req.port + assert port is not None + host_resolved = asyncio.ensure_future( + self._resolve_host(host, port, traces=traces), loop=self._loop + ) + try: + # Cancelling this lookup should not cancel the underlying lookup + # or else the cancel event will get broadcast to all the waiters + # across all connections. + hosts = await asyncio.shield(host_resolved) + except asyncio.CancelledError: + + def drop_exception(fut: "asyncio.Future[List[Dict[str, Any]]]") -> None: + with suppress(Exception, asyncio.CancelledError): + fut.result() + + host_resolved.add_done_callback(drop_exception) + raise + except OSError as exc: + if exc.errno is None and isinstance(exc, asyncio.TimeoutError): + raise + # in case of proxy it is not ClientProxyConnectionError + # it is problem of resolving proxy ip itself + raise ClientConnectorError(req.connection_key, exc) from exc + + last_exc: Optional[Exception] = None + + for hinfo in hosts: + host = hinfo["host"] + port = hinfo["port"] + + try: + transp, proto = await self._wrap_create_connection( + self._factory, + host, + port, + timeout=timeout, + ssl=sslcontext, + family=hinfo["family"], + proto=hinfo["proto"], + flags=hinfo["flags"], + server_hostname=hinfo["hostname"] if sslcontext else None, + local_addr=self._local_addr, + req=req, + client_error=client_error, + ) + except ClientConnectorError as exc: + last_exc = exc + continue + + if req.is_ssl() and fingerprint: + try: + fingerprint.check(transp) + except ServerFingerprintMismatch as exc: + transp.close() + if not self._cleanup_closed_disabled: + self._cleanup_closed_transports.append(transp) + last_exc = exc + continue + + return transp, proto + else: + assert last_exc is not None + raise last_exc + + async def _create_proxy_connection( + self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout" + ) -> Tuple[asyncio.BaseTransport, ResponseHandler]: + self._fail_on_no_start_tls(req) + runtime_has_start_tls = self._loop_supports_start_tls() + + headers: Dict[str, str] = {} + if req.proxy_headers is not None: + headers = req.proxy_headers # type: ignore[assignment] + headers[hdrs.HOST] = req.headers[hdrs.HOST] + + url = req.proxy + assert url is not None + proxy_req = ClientRequest( + hdrs.METH_GET, + url, + headers=headers, + auth=req.proxy_auth, + loop=self._loop, + ssl=req.ssl, + ) + + # create connection to proxy server + transport, proto = await self._create_direct_connection( + proxy_req, [], timeout, client_error=ClientProxyConnectionError + ) + + # Many HTTP proxies has buggy keepalive support. Let's not + # reuse connection but close it after processing every + # response. + proto.force_close() + + auth = proxy_req.headers.pop(hdrs.AUTHORIZATION, None) + if auth is not None: + if not req.is_ssl(): + req.headers[hdrs.PROXY_AUTHORIZATION] = auth + else: + proxy_req.headers[hdrs.PROXY_AUTHORIZATION] = auth + + if req.is_ssl(): + if runtime_has_start_tls: + self._warn_about_tls_in_tls(transport, req) + + # For HTTPS requests over HTTP proxy + # we must notify proxy to tunnel connection + # so we send CONNECT command: + # CONNECT www.python.org:443 HTTP/1.1 + # Host: www.python.org + # + # next we must do TLS handshake and so on + # to do this we must wrap raw socket into secure one + # asyncio handles this perfectly + proxy_req.method = hdrs.METH_CONNECT + proxy_req.url = req.url + key = attr.evolve( + req.connection_key, proxy=None, proxy_auth=None, proxy_headers_hash=None + ) + conn = Connection(self, key, proto, self._loop) + proxy_resp = await proxy_req.send(conn) + try: + protocol = conn._protocol + assert protocol is not None + + # read_until_eof=True will ensure the connection isn't closed + # once the response is received and processed allowing + # START_TLS to work on the connection below. + protocol.set_response_params(read_until_eof=runtime_has_start_tls) + resp = await proxy_resp.start(conn) + except BaseException: + proxy_resp.close() + conn.close() + raise + else: + conn._protocol = None + conn._transport = None + try: + if resp.status != 200: + message = resp.reason + if message is None: + message = RESPONSES[resp.status][0] + raise ClientHttpProxyError( + proxy_resp.request_info, + resp.history, + status=resp.status, + message=message, + headers=resp.headers, + ) + if not runtime_has_start_tls: + rawsock = transport.get_extra_info("socket", default=None) + if rawsock is None: + raise RuntimeError( + "Transport does not expose socket instance" + ) + # Duplicate the socket, so now we can close proxy transport + rawsock = rawsock.dup() + except BaseException: + # It shouldn't be closed in `finally` because it's fed to + # `loop.start_tls()` and the docs say not to touch it after + # passing there. + transport.close() + raise + finally: + if not runtime_has_start_tls: + transport.close() + + if not runtime_has_start_tls: + # HTTP proxy with support for upgrade to HTTPS + sslcontext = self._get_ssl_context(req) + return await self._wrap_create_connection( + self._factory, + timeout=timeout, + ssl=sslcontext, + sock=rawsock, + server_hostname=req.host, + req=req, + ) + + return await self._start_tls_connection( + # Access the old transport for the last time before it's + # closed and forgotten forever: + transport, + req=req, + timeout=timeout, + ) + finally: + proxy_resp.close() + + return transport, proto + + +class UnixConnector(BaseConnector): + """Unix socket connector. + + path - Unix socket path. + keepalive_timeout - (optional) Keep-alive timeout. + force_close - Set to True to force close and do reconnect + after each request (and between redirects). + limit - The total number of simultaneous connections. + limit_per_host - Number of simultaneous connections to one host. + loop - Optional event loop. + """ + + def __init__( + self, + path: str, + force_close: bool = False, + keepalive_timeout: Union[object, float, None] = sentinel, + limit: int = 100, + limit_per_host: int = 0, + loop: Optional[asyncio.AbstractEventLoop] = None, + ) -> None: + super().__init__( + force_close=force_close, + keepalive_timeout=keepalive_timeout, + limit=limit, + limit_per_host=limit_per_host, + loop=loop, + ) + self._path = path + + @property + def path(self) -> str: + """Path to unix socket.""" + return self._path + + async def _create_connection( + self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout" + ) -> ResponseHandler: + try: + async with ceil_timeout(timeout.sock_connect): + _, proto = await self._loop.create_unix_connection( + self._factory, self._path + ) + except OSError as exc: + if exc.errno is None and isinstance(exc, asyncio.TimeoutError): + raise + raise UnixClientConnectorError(self.path, req.connection_key, exc) from exc + + return cast(ResponseHandler, proto) + + +class NamedPipeConnector(BaseConnector): + """Named pipe connector. + + Only supported by the proactor event loop. + See also: https://docs.python.org/3.7/library/asyncio-eventloop.html + + path - Windows named pipe path. + keepalive_timeout - (optional) Keep-alive timeout. + force_close - Set to True to force close and do reconnect + after each request (and between redirects). + limit - The total number of simultaneous connections. + limit_per_host - Number of simultaneous connections to one host. + loop - Optional event loop. + """ + + def __init__( + self, + path: str, + force_close: bool = False, + keepalive_timeout: Union[object, float, None] = sentinel, + limit: int = 100, + limit_per_host: int = 0, + loop: Optional[asyncio.AbstractEventLoop] = None, + ) -> None: + super().__init__( + force_close=force_close, + keepalive_timeout=keepalive_timeout, + limit=limit, + limit_per_host=limit_per_host, + loop=loop, + ) + if not isinstance( + self._loop, asyncio.ProactorEventLoop # type: ignore[attr-defined] + ): + raise RuntimeError( + "Named Pipes only available in proactor " "loop under windows" + ) + self._path = path + + @property + def path(self) -> str: + """Path to the named pipe.""" + return self._path + + async def _create_connection( + self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout" + ) -> ResponseHandler: + try: + async with ceil_timeout(timeout.sock_connect): + _, proto = await self._loop.create_pipe_connection( # type: ignore[attr-defined] # noqa: E501 + self._factory, self._path + ) + # the drain is required so that the connection_made is called + # and transport is set otherwise it is not set before the + # `assert conn.transport is not None` + # in client.py's _request method + await asyncio.sleep(0) + # other option is to manually set transport like + # `proto.transport = trans` + except OSError as exc: + if exc.errno is None and isinstance(exc, asyncio.TimeoutError): + raise + raise ClientConnectorError(req.connection_key, exc) from exc + + return cast(ResponseHandler, proto) diff --git a/runtime/Lib/site-packages/aiohttp/cookiejar.py b/runtime/Lib/site-packages/aiohttp/cookiejar.py new file mode 100644 index 0000000000000000000000000000000000000000..61a5ae8558fb9023b63b303d21d038415aa7cff6 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/cookiejar.py @@ -0,0 +1,411 @@ +import asyncio +import contextlib +import datetime +import os # noqa +import pathlib +import pickle +import re +from collections import defaultdict +from http.cookies import BaseCookie, Morsel, SimpleCookie +from typing import ( # noqa + DefaultDict, + Dict, + Iterable, + Iterator, + List, + Mapping, + Optional, + Set, + Tuple, + Union, + cast, +) + +from yarl import URL + +from .abc import AbstractCookieJar, ClearCookiePredicate +from .helpers import is_ip_address, next_whole_second +from .typedefs import LooseCookies, PathLike, StrOrURL + +__all__ = ("CookieJar", "DummyCookieJar") + + +CookieItem = Union[str, "Morsel[str]"] + + +class CookieJar(AbstractCookieJar): + """Implements cookie storage adhering to RFC 6265.""" + + DATE_TOKENS_RE = re.compile( + r"[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]*" + r"(?P[\x00-\x08\x0A-\x1F\d:a-zA-Z\x7F-\xFF]+)" + ) + + DATE_HMS_TIME_RE = re.compile(r"(\d{1,2}):(\d{1,2}):(\d{1,2})") + + DATE_DAY_OF_MONTH_RE = re.compile(r"(\d{1,2})") + + DATE_MONTH_RE = re.compile( + "(jan)|(feb)|(mar)|(apr)|(may)|(jun)|(jul)|" "(aug)|(sep)|(oct)|(nov)|(dec)", + re.I, + ) + + DATE_YEAR_RE = re.compile(r"(\d{2,4})") + + MAX_TIME = datetime.datetime.max.replace(tzinfo=datetime.timezone.utc) + + MAX_32BIT_TIME = datetime.datetime.utcfromtimestamp(2**31 - 1) + + def __init__( + self, + *, + unsafe: bool = False, + quote_cookie: bool = True, + treat_as_secure_origin: Union[StrOrURL, List[StrOrURL], None] = None, + loop: Optional[asyncio.AbstractEventLoop] = None, + ) -> None: + super().__init__(loop=loop) + self._cookies: DefaultDict[str, SimpleCookie[str]] = defaultdict(SimpleCookie) + self._host_only_cookies: Set[Tuple[str, str]] = set() + self._unsafe = unsafe + self._quote_cookie = quote_cookie + if treat_as_secure_origin is None: + treat_as_secure_origin = [] + elif isinstance(treat_as_secure_origin, URL): + treat_as_secure_origin = [treat_as_secure_origin.origin()] + elif isinstance(treat_as_secure_origin, str): + treat_as_secure_origin = [URL(treat_as_secure_origin).origin()] + else: + treat_as_secure_origin = [ + URL(url).origin() if isinstance(url, str) else url.origin() + for url in treat_as_secure_origin + ] + self._treat_as_secure_origin = treat_as_secure_origin + self._next_expiration = next_whole_second() + self._expirations: Dict[Tuple[str, str], datetime.datetime] = {} + # #4515: datetime.max may not be representable on 32-bit platforms + self._max_time = self.MAX_TIME + try: + self._max_time.timestamp() + except OverflowError: + self._max_time = self.MAX_32BIT_TIME + + def save(self, file_path: PathLike) -> None: + file_path = pathlib.Path(file_path) + with file_path.open(mode="wb") as f: + pickle.dump(self._cookies, f, pickle.HIGHEST_PROTOCOL) + + def load(self, file_path: PathLike) -> None: + file_path = pathlib.Path(file_path) + with file_path.open(mode="rb") as f: + self._cookies = pickle.load(f) + + def clear(self, predicate: Optional[ClearCookiePredicate] = None) -> None: + if predicate is None: + self._next_expiration = next_whole_second() + self._cookies.clear() + self._host_only_cookies.clear() + self._expirations.clear() + return + + to_del = [] + now = datetime.datetime.now(datetime.timezone.utc) + for domain, cookie in self._cookies.items(): + for name, morsel in cookie.items(): + key = (domain, name) + if ( + key in self._expirations and self._expirations[key] <= now + ) or predicate(morsel): + to_del.append(key) + + for domain, name in to_del: + key = (domain, name) + self._host_only_cookies.discard(key) + if key in self._expirations: + del self._expirations[(domain, name)] + self._cookies[domain].pop(name, None) + + next_expiration = min(self._expirations.values(), default=self._max_time) + try: + self._next_expiration = next_expiration.replace( + microsecond=0 + ) + datetime.timedelta(seconds=1) + except OverflowError: + self._next_expiration = self._max_time + + def clear_domain(self, domain: str) -> None: + self.clear(lambda x: self._is_domain_match(domain, x["domain"])) + + def __iter__(self) -> "Iterator[Morsel[str]]": + self._do_expiration() + for val in self._cookies.values(): + yield from val.values() + + def __len__(self) -> int: + return sum(1 for i in self) + + def _do_expiration(self) -> None: + self.clear(lambda x: False) + + def _expire_cookie(self, when: datetime.datetime, domain: str, name: str) -> None: + self._next_expiration = min(self._next_expiration, when) + self._expirations[(domain, name)] = when + + def update_cookies(self, cookies: LooseCookies, response_url: URL = URL()) -> None: + """Update cookies.""" + hostname = response_url.raw_host + + if not self._unsafe and is_ip_address(hostname): + # Don't accept cookies from IPs + return + + if isinstance(cookies, Mapping): + cookies = cookies.items() + + for name, cookie in cookies: + if not isinstance(cookie, Morsel): + tmp: SimpleCookie[str] = SimpleCookie() + tmp[name] = cookie # type: ignore[assignment] + cookie = tmp[name] + + domain = cookie["domain"] + + # ignore domains with trailing dots + if domain.endswith("."): + domain = "" + del cookie["domain"] + + if not domain and hostname is not None: + # Set the cookie's domain to the response hostname + # and set its host-only-flag + self._host_only_cookies.add((hostname, name)) + domain = cookie["domain"] = hostname + + if domain.startswith("."): + # Remove leading dot + domain = domain[1:] + cookie["domain"] = domain + + if hostname and not self._is_domain_match(domain, hostname): + # Setting cookies for different domains is not allowed + continue + + path = cookie["path"] + if not path or not path.startswith("/"): + # Set the cookie's path to the response path + path = response_url.path + if not path.startswith("/"): + path = "/" + else: + # Cut everything from the last slash to the end + path = "/" + path[1 : path.rfind("/")] + cookie["path"] = path + + max_age = cookie["max-age"] + if max_age: + try: + delta_seconds = int(max_age) + try: + max_age_expiration = datetime.datetime.now( + datetime.timezone.utc + ) + datetime.timedelta(seconds=delta_seconds) + except OverflowError: + max_age_expiration = self._max_time + self._expire_cookie(max_age_expiration, domain, name) + except ValueError: + cookie["max-age"] = "" + + else: + expires = cookie["expires"] + if expires: + expire_time = self._parse_date(expires) + if expire_time: + self._expire_cookie(expire_time, domain, name) + else: + cookie["expires"] = "" + + self._cookies[domain][name] = cookie + + self._do_expiration() + + def filter_cookies( + self, request_url: URL = URL() + ) -> Union["BaseCookie[str]", "SimpleCookie[str]"]: + """Returns this jar's cookies filtered by their attributes.""" + self._do_expiration() + request_url = URL(request_url) + filtered: Union["SimpleCookie[str]", "BaseCookie[str]"] = ( + SimpleCookie() if self._quote_cookie else BaseCookie() + ) + hostname = request_url.raw_host or "" + request_origin = URL() + with contextlib.suppress(ValueError): + request_origin = request_url.origin() + + is_not_secure = ( + request_url.scheme not in ("https", "wss") + and request_origin not in self._treat_as_secure_origin + ) + + for cookie in self: + name = cookie.key + domain = cookie["domain"] + + # Send shared cookies + if not domain: + filtered[name] = cookie.value + continue + + if not self._unsafe and is_ip_address(hostname): + continue + + if (domain, name) in self._host_only_cookies: + if domain != hostname: + continue + elif not self._is_domain_match(domain, hostname): + continue + + if not self._is_path_match(request_url.path, cookie["path"]): + continue + + if is_not_secure and cookie["secure"]: + continue + + # It's critical we use the Morsel so the coded_value + # (based on cookie version) is preserved + mrsl_val = cast("Morsel[str]", cookie.get(cookie.key, Morsel())) + mrsl_val.set(cookie.key, cookie.value, cookie.coded_value) + filtered[name] = mrsl_val + + return filtered + + @staticmethod + def _is_domain_match(domain: str, hostname: str) -> bool: + """Implements domain matching adhering to RFC 6265.""" + if hostname == domain: + return True + + if not hostname.endswith(domain): + return False + + non_matching = hostname[: -len(domain)] + + if not non_matching.endswith("."): + return False + + return not is_ip_address(hostname) + + @staticmethod + def _is_path_match(req_path: str, cookie_path: str) -> bool: + """Implements path matching adhering to RFC 6265.""" + if not req_path.startswith("/"): + req_path = "/" + + if req_path == cookie_path: + return True + + if not req_path.startswith(cookie_path): + return False + + if cookie_path.endswith("/"): + return True + + non_matching = req_path[len(cookie_path) :] + + return non_matching.startswith("/") + + @classmethod + def _parse_date(cls, date_str: str) -> Optional[datetime.datetime]: + """Implements date string parsing adhering to RFC 6265.""" + if not date_str: + return None + + found_time = False + found_day = False + found_month = False + found_year = False + + hour = minute = second = 0 + day = 0 + month = 0 + year = 0 + + for token_match in cls.DATE_TOKENS_RE.finditer(date_str): + + token = token_match.group("token") + + if not found_time: + time_match = cls.DATE_HMS_TIME_RE.match(token) + if time_match: + found_time = True + hour, minute, second = (int(s) for s in time_match.groups()) + continue + + if not found_day: + day_match = cls.DATE_DAY_OF_MONTH_RE.match(token) + if day_match: + found_day = True + day = int(day_match.group()) + continue + + if not found_month: + month_match = cls.DATE_MONTH_RE.match(token) + if month_match: + found_month = True + assert month_match.lastindex is not None + month = month_match.lastindex + continue + + if not found_year: + year_match = cls.DATE_YEAR_RE.match(token) + if year_match: + found_year = True + year = int(year_match.group()) + + if 70 <= year <= 99: + year += 1900 + elif 0 <= year <= 69: + year += 2000 + + if False in (found_day, found_month, found_year, found_time): + return None + + if not 1 <= day <= 31: + return None + + if year < 1601 or hour > 23 or minute > 59 or second > 59: + return None + + return datetime.datetime( + year, month, day, hour, minute, second, tzinfo=datetime.timezone.utc + ) + + +class DummyCookieJar(AbstractCookieJar): + """Implements a dummy cookie storage. + + It can be used with the ClientSession when no cookie processing is needed. + + """ + + def __init__(self, *, loop: Optional[asyncio.AbstractEventLoop] = None) -> None: + super().__init__(loop=loop) + + def __iter__(self) -> "Iterator[Morsel[str]]": + while False: + yield None + + def __len__(self) -> int: + return 0 + + def clear(self, predicate: Optional[ClearCookiePredicate] = None) -> None: + pass + + def clear_domain(self, domain: str) -> None: + pass + + def update_cookies(self, cookies: LooseCookies, response_url: URL = URL()) -> None: + pass + + def filter_cookies(self, request_url: URL) -> "BaseCookie[str]": + return SimpleCookie() diff --git a/runtime/Lib/site-packages/aiohttp/formdata.py b/runtime/Lib/site-packages/aiohttp/formdata.py new file mode 100644 index 0000000000000000000000000000000000000000..a9c2724275a4265bf071bb3049f095f6bdb2e9c1 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/formdata.py @@ -0,0 +1,172 @@ +import io +from typing import Any, Iterable, List, Optional +from urllib.parse import urlencode + +from multidict import MultiDict, MultiDictProxy + +from . import hdrs, multipart, payload +from .helpers import guess_filename +from .payload import Payload + +__all__ = ("FormData",) + + +class FormData: + """Helper class for form body generation. + + Supports multipart/form-data and application/x-www-form-urlencoded. + """ + + def __init__( + self, + fields: Iterable[Any] = (), + quote_fields: bool = True, + charset: Optional[str] = None, + ) -> None: + self._writer = multipart.MultipartWriter("form-data") + self._fields: List[Any] = [] + self._is_multipart = False + self._is_processed = False + self._quote_fields = quote_fields + self._charset = charset + + if isinstance(fields, dict): + fields = list(fields.items()) + elif not isinstance(fields, (list, tuple)): + fields = (fields,) + self.add_fields(*fields) + + @property + def is_multipart(self) -> bool: + return self._is_multipart + + def add_field( + self, + name: str, + value: Any, + *, + content_type: Optional[str] = None, + filename: Optional[str] = None, + content_transfer_encoding: Optional[str] = None, + ) -> None: + + if isinstance(value, io.IOBase): + self._is_multipart = True + elif isinstance(value, (bytes, bytearray, memoryview)): + if filename is None and content_transfer_encoding is None: + filename = name + + type_options: MultiDict[str] = MultiDict({"name": name}) + if filename is not None and not isinstance(filename, str): + raise TypeError( + "filename must be an instance of str. " "Got: %s" % filename + ) + if filename is None and isinstance(value, io.IOBase): + filename = guess_filename(value, name) + if filename is not None: + type_options["filename"] = filename + self._is_multipart = True + + headers = {} + if content_type is not None: + if not isinstance(content_type, str): + raise TypeError( + "content_type must be an instance of str. " "Got: %s" % content_type + ) + headers[hdrs.CONTENT_TYPE] = content_type + self._is_multipart = True + if content_transfer_encoding is not None: + if not isinstance(content_transfer_encoding, str): + raise TypeError( + "content_transfer_encoding must be an instance" + " of str. Got: %s" % content_transfer_encoding + ) + headers[hdrs.CONTENT_TRANSFER_ENCODING] = content_transfer_encoding + self._is_multipart = True + + self._fields.append((type_options, headers, value)) + + def add_fields(self, *fields: Any) -> None: + to_add = list(fields) + + while to_add: + rec = to_add.pop(0) + + if isinstance(rec, io.IOBase): + k = guess_filename(rec, "unknown") + self.add_field(k, rec) # type: ignore[arg-type] + + elif isinstance(rec, (MultiDictProxy, MultiDict)): + to_add.extend(rec.items()) + + elif isinstance(rec, (list, tuple)) and len(rec) == 2: + k, fp = rec + self.add_field(k, fp) # type: ignore[arg-type] + + else: + raise TypeError( + "Only io.IOBase, multidict and (name, file) " + "pairs allowed, use .add_field() for passing " + "more complex parameters, got {!r}".format(rec) + ) + + def _gen_form_urlencoded(self) -> payload.BytesPayload: + # form data (x-www-form-urlencoded) + data = [] + for type_options, _, value in self._fields: + data.append((type_options["name"], value)) + + charset = self._charset if self._charset is not None else "utf-8" + + if charset == "utf-8": + content_type = "application/x-www-form-urlencoded" + else: + content_type = "application/x-www-form-urlencoded; " "charset=%s" % charset + + return payload.BytesPayload( + urlencode(data, doseq=True, encoding=charset).encode(), + content_type=content_type, + ) + + def _gen_form_data(self) -> multipart.MultipartWriter: + """Encode a list of fields using the multipart/form-data MIME format""" + if self._is_processed: + raise RuntimeError("Form data has been processed already") + for dispparams, headers, value in self._fields: + try: + if hdrs.CONTENT_TYPE in headers: + part = payload.get_payload( + value, + content_type=headers[hdrs.CONTENT_TYPE], + headers=headers, + encoding=self._charset, + ) + else: + part = payload.get_payload( + value, headers=headers, encoding=self._charset + ) + except Exception as exc: + raise TypeError( + "Can not serialize value type: %r\n " + "headers: %r\n value: %r" % (type(value), headers, value) + ) from exc + + if dispparams: + part.set_content_disposition( + "form-data", quote_fields=self._quote_fields, **dispparams + ) + # FIXME cgi.FieldStorage doesn't likes body parts with + # Content-Length which were sent via chunked transfer encoding + assert part.headers is not None + part.headers.popall(hdrs.CONTENT_LENGTH, None) + + self._writer.append_payload(part) + + self._is_processed = True + return self._writer + + def __call__(self) -> Payload: + if self._is_multipart: + return self._gen_form_data() + else: + return self._gen_form_urlencoded() diff --git a/runtime/Lib/site-packages/aiohttp/hdrs.py b/runtime/Lib/site-packages/aiohttp/hdrs.py new file mode 100644 index 0000000000000000000000000000000000000000..185fe849ca53b9d02debfbf0ba267b88bbce7da3 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/hdrs.py @@ -0,0 +1,114 @@ +"""HTTP Headers constants.""" + +# After changing the file content call ./tools/gen.py +# to regenerate the headers parser +import sys +from typing import Set + +from multidict import istr + +if sys.version_info >= (3, 8): + from typing import Final +else: + from typing_extensions import Final + +METH_ANY: Final[str] = "*" +METH_CONNECT: Final[str] = "CONNECT" +METH_HEAD: Final[str] = "HEAD" +METH_GET: Final[str] = "GET" +METH_DELETE: Final[str] = "DELETE" +METH_OPTIONS: Final[str] = "OPTIONS" +METH_PATCH: Final[str] = "PATCH" +METH_POST: Final[str] = "POST" +METH_PUT: Final[str] = "PUT" +METH_TRACE: Final[str] = "TRACE" + +METH_ALL: Final[Set[str]] = { + METH_CONNECT, + METH_HEAD, + METH_GET, + METH_DELETE, + METH_OPTIONS, + METH_PATCH, + METH_POST, + METH_PUT, + METH_TRACE, +} + +ACCEPT: Final[istr] = istr("Accept") +ACCEPT_CHARSET: Final[istr] = istr("Accept-Charset") +ACCEPT_ENCODING: Final[istr] = istr("Accept-Encoding") +ACCEPT_LANGUAGE: Final[istr] = istr("Accept-Language") +ACCEPT_RANGES: Final[istr] = istr("Accept-Ranges") +ACCESS_CONTROL_MAX_AGE: Final[istr] = istr("Access-Control-Max-Age") +ACCESS_CONTROL_ALLOW_CREDENTIALS: Final[istr] = istr("Access-Control-Allow-Credentials") +ACCESS_CONTROL_ALLOW_HEADERS: Final[istr] = istr("Access-Control-Allow-Headers") +ACCESS_CONTROL_ALLOW_METHODS: Final[istr] = istr("Access-Control-Allow-Methods") +ACCESS_CONTROL_ALLOW_ORIGIN: Final[istr] = istr("Access-Control-Allow-Origin") +ACCESS_CONTROL_EXPOSE_HEADERS: Final[istr] = istr("Access-Control-Expose-Headers") +ACCESS_CONTROL_REQUEST_HEADERS: Final[istr] = istr("Access-Control-Request-Headers") +ACCESS_CONTROL_REQUEST_METHOD: Final[istr] = istr("Access-Control-Request-Method") +AGE: Final[istr] = istr("Age") +ALLOW: Final[istr] = istr("Allow") +AUTHORIZATION: Final[istr] = istr("Authorization") +CACHE_CONTROL: Final[istr] = istr("Cache-Control") +CONNECTION: Final[istr] = istr("Connection") +CONTENT_DISPOSITION: Final[istr] = istr("Content-Disposition") +CONTENT_ENCODING: Final[istr] = istr("Content-Encoding") +CONTENT_LANGUAGE: Final[istr] = istr("Content-Language") +CONTENT_LENGTH: Final[istr] = istr("Content-Length") +CONTENT_LOCATION: Final[istr] = istr("Content-Location") +CONTENT_MD5: Final[istr] = istr("Content-MD5") +CONTENT_RANGE: Final[istr] = istr("Content-Range") +CONTENT_TRANSFER_ENCODING: Final[istr] = istr("Content-Transfer-Encoding") +CONTENT_TYPE: Final[istr] = istr("Content-Type") +COOKIE: Final[istr] = istr("Cookie") +DATE: Final[istr] = istr("Date") +DESTINATION: Final[istr] = istr("Destination") +DIGEST: Final[istr] = istr("Digest") +ETAG: Final[istr] = istr("Etag") +EXPECT: Final[istr] = istr("Expect") +EXPIRES: Final[istr] = istr("Expires") +FORWARDED: Final[istr] = istr("Forwarded") +FROM: Final[istr] = istr("From") +HOST: Final[istr] = istr("Host") +IF_MATCH: Final[istr] = istr("If-Match") +IF_MODIFIED_SINCE: Final[istr] = istr("If-Modified-Since") +IF_NONE_MATCH: Final[istr] = istr("If-None-Match") +IF_RANGE: Final[istr] = istr("If-Range") +IF_UNMODIFIED_SINCE: Final[istr] = istr("If-Unmodified-Since") +KEEP_ALIVE: Final[istr] = istr("Keep-Alive") +LAST_EVENT_ID: Final[istr] = istr("Last-Event-ID") +LAST_MODIFIED: Final[istr] = istr("Last-Modified") +LINK: Final[istr] = istr("Link") +LOCATION: Final[istr] = istr("Location") +MAX_FORWARDS: Final[istr] = istr("Max-Forwards") +ORIGIN: Final[istr] = istr("Origin") +PRAGMA: Final[istr] = istr("Pragma") +PROXY_AUTHENTICATE: Final[istr] = istr("Proxy-Authenticate") +PROXY_AUTHORIZATION: Final[istr] = istr("Proxy-Authorization") +RANGE: Final[istr] = istr("Range") +REFERER: Final[istr] = istr("Referer") +RETRY_AFTER: Final[istr] = istr("Retry-After") +SEC_WEBSOCKET_ACCEPT: Final[istr] = istr("Sec-WebSocket-Accept") +SEC_WEBSOCKET_VERSION: Final[istr] = istr("Sec-WebSocket-Version") +SEC_WEBSOCKET_PROTOCOL: Final[istr] = istr("Sec-WebSocket-Protocol") +SEC_WEBSOCKET_EXTENSIONS: Final[istr] = istr("Sec-WebSocket-Extensions") +SEC_WEBSOCKET_KEY: Final[istr] = istr("Sec-WebSocket-Key") +SEC_WEBSOCKET_KEY1: Final[istr] = istr("Sec-WebSocket-Key1") +SERVER: Final[istr] = istr("Server") +SET_COOKIE: Final[istr] = istr("Set-Cookie") +TE: Final[istr] = istr("TE") +TRAILER: Final[istr] = istr("Trailer") +TRANSFER_ENCODING: Final[istr] = istr("Transfer-Encoding") +UPGRADE: Final[istr] = istr("Upgrade") +URI: Final[istr] = istr("URI") +USER_AGENT: Final[istr] = istr("User-Agent") +VARY: Final[istr] = istr("Vary") +VIA: Final[istr] = istr("Via") +WANT_DIGEST: Final[istr] = istr("Want-Digest") +WARNING: Final[istr] = istr("Warning") +WWW_AUTHENTICATE: Final[istr] = istr("WWW-Authenticate") +X_FORWARDED_FOR: Final[istr] = istr("X-Forwarded-For") +X_FORWARDED_HOST: Final[istr] = istr("X-Forwarded-Host") +X_FORWARDED_PROTO: Final[istr] = istr("X-Forwarded-Proto") diff --git a/runtime/Lib/site-packages/aiohttp/helpers.py b/runtime/Lib/site-packages/aiohttp/helpers.py new file mode 100644 index 0000000000000000000000000000000000000000..65608cfad1ace7820ae7497f0371865ab990a7d0 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/helpers.py @@ -0,0 +1,877 @@ +"""Various helper functions""" + +import asyncio +import base64 +import binascii +import datetime +import functools +import inspect +import netrc +import os +import platform +import re +import sys +import time +import warnings +import weakref +from collections import namedtuple +from contextlib import suppress +from email.parser import HeaderParser +from email.utils import parsedate +from math import ceil +from pathlib import Path +from types import TracebackType +from typing import ( + Any, + Callable, + ContextManager, + Dict, + Generator, + Generic, + Iterable, + Iterator, + List, + Mapping, + Optional, + Pattern, + Set, + Tuple, + Type, + TypeVar, + Union, + cast, +) +from urllib.parse import quote +from urllib.request import getproxies, proxy_bypass + +import async_timeout +import attr +from multidict import MultiDict, MultiDictProxy +from yarl import URL + +from . import hdrs +from .log import client_logger, internal_logger +from .typedefs import PathLike, Protocol # noqa + +__all__ = ("BasicAuth", "ChainMapProxy", "ETag") + +IS_MACOS = platform.system() == "Darwin" +IS_WINDOWS = platform.system() == "Windows" + +PY_36 = sys.version_info >= (3, 6) +PY_37 = sys.version_info >= (3, 7) +PY_38 = sys.version_info >= (3, 8) +PY_310 = sys.version_info >= (3, 10) + +if sys.version_info < (3, 7): + import idna_ssl + + idna_ssl.patch_match_hostname() + + def all_tasks( + loop: Optional[asyncio.AbstractEventLoop] = None, + ) -> Set["asyncio.Task[Any]"]: + tasks = list(asyncio.Task.all_tasks(loop)) + return {t for t in tasks if not t.done()} + +else: + all_tasks = asyncio.all_tasks + + +_T = TypeVar("_T") +_S = TypeVar("_S") + + +sentinel: Any = object() +NO_EXTENSIONS: bool = bool(os.environ.get("AIOHTTP_NO_EXTENSIONS")) + +# N.B. sys.flags.dev_mode is available on Python 3.7+, use getattr +# for compatibility with older versions +DEBUG: bool = getattr(sys.flags, "dev_mode", False) or ( + not sys.flags.ignore_environment and bool(os.environ.get("PYTHONASYNCIODEBUG")) +) + + +CHAR = {chr(i) for i in range(0, 128)} +CTL = {chr(i) for i in range(0, 32)} | { + chr(127), +} +SEPARATORS = { + "(", + ")", + "<", + ">", + "@", + ",", + ";", + ":", + "\\", + '"', + "/", + "[", + "]", + "?", + "=", + "{", + "}", + " ", + chr(9), +} +TOKEN = CHAR ^ CTL ^ SEPARATORS + + +class noop: + def __await__(self) -> Generator[None, None, None]: + yield + + +class BasicAuth(namedtuple("BasicAuth", ["login", "password", "encoding"])): + """Http basic authentication helper.""" + + def __new__( + cls, login: str, password: str = "", encoding: str = "latin1" + ) -> "BasicAuth": + if login is None: + raise ValueError("None is not allowed as login value") + + if password is None: + raise ValueError("None is not allowed as password value") + + if ":" in login: + raise ValueError('A ":" is not allowed in login (RFC 1945#section-11.1)') + + return super().__new__(cls, login, password, encoding) + + @classmethod + def decode(cls, auth_header: str, encoding: str = "latin1") -> "BasicAuth": + """Create a BasicAuth object from an Authorization HTTP header.""" + try: + auth_type, encoded_credentials = auth_header.split(" ", 1) + except ValueError: + raise ValueError("Could not parse authorization header.") + + if auth_type.lower() != "basic": + raise ValueError("Unknown authorization method %s" % auth_type) + + try: + decoded = base64.b64decode( + encoded_credentials.encode("ascii"), validate=True + ).decode(encoding) + except binascii.Error: + raise ValueError("Invalid base64 encoding.") + + try: + # RFC 2617 HTTP Authentication + # https://www.ietf.org/rfc/rfc2617.txt + # the colon must be present, but the username and password may be + # otherwise blank. + username, password = decoded.split(":", 1) + except ValueError: + raise ValueError("Invalid credentials.") + + return cls(username, password, encoding=encoding) + + @classmethod + def from_url(cls, url: URL, *, encoding: str = "latin1") -> Optional["BasicAuth"]: + """Create BasicAuth from url.""" + if not isinstance(url, URL): + raise TypeError("url should be yarl.URL instance") + if url.user is None: + return None + return cls(url.user, url.password or "", encoding=encoding) + + def encode(self) -> str: + """Encode credentials.""" + creds = (f"{self.login}:{self.password}").encode(self.encoding) + return "Basic %s" % base64.b64encode(creds).decode(self.encoding) + + +def strip_auth_from_url(url: URL) -> Tuple[URL, Optional[BasicAuth]]: + auth = BasicAuth.from_url(url) + if auth is None: + return url, None + else: + return url.with_user(None), auth + + +def netrc_from_env() -> Optional[netrc.netrc]: + """Load netrc from file. + + Attempt to load it from the path specified by the env-var + NETRC or in the default location in the user's home directory. + + Returns None if it couldn't be found or fails to parse. + """ + netrc_env = os.environ.get("NETRC") + + if netrc_env is not None: + netrc_path = Path(netrc_env) + else: + try: + home_dir = Path.home() + except RuntimeError as e: # pragma: no cover + # if pathlib can't resolve home, it may raise a RuntimeError + client_logger.debug( + "Could not resolve home directory when " + "trying to look for .netrc file: %s", + e, + ) + return None + + netrc_path = home_dir / ("_netrc" if IS_WINDOWS else ".netrc") + + try: + return netrc.netrc(str(netrc_path)) + except netrc.NetrcParseError as e: + client_logger.warning("Could not parse .netrc file: %s", e) + except OSError as e: + # we couldn't read the file (doesn't exist, permissions, etc.) + if netrc_env or netrc_path.is_file(): + # only warn if the environment wanted us to load it, + # or it appears like the default file does actually exist + client_logger.warning("Could not read .netrc file: %s", e) + + return None + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class ProxyInfo: + proxy: URL + proxy_auth: Optional[BasicAuth] + + +def proxies_from_env() -> Dict[str, ProxyInfo]: + proxy_urls = { + k: URL(v) + for k, v in getproxies().items() + if k in ("http", "https", "ws", "wss") + } + netrc_obj = netrc_from_env() + stripped = {k: strip_auth_from_url(v) for k, v in proxy_urls.items()} + ret = {} + for proto, val in stripped.items(): + proxy, auth = val + if proxy.scheme in ("https", "wss"): + client_logger.warning( + "%s proxies %s are not supported, ignoring", proxy.scheme.upper(), proxy + ) + continue + if netrc_obj and auth is None: + auth_from_netrc = None + if proxy.host is not None: + auth_from_netrc = netrc_obj.authenticators(proxy.host) + if auth_from_netrc is not None: + # auth_from_netrc is a (`user`, `account`, `password`) tuple, + # `user` and `account` both can be username, + # if `user` is None, use `account` + *logins, password = auth_from_netrc + login = logins[0] if logins[0] else logins[-1] + auth = BasicAuth(cast(str, login), cast(str, password)) + ret[proto] = ProxyInfo(proxy, auth) + return ret + + +def current_task( + loop: Optional[asyncio.AbstractEventLoop] = None, +) -> "Optional[asyncio.Task[Any]]": + if sys.version_info >= (3, 7): + return asyncio.current_task(loop=loop) + else: + return asyncio.Task.current_task(loop=loop) + + +def get_running_loop( + loop: Optional[asyncio.AbstractEventLoop] = None, +) -> asyncio.AbstractEventLoop: + if loop is None: + loop = asyncio.get_event_loop() + if not loop.is_running(): + warnings.warn( + "The object should be created within an async function", + DeprecationWarning, + stacklevel=3, + ) + if loop.get_debug(): + internal_logger.warning( + "The object should be created within an async function", stack_info=True + ) + return loop + + +def isasyncgenfunction(obj: Any) -> bool: + func = getattr(inspect, "isasyncgenfunction", None) + if func is not None: + return func(obj) # type: ignore[no-any-return] + else: + return False + + +def get_env_proxy_for_url(url: URL) -> Tuple[URL, Optional[BasicAuth]]: + """Get a permitted proxy for the given URL from the env.""" + if url.host is not None and proxy_bypass(url.host): + raise LookupError(f"Proxying is disallowed for `{url.host!r}`") + + proxies_in_env = proxies_from_env() + try: + proxy_info = proxies_in_env[url.scheme] + except KeyError: + raise LookupError(f"No proxies found for `{url!s}` in the env") + else: + return proxy_info.proxy, proxy_info.proxy_auth + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class MimeType: + type: str + subtype: str + suffix: str + parameters: "MultiDictProxy[str]" + + +@functools.lru_cache(maxsize=56) +def parse_mimetype(mimetype: str) -> MimeType: + """Parses a MIME type into its components. + + mimetype is a MIME type string. + + Returns a MimeType object. + + Example: + + >>> parse_mimetype('text/html; charset=utf-8') + MimeType(type='text', subtype='html', suffix='', + parameters={'charset': 'utf-8'}) + + """ + if not mimetype: + return MimeType( + type="", subtype="", suffix="", parameters=MultiDictProxy(MultiDict()) + ) + + parts = mimetype.split(";") + params: MultiDict[str] = MultiDict() + for item in parts[1:]: + if not item: + continue + key, value = cast( + Tuple[str, str], item.split("=", 1) if "=" in item else (item, "") + ) + params.add(key.lower().strip(), value.strip(' "')) + + fulltype = parts[0].strip().lower() + if fulltype == "*": + fulltype = "*/*" + + mtype, stype = ( + cast(Tuple[str, str], fulltype.split("/", 1)) + if "/" in fulltype + else (fulltype, "") + ) + stype, suffix = ( + cast(Tuple[str, str], stype.split("+", 1)) if "+" in stype else (stype, "") + ) + + return MimeType( + type=mtype, subtype=stype, suffix=suffix, parameters=MultiDictProxy(params) + ) + + +def guess_filename(obj: Any, default: Optional[str] = None) -> Optional[str]: + name = getattr(obj, "name", None) + if name and isinstance(name, str) and name[0] != "<" and name[-1] != ">": + return Path(name).name + return default + + +not_qtext_re = re.compile(r"[^\041\043-\133\135-\176]") +QCONTENT = {chr(i) for i in range(0x20, 0x7F)} | {"\t"} + + +def quoted_string(content: str) -> str: + """Return 7-bit content as quoted-string. + + Format content into a quoted-string as defined in RFC5322 for + Internet Message Format. Notice that this is not the 8-bit HTTP + format, but the 7-bit email format. Content must be in usascii or + a ValueError is raised. + """ + if not (QCONTENT > set(content)): + raise ValueError(f"bad content for quoted-string {content!r}") + return not_qtext_re.sub(lambda x: "\\" + x.group(0), content) + + +def content_disposition_header( + disptype: str, quote_fields: bool = True, _charset: str = "utf-8", **params: str +) -> str: + """Sets ``Content-Disposition`` header for MIME. + + This is the MIME payload Content-Disposition header from RFC 2183 + and RFC 7579 section 4.2, not the HTTP Content-Disposition from + RFC 6266. + + disptype is a disposition type: inline, attachment, form-data. + Should be valid extension token (see RFC 2183) + + quote_fields performs value quoting to 7-bit MIME headers + according to RFC 7578. Set to quote_fields to False if recipient + can take 8-bit file names and field values. + + _charset specifies the charset to use when quote_fields is True. + + params is a dict with disposition params. + """ + if not disptype or not (TOKEN > set(disptype)): + raise ValueError("bad content disposition type {!r}" "".format(disptype)) + + value = disptype + if params: + lparams = [] + for key, val in params.items(): + if not key or not (TOKEN > set(key)): + raise ValueError( + "bad content disposition parameter" " {!r}={!r}".format(key, val) + ) + if quote_fields: + if key.lower() == "filename": + qval = quote(val, "", encoding=_charset) + lparams.append((key, '"%s"' % qval)) + else: + try: + qval = quoted_string(val) + except ValueError: + qval = "".join( + (_charset, "''", quote(val, "", encoding=_charset)) + ) + lparams.append((key + "*", qval)) + else: + lparams.append((key, '"%s"' % qval)) + else: + qval = val.replace("\\", "\\\\").replace('"', '\\"') + lparams.append((key, '"%s"' % qval)) + sparams = "; ".join("=".join(pair) for pair in lparams) + value = "; ".join((value, sparams)) + return value + + +class _TSelf(Protocol, Generic[_T]): + _cache: Dict[str, _T] + + +class reify(Generic[_T]): + """Use as a class method decorator. + + It operates almost exactly like + the Python `@property` decorator, but it puts the result of the + method it decorates into the instance dict after the first call, + effectively replacing the function it decorates with an instance + variable. It is, in Python parlance, a data descriptor. + """ + + def __init__(self, wrapped: Callable[..., _T]) -> None: + self.wrapped = wrapped + self.__doc__ = wrapped.__doc__ + self.name = wrapped.__name__ + + def __get__(self, inst: _TSelf[_T], owner: Optional[Type[Any]] = None) -> _T: + try: + try: + return inst._cache[self.name] + except KeyError: + val = self.wrapped(inst) + inst._cache[self.name] = val + return val + except AttributeError: + if inst is None: + return self + raise + + def __set__(self, inst: _TSelf[_T], value: _T) -> None: + raise AttributeError("reified property is read-only") + + +reify_py = reify + +try: + from ._helpers import reify as reify_c + + if not NO_EXTENSIONS: + reify = reify_c # type: ignore[misc,assignment] +except ImportError: + pass + +_ipv4_pattern = ( + r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}" + r"(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" +) +_ipv6_pattern = ( + r"^(?:(?:(?:[A-F0-9]{1,4}:){6}|(?=(?:[A-F0-9]{0,4}:){0,6}" + r"(?:[0-9]{1,3}\.){3}[0-9]{1,3}$)(([0-9A-F]{1,4}:){0,5}|:)" + r"((:[0-9A-F]{1,4}){1,5}:|:)|::(?:[A-F0-9]{1,4}:){5})" + r"(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.){3}" + r"(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])|(?:[A-F0-9]{1,4}:){7}" + r"[A-F0-9]{1,4}|(?=(?:[A-F0-9]{0,4}:){0,7}[A-F0-9]{0,4}$)" + r"(([0-9A-F]{1,4}:){1,7}|:)((:[0-9A-F]{1,4}){1,7}|:)|(?:[A-F0-9]{1,4}:){7}" + r":|:(:[A-F0-9]{1,4}){7})$" +) +_ipv4_regex = re.compile(_ipv4_pattern) +_ipv6_regex = re.compile(_ipv6_pattern, flags=re.IGNORECASE) +_ipv4_regexb = re.compile(_ipv4_pattern.encode("ascii")) +_ipv6_regexb = re.compile(_ipv6_pattern.encode("ascii"), flags=re.IGNORECASE) + + +def _is_ip_address( + regex: Pattern[str], regexb: Pattern[bytes], host: Optional[Union[str, bytes]] +) -> bool: + if host is None: + return False + if isinstance(host, str): + return bool(regex.match(host)) + elif isinstance(host, (bytes, bytearray, memoryview)): + return bool(regexb.match(host)) + else: + raise TypeError(f"{host} [{type(host)}] is not a str or bytes") + + +is_ipv4_address = functools.partial(_is_ip_address, _ipv4_regex, _ipv4_regexb) +is_ipv6_address = functools.partial(_is_ip_address, _ipv6_regex, _ipv6_regexb) + + +def is_ip_address(host: Optional[Union[str, bytes, bytearray, memoryview]]) -> bool: + return is_ipv4_address(host) or is_ipv6_address(host) + + +def next_whole_second() -> datetime.datetime: + """Return current time rounded up to the next whole second.""" + return datetime.datetime.now(datetime.timezone.utc).replace( + microsecond=0 + ) + datetime.timedelta(seconds=0) + + +_cached_current_datetime: Optional[int] = None +_cached_formatted_datetime = "" + + +def rfc822_formatted_time() -> str: + global _cached_current_datetime + global _cached_formatted_datetime + + now = int(time.time()) + if now != _cached_current_datetime: + # Weekday and month names for HTTP date/time formatting; + # always English! + # Tuples are constants stored in codeobject! + _weekdayname = ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun") + _monthname = ( + "", # Dummy so we can use 1-based month numbers + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec", + ) + + year, month, day, hh, mm, ss, wd, *tail = time.gmtime(now) + _cached_formatted_datetime = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % ( + _weekdayname[wd], + day, + _monthname[month], + year, + hh, + mm, + ss, + ) + _cached_current_datetime = now + return _cached_formatted_datetime + + +def _weakref_handle(info: "Tuple[weakref.ref[object], str]") -> None: + ref, name = info + ob = ref() + if ob is not None: + with suppress(Exception): + getattr(ob, name)() + + +def weakref_handle( + ob: object, name: str, timeout: float, loop: asyncio.AbstractEventLoop +) -> Optional[asyncio.TimerHandle]: + if timeout is not None and timeout > 0: + when = loop.time() + timeout + if timeout >= 5: + when = ceil(when) + + return loop.call_at(when, _weakref_handle, (weakref.ref(ob), name)) + return None + + +def call_later( + cb: Callable[[], Any], timeout: float, loop: asyncio.AbstractEventLoop +) -> Optional[asyncio.TimerHandle]: + if timeout is not None and timeout > 0: + when = loop.time() + timeout + if timeout > 5: + when = ceil(when) + return loop.call_at(when, cb) + return None + + +class TimeoutHandle: + """Timeout handle""" + + def __init__( + self, loop: asyncio.AbstractEventLoop, timeout: Optional[float] + ) -> None: + self._timeout = timeout + self._loop = loop + self._callbacks: List[ + Tuple[Callable[..., None], Tuple[Any, ...], Dict[str, Any]] + ] = [] + + def register( + self, callback: Callable[..., None], *args: Any, **kwargs: Any + ) -> None: + self._callbacks.append((callback, args, kwargs)) + + def close(self) -> None: + self._callbacks.clear() + + def start(self) -> Optional[asyncio.Handle]: + timeout = self._timeout + if timeout is not None and timeout > 0: + when = self._loop.time() + timeout + if timeout >= 5: + when = ceil(when) + return self._loop.call_at(when, self.__call__) + else: + return None + + def timer(self) -> "BaseTimerContext": + if self._timeout is not None and self._timeout > 0: + timer = TimerContext(self._loop) + self.register(timer.timeout) + return timer + else: + return TimerNoop() + + def __call__(self) -> None: + for cb, args, kwargs in self._callbacks: + with suppress(Exception): + cb(*args, **kwargs) + + self._callbacks.clear() + + +class BaseTimerContext(ContextManager["BaseTimerContext"]): + pass + + +class TimerNoop(BaseTimerContext): + def __enter__(self) -> BaseTimerContext: + return self + + def __exit__( + self, + exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType], + ) -> None: + return + + +class TimerContext(BaseTimerContext): + """Low resolution timeout context manager""" + + def __init__(self, loop: asyncio.AbstractEventLoop) -> None: + self._loop = loop + self._tasks: List[asyncio.Task[Any]] = [] + self._cancelled = False + + def __enter__(self) -> BaseTimerContext: + task = current_task(loop=self._loop) + + if task is None: + raise RuntimeError( + "Timeout context manager should be used " "inside a task" + ) + + if self._cancelled: + raise asyncio.TimeoutError from None + + self._tasks.append(task) + return self + + def __exit__( + self, + exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType], + ) -> Optional[bool]: + if self._tasks: + self._tasks.pop() + + if exc_type is asyncio.CancelledError and self._cancelled: + raise asyncio.TimeoutError from None + return None + + def timeout(self) -> None: + if not self._cancelled: + for task in set(self._tasks): + task.cancel() + + self._cancelled = True + + +def ceil_timeout(delay: Optional[float]) -> async_timeout.Timeout: + if delay is None or delay <= 0: + return async_timeout.timeout(None) + + loop = get_running_loop() + now = loop.time() + when = now + delay + if delay > 5: + when = ceil(when) + return async_timeout.timeout_at(when) + + +class HeadersMixin: + + ATTRS = frozenset(["_content_type", "_content_dict", "_stored_content_type"]) + + _content_type: Optional[str] = None + _content_dict: Optional[Dict[str, str]] = None + _stored_content_type = sentinel + + def _parse_content_type(self, raw: str) -> None: + self._stored_content_type = raw + if raw is None: + # default value according to RFC 2616 + self._content_type = "application/octet-stream" + self._content_dict = {} + else: + msg = HeaderParser().parsestr("Content-Type: " + raw) + self._content_type = msg.get_content_type() + params = msg.get_params() + self._content_dict = dict(params[1:]) # First element is content type again + + @property + def content_type(self) -> str: + """The value of content part for Content-Type HTTP header.""" + raw = self._headers.get(hdrs.CONTENT_TYPE) # type: ignore[attr-defined] + if self._stored_content_type != raw: + self._parse_content_type(raw) + return self._content_type # type: ignore[return-value] + + @property + def charset(self) -> Optional[str]: + """The value of charset part for Content-Type HTTP header.""" + raw = self._headers.get(hdrs.CONTENT_TYPE) # type: ignore[attr-defined] + if self._stored_content_type != raw: + self._parse_content_type(raw) + return self._content_dict.get("charset") # type: ignore[union-attr] + + @property + def content_length(self) -> Optional[int]: + """The value of Content-Length HTTP header.""" + content_length = self._headers.get( # type: ignore[attr-defined] + hdrs.CONTENT_LENGTH + ) + + if content_length is not None: + return int(content_length) + else: + return None + + +def set_result(fut: "asyncio.Future[_T]", result: _T) -> None: + if not fut.done(): + fut.set_result(result) + + +def set_exception(fut: "asyncio.Future[_T]", exc: BaseException) -> None: + if not fut.done(): + fut.set_exception(exc) + + +class ChainMapProxy(Mapping[str, Any]): + __slots__ = ("_maps",) + + def __init__(self, maps: Iterable[Mapping[str, Any]]) -> None: + self._maps = tuple(maps) + + def __init_subclass__(cls) -> None: + raise TypeError( + "Inheritance class {} from ChainMapProxy " + "is forbidden".format(cls.__name__) + ) + + def __getitem__(self, key: str) -> Any: + for mapping in self._maps: + try: + return mapping[key] + except KeyError: + pass + raise KeyError(key) + + def get(self, key: str, default: Any = None) -> Any: + return self[key] if key in self else default + + def __len__(self) -> int: + # reuses stored hash values if possible + return len(set().union(*self._maps)) # type: ignore[arg-type] + + def __iter__(self) -> Iterator[str]: + d: Dict[str, Any] = {} + for mapping in reversed(self._maps): + # reuses stored hash values if possible + d.update(mapping) + return iter(d) + + def __contains__(self, key: object) -> bool: + return any(key in m for m in self._maps) + + def __bool__(self) -> bool: + return any(self._maps) + + def __repr__(self) -> str: + content = ", ".join(map(repr, self._maps)) + return f"ChainMapProxy({content})" + + +# https://tools.ietf.org/html/rfc7232#section-2.3 +_ETAGC = r"[!#-}\x80-\xff]+" +_ETAGC_RE = re.compile(_ETAGC) +_QUOTED_ETAG = rf'(W/)?"({_ETAGC})"' +QUOTED_ETAG_RE = re.compile(_QUOTED_ETAG) +LIST_QUOTED_ETAG_RE = re.compile(rf"({_QUOTED_ETAG})(?:\s*,\s*|$)|(.)") + +ETAG_ANY = "*" + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class ETag: + value: str + is_weak: bool = False + + +def validate_etag_value(value: str) -> None: + if value != ETAG_ANY and not _ETAGC_RE.fullmatch(value): + raise ValueError( + f"Value {value!r} is not a valid etag. Maybe it contains '\"'?" + ) + + +def parse_http_date(date_str: Optional[str]) -> Optional[datetime.datetime]: + """Process a date string, return a datetime object""" + if date_str is not None: + timetuple = parsedate(date_str) + if timetuple is not None: + with suppress(ValueError): + return datetime.datetime(*timetuple[:6], tzinfo=datetime.timezone.utc) + return None diff --git a/runtime/Lib/site-packages/aiohttp/http.py b/runtime/Lib/site-packages/aiohttp/http.py new file mode 100644 index 0000000000000000000000000000000000000000..d1d6d19701293355a70e9a8fbd9027b079fa3b60 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/http.py @@ -0,0 +1,70 @@ +import http.server +import sys +from typing import Mapping, Tuple + +from . import __version__ +from .http_exceptions import HttpProcessingError as HttpProcessingError +from .http_parser import ( + HeadersParser as HeadersParser, + HttpParser as HttpParser, + HttpRequestParser as HttpRequestParser, + HttpResponseParser as HttpResponseParser, + RawRequestMessage as RawRequestMessage, + RawResponseMessage as RawResponseMessage, +) +from .http_websocket import ( + WS_CLOSED_MESSAGE as WS_CLOSED_MESSAGE, + WS_CLOSING_MESSAGE as WS_CLOSING_MESSAGE, + WS_KEY as WS_KEY, + WebSocketError as WebSocketError, + WebSocketReader as WebSocketReader, + WebSocketWriter as WebSocketWriter, + WSCloseCode as WSCloseCode, + WSMessage as WSMessage, + WSMsgType as WSMsgType, + ws_ext_gen as ws_ext_gen, + ws_ext_parse as ws_ext_parse, +) +from .http_writer import ( + HttpVersion as HttpVersion, + HttpVersion10 as HttpVersion10, + HttpVersion11 as HttpVersion11, + StreamWriter as StreamWriter, +) + +__all__ = ( + "HttpProcessingError", + "RESPONSES", + "SERVER_SOFTWARE", + # .http_writer + "StreamWriter", + "HttpVersion", + "HttpVersion10", + "HttpVersion11", + # .http_parser + "HeadersParser", + "HttpParser", + "HttpRequestParser", + "HttpResponseParser", + "RawRequestMessage", + "RawResponseMessage", + # .http_websocket + "WS_CLOSED_MESSAGE", + "WS_CLOSING_MESSAGE", + "WS_KEY", + "WebSocketReader", + "WebSocketWriter", + "ws_ext_gen", + "ws_ext_parse", + "WSMessage", + "WebSocketError", + "WSMsgType", + "WSCloseCode", +) + + +SERVER_SOFTWARE: str = "Python/{0[0]}.{0[1]} aiohttp/{1}".format( + sys.version_info, __version__ +) + +RESPONSES: Mapping[int, Tuple[str, str]] = http.server.BaseHTTPRequestHandler.responses diff --git a/runtime/Lib/site-packages/aiohttp/http_exceptions.py b/runtime/Lib/site-packages/aiohttp/http_exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..9635cfbb8442be53364446e01b2759b3e60a8ac7 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/http_exceptions.py @@ -0,0 +1,105 @@ +"""Low-level http related exceptions.""" + + +from typing import Optional, Union + +from .typedefs import _CIMultiDict + +__all__ = ("HttpProcessingError",) + + +class HttpProcessingError(Exception): + """HTTP error. + + Shortcut for raising HTTP errors with custom code, message and headers. + + code: HTTP Error code. + message: (optional) Error message. + headers: (optional) Headers to be sent in response, a list of pairs + """ + + code = 0 + message = "" + headers = None + + def __init__( + self, + *, + code: Optional[int] = None, + message: str = "", + headers: Optional[_CIMultiDict] = None, + ) -> None: + if code is not None: + self.code = code + self.headers = headers + self.message = message + + def __str__(self) -> str: + return f"{self.code}, message={self.message!r}" + + def __repr__(self) -> str: + return f"<{self.__class__.__name__}: {self}>" + + +class BadHttpMessage(HttpProcessingError): + + code = 400 + message = "Bad Request" + + def __init__(self, message: str, *, headers: Optional[_CIMultiDict] = None) -> None: + super().__init__(message=message, headers=headers) + self.args = (message,) + + +class HttpBadRequest(BadHttpMessage): + + code = 400 + message = "Bad Request" + + +class PayloadEncodingError(BadHttpMessage): + """Base class for payload errors""" + + +class ContentEncodingError(PayloadEncodingError): + """Content encoding error.""" + + +class TransferEncodingError(PayloadEncodingError): + """transfer encoding error.""" + + +class ContentLengthError(PayloadEncodingError): + """Not enough data for satisfy content length header.""" + + +class LineTooLong(BadHttpMessage): + def __init__( + self, line: str, limit: str = "Unknown", actual_size: str = "Unknown" + ) -> None: + super().__init__( + f"Got more than {limit} bytes ({actual_size}) when reading {line}." + ) + self.args = (line, limit, actual_size) + + +class InvalidHeader(BadHttpMessage): + def __init__(self, hdr: Union[bytes, str]) -> None: + if isinstance(hdr, bytes): + hdr = hdr.decode("utf-8", "surrogateescape") + super().__init__(f"Invalid HTTP Header: {hdr}") + self.hdr = hdr + self.args = (hdr,) + + +class BadStatusLine(BadHttpMessage): + def __init__(self, line: str = "") -> None: + if not isinstance(line, str): + line = repr(line) + super().__init__(f"Bad status line {line!r}") + self.args = (line,) + self.line = line + + +class InvalidURLError(BadHttpMessage): + pass diff --git a/runtime/Lib/site-packages/aiohttp/http_parser.py b/runtime/Lib/site-packages/aiohttp/http_parser.py new file mode 100644 index 0000000000000000000000000000000000000000..60a1ae8f1dedadba2839160ec0df8b1f66919b8c --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/http_parser.py @@ -0,0 +1,969 @@ +import abc +import asyncio +import collections +import re +import string +import zlib +from contextlib import suppress +from enum import IntEnum +from typing import ( + Any, + Generic, + List, + NamedTuple, + Optional, + Pattern, + Set, + Tuple, + Type, + TypeVar, + Union, + cast, +) + +from multidict import CIMultiDict, CIMultiDictProxy, istr +from yarl import URL + +from . import hdrs +from .base_protocol import BaseProtocol +from .helpers import NO_EXTENSIONS, BaseTimerContext +from .http_exceptions import ( + BadHttpMessage, + BadStatusLine, + ContentEncodingError, + ContentLengthError, + InvalidHeader, + LineTooLong, + TransferEncodingError, +) +from .http_writer import HttpVersion, HttpVersion10 +from .log import internal_logger +from .streams import EMPTY_PAYLOAD, StreamReader +from .typedefs import Final, RawHeaders + +try: + import brotli + + HAS_BROTLI = True +except ImportError: # pragma: no cover + HAS_BROTLI = False + + +__all__ = ( + "HeadersParser", + "HttpParser", + "HttpRequestParser", + "HttpResponseParser", + "RawRequestMessage", + "RawResponseMessage", +) + +ASCIISET: Final[Set[str]] = set(string.printable) + +# See https://tools.ietf.org/html/rfc7230#section-3.1.1 +# and https://tools.ietf.org/html/rfc7230#appendix-B +# +# method = token +# tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / +# "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA +# token = 1*tchar +METHRE: Final[Pattern[str]] = re.compile(r"[!#$%&'*+\-.^_`|~0-9A-Za-z]+") +VERSRE: Final[Pattern[str]] = re.compile(r"HTTP/(\d+).(\d+)") +HDRRE: Final[Pattern[bytes]] = re.compile(rb"[\x00-\x1F\x7F()<>@,;:\[\]={} \t\\\\\"]") + + +class RawRequestMessage(NamedTuple): + method: str + path: str + version: HttpVersion + headers: "CIMultiDictProxy[str]" + raw_headers: RawHeaders + should_close: bool + compression: Optional[str] + upgrade: bool + chunked: bool + url: URL + + +RawResponseMessage = collections.namedtuple( + "RawResponseMessage", + [ + "version", + "code", + "reason", + "headers", + "raw_headers", + "should_close", + "compression", + "upgrade", + "chunked", + ], +) + + +_MsgT = TypeVar("_MsgT", RawRequestMessage, RawResponseMessage) + + +class ParseState(IntEnum): + + PARSE_NONE = 0 + PARSE_LENGTH = 1 + PARSE_CHUNKED = 2 + PARSE_UNTIL_EOF = 3 + + +class ChunkState(IntEnum): + PARSE_CHUNKED_SIZE = 0 + PARSE_CHUNKED_CHUNK = 1 + PARSE_CHUNKED_CHUNK_EOF = 2 + PARSE_MAYBE_TRAILERS = 3 + PARSE_TRAILERS = 4 + + +class HeadersParser: + def __init__( + self, + max_line_size: int = 8190, + max_headers: int = 32768, + max_field_size: int = 8190, + ) -> None: + self.max_line_size = max_line_size + self.max_headers = max_headers + self.max_field_size = max_field_size + + def parse_headers( + self, lines: List[bytes] + ) -> Tuple["CIMultiDictProxy[str]", RawHeaders]: + headers: CIMultiDict[str] = CIMultiDict() + raw_headers = [] + + lines_idx = 1 + line = lines[1] + line_count = len(lines) + + while line: + # Parse initial header name : value pair. + try: + bname, bvalue = line.split(b":", 1) + except ValueError: + raise InvalidHeader(line) from None + + bname = bname.strip(b" \t") + bvalue = bvalue.lstrip() + if HDRRE.search(bname): + raise InvalidHeader(bname) + if len(bname) > self.max_field_size: + raise LineTooLong( + "request header name {}".format( + bname.decode("utf8", "xmlcharrefreplace") + ), + str(self.max_field_size), + str(len(bname)), + ) + + header_length = len(bvalue) + + # next line + lines_idx += 1 + line = lines[lines_idx] + + # consume continuation lines + continuation = line and line[0] in (32, 9) # (' ', '\t') + + if continuation: + bvalue_lst = [bvalue] + while continuation: + header_length += len(line) + if header_length > self.max_field_size: + raise LineTooLong( + "request header field {}".format( + bname.decode("utf8", "xmlcharrefreplace") + ), + str(self.max_field_size), + str(header_length), + ) + bvalue_lst.append(line) + + # next line + lines_idx += 1 + if lines_idx < line_count: + line = lines[lines_idx] + if line: + continuation = line[0] in (32, 9) # (' ', '\t') + else: + line = b"" + break + bvalue = b"".join(bvalue_lst) + else: + if header_length > self.max_field_size: + raise LineTooLong( + "request header field {}".format( + bname.decode("utf8", "xmlcharrefreplace") + ), + str(self.max_field_size), + str(header_length), + ) + + bvalue = bvalue.strip() + name = bname.decode("utf-8", "surrogateescape") + value = bvalue.decode("utf-8", "surrogateescape") + + headers.add(name, value) + raw_headers.append((bname, bvalue)) + + return (CIMultiDictProxy(headers), tuple(raw_headers)) + + +class HttpParser(abc.ABC, Generic[_MsgT]): + def __init__( + self, + protocol: Optional[BaseProtocol] = None, + loop: Optional[asyncio.AbstractEventLoop] = None, + limit: int = 2**16, + max_line_size: int = 8190, + max_headers: int = 32768, + max_field_size: int = 8190, + timer: Optional[BaseTimerContext] = None, + code: Optional[int] = None, + method: Optional[str] = None, + readall: bool = False, + payload_exception: Optional[Type[BaseException]] = None, + response_with_body: bool = True, + read_until_eof: bool = False, + auto_decompress: bool = True, + ) -> None: + self.protocol = protocol + self.loop = loop + self.max_line_size = max_line_size + self.max_headers = max_headers + self.max_field_size = max_field_size + self.timer = timer + self.code = code + self.method = method + self.readall = readall + self.payload_exception = payload_exception + self.response_with_body = response_with_body + self.read_until_eof = read_until_eof + + self._lines: List[bytes] = [] + self._tail = b"" + self._upgraded = False + self._payload = None + self._payload_parser: Optional[HttpPayloadParser] = None + self._auto_decompress = auto_decompress + self._limit = limit + self._headers_parser = HeadersParser(max_line_size, max_headers, max_field_size) + + @abc.abstractmethod + def parse_message(self, lines: List[bytes]) -> _MsgT: + pass + + def feed_eof(self) -> Optional[_MsgT]: + if self._payload_parser is not None: + self._payload_parser.feed_eof() + self._payload_parser = None + else: + # try to extract partial message + if self._tail: + self._lines.append(self._tail) + + if self._lines: + if self._lines[-1] != "\r\n": + self._lines.append(b"") + with suppress(Exception): + return self.parse_message(self._lines) + return None + + def feed_data( + self, + data: bytes, + SEP: bytes = b"\r\n", + EMPTY: bytes = b"", + CONTENT_LENGTH: istr = hdrs.CONTENT_LENGTH, + METH_CONNECT: str = hdrs.METH_CONNECT, + SEC_WEBSOCKET_KEY1: istr = hdrs.SEC_WEBSOCKET_KEY1, + ) -> Tuple[List[Tuple[_MsgT, StreamReader]], bool, bytes]: + + messages = [] + + if self._tail: + data, self._tail = self._tail + data, b"" + + data_len = len(data) + start_pos = 0 + loop = self.loop + + while start_pos < data_len: + + # read HTTP message (request/response line + headers), \r\n\r\n + # and split by lines + if self._payload_parser is None and not self._upgraded: + pos = data.find(SEP, start_pos) + # consume \r\n + if pos == start_pos and not self._lines: + start_pos = pos + 2 + continue + + if pos >= start_pos: + # line found + self._lines.append(data[start_pos:pos]) + start_pos = pos + 2 + + # \r\n\r\n found + if self._lines[-1] == EMPTY: + try: + msg: _MsgT = self.parse_message(self._lines) + finally: + self._lines.clear() + + def get_content_length() -> Optional[int]: + # payload length + length_hdr = msg.headers.get(CONTENT_LENGTH) + if length_hdr is None: + return None + + try: + length = int(length_hdr) + except ValueError: + raise InvalidHeader(CONTENT_LENGTH) + + if length < 0: + raise InvalidHeader(CONTENT_LENGTH) + + return length + + length = get_content_length() + # do not support old websocket spec + if SEC_WEBSOCKET_KEY1 in msg.headers: + raise InvalidHeader(SEC_WEBSOCKET_KEY1) + + self._upgraded = msg.upgrade + + method = getattr(msg, "method", self.method) + + assert self.protocol is not None + # calculate payload + if ( + (length is not None and length > 0) + or msg.chunked + and not msg.upgrade + ): + payload = StreamReader( + self.protocol, + timer=self.timer, + loop=loop, + limit=self._limit, + ) + payload_parser = HttpPayloadParser( + payload, + length=length, + chunked=msg.chunked, + method=method, + compression=msg.compression, + code=self.code, + readall=self.readall, + response_with_body=self.response_with_body, + auto_decompress=self._auto_decompress, + ) + if not payload_parser.done: + self._payload_parser = payload_parser + elif method == METH_CONNECT: + assert isinstance(msg, RawRequestMessage) + payload = StreamReader( + self.protocol, + timer=self.timer, + loop=loop, + limit=self._limit, + ) + self._upgraded = True + self._payload_parser = HttpPayloadParser( + payload, + method=msg.method, + compression=msg.compression, + readall=True, + auto_decompress=self._auto_decompress, + ) + else: + if ( + getattr(msg, "code", 100) >= 199 + and length is None + and self.read_until_eof + ): + payload = StreamReader( + self.protocol, + timer=self.timer, + loop=loop, + limit=self._limit, + ) + payload_parser = HttpPayloadParser( + payload, + length=length, + chunked=msg.chunked, + method=method, + compression=msg.compression, + code=self.code, + readall=True, + response_with_body=self.response_with_body, + auto_decompress=self._auto_decompress, + ) + if not payload_parser.done: + self._payload_parser = payload_parser + else: + payload = EMPTY_PAYLOAD + + messages.append((msg, payload)) + else: + self._tail = data[start_pos:] + data = EMPTY + break + + # no parser, just store + elif self._payload_parser is None and self._upgraded: + assert not self._lines + break + + # feed payload + elif data and start_pos < data_len: + assert not self._lines + assert self._payload_parser is not None + try: + eof, data = self._payload_parser.feed_data(data[start_pos:]) + except BaseException as exc: + if self.payload_exception is not None: + self._payload_parser.payload.set_exception( + self.payload_exception(str(exc)) + ) + else: + self._payload_parser.payload.set_exception(exc) + + eof = True + data = b"" + + if eof: + start_pos = 0 + data_len = len(data) + self._payload_parser = None + continue + else: + break + + if data and start_pos < data_len: + data = data[start_pos:] + else: + data = EMPTY + + return messages, self._upgraded, data + + def parse_headers( + self, lines: List[bytes] + ) -> Tuple[ + "CIMultiDictProxy[str]", RawHeaders, Optional[bool], Optional[str], bool, bool + ]: + """Parses RFC 5322 headers from a stream. + + Line continuations are supported. Returns list of header name + and value pairs. Header name is in upper case. + """ + headers, raw_headers = self._headers_parser.parse_headers(lines) + close_conn = None + encoding = None + upgrade = False + chunked = False + + # keep-alive + conn = headers.get(hdrs.CONNECTION) + if conn: + v = conn.lower() + if v == "close": + close_conn = True + elif v == "keep-alive": + close_conn = False + elif v == "upgrade": + upgrade = True + + # encoding + enc = headers.get(hdrs.CONTENT_ENCODING) + if enc: + enc = enc.lower() + if enc in ("gzip", "deflate", "br"): + encoding = enc + + # chunking + te = headers.get(hdrs.TRANSFER_ENCODING) + if te is not None: + if "chunked" == te.lower(): + chunked = True + else: + raise BadHttpMessage("Request has invalid `Transfer-Encoding`") + + if hdrs.CONTENT_LENGTH in headers: + raise BadHttpMessage( + "Content-Length can't be present with Transfer-Encoding", + ) + + return (headers, raw_headers, close_conn, encoding, upgrade, chunked) + + def set_upgraded(self, val: bool) -> None: + """Set connection upgraded (to websocket) mode. + + :param bool val: new state. + """ + self._upgraded = val + + +class HttpRequestParser(HttpParser[RawRequestMessage]): + """Read request status line. + + Exception .http_exceptions.BadStatusLine + could be raised in case of any errors in status line. + Returns RawRequestMessage. + """ + + def parse_message(self, lines: List[bytes]) -> RawRequestMessage: + # request line + line = lines[0].decode("utf-8", "surrogateescape") + try: + method, path, version = line.split(None, 2) + except ValueError: + raise BadStatusLine(line) from None + + if len(path) > self.max_line_size: + raise LineTooLong( + "Status line is too long", str(self.max_line_size), str(len(path)) + ) + + # method + if not METHRE.match(method): + raise BadStatusLine(method) + + # version + try: + if version.startswith("HTTP/"): + n1, n2 = version[5:].split(".", 1) + version_o = HttpVersion(int(n1), int(n2)) + else: + raise BadStatusLine(version) + except Exception: + raise BadStatusLine(version) + + if method == "CONNECT": + # authority-form, + # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.3 + url = URL.build(authority=path, encoded=True) + elif path.startswith("/"): + # origin-form, + # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1 + path_part, _hash_separator, url_fragment = path.partition("#") + path_part, _question_mark_separator, qs_part = path_part.partition("?") + + # NOTE: `yarl.URL.build()` is used to mimic what the Cython-based + # NOTE: parser does, otherwise it results into the same + # NOTE: HTTP Request-Line input producing different + # NOTE: `yarl.URL()` objects + url = URL.build( + path=path_part, + query_string=qs_part, + fragment=url_fragment, + encoded=True, + ) + else: + # absolute-form for proxy maybe, + # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.2 + url = URL(path, encoded=True) + + # read headers + ( + headers, + raw_headers, + close, + compression, + upgrade, + chunked, + ) = self.parse_headers(lines) + + if close is None: # then the headers weren't set in the request + if version_o <= HttpVersion10: # HTTP 1.0 must asks to not close + close = True + else: # HTTP 1.1 must ask to close. + close = False + + return RawRequestMessage( + method, + path, + version_o, + headers, + raw_headers, + close, + compression, + upgrade, + chunked, + url, + ) + + +class HttpResponseParser(HttpParser[RawResponseMessage]): + """Read response status line and headers. + + BadStatusLine could be raised in case of any errors in status line. + Returns RawResponseMessage. + """ + + def parse_message(self, lines: List[bytes]) -> RawResponseMessage: + line = lines[0].decode("utf-8", "surrogateescape") + try: + version, status = line.split(None, 1) + except ValueError: + raise BadStatusLine(line) from None + + try: + status, reason = status.split(None, 1) + except ValueError: + reason = "" + + if len(reason) > self.max_line_size: + raise LineTooLong( + "Status line is too long", str(self.max_line_size), str(len(reason)) + ) + + # version + match = VERSRE.match(version) + if match is None: + raise BadStatusLine(line) + version_o = HttpVersion(int(match.group(1)), int(match.group(2))) + + # The status code is a three-digit number + try: + status_i = int(status) + except ValueError: + raise BadStatusLine(line) from None + + if status_i > 999: + raise BadStatusLine(line) + + # read headers + ( + headers, + raw_headers, + close, + compression, + upgrade, + chunked, + ) = self.parse_headers(lines) + + if close is None: + close = version_o <= HttpVersion10 + + return RawResponseMessage( + version_o, + status_i, + reason.strip(), + headers, + raw_headers, + close, + compression, + upgrade, + chunked, + ) + + +class HttpPayloadParser: + def __init__( + self, + payload: StreamReader, + length: Optional[int] = None, + chunked: bool = False, + compression: Optional[str] = None, + code: Optional[int] = None, + method: Optional[str] = None, + readall: bool = False, + response_with_body: bool = True, + auto_decompress: bool = True, + ) -> None: + self._length = 0 + self._type = ParseState.PARSE_NONE + self._chunk = ChunkState.PARSE_CHUNKED_SIZE + self._chunk_size = 0 + self._chunk_tail = b"" + self._auto_decompress = auto_decompress + self.done = False + + # payload decompression wrapper + if response_with_body and compression and self._auto_decompress: + real_payload: Union[StreamReader, DeflateBuffer] = DeflateBuffer( + payload, compression + ) + else: + real_payload = payload + + # payload parser + if not response_with_body: + # don't parse payload if it's not expected to be received + self._type = ParseState.PARSE_NONE + real_payload.feed_eof() + self.done = True + + elif chunked: + self._type = ParseState.PARSE_CHUNKED + elif length is not None: + self._type = ParseState.PARSE_LENGTH + self._length = length + if self._length == 0: + real_payload.feed_eof() + self.done = True + else: + if readall and code != 204: + self._type = ParseState.PARSE_UNTIL_EOF + elif method in ("PUT", "POST"): + internal_logger.warning( # pragma: no cover + "Content-Length or Transfer-Encoding header is required" + ) + self._type = ParseState.PARSE_NONE + real_payload.feed_eof() + self.done = True + + self.payload = real_payload + + def feed_eof(self) -> None: + if self._type == ParseState.PARSE_UNTIL_EOF: + self.payload.feed_eof() + elif self._type == ParseState.PARSE_LENGTH: + raise ContentLengthError( + "Not enough data for satisfy content length header." + ) + elif self._type == ParseState.PARSE_CHUNKED: + raise TransferEncodingError( + "Not enough data for satisfy transfer length header." + ) + + def feed_data( + self, chunk: bytes, SEP: bytes = b"\r\n", CHUNK_EXT: bytes = b";" + ) -> Tuple[bool, bytes]: + # Read specified amount of bytes + if self._type == ParseState.PARSE_LENGTH: + required = self._length + chunk_len = len(chunk) + + if required >= chunk_len: + self._length = required - chunk_len + self.payload.feed_data(chunk, chunk_len) + if self._length == 0: + self.payload.feed_eof() + return True, b"" + else: + self._length = 0 + self.payload.feed_data(chunk[:required], required) + self.payload.feed_eof() + return True, chunk[required:] + + # Chunked transfer encoding parser + elif self._type == ParseState.PARSE_CHUNKED: + if self._chunk_tail: + chunk = self._chunk_tail + chunk + self._chunk_tail = b"" + + while chunk: + + # read next chunk size + if self._chunk == ChunkState.PARSE_CHUNKED_SIZE: + pos = chunk.find(SEP) + if pos >= 0: + i = chunk.find(CHUNK_EXT, 0, pos) + if i >= 0: + size_b = chunk[:i] # strip chunk-extensions + else: + size_b = chunk[:pos] + + try: + size = int(bytes(size_b), 16) + except ValueError: + exc = TransferEncodingError( + chunk[:pos].decode("ascii", "surrogateescape") + ) + self.payload.set_exception(exc) + raise exc from None + + chunk = chunk[pos + 2 :] + if size == 0: # eof marker + self._chunk = ChunkState.PARSE_MAYBE_TRAILERS + else: + self._chunk = ChunkState.PARSE_CHUNKED_CHUNK + self._chunk_size = size + self.payload.begin_http_chunk_receiving() + else: + self._chunk_tail = chunk + return False, b"" + + # read chunk and feed buffer + if self._chunk == ChunkState.PARSE_CHUNKED_CHUNK: + required = self._chunk_size + chunk_len = len(chunk) + + if required > chunk_len: + self._chunk_size = required - chunk_len + self.payload.feed_data(chunk, chunk_len) + return False, b"" + else: + self._chunk_size = 0 + self.payload.feed_data(chunk[:required], required) + chunk = chunk[required:] + self._chunk = ChunkState.PARSE_CHUNKED_CHUNK_EOF + self.payload.end_http_chunk_receiving() + + # toss the CRLF at the end of the chunk + if self._chunk == ChunkState.PARSE_CHUNKED_CHUNK_EOF: + if chunk[:2] == SEP: + chunk = chunk[2:] + self._chunk = ChunkState.PARSE_CHUNKED_SIZE + else: + self._chunk_tail = chunk + return False, b"" + + # if stream does not contain trailer, after 0\r\n + # we should get another \r\n otherwise + # trailers needs to be skiped until \r\n\r\n + if self._chunk == ChunkState.PARSE_MAYBE_TRAILERS: + head = chunk[:2] + if head == SEP: + # end of stream + self.payload.feed_eof() + return True, chunk[2:] + # Both CR and LF, or only LF may not be received yet. It is + # expected that CRLF or LF will be shown at the very first + # byte next time, otherwise trailers should come. The last + # CRLF which marks the end of response might not be + # contained in the same TCP segment which delivered the + # size indicator. + if not head: + return False, b"" + if head == SEP[:1]: + self._chunk_tail = head + return False, b"" + self._chunk = ChunkState.PARSE_TRAILERS + + # read and discard trailer up to the CRLF terminator + if self._chunk == ChunkState.PARSE_TRAILERS: + pos = chunk.find(SEP) + if pos >= 0: + chunk = chunk[pos + 2 :] + self._chunk = ChunkState.PARSE_MAYBE_TRAILERS + else: + self._chunk_tail = chunk + return False, b"" + + # Read all bytes until eof + elif self._type == ParseState.PARSE_UNTIL_EOF: + self.payload.feed_data(chunk, len(chunk)) + + return False, b"" + + +class DeflateBuffer: + """DeflateStream decompress stream and feed data into specified stream.""" + + decompressor: Any + + def __init__(self, out: StreamReader, encoding: Optional[str]) -> None: + self.out = out + self.size = 0 + self.encoding = encoding + self._started_decoding = False + + if encoding == "br": + if not HAS_BROTLI: # pragma: no cover + raise ContentEncodingError( + "Can not decode content-encoding: brotli (br). " + "Please install `Brotli`" + ) + + class BrotliDecoder: + # Supports both 'brotlipy' and 'Brotli' packages + # since they share an import name. The top branches + # are for 'brotlipy' and bottom branches for 'Brotli' + def __init__(self) -> None: + self._obj = brotli.Decompressor() + + def decompress(self, data: bytes) -> bytes: + if hasattr(self._obj, "decompress"): + return cast(bytes, self._obj.decompress(data)) + return cast(bytes, self._obj.process(data)) + + def flush(self) -> bytes: + if hasattr(self._obj, "flush"): + return cast(bytes, self._obj.flush()) + return b"" + + self.decompressor = BrotliDecoder() + else: + zlib_mode = 16 + zlib.MAX_WBITS if encoding == "gzip" else zlib.MAX_WBITS + self.decompressor = zlib.decompressobj(wbits=zlib_mode) + + def set_exception(self, exc: BaseException) -> None: + self.out.set_exception(exc) + + def feed_data(self, chunk: bytes, size: int) -> None: + if not size: + return + + self.size += size + + # RFC1950 + # bits 0..3 = CM = 0b1000 = 8 = "deflate" + # bits 4..7 = CINFO = 1..7 = windows size. + if ( + not self._started_decoding + and self.encoding == "deflate" + and chunk[0] & 0xF != 8 + ): + # Change the decoder to decompress incorrectly compressed data + # Actually we should issue a warning about non-RFC-compliant data. + self.decompressor = zlib.decompressobj(wbits=-zlib.MAX_WBITS) + + try: + chunk = self.decompressor.decompress(chunk) + except Exception: + raise ContentEncodingError( + "Can not decode content-encoding: %s" % self.encoding + ) + + self._started_decoding = True + + if chunk: + self.out.feed_data(chunk, len(chunk)) + + def feed_eof(self) -> None: + chunk = self.decompressor.flush() + + if chunk or self.size > 0: + self.out.feed_data(chunk, len(chunk)) + if self.encoding == "deflate" and not self.decompressor.eof: + raise ContentEncodingError("deflate") + + self.out.feed_eof() + + def begin_http_chunk_receiving(self) -> None: + self.out.begin_http_chunk_receiving() + + def end_http_chunk_receiving(self) -> None: + self.out.end_http_chunk_receiving() + + +HttpRequestParserPy = HttpRequestParser +HttpResponseParserPy = HttpResponseParser +RawRequestMessagePy = RawRequestMessage +RawResponseMessagePy = RawResponseMessage + +try: + if not NO_EXTENSIONS: + from ._http_parser import ( # type: ignore[import,no-redef] + HttpRequestParser, + HttpResponseParser, + RawRequestMessage, + RawResponseMessage, + ) + + HttpRequestParserC = HttpRequestParser + HttpResponseParserC = HttpResponseParser + RawRequestMessageC = RawRequestMessage + RawResponseMessageC = RawResponseMessage +except ImportError: # pragma: no cover + pass diff --git a/runtime/Lib/site-packages/aiohttp/http_websocket.py b/runtime/Lib/site-packages/aiohttp/http_websocket.py new file mode 100644 index 0000000000000000000000000000000000000000..7e23d185c555f1d1a9d65ce7f96ee39df1d36198 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/http_websocket.py @@ -0,0 +1,701 @@ +"""WebSocket protocol versions 13 and 8.""" + +import asyncio +import collections +import json +import random +import re +import sys +import zlib +from enum import IntEnum +from struct import Struct +from typing import Any, Callable, List, Optional, Pattern, Set, Tuple, Union, cast + +from .base_protocol import BaseProtocol +from .helpers import NO_EXTENSIONS +from .streams import DataQueue +from .typedefs import Final + +__all__ = ( + "WS_CLOSED_MESSAGE", + "WS_CLOSING_MESSAGE", + "WS_KEY", + "WebSocketReader", + "WebSocketWriter", + "WSMessage", + "WebSocketError", + "WSMsgType", + "WSCloseCode", +) + + +class WSCloseCode(IntEnum): + OK = 1000 + GOING_AWAY = 1001 + PROTOCOL_ERROR = 1002 + UNSUPPORTED_DATA = 1003 + ABNORMAL_CLOSURE = 1006 + INVALID_TEXT = 1007 + POLICY_VIOLATION = 1008 + MESSAGE_TOO_BIG = 1009 + MANDATORY_EXTENSION = 1010 + INTERNAL_ERROR = 1011 + SERVICE_RESTART = 1012 + TRY_AGAIN_LATER = 1013 + BAD_GATEWAY = 1014 + + +ALLOWED_CLOSE_CODES: Final[Set[int]] = {int(i) for i in WSCloseCode} + + +class WSMsgType(IntEnum): + # websocket spec types + CONTINUATION = 0x0 + TEXT = 0x1 + BINARY = 0x2 + PING = 0x9 + PONG = 0xA + CLOSE = 0x8 + + # aiohttp specific types + CLOSING = 0x100 + CLOSED = 0x101 + ERROR = 0x102 + + text = TEXT + binary = BINARY + ping = PING + pong = PONG + close = CLOSE + closing = CLOSING + closed = CLOSED + error = ERROR + + +WS_KEY: Final[bytes] = b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11" + + +UNPACK_LEN2 = Struct("!H").unpack_from +UNPACK_LEN3 = Struct("!Q").unpack_from +UNPACK_CLOSE_CODE = Struct("!H").unpack +PACK_LEN1 = Struct("!BB").pack +PACK_LEN2 = Struct("!BBH").pack +PACK_LEN3 = Struct("!BBQ").pack +PACK_CLOSE_CODE = Struct("!H").pack +MSG_SIZE: Final[int] = 2**14 +DEFAULT_LIMIT: Final[int] = 2**16 + + +_WSMessageBase = collections.namedtuple("_WSMessageBase", ["type", "data", "extra"]) + + +class WSMessage(_WSMessageBase): + def json(self, *, loads: Callable[[Any], Any] = json.loads) -> Any: + """Return parsed JSON data. + + .. versionadded:: 0.22 + """ + return loads(self.data) + + +WS_CLOSED_MESSAGE = WSMessage(WSMsgType.CLOSED, None, None) +WS_CLOSING_MESSAGE = WSMessage(WSMsgType.CLOSING, None, None) + + +class WebSocketError(Exception): + """WebSocket protocol parser error.""" + + def __init__(self, code: int, message: str) -> None: + self.code = code + super().__init__(code, message) + + def __str__(self) -> str: + return cast(str, self.args[1]) + + +class WSHandshakeError(Exception): + """WebSocket protocol handshake error.""" + + +native_byteorder: Final[str] = sys.byteorder + + +# Used by _websocket_mask_python +_XOR_TABLE: Final[List[bytes]] = [bytes(a ^ b for a in range(256)) for b in range(256)] + + +def _websocket_mask_python(mask: bytes, data: bytearray) -> None: + """Websocket masking function. + + `mask` is a `bytes` object of length 4; `data` is a `bytearray` + object of any length. The contents of `data` are masked with `mask`, + as specified in section 5.3 of RFC 6455. + + Note that this function mutates the `data` argument. + + This pure-python implementation may be replaced by an optimized + version when available. + + """ + assert isinstance(data, bytearray), data + assert len(mask) == 4, mask + + if data: + a, b, c, d = (_XOR_TABLE[n] for n in mask) + data[::4] = data[::4].translate(a) + data[1::4] = data[1::4].translate(b) + data[2::4] = data[2::4].translate(c) + data[3::4] = data[3::4].translate(d) + + +if NO_EXTENSIONS: # pragma: no cover + _websocket_mask = _websocket_mask_python +else: + try: + from ._websocket import _websocket_mask_cython # type: ignore[import] + + _websocket_mask = _websocket_mask_cython + except ImportError: # pragma: no cover + _websocket_mask = _websocket_mask_python + +_WS_DEFLATE_TRAILING: Final[bytes] = bytes([0x00, 0x00, 0xFF, 0xFF]) + + +_WS_EXT_RE: Final[Pattern[str]] = re.compile( + r"^(?:;\s*(?:" + r"(server_no_context_takeover)|" + r"(client_no_context_takeover)|" + r"(server_max_window_bits(?:=(\d+))?)|" + r"(client_max_window_bits(?:=(\d+))?)))*$" +) + +_WS_EXT_RE_SPLIT: Final[Pattern[str]] = re.compile(r"permessage-deflate([^,]+)?") + + +def ws_ext_parse(extstr: Optional[str], isserver: bool = False) -> Tuple[int, bool]: + if not extstr: + return 0, False + + compress = 0 + notakeover = False + for ext in _WS_EXT_RE_SPLIT.finditer(extstr): + defext = ext.group(1) + # Return compress = 15 when get `permessage-deflate` + if not defext: + compress = 15 + break + match = _WS_EXT_RE.match(defext) + if match: + compress = 15 + if isserver: + # Server never fail to detect compress handshake. + # Server does not need to send max wbit to client + if match.group(4): + compress = int(match.group(4)) + # Group3 must match if group4 matches + # Compress wbit 8 does not support in zlib + # If compress level not support, + # CONTINUE to next extension + if compress > 15 or compress < 9: + compress = 0 + continue + if match.group(1): + notakeover = True + # Ignore regex group 5 & 6 for client_max_window_bits + break + else: + if match.group(6): + compress = int(match.group(6)) + # Group5 must match if group6 matches + # Compress wbit 8 does not support in zlib + # If compress level not support, + # FAIL the parse progress + if compress > 15 or compress < 9: + raise WSHandshakeError("Invalid window size") + if match.group(2): + notakeover = True + # Ignore regex group 5 & 6 for client_max_window_bits + break + # Return Fail if client side and not match + elif not isserver: + raise WSHandshakeError("Extension for deflate not supported" + ext.group(1)) + + return compress, notakeover + + +def ws_ext_gen( + compress: int = 15, isserver: bool = False, server_notakeover: bool = False +) -> str: + # client_notakeover=False not used for server + # compress wbit 8 does not support in zlib + if compress < 9 or compress > 15: + raise ValueError( + "Compress wbits must between 9 and 15, " "zlib does not support wbits=8" + ) + enabledext = ["permessage-deflate"] + if not isserver: + enabledext.append("client_max_window_bits") + + if compress < 15: + enabledext.append("server_max_window_bits=" + str(compress)) + if server_notakeover: + enabledext.append("server_no_context_takeover") + # if client_notakeover: + # enabledext.append('client_no_context_takeover') + return "; ".join(enabledext) + + +class WSParserState(IntEnum): + READ_HEADER = 1 + READ_PAYLOAD_LENGTH = 2 + READ_PAYLOAD_MASK = 3 + READ_PAYLOAD = 4 + + +class WebSocketReader: + def __init__( + self, queue: DataQueue[WSMessage], max_msg_size: int, compress: bool = True + ) -> None: + self.queue = queue + self._max_msg_size = max_msg_size + + self._exc: Optional[BaseException] = None + self._partial = bytearray() + self._state = WSParserState.READ_HEADER + + self._opcode: Optional[int] = None + self._frame_fin = False + self._frame_opcode: Optional[int] = None + self._frame_payload = bytearray() + + self._tail = b"" + self._has_mask = False + self._frame_mask: Optional[bytes] = None + self._payload_length = 0 + self._payload_length_flag = 0 + self._compressed: Optional[bool] = None + self._decompressobj: Any = None # zlib.decompressobj actually + self._compress = compress + + def feed_eof(self) -> None: + self.queue.feed_eof() + + def feed_data(self, data: bytes) -> Tuple[bool, bytes]: + if self._exc: + return True, data + + try: + return self._feed_data(data) + except Exception as exc: + self._exc = exc + self.queue.set_exception(exc) + return True, b"" + + def _feed_data(self, data: bytes) -> Tuple[bool, bytes]: + for fin, opcode, payload, compressed in self.parse_frame(data): + if compressed and not self._decompressobj: + self._decompressobj = zlib.decompressobj(wbits=-zlib.MAX_WBITS) + if opcode == WSMsgType.CLOSE: + if len(payload) >= 2: + close_code = UNPACK_CLOSE_CODE(payload[:2])[0] + if close_code < 3000 and close_code not in ALLOWED_CLOSE_CODES: + raise WebSocketError( + WSCloseCode.PROTOCOL_ERROR, + f"Invalid close code: {close_code}", + ) + try: + close_message = payload[2:].decode("utf-8") + except UnicodeDecodeError as exc: + raise WebSocketError( + WSCloseCode.INVALID_TEXT, "Invalid UTF-8 text message" + ) from exc + msg = WSMessage(WSMsgType.CLOSE, close_code, close_message) + elif payload: + raise WebSocketError( + WSCloseCode.PROTOCOL_ERROR, + f"Invalid close frame: {fin} {opcode} {payload!r}", + ) + else: + msg = WSMessage(WSMsgType.CLOSE, 0, "") + + self.queue.feed_data(msg, 0) + + elif opcode == WSMsgType.PING: + self.queue.feed_data( + WSMessage(WSMsgType.PING, payload, ""), len(payload) + ) + + elif opcode == WSMsgType.PONG: + self.queue.feed_data( + WSMessage(WSMsgType.PONG, payload, ""), len(payload) + ) + + elif ( + opcode not in (WSMsgType.TEXT, WSMsgType.BINARY) + and self._opcode is None + ): + raise WebSocketError( + WSCloseCode.PROTOCOL_ERROR, f"Unexpected opcode={opcode!r}" + ) + else: + # load text/binary + if not fin: + # got partial frame payload + if opcode != WSMsgType.CONTINUATION: + self._opcode = opcode + self._partial.extend(payload) + if self._max_msg_size and len(self._partial) >= self._max_msg_size: + raise WebSocketError( + WSCloseCode.MESSAGE_TOO_BIG, + "Message size {} exceeds limit {}".format( + len(self._partial), self._max_msg_size + ), + ) + else: + # previous frame was non finished + # we should get continuation opcode + if self._partial: + if opcode != WSMsgType.CONTINUATION: + raise WebSocketError( + WSCloseCode.PROTOCOL_ERROR, + "The opcode in non-fin frame is expected " + "to be zero, got {!r}".format(opcode), + ) + + if opcode == WSMsgType.CONTINUATION: + assert self._opcode is not None + opcode = self._opcode + self._opcode = None + + self._partial.extend(payload) + if self._max_msg_size and len(self._partial) >= self._max_msg_size: + raise WebSocketError( + WSCloseCode.MESSAGE_TOO_BIG, + "Message size {} exceeds limit {}".format( + len(self._partial), self._max_msg_size + ), + ) + + # Decompress process must to be done after all packets + # received. + if compressed: + self._partial.extend(_WS_DEFLATE_TRAILING) + payload_merged = self._decompressobj.decompress( + self._partial, self._max_msg_size + ) + if self._decompressobj.unconsumed_tail: + left = len(self._decompressobj.unconsumed_tail) + raise WebSocketError( + WSCloseCode.MESSAGE_TOO_BIG, + "Decompressed message size {} exceeds limit {}".format( + self._max_msg_size + left, self._max_msg_size + ), + ) + else: + payload_merged = bytes(self._partial) + + self._partial.clear() + + if opcode == WSMsgType.TEXT: + try: + text = payload_merged.decode("utf-8") + self.queue.feed_data( + WSMessage(WSMsgType.TEXT, text, ""), len(text) + ) + except UnicodeDecodeError as exc: + raise WebSocketError( + WSCloseCode.INVALID_TEXT, "Invalid UTF-8 text message" + ) from exc + else: + self.queue.feed_data( + WSMessage(WSMsgType.BINARY, payload_merged, ""), + len(payload_merged), + ) + + return False, b"" + + def parse_frame( + self, buf: bytes + ) -> List[Tuple[bool, Optional[int], bytearray, Optional[bool]]]: + """Return the next frame from the socket.""" + frames = [] + if self._tail: + buf, self._tail = self._tail + buf, b"" + + start_pos = 0 + buf_length = len(buf) + + while True: + # read header + if self._state == WSParserState.READ_HEADER: + if buf_length - start_pos >= 2: + data = buf[start_pos : start_pos + 2] + start_pos += 2 + first_byte, second_byte = data + + fin = (first_byte >> 7) & 1 + rsv1 = (first_byte >> 6) & 1 + rsv2 = (first_byte >> 5) & 1 + rsv3 = (first_byte >> 4) & 1 + opcode = first_byte & 0xF + + # frame-fin = %x0 ; more frames of this message follow + # / %x1 ; final frame of this message + # frame-rsv1 = %x0 ; + # 1 bit, MUST be 0 unless negotiated otherwise + # frame-rsv2 = %x0 ; + # 1 bit, MUST be 0 unless negotiated otherwise + # frame-rsv3 = %x0 ; + # 1 bit, MUST be 0 unless negotiated otherwise + # + # Remove rsv1 from this test for deflate development + if rsv2 or rsv3 or (rsv1 and not self._compress): + raise WebSocketError( + WSCloseCode.PROTOCOL_ERROR, + "Received frame with non-zero reserved bits", + ) + + if opcode > 0x7 and fin == 0: + raise WebSocketError( + WSCloseCode.PROTOCOL_ERROR, + "Received fragmented control frame", + ) + + has_mask = (second_byte >> 7) & 1 + length = second_byte & 0x7F + + # Control frames MUST have a payload + # length of 125 bytes or less + if opcode > 0x7 and length > 125: + raise WebSocketError( + WSCloseCode.PROTOCOL_ERROR, + "Control frame payload cannot be " "larger than 125 bytes", + ) + + # Set compress status if last package is FIN + # OR set compress status if this is first fragment + # Raise error if not first fragment with rsv1 = 0x1 + if self._frame_fin or self._compressed is None: + self._compressed = True if rsv1 else False + elif rsv1: + raise WebSocketError( + WSCloseCode.PROTOCOL_ERROR, + "Received frame with non-zero reserved bits", + ) + + self._frame_fin = bool(fin) + self._frame_opcode = opcode + self._has_mask = bool(has_mask) + self._payload_length_flag = length + self._state = WSParserState.READ_PAYLOAD_LENGTH + else: + break + + # read payload length + if self._state == WSParserState.READ_PAYLOAD_LENGTH: + length = self._payload_length_flag + if length == 126: + if buf_length - start_pos >= 2: + data = buf[start_pos : start_pos + 2] + start_pos += 2 + length = UNPACK_LEN2(data)[0] + self._payload_length = length + self._state = ( + WSParserState.READ_PAYLOAD_MASK + if self._has_mask + else WSParserState.READ_PAYLOAD + ) + else: + break + elif length > 126: + if buf_length - start_pos >= 8: + data = buf[start_pos : start_pos + 8] + start_pos += 8 + length = UNPACK_LEN3(data)[0] + self._payload_length = length + self._state = ( + WSParserState.READ_PAYLOAD_MASK + if self._has_mask + else WSParserState.READ_PAYLOAD + ) + else: + break + else: + self._payload_length = length + self._state = ( + WSParserState.READ_PAYLOAD_MASK + if self._has_mask + else WSParserState.READ_PAYLOAD + ) + + # read payload mask + if self._state == WSParserState.READ_PAYLOAD_MASK: + if buf_length - start_pos >= 4: + self._frame_mask = buf[start_pos : start_pos + 4] + start_pos += 4 + self._state = WSParserState.READ_PAYLOAD + else: + break + + if self._state == WSParserState.READ_PAYLOAD: + length = self._payload_length + payload = self._frame_payload + + chunk_len = buf_length - start_pos + if length >= chunk_len: + self._payload_length = length - chunk_len + payload.extend(buf[start_pos:]) + start_pos = buf_length + else: + self._payload_length = 0 + payload.extend(buf[start_pos : start_pos + length]) + start_pos = start_pos + length + + if self._payload_length == 0: + if self._has_mask: + assert self._frame_mask is not None + _websocket_mask(self._frame_mask, payload) + + frames.append( + (self._frame_fin, self._frame_opcode, payload, self._compressed) + ) + + self._frame_payload = bytearray() + self._state = WSParserState.READ_HEADER + else: + break + + self._tail = buf[start_pos:] + + return frames + + +class WebSocketWriter: + def __init__( + self, + protocol: BaseProtocol, + transport: asyncio.Transport, + *, + use_mask: bool = False, + limit: int = DEFAULT_LIMIT, + random: Any = random.Random(), + compress: int = 0, + notakeover: bool = False, + ) -> None: + self.protocol = protocol + self.transport = transport + self.use_mask = use_mask + self.randrange = random.randrange + self.compress = compress + self.notakeover = notakeover + self._closing = False + self._limit = limit + self._output_size = 0 + self._compressobj: Any = None # actually compressobj + + async def _send_frame( + self, message: bytes, opcode: int, compress: Optional[int] = None + ) -> None: + """Send a frame over the websocket with message as its payload.""" + if self._closing and not (opcode & WSMsgType.CLOSE): + raise ConnectionResetError("Cannot write to closing transport") + + rsv = 0 + + # Only compress larger packets (disabled) + # Does small packet needs to be compressed? + # if self.compress and opcode < 8 and len(message) > 124: + if (compress or self.compress) and opcode < 8: + if compress: + # Do not set self._compress if compressing is for this frame + compressobj = zlib.compressobj(level=zlib.Z_BEST_SPEED, wbits=-compress) + else: # self.compress + if not self._compressobj: + self._compressobj = zlib.compressobj( + level=zlib.Z_BEST_SPEED, wbits=-self.compress + ) + compressobj = self._compressobj + + message = compressobj.compress(message) + message = message + compressobj.flush( + zlib.Z_FULL_FLUSH if self.notakeover else zlib.Z_SYNC_FLUSH + ) + if message.endswith(_WS_DEFLATE_TRAILING): + message = message[:-4] + rsv = rsv | 0x40 + + msg_length = len(message) + + use_mask = self.use_mask + if use_mask: + mask_bit = 0x80 + else: + mask_bit = 0 + + if msg_length < 126: + header = PACK_LEN1(0x80 | rsv | opcode, msg_length | mask_bit) + elif msg_length < (1 << 16): + header = PACK_LEN2(0x80 | rsv | opcode, 126 | mask_bit, msg_length) + else: + header = PACK_LEN3(0x80 | rsv | opcode, 127 | mask_bit, msg_length) + if use_mask: + mask = self.randrange(0, 0xFFFFFFFF) + mask = mask.to_bytes(4, "big") + message = bytearray(message) + _websocket_mask(mask, message) + self._write(header + mask + message) + self._output_size += len(header) + len(mask) + len(message) + else: + if len(message) > MSG_SIZE: + self._write(header) + self._write(message) + else: + self._write(header + message) + + self._output_size += len(header) + len(message) + + if self._output_size > self._limit: + self._output_size = 0 + await self.protocol._drain_helper() + + def _write(self, data: bytes) -> None: + if self.transport is None or self.transport.is_closing(): + raise ConnectionResetError("Cannot write to closing transport") + self.transport.write(data) + + async def pong(self, message: bytes = b"") -> None: + """Send pong message.""" + if isinstance(message, str): + message = message.encode("utf-8") + await self._send_frame(message, WSMsgType.PONG) + + async def ping(self, message: bytes = b"") -> None: + """Send ping message.""" + if isinstance(message, str): + message = message.encode("utf-8") + await self._send_frame(message, WSMsgType.PING) + + async def send( + self, + message: Union[str, bytes], + binary: bool = False, + compress: Optional[int] = None, + ) -> None: + """Send a frame over the websocket with message as its payload.""" + if isinstance(message, str): + message = message.encode("utf-8") + if binary: + await self._send_frame(message, WSMsgType.BINARY, compress) + else: + await self._send_frame(message, WSMsgType.TEXT, compress) + + async def close(self, code: int = 1000, message: bytes = b"") -> None: + """Close the websocket, sending the specified code and message.""" + if isinstance(message, str): + message = message.encode("utf-8") + try: + await self._send_frame( + PACK_CLOSE_CODE(code) + message, opcode=WSMsgType.CLOSE + ) + finally: + self._closing = True diff --git a/runtime/Lib/site-packages/aiohttp/http_writer.py b/runtime/Lib/site-packages/aiohttp/http_writer.py new file mode 100644 index 0000000000000000000000000000000000000000..dd0daf86cf190d6bcbc76ac71a68b06550236ff2 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/http_writer.py @@ -0,0 +1,200 @@ +"""Http related parsers and protocol.""" + +import asyncio +import zlib +from typing import Any, Awaitable, Callable, NamedTuple, Optional, Union # noqa + +from multidict import CIMultiDict + +from .abc import AbstractStreamWriter +from .base_protocol import BaseProtocol +from .helpers import NO_EXTENSIONS + +__all__ = ("StreamWriter", "HttpVersion", "HttpVersion10", "HttpVersion11") + + +class HttpVersion(NamedTuple): + major: int + minor: int + + +HttpVersion10 = HttpVersion(1, 0) +HttpVersion11 = HttpVersion(1, 1) + + +_T_OnChunkSent = Optional[Callable[[bytes], Awaitable[None]]] +_T_OnHeadersSent = Optional[Callable[["CIMultiDict[str]"], Awaitable[None]]] + + +class StreamWriter(AbstractStreamWriter): + def __init__( + self, + protocol: BaseProtocol, + loop: asyncio.AbstractEventLoop, + on_chunk_sent: _T_OnChunkSent = None, + on_headers_sent: _T_OnHeadersSent = None, + ) -> None: + self._protocol = protocol + self._transport = protocol.transport + + self.loop = loop + self.length = None + self.chunked = False + self.buffer_size = 0 + self.output_size = 0 + + self._eof = False + self._compress: Any = None + self._drain_waiter = None + + self._on_chunk_sent: _T_OnChunkSent = on_chunk_sent + self._on_headers_sent: _T_OnHeadersSent = on_headers_sent + + @property + def transport(self) -> Optional[asyncio.Transport]: + return self._transport + + @property + def protocol(self) -> BaseProtocol: + return self._protocol + + def enable_chunking(self) -> None: + self.chunked = True + + def enable_compression( + self, encoding: str = "deflate", strategy: int = zlib.Z_DEFAULT_STRATEGY + ) -> None: + zlib_mode = 16 + zlib.MAX_WBITS if encoding == "gzip" else zlib.MAX_WBITS + self._compress = zlib.compressobj(wbits=zlib_mode, strategy=strategy) + + def _write(self, chunk: bytes) -> None: + size = len(chunk) + self.buffer_size += size + self.output_size += size + + if self._transport is None or self._transport.is_closing(): + raise ConnectionResetError("Cannot write to closing transport") + self._transport.write(chunk) + + async def write( + self, chunk: bytes, *, drain: bool = True, LIMIT: int = 0x10000 + ) -> None: + """Writes chunk of data to a stream. + + write_eof() indicates end of stream. + writer can't be used after write_eof() method being called. + write() return drain future. + """ + if self._on_chunk_sent is not None: + await self._on_chunk_sent(chunk) + + if isinstance(chunk, memoryview): + if chunk.nbytes != len(chunk): + # just reshape it + chunk = chunk.cast("c") + + if self._compress is not None: + chunk = self._compress.compress(chunk) + if not chunk: + return + + if self.length is not None: + chunk_len = len(chunk) + if self.length >= chunk_len: + self.length = self.length - chunk_len + else: + chunk = chunk[: self.length] + self.length = 0 + if not chunk: + return + + if chunk: + if self.chunked: + chunk_len_pre = ("%x\r\n" % len(chunk)).encode("ascii") + chunk = chunk_len_pre + chunk + b"\r\n" + + self._write(chunk) + + if self.buffer_size > LIMIT and drain: + self.buffer_size = 0 + await self.drain() + + async def write_headers( + self, status_line: str, headers: "CIMultiDict[str]" + ) -> None: + """Write request/response status and headers.""" + if self._on_headers_sent is not None: + await self._on_headers_sent(headers) + + # status + headers + buf = _serialize_headers(status_line, headers) + self._write(buf) + + async def write_eof(self, chunk: bytes = b"") -> None: + if self._eof: + return + + if chunk and self._on_chunk_sent is not None: + await self._on_chunk_sent(chunk) + + if self._compress: + if chunk: + chunk = self._compress.compress(chunk) + + chunk = chunk + self._compress.flush() + if chunk and self.chunked: + chunk_len = ("%x\r\n" % len(chunk)).encode("ascii") + chunk = chunk_len + chunk + b"\r\n0\r\n\r\n" + else: + if self.chunked: + if chunk: + chunk_len = ("%x\r\n" % len(chunk)).encode("ascii") + chunk = chunk_len + chunk + b"\r\n0\r\n\r\n" + else: + chunk = b"0\r\n\r\n" + + if chunk: + self._write(chunk) + + await self.drain() + + self._eof = True + self._transport = None + + async def drain(self) -> None: + """Flush the write buffer. + + The intended use is to write + + await w.write(data) + await w.drain() + """ + if self._protocol.transport is not None: + await self._protocol._drain_helper() + + +def _safe_header(string: str) -> str: + if "\r" in string or "\n" in string: + raise ValueError( + "Newline or carriage return detected in headers. " + "Potential header injection attack." + ) + return string + + +def _py_serialize_headers(status_line: str, headers: "CIMultiDict[str]") -> bytes: + headers_gen = (_safe_header(k) + ": " + _safe_header(v) for k, v in headers.items()) + line = status_line + "\r\n" + "\r\n".join(headers_gen) + "\r\n\r\n" + return line.encode("utf-8") + + +_serialize_headers = _py_serialize_headers + +try: + import aiohttp._http_writer as _http_writer # type: ignore[import] + + _c_serialize_headers = _http_writer._serialize_headers + if not NO_EXTENSIONS: + _serialize_headers = _c_serialize_headers +except ImportError: + pass diff --git a/runtime/Lib/site-packages/aiohttp/locks.py b/runtime/Lib/site-packages/aiohttp/locks.py new file mode 100644 index 0000000000000000000000000000000000000000..fbfff2fa42cc29d377e29552092744899c10d640 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/locks.py @@ -0,0 +1,41 @@ +import asyncio +import collections +from typing import Any, Deque, Optional + + +class EventResultOrError: + """Event asyncio lock helper class. + + Wraps the Event asyncio lock allowing either to awake the + locked Tasks without any error or raising an exception. + + thanks to @vorpalsmith for the simple design. + """ + + def __init__(self, loop: asyncio.AbstractEventLoop) -> None: + self._loop = loop + self._exc: Optional[BaseException] = None + self._event = asyncio.Event() + self._waiters: Deque[asyncio.Future[Any]] = collections.deque() + + def set(self, exc: Optional[BaseException] = None) -> None: + self._exc = exc + self._event.set() + + async def wait(self) -> Any: + waiter = self._loop.create_task(self._event.wait()) + self._waiters.append(waiter) + try: + val = await waiter + finally: + self._waiters.remove(waiter) + + if self._exc is not None: + raise self._exc + + return val + + def cancel(self) -> None: + """Cancel all waiters""" + for waiter in self._waiters: + waiter.cancel() diff --git a/runtime/Lib/site-packages/aiohttp/log.py b/runtime/Lib/site-packages/aiohttp/log.py new file mode 100644 index 0000000000000000000000000000000000000000..d1314145b262658992db308631a13bac6948f7f8 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/log.py @@ -0,0 +1,8 @@ +import logging + +access_logger = logging.getLogger("aiohttp.access") +client_logger = logging.getLogger("aiohttp.client") +internal_logger = logging.getLogger("aiohttp.internal") +server_logger = logging.getLogger("aiohttp.server") +web_logger = logging.getLogger("aiohttp.web") +ws_logger = logging.getLogger("aiohttp.websocket") diff --git a/runtime/Lib/site-packages/aiohttp/multipart.py b/runtime/Lib/site-packages/aiohttp/multipart.py new file mode 100644 index 0000000000000000000000000000000000000000..39f7a39ac8d458ab270c10e898fe1371e80257d0 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/multipart.py @@ -0,0 +1,961 @@ +import base64 +import binascii +import json +import re +import uuid +import warnings +import zlib +from collections import deque +from types import TracebackType +from typing import ( + TYPE_CHECKING, + Any, + AsyncIterator, + Deque, + Dict, + Iterator, + List, + Mapping, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) +from urllib.parse import parse_qsl, unquote, urlencode + +from multidict import CIMultiDict, CIMultiDictProxy, MultiMapping + +from .hdrs import ( + CONTENT_DISPOSITION, + CONTENT_ENCODING, + CONTENT_LENGTH, + CONTENT_TRANSFER_ENCODING, + CONTENT_TYPE, +) +from .helpers import CHAR, TOKEN, parse_mimetype, reify +from .http import HeadersParser +from .payload import ( + JsonPayload, + LookupError, + Order, + Payload, + StringPayload, + get_payload, + payload_type, +) +from .streams import StreamReader + +__all__ = ( + "MultipartReader", + "MultipartWriter", + "BodyPartReader", + "BadContentDispositionHeader", + "BadContentDispositionParam", + "parse_content_disposition", + "content_disposition_filename", +) + + +if TYPE_CHECKING: # pragma: no cover + from .client_reqrep import ClientResponse + + +class BadContentDispositionHeader(RuntimeWarning): + pass + + +class BadContentDispositionParam(RuntimeWarning): + pass + + +def parse_content_disposition( + header: Optional[str], +) -> Tuple[Optional[str], Dict[str, str]]: + def is_token(string: str) -> bool: + return bool(string) and TOKEN >= set(string) + + def is_quoted(string: str) -> bool: + return string[0] == string[-1] == '"' + + def is_rfc5987(string: str) -> bool: + return is_token(string) and string.count("'") == 2 + + def is_extended_param(string: str) -> bool: + return string.endswith("*") + + def is_continuous_param(string: str) -> bool: + pos = string.find("*") + 1 + if not pos: + return False + substring = string[pos:-1] if string.endswith("*") else string[pos:] + return substring.isdigit() + + def unescape(text: str, *, chars: str = "".join(map(re.escape, CHAR))) -> str: + return re.sub(f"\\\\([{chars}])", "\\1", text) + + if not header: + return None, {} + + disptype, *parts = header.split(";") + if not is_token(disptype): + warnings.warn(BadContentDispositionHeader(header)) + return None, {} + + params: Dict[str, str] = {} + while parts: + item = parts.pop(0) + + if "=" not in item: + warnings.warn(BadContentDispositionHeader(header)) + return None, {} + + key, value = item.split("=", 1) + key = key.lower().strip() + value = value.lstrip() + + if key in params: + warnings.warn(BadContentDispositionHeader(header)) + return None, {} + + if not is_token(key): + warnings.warn(BadContentDispositionParam(item)) + continue + + elif is_continuous_param(key): + if is_quoted(value): + value = unescape(value[1:-1]) + elif not is_token(value): + warnings.warn(BadContentDispositionParam(item)) + continue + + elif is_extended_param(key): + if is_rfc5987(value): + encoding, _, value = value.split("'", 2) + encoding = encoding or "utf-8" + else: + warnings.warn(BadContentDispositionParam(item)) + continue + + try: + value = unquote(value, encoding, "strict") + except UnicodeDecodeError: # pragma: nocover + warnings.warn(BadContentDispositionParam(item)) + continue + + else: + failed = True + if is_quoted(value): + failed = False + value = unescape(value[1:-1].lstrip("\\/")) + elif is_token(value): + failed = False + elif parts: + # maybe just ; in filename, in any case this is just + # one case fix, for proper fix we need to redesign parser + _value = f"{value};{parts[0]}" + if is_quoted(_value): + parts.pop(0) + value = unescape(_value[1:-1].lstrip("\\/")) + failed = False + + if failed: + warnings.warn(BadContentDispositionHeader(header)) + return None, {} + + params[key] = value + + return disptype.lower(), params + + +def content_disposition_filename( + params: Mapping[str, str], name: str = "filename" +) -> Optional[str]: + name_suf = "%s*" % name + if not params: + return None + elif name_suf in params: + return params[name_suf] + elif name in params: + return params[name] + else: + parts = [] + fnparams = sorted( + (key, value) for key, value in params.items() if key.startswith(name_suf) + ) + for num, (key, value) in enumerate(fnparams): + _, tail = key.split("*", 1) + if tail.endswith("*"): + tail = tail[:-1] + if tail == str(num): + parts.append(value) + else: + break + if not parts: + return None + value = "".join(parts) + if "'" in value: + encoding, _, value = value.split("'", 2) + encoding = encoding or "utf-8" + return unquote(value, encoding, "strict") + return value + + +class MultipartResponseWrapper: + """Wrapper around the MultipartReader. + + It takes care about + underlying connection and close it when it needs in. + """ + + def __init__( + self, + resp: "ClientResponse", + stream: "MultipartReader", + ) -> None: + self.resp = resp + self.stream = stream + + def __aiter__(self) -> "MultipartResponseWrapper": + return self + + async def __anext__( + self, + ) -> Union["MultipartReader", "BodyPartReader"]: + part = await self.next() + if part is None: + raise StopAsyncIteration + return part + + def at_eof(self) -> bool: + """Returns True when all response data had been read.""" + return self.resp.content.at_eof() + + async def next( + self, + ) -> Optional[Union["MultipartReader", "BodyPartReader"]]: + """Emits next multipart reader object.""" + item = await self.stream.next() + if self.stream.at_eof(): + await self.release() + return item + + async def release(self) -> None: + """Release the connection gracefully. + + All remaining content is read to the void. + """ + await self.resp.release() + + +class BodyPartReader: + """Multipart reader for single body part.""" + + chunk_size = 8192 + + def __init__( + self, boundary: bytes, headers: "CIMultiDictProxy[str]", content: StreamReader + ) -> None: + self.headers = headers + self._boundary = boundary + self._content = content + self._at_eof = False + length = self.headers.get(CONTENT_LENGTH, None) + self._length = int(length) if length is not None else None + self._read_bytes = 0 + # TODO: typeing.Deque is not supported by Python 3.5 + self._unread: Deque[bytes] = deque() + self._prev_chunk: Optional[bytes] = None + self._content_eof = 0 + self._cache: Dict[str, Any] = {} + + def __aiter__(self) -> AsyncIterator["BodyPartReader"]: + return self # type: ignore[return-value] + + async def __anext__(self) -> bytes: + part = await self.next() + if part is None: + raise StopAsyncIteration + return part + + async def next(self) -> Optional[bytes]: + item = await self.read() + if not item: + return None + return item + + async def read(self, *, decode: bool = False) -> bytes: + """Reads body part data. + + decode: Decodes data following by encoding + method from Content-Encoding header. If it missed + data remains untouched + """ + if self._at_eof: + return b"" + data = bytearray() + while not self._at_eof: + data.extend(await self.read_chunk(self.chunk_size)) + if decode: + return self.decode(data) + return data + + async def read_chunk(self, size: int = chunk_size) -> bytes: + """Reads body part content chunk of the specified size. + + size: chunk size + """ + if self._at_eof: + return b"" + if self._length: + chunk = await self._read_chunk_from_length(size) + else: + chunk = await self._read_chunk_from_stream(size) + + self._read_bytes += len(chunk) + if self._read_bytes == self._length: + self._at_eof = True + if self._at_eof: + clrf = await self._content.readline() + assert ( + b"\r\n" == clrf + ), "reader did not read all the data or it is malformed" + return chunk + + async def _read_chunk_from_length(self, size: int) -> bytes: + # Reads body part content chunk of the specified size. + # The body part must has Content-Length header with proper value. + assert self._length is not None, "Content-Length required for chunked read" + chunk_size = min(size, self._length - self._read_bytes) + chunk = await self._content.read(chunk_size) + return chunk + + async def _read_chunk_from_stream(self, size: int) -> bytes: + # Reads content chunk of body part with unknown length. + # The Content-Length header for body part is not necessary. + assert ( + size >= len(self._boundary) + 2 + ), "Chunk size must be greater or equal than boundary length + 2" + first_chunk = self._prev_chunk is None + if first_chunk: + self._prev_chunk = await self._content.read(size) + + chunk = await self._content.read(size) + self._content_eof += int(self._content.at_eof()) + assert self._content_eof < 3, "Reading after EOF" + assert self._prev_chunk is not None + window = self._prev_chunk + chunk + sub = b"\r\n" + self._boundary + if first_chunk: + idx = window.find(sub) + else: + idx = window.find(sub, max(0, len(self._prev_chunk) - len(sub))) + if idx >= 0: + # pushing boundary back to content + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", category=DeprecationWarning) + self._content.unread_data(window[idx:]) + if size > idx: + self._prev_chunk = self._prev_chunk[:idx] + chunk = window[len(self._prev_chunk) : idx] + if not chunk: + self._at_eof = True + result = self._prev_chunk + self._prev_chunk = chunk + return result + + async def readline(self) -> bytes: + """Reads body part by line by line.""" + if self._at_eof: + return b"" + + if self._unread: + line = self._unread.popleft() + else: + line = await self._content.readline() + + if line.startswith(self._boundary): + # the very last boundary may not come with \r\n, + # so set single rules for everyone + sline = line.rstrip(b"\r\n") + boundary = self._boundary + last_boundary = self._boundary + b"--" + # ensure that we read exactly the boundary, not something alike + if sline == boundary or sline == last_boundary: + self._at_eof = True + self._unread.append(line) + return b"" + else: + next_line = await self._content.readline() + if next_line.startswith(self._boundary): + line = line[:-2] # strip CRLF but only once + self._unread.append(next_line) + + return line + + async def release(self) -> None: + """Like read(), but reads all the data to the void.""" + if self._at_eof: + return + while not self._at_eof: + await self.read_chunk(self.chunk_size) + + async def text(self, *, encoding: Optional[str] = None) -> str: + """Like read(), but assumes that body part contains text data.""" + data = await self.read(decode=True) + # see https://www.w3.org/TR/html5/forms.html#multipart/form-data-encoding-algorithm # NOQA + # and https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttprequest-send # NOQA + encoding = encoding or self.get_charset(default="utf-8") + return data.decode(encoding) + + async def json(self, *, encoding: Optional[str] = None) -> Optional[Dict[str, Any]]: + """Like read(), but assumes that body parts contains JSON data.""" + data = await self.read(decode=True) + if not data: + return None + encoding = encoding or self.get_charset(default="utf-8") + return cast(Dict[str, Any], json.loads(data.decode(encoding))) + + async def form(self, *, encoding: Optional[str] = None) -> List[Tuple[str, str]]: + """Like read(), but assumes that body parts contain form urlencoded data.""" + data = await self.read(decode=True) + if not data: + return [] + if encoding is not None: + real_encoding = encoding + else: + real_encoding = self.get_charset(default="utf-8") + return parse_qsl( + data.rstrip().decode(real_encoding), + keep_blank_values=True, + encoding=real_encoding, + ) + + def at_eof(self) -> bool: + """Returns True if the boundary was reached or False otherwise.""" + return self._at_eof + + def decode(self, data: bytes) -> bytes: + """Decodes data. + + Decoding is done according the specified Content-Encoding + or Content-Transfer-Encoding headers value. + """ + if CONTENT_TRANSFER_ENCODING in self.headers: + data = self._decode_content_transfer(data) + if CONTENT_ENCODING in self.headers: + return self._decode_content(data) + return data + + def _decode_content(self, data: bytes) -> bytes: + encoding = self.headers.get(CONTENT_ENCODING, "").lower() + + if encoding == "deflate": + return zlib.decompress(data, -zlib.MAX_WBITS) + elif encoding == "gzip": + return zlib.decompress(data, 16 + zlib.MAX_WBITS) + elif encoding == "identity": + return data + else: + raise RuntimeError(f"unknown content encoding: {encoding}") + + def _decode_content_transfer(self, data: bytes) -> bytes: + encoding = self.headers.get(CONTENT_TRANSFER_ENCODING, "").lower() + + if encoding == "base64": + return base64.b64decode(data) + elif encoding == "quoted-printable": + return binascii.a2b_qp(data) + elif encoding in ("binary", "8bit", "7bit"): + return data + else: + raise RuntimeError( + "unknown content transfer encoding: {}" "".format(encoding) + ) + + def get_charset(self, default: str) -> str: + """Returns charset parameter from Content-Type header or default.""" + ctype = self.headers.get(CONTENT_TYPE, "") + mimetype = parse_mimetype(ctype) + return mimetype.parameters.get("charset", default) + + @reify + def name(self) -> Optional[str]: + """Returns name specified in Content-Disposition header. + + If the header is missing or malformed, returns None. + """ + _, params = parse_content_disposition(self.headers.get(CONTENT_DISPOSITION)) + return content_disposition_filename(params, "name") + + @reify + def filename(self) -> Optional[str]: + """Returns filename specified in Content-Disposition header. + + Returns None if the header is missing or malformed. + """ + _, params = parse_content_disposition(self.headers.get(CONTENT_DISPOSITION)) + return content_disposition_filename(params, "filename") + + +@payload_type(BodyPartReader, order=Order.try_first) +class BodyPartReaderPayload(Payload): + def __init__(self, value: BodyPartReader, *args: Any, **kwargs: Any) -> None: + super().__init__(value, *args, **kwargs) + + params: Dict[str, str] = {} + if value.name is not None: + params["name"] = value.name + if value.filename is not None: + params["filename"] = value.filename + + if params: + self.set_content_disposition("attachment", True, **params) + + async def write(self, writer: Any) -> None: + field = self._value + chunk = await field.read_chunk(size=2**16) + while chunk: + await writer.write(field.decode(chunk)) + chunk = await field.read_chunk(size=2**16) + + +class MultipartReader: + """Multipart body reader.""" + + #: Response wrapper, used when multipart readers constructs from response. + response_wrapper_cls = MultipartResponseWrapper + #: Multipart reader class, used to handle multipart/* body parts. + #: None points to type(self) + multipart_reader_cls = None + #: Body part reader class for non multipart/* content types. + part_reader_cls = BodyPartReader + + def __init__(self, headers: Mapping[str, str], content: StreamReader) -> None: + self.headers = headers + self._boundary = ("--" + self._get_boundary()).encode() + self._content = content + self._last_part: Optional[Union["MultipartReader", BodyPartReader]] = None + self._at_eof = False + self._at_bof = True + self._unread: List[bytes] = [] + + def __aiter__( + self, + ) -> AsyncIterator["BodyPartReader"]: + return self # type: ignore[return-value] + + async def __anext__( + self, + ) -> Optional[Union["MultipartReader", BodyPartReader]]: + part = await self.next() + if part is None: + raise StopAsyncIteration + return part + + @classmethod + def from_response( + cls, + response: "ClientResponse", + ) -> MultipartResponseWrapper: + """Constructs reader instance from HTTP response. + + :param response: :class:`~aiohttp.client.ClientResponse` instance + """ + obj = cls.response_wrapper_cls( + response, cls(response.headers, response.content) + ) + return obj + + def at_eof(self) -> bool: + """Returns True if the final boundary was reached, false otherwise.""" + return self._at_eof + + async def next( + self, + ) -> Optional[Union["MultipartReader", BodyPartReader]]: + """Emits the next multipart body part.""" + # So, if we're at BOF, we need to skip till the boundary. + if self._at_eof: + return None + await self._maybe_release_last_part() + if self._at_bof: + await self._read_until_first_boundary() + self._at_bof = False + else: + await self._read_boundary() + if self._at_eof: # we just read the last boundary, nothing to do there + return None + self._last_part = await self.fetch_next_part() + return self._last_part + + async def release(self) -> None: + """Reads all the body parts to the void till the final boundary.""" + while not self._at_eof: + item = await self.next() + if item is None: + break + await item.release() + + async def fetch_next_part( + self, + ) -> Union["MultipartReader", BodyPartReader]: + """Returns the next body part reader.""" + headers = await self._read_headers() + return self._get_part_reader(headers) + + def _get_part_reader( + self, + headers: "CIMultiDictProxy[str]", + ) -> Union["MultipartReader", BodyPartReader]: + """Dispatches the response by the `Content-Type` header. + + Returns a suitable reader instance. + + :param dict headers: Response headers + """ + ctype = headers.get(CONTENT_TYPE, "") + mimetype = parse_mimetype(ctype) + + if mimetype.type == "multipart": + if self.multipart_reader_cls is None: + return type(self)(headers, self._content) + return self.multipart_reader_cls(headers, self._content) + else: + return self.part_reader_cls(self._boundary, headers, self._content) + + def _get_boundary(self) -> str: + mimetype = parse_mimetype(self.headers[CONTENT_TYPE]) + + assert mimetype.type == "multipart", "multipart/* content type expected" + + if "boundary" not in mimetype.parameters: + raise ValueError( + "boundary missed for Content-Type: %s" % self.headers[CONTENT_TYPE] + ) + + boundary = mimetype.parameters["boundary"] + if len(boundary) > 70: + raise ValueError("boundary %r is too long (70 chars max)" % boundary) + + return boundary + + async def _readline(self) -> bytes: + if self._unread: + return self._unread.pop() + return await self._content.readline() + + async def _read_until_first_boundary(self) -> None: + while True: + chunk = await self._readline() + if chunk == b"": + raise ValueError( + "Could not find starting boundary %r" % (self._boundary) + ) + chunk = chunk.rstrip() + if chunk == self._boundary: + return + elif chunk == self._boundary + b"--": + self._at_eof = True + return + + async def _read_boundary(self) -> None: + chunk = (await self._readline()).rstrip() + if chunk == self._boundary: + pass + elif chunk == self._boundary + b"--": + self._at_eof = True + epilogue = await self._readline() + next_line = await self._readline() + + # the epilogue is expected and then either the end of input or the + # parent multipart boundary, if the parent boundary is found then + # it should be marked as unread and handed to the parent for + # processing + if next_line[:2] == b"--": + self._unread.append(next_line) + # otherwise the request is likely missing an epilogue and both + # lines should be passed to the parent for processing + # (this handles the old behavior gracefully) + else: + self._unread.extend([next_line, epilogue]) + else: + raise ValueError(f"Invalid boundary {chunk!r}, expected {self._boundary!r}") + + async def _read_headers(self) -> "CIMultiDictProxy[str]": + lines = [b""] + while True: + chunk = await self._content.readline() + chunk = chunk.strip() + lines.append(chunk) + if not chunk: + break + parser = HeadersParser() + headers, raw_headers = parser.parse_headers(lines) + return headers + + async def _maybe_release_last_part(self) -> None: + """Ensures that the last read body part is read completely.""" + if self._last_part is not None: + if not self._last_part.at_eof(): + await self._last_part.release() + self._unread.extend(self._last_part._unread) + self._last_part = None + + +_Part = Tuple[Payload, str, str] + + +class MultipartWriter(Payload): + """Multipart body writer.""" + + def __init__(self, subtype: str = "mixed", boundary: Optional[str] = None) -> None: + boundary = boundary if boundary is not None else uuid.uuid4().hex + # The underlying Payload API demands a str (utf-8), not bytes, + # so we need to ensure we don't lose anything during conversion. + # As a result, require the boundary to be ASCII only. + # In both situations. + + try: + self._boundary = boundary.encode("ascii") + except UnicodeEncodeError: + raise ValueError("boundary should contain ASCII only chars") from None + ctype = f"multipart/{subtype}; boundary={self._boundary_value}" + + super().__init__(None, content_type=ctype) + + self._parts: List[_Part] = [] + + def __enter__(self) -> "MultipartWriter": + return self + + def __exit__( + self, + exc_type: Optional[Type[BaseException]], + exc_val: Optional[BaseException], + exc_tb: Optional[TracebackType], + ) -> None: + pass + + def __iter__(self) -> Iterator[_Part]: + return iter(self._parts) + + def __len__(self) -> int: + return len(self._parts) + + def __bool__(self) -> bool: + return True + + _valid_tchar_regex = re.compile(rb"\A[!#$%&'*+\-.^_`|~\w]+\Z") + _invalid_qdtext_char_regex = re.compile(rb"[\x00-\x08\x0A-\x1F\x7F]") + + @property + def _boundary_value(self) -> str: + """Wrap boundary parameter value in quotes, if necessary. + + Reads self.boundary and returns a unicode sting. + """ + # Refer to RFCs 7231, 7230, 5234. + # + # parameter = token "=" ( token / quoted-string ) + # token = 1*tchar + # quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE + # qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text + # obs-text = %x80-FF + # quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) + # tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" + # / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" + # / DIGIT / ALPHA + # ; any VCHAR, except delimiters + # VCHAR = %x21-7E + value = self._boundary + if re.match(self._valid_tchar_regex, value): + return value.decode("ascii") # cannot fail + + if re.search(self._invalid_qdtext_char_regex, value): + raise ValueError("boundary value contains invalid characters") + + # escape %x5C and %x22 + quoted_value_content = value.replace(b"\\", b"\\\\") + quoted_value_content = quoted_value_content.replace(b'"', b'\\"') + + return '"' + quoted_value_content.decode("ascii") + '"' + + @property + def boundary(self) -> str: + return self._boundary.decode("ascii") + + def append(self, obj: Any, headers: Optional[MultiMapping[str]] = None) -> Payload: + if headers is None: + headers = CIMultiDict() + + if isinstance(obj, Payload): + obj.headers.update(headers) + return self.append_payload(obj) + else: + try: + payload = get_payload(obj, headers=headers) + except LookupError: + raise TypeError("Cannot create payload from %r" % obj) + else: + return self.append_payload(payload) + + def append_payload(self, payload: Payload) -> Payload: + """Adds a new body part to multipart writer.""" + # compression + encoding: Optional[str] = payload.headers.get( + CONTENT_ENCODING, + "", + ).lower() + if encoding and encoding not in ("deflate", "gzip", "identity"): + raise RuntimeError(f"unknown content encoding: {encoding}") + if encoding == "identity": + encoding = None + + # te encoding + te_encoding: Optional[str] = payload.headers.get( + CONTENT_TRANSFER_ENCODING, + "", + ).lower() + if te_encoding not in ("", "base64", "quoted-printable", "binary"): + raise RuntimeError( + "unknown content transfer encoding: {}" "".format(te_encoding) + ) + if te_encoding == "binary": + te_encoding = None + + # size + size = payload.size + if size is not None and not (encoding or te_encoding): + payload.headers[CONTENT_LENGTH] = str(size) + + self._parts.append((payload, encoding, te_encoding)) # type: ignore[arg-type] + return payload + + def append_json( + self, obj: Any, headers: Optional[MultiMapping[str]] = None + ) -> Payload: + """Helper to append JSON part.""" + if headers is None: + headers = CIMultiDict() + + return self.append_payload(JsonPayload(obj, headers=headers)) + + def append_form( + self, + obj: Union[Sequence[Tuple[str, str]], Mapping[str, str]], + headers: Optional[MultiMapping[str]] = None, + ) -> Payload: + """Helper to append form urlencoded part.""" + assert isinstance(obj, (Sequence, Mapping)) + + if headers is None: + headers = CIMultiDict() + + if isinstance(obj, Mapping): + obj = list(obj.items()) + data = urlencode(obj, doseq=True) + + return self.append_payload( + StringPayload( + data, headers=headers, content_type="application/x-www-form-urlencoded" + ) + ) + + @property + def size(self) -> Optional[int]: + """Size of the payload.""" + total = 0 + for part, encoding, te_encoding in self._parts: + if encoding or te_encoding or part.size is None: + return None + + total += int( + 2 + + len(self._boundary) + + 2 + + part.size # b'--'+self._boundary+b'\r\n' + + len(part._binary_headers) + + 2 # b'\r\n' + ) + + total += 2 + len(self._boundary) + 4 # b'--'+self._boundary+b'--\r\n' + return total + + async def write(self, writer: Any, close_boundary: bool = True) -> None: + """Write body.""" + for part, encoding, te_encoding in self._parts: + await writer.write(b"--" + self._boundary + b"\r\n") + await writer.write(part._binary_headers) + + if encoding or te_encoding: + w = MultipartPayloadWriter(writer) + if encoding: + w.enable_compression(encoding) + if te_encoding: + w.enable_encoding(te_encoding) + await part.write(w) # type: ignore[arg-type] + await w.write_eof() + else: + await part.write(writer) + + await writer.write(b"\r\n") + + if close_boundary: + await writer.write(b"--" + self._boundary + b"--\r\n") + + +class MultipartPayloadWriter: + def __init__(self, writer: Any) -> None: + self._writer = writer + self._encoding: Optional[str] = None + self._compress: Any = None + self._encoding_buffer: Optional[bytearray] = None + + def enable_encoding(self, encoding: str) -> None: + if encoding == "base64": + self._encoding = encoding + self._encoding_buffer = bytearray() + elif encoding == "quoted-printable": + self._encoding = "quoted-printable" + + def enable_compression( + self, encoding: str = "deflate", strategy: int = zlib.Z_DEFAULT_STRATEGY + ) -> None: + zlib_mode = 16 + zlib.MAX_WBITS if encoding == "gzip" else -zlib.MAX_WBITS + self._compress = zlib.compressobj(wbits=zlib_mode, strategy=strategy) + + async def write_eof(self) -> None: + if self._compress is not None: + chunk = self._compress.flush() + if chunk: + self._compress = None + await self.write(chunk) + + if self._encoding == "base64": + if self._encoding_buffer: + await self._writer.write(base64.b64encode(self._encoding_buffer)) + + async def write(self, chunk: bytes) -> None: + if self._compress is not None: + if chunk: + chunk = self._compress.compress(chunk) + if not chunk: + return + + if self._encoding == "base64": + buf = self._encoding_buffer + assert buf is not None + buf.extend(chunk) + + if buf: + div, mod = divmod(len(buf), 3) + enc_chunk, self._encoding_buffer = (buf[: div * 3], buf[div * 3 :]) + if enc_chunk: + b64chunk = base64.b64encode(enc_chunk) + await self._writer.write(b64chunk) + elif self._encoding == "quoted-printable": + await self._writer.write(binascii.b2a_qp(chunk)) + else: + await self._writer.write(chunk) diff --git a/runtime/Lib/site-packages/aiohttp/payload.py b/runtime/Lib/site-packages/aiohttp/payload.py new file mode 100644 index 0000000000000000000000000000000000000000..acfd52ec4203a732412565073bf541b517c56111 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/payload.py @@ -0,0 +1,465 @@ +import asyncio +import enum +import io +import json +import mimetypes +import os +import warnings +from abc import ABC, abstractmethod +from itertools import chain +from typing import ( + IO, + TYPE_CHECKING, + Any, + ByteString, + Dict, + Iterable, + Optional, + TextIO, + Tuple, + Type, + Union, +) + +from multidict import CIMultiDict + +from . import hdrs +from .abc import AbstractStreamWriter +from .helpers import ( + PY_36, + content_disposition_header, + guess_filename, + parse_mimetype, + sentinel, +) +from .streams import StreamReader +from .typedefs import Final, JSONEncoder, _CIMultiDict + +__all__ = ( + "PAYLOAD_REGISTRY", + "get_payload", + "payload_type", + "Payload", + "BytesPayload", + "StringPayload", + "IOBasePayload", + "BytesIOPayload", + "BufferedReaderPayload", + "TextIOPayload", + "StringIOPayload", + "JsonPayload", + "AsyncIterablePayload", +) + +TOO_LARGE_BYTES_BODY: Final[int] = 2**20 # 1 MB + +if TYPE_CHECKING: # pragma: no cover + from typing import List + + +class LookupError(Exception): + pass + + +class Order(str, enum.Enum): + normal = "normal" + try_first = "try_first" + try_last = "try_last" + + +def get_payload(data: Any, *args: Any, **kwargs: Any) -> "Payload": + return PAYLOAD_REGISTRY.get(data, *args, **kwargs) + + +def register_payload( + factory: Type["Payload"], type: Any, *, order: Order = Order.normal +) -> None: + PAYLOAD_REGISTRY.register(factory, type, order=order) + + +class payload_type: + def __init__(self, type: Any, *, order: Order = Order.normal) -> None: + self.type = type + self.order = order + + def __call__(self, factory: Type["Payload"]) -> Type["Payload"]: + register_payload(factory, self.type, order=self.order) + return factory + + +PayloadType = Type["Payload"] +_PayloadRegistryItem = Tuple[PayloadType, Any] + + +class PayloadRegistry: + """Payload registry. + + note: we need zope.interface for more efficient adapter search + """ + + def __init__(self) -> None: + self._first: List[_PayloadRegistryItem] = [] + self._normal: List[_PayloadRegistryItem] = [] + self._last: List[_PayloadRegistryItem] = [] + + def get( + self, + data: Any, + *args: Any, + _CHAIN: "Type[chain[_PayloadRegistryItem]]" = chain, + **kwargs: Any, + ) -> "Payload": + if isinstance(data, Payload): + return data + for factory, type in _CHAIN(self._first, self._normal, self._last): + if isinstance(data, type): + return factory(data, *args, **kwargs) + + raise LookupError() + + def register( + self, factory: PayloadType, type: Any, *, order: Order = Order.normal + ) -> None: + if order is Order.try_first: + self._first.append((factory, type)) + elif order is Order.normal: + self._normal.append((factory, type)) + elif order is Order.try_last: + self._last.append((factory, type)) + else: + raise ValueError(f"Unsupported order {order!r}") + + +class Payload(ABC): + + _default_content_type: str = "application/octet-stream" + _size: Optional[int] = None + + def __init__( + self, + value: Any, + headers: Optional[ + Union[_CIMultiDict, Dict[str, str], Iterable[Tuple[str, str]]] + ] = None, + content_type: Optional[str] = sentinel, + filename: Optional[str] = None, + encoding: Optional[str] = None, + **kwargs: Any, + ) -> None: + self._encoding = encoding + self._filename = filename + self._headers: _CIMultiDict = CIMultiDict() + self._value = value + if content_type is not sentinel and content_type is not None: + self._headers[hdrs.CONTENT_TYPE] = content_type + elif self._filename is not None: + content_type = mimetypes.guess_type(self._filename)[0] + if content_type is None: + content_type = self._default_content_type + self._headers[hdrs.CONTENT_TYPE] = content_type + else: + self._headers[hdrs.CONTENT_TYPE] = self._default_content_type + self._headers.update(headers or {}) + + @property + def size(self) -> Optional[int]: + """Size of the payload.""" + return self._size + + @property + def filename(self) -> Optional[str]: + """Filename of the payload.""" + return self._filename + + @property + def headers(self) -> _CIMultiDict: + """Custom item headers""" + return self._headers + + @property + def _binary_headers(self) -> bytes: + return ( + "".join([k + ": " + v + "\r\n" for k, v in self.headers.items()]).encode( + "utf-8" + ) + + b"\r\n" + ) + + @property + def encoding(self) -> Optional[str]: + """Payload encoding""" + return self._encoding + + @property + def content_type(self) -> str: + """Content type""" + return self._headers[hdrs.CONTENT_TYPE] + + def set_content_disposition( + self, + disptype: str, + quote_fields: bool = True, + _charset: str = "utf-8", + **params: Any, + ) -> None: + """Sets ``Content-Disposition`` header.""" + self._headers[hdrs.CONTENT_DISPOSITION] = content_disposition_header( + disptype, quote_fields=quote_fields, _charset=_charset, **params + ) + + @abstractmethod + async def write(self, writer: AbstractStreamWriter) -> None: + """Write payload. + + writer is an AbstractStreamWriter instance: + """ + + +class BytesPayload(Payload): + def __init__(self, value: ByteString, *args: Any, **kwargs: Any) -> None: + if not isinstance(value, (bytes, bytearray, memoryview)): + raise TypeError(f"value argument must be byte-ish, not {type(value)!r}") + + if "content_type" not in kwargs: + kwargs["content_type"] = "application/octet-stream" + + super().__init__(value, *args, **kwargs) + + if isinstance(value, memoryview): + self._size = value.nbytes + else: + self._size = len(value) + + if self._size > TOO_LARGE_BYTES_BODY: + if PY_36: + kwargs = {"source": self} + else: + kwargs = {} + warnings.warn( + "Sending a large body directly with raw bytes might" + " lock the event loop. You should probably pass an " + "io.BytesIO object instead", + ResourceWarning, + **kwargs, + ) + + async def write(self, writer: AbstractStreamWriter) -> None: + await writer.write(self._value) + + +class StringPayload(BytesPayload): + def __init__( + self, + value: str, + *args: Any, + encoding: Optional[str] = None, + content_type: Optional[str] = None, + **kwargs: Any, + ) -> None: + + if encoding is None: + if content_type is None: + real_encoding = "utf-8" + content_type = "text/plain; charset=utf-8" + else: + mimetype = parse_mimetype(content_type) + real_encoding = mimetype.parameters.get("charset", "utf-8") + else: + if content_type is None: + content_type = "text/plain; charset=%s" % encoding + real_encoding = encoding + + super().__init__( + value.encode(real_encoding), + encoding=real_encoding, + content_type=content_type, + *args, + **kwargs, + ) + + +class StringIOPayload(StringPayload): + def __init__(self, value: IO[str], *args: Any, **kwargs: Any) -> None: + super().__init__(value.read(), *args, **kwargs) + + +class IOBasePayload(Payload): + _value: IO[Any] + + def __init__( + self, value: IO[Any], disposition: str = "attachment", *args: Any, **kwargs: Any + ) -> None: + if "filename" not in kwargs: + kwargs["filename"] = guess_filename(value) + + super().__init__(value, *args, **kwargs) + + if self._filename is not None and disposition is not None: + if hdrs.CONTENT_DISPOSITION not in self.headers: + self.set_content_disposition(disposition, filename=self._filename) + + async def write(self, writer: AbstractStreamWriter) -> None: + loop = asyncio.get_event_loop() + try: + chunk = await loop.run_in_executor(None, self._value.read, 2**16) + while chunk: + await writer.write(chunk) + chunk = await loop.run_in_executor(None, self._value.read, 2**16) + finally: + await loop.run_in_executor(None, self._value.close) + + +class TextIOPayload(IOBasePayload): + _value: TextIO + + def __init__( + self, + value: TextIO, + *args: Any, + encoding: Optional[str] = None, + content_type: Optional[str] = None, + **kwargs: Any, + ) -> None: + + if encoding is None: + if content_type is None: + encoding = "utf-8" + content_type = "text/plain; charset=utf-8" + else: + mimetype = parse_mimetype(content_type) + encoding = mimetype.parameters.get("charset", "utf-8") + else: + if content_type is None: + content_type = "text/plain; charset=%s" % encoding + + super().__init__( + value, + content_type=content_type, + encoding=encoding, + *args, + **kwargs, + ) + + @property + def size(self) -> Optional[int]: + try: + return os.fstat(self._value.fileno()).st_size - self._value.tell() + except OSError: + return None + + async def write(self, writer: AbstractStreamWriter) -> None: + loop = asyncio.get_event_loop() + try: + chunk = await loop.run_in_executor(None, self._value.read, 2**16) + while chunk: + data = ( + chunk.encode(encoding=self._encoding) + if self._encoding + else chunk.encode() + ) + await writer.write(data) + chunk = await loop.run_in_executor(None, self._value.read, 2**16) + finally: + await loop.run_in_executor(None, self._value.close) + + +class BytesIOPayload(IOBasePayload): + @property + def size(self) -> int: + position = self._value.tell() + end = self._value.seek(0, os.SEEK_END) + self._value.seek(position) + return end - position + + +class BufferedReaderPayload(IOBasePayload): + @property + def size(self) -> Optional[int]: + try: + return os.fstat(self._value.fileno()).st_size - self._value.tell() + except OSError: + # data.fileno() is not supported, e.g. + # io.BufferedReader(io.BytesIO(b'data')) + return None + + +class JsonPayload(BytesPayload): + def __init__( + self, + value: Any, + encoding: str = "utf-8", + content_type: str = "application/json", + dumps: JSONEncoder = json.dumps, + *args: Any, + **kwargs: Any, + ) -> None: + + super().__init__( + dumps(value).encode(encoding), + content_type=content_type, + encoding=encoding, + *args, + **kwargs, + ) + + +if TYPE_CHECKING: # pragma: no cover + from typing import AsyncIterable, AsyncIterator + + _AsyncIterator = AsyncIterator[bytes] + _AsyncIterable = AsyncIterable[bytes] +else: + from collections.abc import AsyncIterable, AsyncIterator + + _AsyncIterator = AsyncIterator + _AsyncIterable = AsyncIterable + + +class AsyncIterablePayload(Payload): + + _iter: Optional[_AsyncIterator] = None + + def __init__(self, value: _AsyncIterable, *args: Any, **kwargs: Any) -> None: + if not isinstance(value, AsyncIterable): + raise TypeError( + "value argument must support " + "collections.abc.AsyncIterablebe interface, " + "got {!r}".format(type(value)) + ) + + if "content_type" not in kwargs: + kwargs["content_type"] = "application/octet-stream" + + super().__init__(value, *args, **kwargs) + + self._iter = value.__aiter__() + + async def write(self, writer: AbstractStreamWriter) -> None: + if self._iter: + try: + # iter is not None check prevents rare cases + # when the case iterable is used twice + while True: + chunk = await self._iter.__anext__() + await writer.write(chunk) + except StopAsyncIteration: + self._iter = None + + +class StreamReaderPayload(AsyncIterablePayload): + def __init__(self, value: StreamReader, *args: Any, **kwargs: Any) -> None: + super().__init__(value.iter_any(), *args, **kwargs) + + +PAYLOAD_REGISTRY = PayloadRegistry() +PAYLOAD_REGISTRY.register(BytesPayload, (bytes, bytearray, memoryview)) +PAYLOAD_REGISTRY.register(StringPayload, str) +PAYLOAD_REGISTRY.register(StringIOPayload, io.StringIO) +PAYLOAD_REGISTRY.register(TextIOPayload, io.TextIOBase) +PAYLOAD_REGISTRY.register(BytesIOPayload, io.BytesIO) +PAYLOAD_REGISTRY.register(BufferedReaderPayload, (io.BufferedReader, io.BufferedRandom)) +PAYLOAD_REGISTRY.register(IOBasePayload, io.IOBase) +PAYLOAD_REGISTRY.register(StreamReaderPayload, StreamReader) +# try_last for giving a chance to more specialized async interables like +# multidict.BodyPartReaderPayload override the default +PAYLOAD_REGISTRY.register(AsyncIterablePayload, AsyncIterable, order=Order.try_last) diff --git a/runtime/Lib/site-packages/aiohttp/payload_streamer.py b/runtime/Lib/site-packages/aiohttp/payload_streamer.py new file mode 100644 index 0000000000000000000000000000000000000000..3cc73559190798ee095fb9712d253fbd085ba73c --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/payload_streamer.py @@ -0,0 +1,75 @@ +""" +Payload implemenation for coroutines as data provider. + +As a simple case, you can upload data from file:: + + @aiohttp.streamer + async def file_sender(writer, file_name=None): + with open(file_name, 'rb') as f: + chunk = f.read(2**16) + while chunk: + await writer.write(chunk) + + chunk = f.read(2**16) + +Then you can use `file_sender` like this: + + async with session.post('http://httpbin.org/post', + data=file_sender(file_name='huge_file')) as resp: + print(await resp.text()) + +..note:: Coroutine must accept `writer` as first argument + +""" + +import types +import warnings +from typing import Any, Awaitable, Callable, Dict, Tuple + +from .abc import AbstractStreamWriter +from .payload import Payload, payload_type + +__all__ = ("streamer",) + + +class _stream_wrapper: + def __init__( + self, + coro: Callable[..., Awaitable[None]], + args: Tuple[Any, ...], + kwargs: Dict[str, Any], + ) -> None: + self.coro = types.coroutine(coro) + self.args = args + self.kwargs = kwargs + + async def __call__(self, writer: AbstractStreamWriter) -> None: + await self.coro(writer, *self.args, **self.kwargs) # type: ignore[operator] + + +class streamer: + def __init__(self, coro: Callable[..., Awaitable[None]]) -> None: + warnings.warn( + "@streamer is deprecated, use async generators instead", + DeprecationWarning, + stacklevel=2, + ) + self.coro = coro + + def __call__(self, *args: Any, **kwargs: Any) -> _stream_wrapper: + return _stream_wrapper(self.coro, args, kwargs) + + +@payload_type(_stream_wrapper) +class StreamWrapperPayload(Payload): + async def write(self, writer: AbstractStreamWriter) -> None: + await self._value(writer) + + +@payload_type(streamer) +class StreamPayload(StreamWrapperPayload): + def __init__(self, value: Any, *args: Any, **kwargs: Any) -> None: + super().__init__(value(), *args, **kwargs) + + async def write(self, writer: AbstractStreamWriter) -> None: + await self._value(writer) diff --git a/runtime/Lib/site-packages/aiohttp/py.typed b/runtime/Lib/site-packages/aiohttp/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..1d9f9a52a2f18944337009f77ba0d3cee2752144 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/py.typed @@ -0,0 +1 @@ +Marker diff --git a/runtime/Lib/site-packages/aiohttp/pytest_plugin.py b/runtime/Lib/site-packages/aiohttp/pytest_plugin.py new file mode 100644 index 0000000000000000000000000000000000000000..f9d9862198616fa73fab2650c827075dad9ca15c --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/pytest_plugin.py @@ -0,0 +1,391 @@ +import asyncio +import contextlib +import warnings +from collections.abc import Callable +from typing import Any, Awaitable, Callable, Dict, Generator, Optional, Union + +import pytest + +from aiohttp.helpers import PY_37, isasyncgenfunction +from aiohttp.web import Application + +from .test_utils import ( + BaseTestServer, + RawTestServer, + TestClient, + TestServer, + loop_context, + setup_test_loop, + teardown_test_loop, + unused_port as _unused_port, +) + +try: + import uvloop +except ImportError: # pragma: no cover + uvloop = None + +try: + import tokio +except ImportError: # pragma: no cover + tokio = None + +AiohttpClient = Callable[[Union[Application, BaseTestServer]], Awaitable[TestClient]] + + +def pytest_addoption(parser): # type: ignore[no-untyped-def] + parser.addoption( + "--aiohttp-fast", + action="store_true", + default=False, + help="run tests faster by disabling extra checks", + ) + parser.addoption( + "--aiohttp-loop", + action="store", + default="pyloop", + help="run tests with specific loop: pyloop, uvloop, tokio or all", + ) + parser.addoption( + "--aiohttp-enable-loop-debug", + action="store_true", + default=False, + help="enable event loop debug mode", + ) + + +def pytest_fixture_setup(fixturedef): # type: ignore[no-untyped-def] + """Set up pytest fixture. + + Allow fixtures to be coroutines. Run coroutine fixtures in an event loop. + """ + func = fixturedef.func + + if isasyncgenfunction(func): + # async generator fixture + is_async_gen = True + elif asyncio.iscoroutinefunction(func): + # regular async fixture + is_async_gen = False + else: + # not an async fixture, nothing to do + return + + strip_request = False + if "request" not in fixturedef.argnames: + fixturedef.argnames += ("request",) + strip_request = True + + def wrapper(*args, **kwargs): # type: ignore[no-untyped-def] + request = kwargs["request"] + if strip_request: + del kwargs["request"] + + # if neither the fixture nor the test use the 'loop' fixture, + # 'getfixturevalue' will fail because the test is not parameterized + # (this can be removed someday if 'loop' is no longer parameterized) + if "loop" not in request.fixturenames: + raise Exception( + "Asynchronous fixtures must depend on the 'loop' fixture or " + "be used in tests depending from it." + ) + + _loop = request.getfixturevalue("loop") + + if is_async_gen: + # for async generators, we need to advance the generator once, + # then advance it again in a finalizer + gen = func(*args, **kwargs) + + def finalizer(): # type: ignore[no-untyped-def] + try: + return _loop.run_until_complete(gen.__anext__()) + except StopAsyncIteration: + pass + + request.addfinalizer(finalizer) + return _loop.run_until_complete(gen.__anext__()) + else: + return _loop.run_until_complete(func(*args, **kwargs)) + + fixturedef.func = wrapper + + +@pytest.fixture +def fast(request): # type: ignore[no-untyped-def] + """--fast config option""" + return request.config.getoption("--aiohttp-fast") + + +@pytest.fixture +def loop_debug(request): # type: ignore[no-untyped-def] + """--enable-loop-debug config option""" + return request.config.getoption("--aiohttp-enable-loop-debug") + + +@contextlib.contextmanager +def _runtime_warning_context(): # type: ignore[no-untyped-def] + """Context manager which checks for RuntimeWarnings. + + This exists specifically to + avoid "coroutine 'X' was never awaited" warnings being missed. + + If RuntimeWarnings occur in the context a RuntimeError is raised. + """ + with warnings.catch_warnings(record=True) as _warnings: + yield + rw = [ + "{w.filename}:{w.lineno}:{w.message}".format(w=w) + for w in _warnings + if w.category == RuntimeWarning + ] + if rw: + raise RuntimeError( + "{} Runtime Warning{},\n{}".format( + len(rw), "" if len(rw) == 1 else "s", "\n".join(rw) + ) + ) + + +@contextlib.contextmanager +def _passthrough_loop_context(loop, fast=False): # type: ignore[no-untyped-def] + """Passthrough loop context. + + Sets up and tears down a loop unless one is passed in via the loop + argument when it's passed straight through. + """ + if loop: + # loop already exists, pass it straight through + yield loop + else: + # this shadows loop_context's standard behavior + loop = setup_test_loop() + yield loop + teardown_test_loop(loop, fast=fast) + + +def pytest_pycollect_makeitem(collector, name, obj): # type: ignore[no-untyped-def] + """Fix pytest collecting for coroutines.""" + if collector.funcnamefilter(name) and asyncio.iscoroutinefunction(obj): + return list(collector._genfunctions(name, obj)) + + +def pytest_pyfunc_call(pyfuncitem): # type: ignore[no-untyped-def] + """Run coroutines in an event loop instead of a normal function call.""" + fast = pyfuncitem.config.getoption("--aiohttp-fast") + if asyncio.iscoroutinefunction(pyfuncitem.function): + existing_loop = pyfuncitem.funcargs.get( + "proactor_loop" + ) or pyfuncitem.funcargs.get("loop", None) + with _runtime_warning_context(): + with _passthrough_loop_context(existing_loop, fast=fast) as _loop: + testargs = { + arg: pyfuncitem.funcargs[arg] + for arg in pyfuncitem._fixtureinfo.argnames + } + _loop.run_until_complete(pyfuncitem.obj(**testargs)) + + return True + + +def pytest_generate_tests(metafunc): # type: ignore[no-untyped-def] + if "loop_factory" not in metafunc.fixturenames: + return + + loops = metafunc.config.option.aiohttp_loop + avail_factories = {"pyloop": asyncio.DefaultEventLoopPolicy} + + if uvloop is not None: # pragma: no cover + avail_factories["uvloop"] = uvloop.EventLoopPolicy + + if tokio is not None: # pragma: no cover + avail_factories["tokio"] = tokio.EventLoopPolicy + + if loops == "all": + loops = "pyloop,uvloop?,tokio?" + + factories = {} # type: ignore[var-annotated] + for name in loops.split(","): + required = not name.endswith("?") + name = name.strip(" ?") + if name not in avail_factories: # pragma: no cover + if required: + raise ValueError( + "Unknown loop '%s', available loops: %s" + % (name, list(factories.keys())) + ) + else: + continue + factories[name] = avail_factories[name] + metafunc.parametrize( + "loop_factory", list(factories.values()), ids=list(factories.keys()) + ) + + +@pytest.fixture +def loop(loop_factory, fast, loop_debug): # type: ignore[no-untyped-def] + """Return an instance of the event loop.""" + policy = loop_factory() + asyncio.set_event_loop_policy(policy) + with loop_context(fast=fast) as _loop: + if loop_debug: + _loop.set_debug(True) # pragma: no cover + asyncio.set_event_loop(_loop) + yield _loop + + +@pytest.fixture +def proactor_loop(): # type: ignore[no-untyped-def] + if not PY_37: + policy = asyncio.get_event_loop_policy() + policy._loop_factory = asyncio.ProactorEventLoop # type: ignore[attr-defined] + else: + policy = asyncio.WindowsProactorEventLoopPolicy() # type: ignore[attr-defined] + asyncio.set_event_loop_policy(policy) + + with loop_context(policy.new_event_loop) as _loop: + asyncio.set_event_loop(_loop) + yield _loop + + +@pytest.fixture +def unused_port(aiohttp_unused_port): # type: ignore[no-untyped-def] # pragma: no cover + warnings.warn( + "Deprecated, use aiohttp_unused_port fixture instead", + DeprecationWarning, + stacklevel=2, + ) + return aiohttp_unused_port + + +@pytest.fixture +def aiohttp_unused_port(): # type: ignore[no-untyped-def] + """Return a port that is unused on the current host.""" + return _unused_port + + +@pytest.fixture +def aiohttp_server(loop): # type: ignore[no-untyped-def] + """Factory to create a TestServer instance, given an app. + + aiohttp_server(app, **kwargs) + """ + servers = [] + + async def go(app, *, port=None, **kwargs): # type: ignore[no-untyped-def] + server = TestServer(app, port=port) + await server.start_server(loop=loop, **kwargs) + servers.append(server) + return server + + yield go + + async def finalize() -> None: + while servers: + await servers.pop().close() + + loop.run_until_complete(finalize()) + + +@pytest.fixture +def test_server(aiohttp_server): # type: ignore[no-untyped-def] # pragma: no cover + warnings.warn( + "Deprecated, use aiohttp_server fixture instead", + DeprecationWarning, + stacklevel=2, + ) + return aiohttp_server + + +@pytest.fixture +def aiohttp_raw_server(loop): # type: ignore[no-untyped-def] + """Factory to create a RawTestServer instance, given a web handler. + + aiohttp_raw_server(handler, **kwargs) + """ + servers = [] + + async def go(handler, *, port=None, **kwargs): # type: ignore[no-untyped-def] + server = RawTestServer(handler, port=port) + await server.start_server(loop=loop, **kwargs) + servers.append(server) + return server + + yield go + + async def finalize() -> None: + while servers: + await servers.pop().close() + + loop.run_until_complete(finalize()) + + +@pytest.fixture +def raw_test_server( # type: ignore[no-untyped-def] # pragma: no cover + aiohttp_raw_server, +): + warnings.warn( + "Deprecated, use aiohttp_raw_server fixture instead", + DeprecationWarning, + stacklevel=2, + ) + return aiohttp_raw_server + + +@pytest.fixture +def aiohttp_client( + loop: asyncio.AbstractEventLoop, +) -> Generator[AiohttpClient, None, None]: + """Factory to create a TestClient instance. + + aiohttp_client(app, **kwargs) + aiohttp_client(server, **kwargs) + aiohttp_client(raw_server, **kwargs) + """ + clients = [] + + async def go( + __param: Union[Application, BaseTestServer], + *args: Any, + server_kwargs: Optional[Dict[str, Any]] = None, + **kwargs: Any + ) -> TestClient: + + if isinstance(__param, Callable) and not isinstance( # type: ignore[arg-type] + __param, (Application, BaseTestServer) + ): + __param = __param(loop, *args, **kwargs) + kwargs = {} + else: + assert not args, "args should be empty" + + if isinstance(__param, Application): + server_kwargs = server_kwargs or {} + server = TestServer(__param, loop=loop, **server_kwargs) + client = TestClient(server, loop=loop, **kwargs) + elif isinstance(__param, BaseTestServer): + client = TestClient(__param, loop=loop, **kwargs) + else: + raise ValueError("Unknown argument type: %r" % type(__param)) + + await client.start_server() + clients.append(client) + return client + + yield go + + async def finalize() -> None: + while clients: + await clients.pop().close() + + loop.run_until_complete(finalize()) + + +@pytest.fixture +def test_client(aiohttp_client): # type: ignore[no-untyped-def] # pragma: no cover + warnings.warn( + "Deprecated, use aiohttp_client fixture instead", + DeprecationWarning, + stacklevel=2, + ) + return aiohttp_client diff --git a/runtime/Lib/site-packages/aiohttp/resolver.py b/runtime/Lib/site-packages/aiohttp/resolver.py new file mode 100644 index 0000000000000000000000000000000000000000..02be9fec24e8820d94933b3fbc07a246325c80a1 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/resolver.py @@ -0,0 +1,160 @@ +import asyncio +import socket +from typing import Any, Dict, List, Optional, Type, Union + +from .abc import AbstractResolver +from .helpers import get_running_loop + +__all__ = ("ThreadedResolver", "AsyncResolver", "DefaultResolver") + +try: + import aiodns + + # aiodns_default = hasattr(aiodns.DNSResolver, 'gethostbyname') +except ImportError: # pragma: no cover + aiodns = None + +aiodns_default = False + + +class ThreadedResolver(AbstractResolver): + """Threaded resolver. + + Uses an Executor for synchronous getaddrinfo() calls. + concurrent.futures.ThreadPoolExecutor is used by default. + """ + + def __init__(self, loop: Optional[asyncio.AbstractEventLoop] = None) -> None: + self._loop = get_running_loop(loop) + + async def resolve( + self, hostname: str, port: int = 0, family: int = socket.AF_INET + ) -> List[Dict[str, Any]]: + infos = await self._loop.getaddrinfo( + hostname, + port, + type=socket.SOCK_STREAM, + family=family, + flags=socket.AI_ADDRCONFIG, + ) + + hosts = [] + for family, _, proto, _, address in infos: + if family == socket.AF_INET6: + if len(address) < 3: + # IPv6 is not supported by Python build, + # or IPv6 is not enabled in the host + continue + if address[3]: # type: ignore[misc] + # This is essential for link-local IPv6 addresses. + # LL IPv6 is a VERY rare case. Strictly speaking, we should use + # getnameinfo() unconditionally, but performance makes sense. + host, _port = socket.getnameinfo( + address, socket.NI_NUMERICHOST | socket.NI_NUMERICSERV + ) + port = int(_port) + else: + host, port = address[:2] + else: # IPv4 + assert family == socket.AF_INET + host, port = address # type: ignore[misc] + hosts.append( + { + "hostname": hostname, + "host": host, + "port": port, + "family": family, + "proto": proto, + "flags": socket.AI_NUMERICHOST | socket.AI_NUMERICSERV, + } + ) + + return hosts + + async def close(self) -> None: + pass + + +class AsyncResolver(AbstractResolver): + """Use the `aiodns` package to make asynchronous DNS lookups""" + + def __init__( + self, + loop: Optional[asyncio.AbstractEventLoop] = None, + *args: Any, + **kwargs: Any + ) -> None: + if aiodns is None: + raise RuntimeError("Resolver requires aiodns library") + + self._loop = get_running_loop(loop) + self._resolver = aiodns.DNSResolver(*args, loop=loop, **kwargs) + + if not hasattr(self._resolver, "gethostbyname"): + # aiodns 1.1 is not available, fallback to DNSResolver.query + self.resolve = self._resolve_with_query # type: ignore + + async def resolve( + self, host: str, port: int = 0, family: int = socket.AF_INET + ) -> List[Dict[str, Any]]: + try: + resp = await self._resolver.gethostbyname(host, family) + except aiodns.error.DNSError as exc: + msg = exc.args[1] if len(exc.args) >= 1 else "DNS lookup failed" + raise OSError(msg) from exc + hosts = [] + for address in resp.addresses: + hosts.append( + { + "hostname": host, + "host": address, + "port": port, + "family": family, + "proto": 0, + "flags": socket.AI_NUMERICHOST | socket.AI_NUMERICSERV, + } + ) + + if not hosts: + raise OSError("DNS lookup failed") + + return hosts + + async def _resolve_with_query( + self, host: str, port: int = 0, family: int = socket.AF_INET + ) -> List[Dict[str, Any]]: + if family == socket.AF_INET6: + qtype = "AAAA" + else: + qtype = "A" + + try: + resp = await self._resolver.query(host, qtype) + except aiodns.error.DNSError as exc: + msg = exc.args[1] if len(exc.args) >= 1 else "DNS lookup failed" + raise OSError(msg) from exc + + hosts = [] + for rr in resp: + hosts.append( + { + "hostname": host, + "host": rr.host, + "port": port, + "family": family, + "proto": 0, + "flags": socket.AI_NUMERICHOST, + } + ) + + if not hosts: + raise OSError("DNS lookup failed") + + return hosts + + async def close(self) -> None: + self._resolver.cancel() + + +_DefaultType = Type[Union[AsyncResolver, ThreadedResolver]] +DefaultResolver: _DefaultType = AsyncResolver if aiodns_default else ThreadedResolver diff --git a/runtime/Lib/site-packages/aiohttp/streams.py b/runtime/Lib/site-packages/aiohttp/streams.py new file mode 100644 index 0000000000000000000000000000000000000000..e0e3c2e7cd2f4a9f69a5501cd76f021cbecb401a --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/streams.py @@ -0,0 +1,660 @@ +import asyncio +import collections +import warnings +from typing import Awaitable, Callable, Deque, Generic, List, Optional, Tuple, TypeVar + +from .base_protocol import BaseProtocol +from .helpers import BaseTimerContext, set_exception, set_result +from .log import internal_logger +from .typedefs import Final + +__all__ = ( + "EMPTY_PAYLOAD", + "EofStream", + "StreamReader", + "DataQueue", + "FlowControlDataQueue", +) + +_T = TypeVar("_T") + + +class EofStream(Exception): + """eof stream indication.""" + + +class AsyncStreamIterator(Generic[_T]): + def __init__(self, read_func: Callable[[], Awaitable[_T]]) -> None: + self.read_func = read_func + + def __aiter__(self) -> "AsyncStreamIterator[_T]": + return self + + async def __anext__(self) -> _T: + try: + rv = await self.read_func() + except EofStream: + raise StopAsyncIteration + if rv == b"": + raise StopAsyncIteration + return rv + + +class ChunkTupleAsyncStreamIterator: + def __init__(self, stream: "StreamReader") -> None: + self._stream = stream + + def __aiter__(self) -> "ChunkTupleAsyncStreamIterator": + return self + + async def __anext__(self) -> Tuple[bytes, bool]: + rv = await self._stream.readchunk() + if rv == (b"", False): + raise StopAsyncIteration + return rv + + +class AsyncStreamReaderMixin: + def __aiter__(self) -> AsyncStreamIterator[bytes]: + return AsyncStreamIterator(self.readline) # type: ignore[attr-defined] + + def iter_chunked(self, n: int) -> AsyncStreamIterator[bytes]: + """Returns an asynchronous iterator that yields chunks of size n. + + Python-3.5 available for Python 3.5+ only + """ + return AsyncStreamIterator( + lambda: self.read(n) # type: ignore[attr-defined,no-any-return] + ) + + def iter_any(self) -> AsyncStreamIterator[bytes]: + """Yield all available data as soon as it is received. + + Python-3.5 available for Python 3.5+ only + """ + return AsyncStreamIterator(self.readany) # type: ignore[attr-defined] + + def iter_chunks(self) -> ChunkTupleAsyncStreamIterator: + """Yield chunks of data as they are received by the server. + + The yielded objects are tuples + of (bytes, bool) as returned by the StreamReader.readchunk method. + + Python-3.5 available for Python 3.5+ only + """ + return ChunkTupleAsyncStreamIterator(self) # type: ignore[arg-type] + + +class StreamReader(AsyncStreamReaderMixin): + """An enhancement of asyncio.StreamReader. + + Supports asynchronous iteration by line, chunk or as available:: + + async for line in reader: + ... + async for chunk in reader.iter_chunked(1024): + ... + async for slice in reader.iter_any(): + ... + + """ + + total_bytes = 0 + + def __init__( + self, + protocol: BaseProtocol, + limit: int, + *, + timer: Optional[BaseTimerContext] = None, + loop: Optional[asyncio.AbstractEventLoop] = None, + ) -> None: + self._protocol = protocol + self._low_water = limit + self._high_water = limit * 2 + if loop is None: + loop = asyncio.get_event_loop() + self._loop = loop + self._size = 0 + self._cursor = 0 + self._http_chunk_splits: Optional[List[int]] = None + self._buffer: Deque[bytes] = collections.deque() + self._buffer_offset = 0 + self._eof = False + self._waiter: Optional[asyncio.Future[None]] = None + self._eof_waiter: Optional[asyncio.Future[None]] = None + self._exception: Optional[BaseException] = None + self._timer = timer + self._eof_callbacks: List[Callable[[], None]] = [] + + def __repr__(self) -> str: + info = [self.__class__.__name__] + if self._size: + info.append("%d bytes" % self._size) + if self._eof: + info.append("eof") + if self._low_water != 2**16: # default limit + info.append("low=%d high=%d" % (self._low_water, self._high_water)) + if self._waiter: + info.append("w=%r" % self._waiter) + if self._exception: + info.append("e=%r" % self._exception) + return "<%s>" % " ".join(info) + + def get_read_buffer_limits(self) -> Tuple[int, int]: + return (self._low_water, self._high_water) + + def exception(self) -> Optional[BaseException]: + return self._exception + + def set_exception(self, exc: BaseException) -> None: + self._exception = exc + self._eof_callbacks.clear() + + waiter = self._waiter + if waiter is not None: + self._waiter = None + set_exception(waiter, exc) + + waiter = self._eof_waiter + if waiter is not None: + self._eof_waiter = None + set_exception(waiter, exc) + + def on_eof(self, callback: Callable[[], None]) -> None: + if self._eof: + try: + callback() + except Exception: + internal_logger.exception("Exception in eof callback") + else: + self._eof_callbacks.append(callback) + + def feed_eof(self) -> None: + self._eof = True + + waiter = self._waiter + if waiter is not None: + self._waiter = None + set_result(waiter, None) + + waiter = self._eof_waiter + if waiter is not None: + self._eof_waiter = None + set_result(waiter, None) + + for cb in self._eof_callbacks: + try: + cb() + except Exception: + internal_logger.exception("Exception in eof callback") + + self._eof_callbacks.clear() + + def is_eof(self) -> bool: + """Return True if 'feed_eof' was called.""" + return self._eof + + def at_eof(self) -> bool: + """Return True if the buffer is empty and 'feed_eof' was called.""" + return self._eof and not self._buffer + + async def wait_eof(self) -> None: + if self._eof: + return + + assert self._eof_waiter is None + self._eof_waiter = self._loop.create_future() + try: + await self._eof_waiter + finally: + self._eof_waiter = None + + def unread_data(self, data: bytes) -> None: + """rollback reading some data from stream, inserting it to buffer head.""" + warnings.warn( + "unread_data() is deprecated " + "and will be removed in future releases (#3260)", + DeprecationWarning, + stacklevel=2, + ) + if not data: + return + + if self._buffer_offset: + self._buffer[0] = self._buffer[0][self._buffer_offset :] + self._buffer_offset = 0 + self._size += len(data) + self._cursor -= len(data) + self._buffer.appendleft(data) + self._eof_counter = 0 + + # TODO: size is ignored, remove the param later + def feed_data(self, data: bytes, size: int = 0) -> None: + assert not self._eof, "feed_data after feed_eof" + + if not data: + return + + self._size += len(data) + self._buffer.append(data) + self.total_bytes += len(data) + + waiter = self._waiter + if waiter is not None: + self._waiter = None + set_result(waiter, None) + + if self._size > self._high_water and not self._protocol._reading_paused: + self._protocol.pause_reading() + + def begin_http_chunk_receiving(self) -> None: + if self._http_chunk_splits is None: + if self.total_bytes: + raise RuntimeError( + "Called begin_http_chunk_receiving when" "some data was already fed" + ) + self._http_chunk_splits = [] + + def end_http_chunk_receiving(self) -> None: + if self._http_chunk_splits is None: + raise RuntimeError( + "Called end_chunk_receiving without calling " + "begin_chunk_receiving first" + ) + + # self._http_chunk_splits contains logical byte offsets from start of + # the body transfer. Each offset is the offset of the end of a chunk. + # "Logical" means bytes, accessible for a user. + # If no chunks containig logical data were received, current position + # is difinitely zero. + pos = self._http_chunk_splits[-1] if self._http_chunk_splits else 0 + + if self.total_bytes == pos: + # We should not add empty chunks here. So we check for that. + # Note, when chunked + gzip is used, we can receive a chunk + # of compressed data, but that data may not be enough for gzip FSM + # to yield any uncompressed data. That's why current position may + # not change after receiving a chunk. + return + + self._http_chunk_splits.append(self.total_bytes) + + # wake up readchunk when end of http chunk received + waiter = self._waiter + if waiter is not None: + self._waiter = None + set_result(waiter, None) + + async def _wait(self, func_name: str) -> None: + # StreamReader uses a future to link the protocol feed_data() method + # to a read coroutine. Running two read coroutines at the same time + # would have an unexpected behaviour. It would not possible to know + # which coroutine would get the next data. + if self._waiter is not None: + raise RuntimeError( + "%s() called while another coroutine is " + "already waiting for incoming data" % func_name + ) + + waiter = self._waiter = self._loop.create_future() + try: + if self._timer: + with self._timer: + await waiter + else: + await waiter + finally: + self._waiter = None + + async def readline(self) -> bytes: + return await self.readuntil() + + async def readuntil(self, separator: bytes = b"\n") -> bytes: + seplen = len(separator) + if seplen == 0: + raise ValueError("Separator should be at least one-byte string") + + if self._exception is not None: + raise self._exception + + chunk = b"" + chunk_size = 0 + not_enough = True + + while not_enough: + while self._buffer and not_enough: + offset = self._buffer_offset + ichar = self._buffer[0].find(separator, offset) + 1 + # Read from current offset to found separator or to the end. + data = self._read_nowait_chunk(ichar - offset if ichar else -1) + chunk += data + chunk_size += len(data) + if ichar: + not_enough = False + + if chunk_size > self._high_water: + raise ValueError("Chunk too big") + + if self._eof: + break + + if not_enough: + await self._wait("readuntil") + + return chunk + + async def read(self, n: int = -1) -> bytes: + if self._exception is not None: + raise self._exception + + # migration problem; with DataQueue you have to catch + # EofStream exception, so common way is to run payload.read() inside + # infinite loop. what can cause real infinite loop with StreamReader + # lets keep this code one major release. + if __debug__: + if self._eof and not self._buffer: + self._eof_counter = getattr(self, "_eof_counter", 0) + 1 + if self._eof_counter > 5: + internal_logger.warning( + "Multiple access to StreamReader in eof state, " + "might be infinite loop.", + stack_info=True, + ) + + if not n: + return b"" + + if n < 0: + # This used to just loop creating a new waiter hoping to + # collect everything in self._buffer, but that would + # deadlock if the subprocess sends more than self.limit + # bytes. So just call self.readany() until EOF. + blocks = [] + while True: + block = await self.readany() + if not block: + break + blocks.append(block) + return b"".join(blocks) + + # TODO: should be `if` instead of `while` + # because waiter maybe triggered on chunk end, + # without feeding any data + while not self._buffer and not self._eof: + await self._wait("read") + + return self._read_nowait(n) + + async def readany(self) -> bytes: + if self._exception is not None: + raise self._exception + + # TODO: should be `if` instead of `while` + # because waiter maybe triggered on chunk end, + # without feeding any data + while not self._buffer and not self._eof: + await self._wait("readany") + + return self._read_nowait(-1) + + async def readchunk(self) -> Tuple[bytes, bool]: + """Returns a tuple of (data, end_of_http_chunk). + + When chunked transfer + encoding is used, end_of_http_chunk is a boolean indicating if the end + of the data corresponds to the end of a HTTP chunk , otherwise it is + always False. + """ + while True: + if self._exception is not None: + raise self._exception + + while self._http_chunk_splits: + pos = self._http_chunk_splits.pop(0) + if pos == self._cursor: + return (b"", True) + if pos > self._cursor: + return (self._read_nowait(pos - self._cursor), True) + internal_logger.warning( + "Skipping HTTP chunk end due to data " + "consumption beyond chunk boundary" + ) + + if self._buffer: + return (self._read_nowait_chunk(-1), False) + # return (self._read_nowait(-1), False) + + if self._eof: + # Special case for signifying EOF. + # (b'', True) is not a final return value actually. + return (b"", False) + + await self._wait("readchunk") + + async def readexactly(self, n: int) -> bytes: + if self._exception is not None: + raise self._exception + + blocks: List[bytes] = [] + while n > 0: + block = await self.read(n) + if not block: + partial = b"".join(blocks) + raise asyncio.IncompleteReadError(partial, len(partial) + n) + blocks.append(block) + n -= len(block) + + return b"".join(blocks) + + def read_nowait(self, n: int = -1) -> bytes: + # default was changed to be consistent with .read(-1) + # + # I believe the most users don't know about the method and + # they are not affected. + if self._exception is not None: + raise self._exception + + if self._waiter and not self._waiter.done(): + raise RuntimeError( + "Called while some coroutine is waiting for incoming data." + ) + + return self._read_nowait(n) + + def _read_nowait_chunk(self, n: int) -> bytes: + first_buffer = self._buffer[0] + offset = self._buffer_offset + if n != -1 and len(first_buffer) - offset > n: + data = first_buffer[offset : offset + n] + self._buffer_offset += n + + elif offset: + self._buffer.popleft() + data = first_buffer[offset:] + self._buffer_offset = 0 + + else: + data = self._buffer.popleft() + + self._size -= len(data) + self._cursor += len(data) + + chunk_splits = self._http_chunk_splits + # Prevent memory leak: drop useless chunk splits + while chunk_splits and chunk_splits[0] < self._cursor: + chunk_splits.pop(0) + + if self._size < self._low_water and self._protocol._reading_paused: + self._protocol.resume_reading() + return data + + def _read_nowait(self, n: int) -> bytes: + """Read not more than n bytes, or whole buffer if n == -1""" + chunks = [] + + while self._buffer: + chunk = self._read_nowait_chunk(n) + chunks.append(chunk) + if n != -1: + n -= len(chunk) + if n == 0: + break + + return b"".join(chunks) if chunks else b"" + + +class EmptyStreamReader(StreamReader): # lgtm [py/missing-call-to-init] + def __init__(self) -> None: + pass + + def exception(self) -> Optional[BaseException]: + return None + + def set_exception(self, exc: BaseException) -> None: + pass + + def on_eof(self, callback: Callable[[], None]) -> None: + try: + callback() + except Exception: + internal_logger.exception("Exception in eof callback") + + def feed_eof(self) -> None: + pass + + def is_eof(self) -> bool: + return True + + def at_eof(self) -> bool: + return True + + async def wait_eof(self) -> None: + return + + def feed_data(self, data: bytes, n: int = 0) -> None: + pass + + async def readline(self) -> bytes: + return b"" + + async def read(self, n: int = -1) -> bytes: + return b"" + + # TODO add async def readuntil + + async def readany(self) -> bytes: + return b"" + + async def readchunk(self) -> Tuple[bytes, bool]: + return (b"", True) + + async def readexactly(self, n: int) -> bytes: + raise asyncio.IncompleteReadError(b"", n) + + def read_nowait(self, n: int = -1) -> bytes: + return b"" + + +EMPTY_PAYLOAD: Final[StreamReader] = EmptyStreamReader() + + +class DataQueue(Generic[_T]): + """DataQueue is a general-purpose blocking queue with one reader.""" + + def __init__(self, loop: asyncio.AbstractEventLoop) -> None: + self._loop = loop + self._eof = False + self._waiter: Optional[asyncio.Future[None]] = None + self._exception: Optional[BaseException] = None + self._size = 0 + self._buffer: Deque[Tuple[_T, int]] = collections.deque() + + def __len__(self) -> int: + return len(self._buffer) + + def is_eof(self) -> bool: + return self._eof + + def at_eof(self) -> bool: + return self._eof and not self._buffer + + def exception(self) -> Optional[BaseException]: + return self._exception + + def set_exception(self, exc: BaseException) -> None: + self._eof = True + self._exception = exc + + waiter = self._waiter + if waiter is not None: + self._waiter = None + set_exception(waiter, exc) + + def feed_data(self, data: _T, size: int = 0) -> None: + self._size += size + self._buffer.append((data, size)) + + waiter = self._waiter + if waiter is not None: + self._waiter = None + set_result(waiter, None) + + def feed_eof(self) -> None: + self._eof = True + + waiter = self._waiter + if waiter is not None: + self._waiter = None + set_result(waiter, None) + + async def read(self) -> _T: + if not self._buffer and not self._eof: + assert not self._waiter + self._waiter = self._loop.create_future() + try: + await self._waiter + except (asyncio.CancelledError, asyncio.TimeoutError): + self._waiter = None + raise + + if self._buffer: + data, size = self._buffer.popleft() + self._size -= size + return data + else: + if self._exception is not None: + raise self._exception + else: + raise EofStream + + def __aiter__(self) -> AsyncStreamIterator[_T]: + return AsyncStreamIterator(self.read) + + +class FlowControlDataQueue(DataQueue[_T]): + """FlowControlDataQueue resumes and pauses an underlying stream. + + It is a destination for parsed data. + """ + + def __init__( + self, protocol: BaseProtocol, limit: int, *, loop: asyncio.AbstractEventLoop + ) -> None: + super().__init__(loop=loop) + + self._protocol = protocol + self._limit = limit * 2 + + def feed_data(self, data: _T, size: int = 0) -> None: + super().feed_data(data, size) + + if self._size > self._limit and not self._protocol._reading_paused: + self._protocol.pause_reading() + + async def read(self) -> _T: + try: + return await super().read() + finally: + if self._size < self._limit and self._protocol._reading_paused: + self._protocol.resume_reading() diff --git a/runtime/Lib/site-packages/aiohttp/tcp_helpers.py b/runtime/Lib/site-packages/aiohttp/tcp_helpers.py new file mode 100644 index 0000000000000000000000000000000000000000..8d39ba9e3c818281d45f8525d0cdf112871e2017 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/tcp_helpers.py @@ -0,0 +1,37 @@ +"""Helper methods to tune a TCP connection""" + +import asyncio +import socket +from contextlib import suppress +from typing import Optional # noqa + +__all__ = ("tcp_keepalive", "tcp_nodelay") + + +if hasattr(socket, "SO_KEEPALIVE"): + + def tcp_keepalive(transport: asyncio.Transport) -> None: + sock = transport.get_extra_info("socket") + if sock is not None: + sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) + +else: + + def tcp_keepalive(transport: asyncio.Transport) -> None: # pragma: no cover + pass + + +def tcp_nodelay(transport: asyncio.Transport, value: bool) -> None: + sock = transport.get_extra_info("socket") + + if sock is None: + return + + if sock.family not in (socket.AF_INET, socket.AF_INET6): + return + + value = bool(value) + + # socket may be closed already, on windows OSError get raised + with suppress(OSError): + sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, value) diff --git a/runtime/Lib/site-packages/aiohttp/test_utils.py b/runtime/Lib/site-packages/aiohttp/test_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..4c4b68290e1f4e24f59764aec0d63734fcd1dab4 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/test_utils.py @@ -0,0 +1,706 @@ +"""Utilities shared by tests.""" + +import asyncio +import contextlib +import gc +import inspect +import ipaddress +import os +import socket +import sys +import warnings +from abc import ABC, abstractmethod +from types import TracebackType +from typing import ( + TYPE_CHECKING, + Any, + Callable, + Iterator, + List, + Optional, + Type, + Union, + cast, +) +from unittest import mock + +from aiosignal import Signal +from multidict import CIMultiDict, CIMultiDictProxy +from yarl import URL + +import aiohttp +from aiohttp.client import _RequestContextManager, _WSRequestContextManager + +from . import ClientSession, hdrs +from .abc import AbstractCookieJar +from .client_reqrep import ClientResponse +from .client_ws import ClientWebSocketResponse +from .helpers import PY_38, sentinel +from .http import HttpVersion, RawRequestMessage +from .web import ( + Application, + AppRunner, + BaseRunner, + Request, + Server, + ServerRunner, + SockSite, + UrlMappingMatchInfo, +) +from .web_protocol import _RequestHandler + +if TYPE_CHECKING: # pragma: no cover + from ssl import SSLContext +else: + SSLContext = None + +if PY_38: + from unittest import IsolatedAsyncioTestCase as TestCase +else: + from asynctest import TestCase # type: ignore[no-redef] + +REUSE_ADDRESS = os.name == "posix" and sys.platform != "cygwin" + + +def get_unused_port_socket( + host: str, family: socket.AddressFamily = socket.AF_INET +) -> socket.socket: + return get_port_socket(host, 0, family) + + +def get_port_socket( + host: str, port: int, family: socket.AddressFamily +) -> socket.socket: + s = socket.socket(family, socket.SOCK_STREAM) + if REUSE_ADDRESS: + # Windows has different semantics for SO_REUSEADDR, + # so don't set it. Ref: + # https://docs.microsoft.com/en-us/windows/win32/winsock/using-so-reuseaddr-and-so-exclusiveaddruse + s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + s.bind((host, port)) + return s + + +def unused_port() -> int: + """Return a port that is unused on the current host.""" + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: + s.bind(("127.0.0.1", 0)) + return cast(int, s.getsockname()[1]) + + +class BaseTestServer(ABC): + __test__ = False + + def __init__( + self, + *, + scheme: Union[str, object] = sentinel, + loop: Optional[asyncio.AbstractEventLoop] = None, + host: str = "127.0.0.1", + port: Optional[int] = None, + skip_url_asserts: bool = False, + socket_factory: Callable[ + [str, int, socket.AddressFamily], socket.socket + ] = get_port_socket, + **kwargs: Any, + ) -> None: + self._loop = loop + self.runner: Optional[BaseRunner] = None + self._root: Optional[URL] = None + self.host = host + self.port = port + self._closed = False + self.scheme = scheme + self.skip_url_asserts = skip_url_asserts + self.socket_factory = socket_factory + + async def start_server( + self, loop: Optional[asyncio.AbstractEventLoop] = None, **kwargs: Any + ) -> None: + if self.runner: + return + self._loop = loop + self._ssl = kwargs.pop("ssl", None) + self.runner = await self._make_runner(**kwargs) + await self.runner.setup() + if not self.port: + self.port = 0 + try: + version = ipaddress.ip_address(self.host).version + except ValueError: + version = 4 + family = socket.AF_INET6 if version == 6 else socket.AF_INET + _sock = self.socket_factory(self.host, self.port, family) + self.host, self.port = _sock.getsockname()[:2] + site = SockSite(self.runner, sock=_sock, ssl_context=self._ssl) + await site.start() + server = site._server + assert server is not None + sockets = server.sockets + assert sockets is not None + self.port = sockets[0].getsockname()[1] + if self.scheme is sentinel: + if self._ssl: + scheme = "https" + else: + scheme = "http" + self.scheme = scheme + self._root = URL(f"{self.scheme}://{self.host}:{self.port}") + + @abstractmethod # pragma: no cover + async def _make_runner(self, **kwargs: Any) -> BaseRunner: + pass + + def make_url(self, path: str) -> URL: + assert self._root is not None + url = URL(path) + if not self.skip_url_asserts: + assert not url.is_absolute() + return self._root.join(url) + else: + return URL(str(self._root) + path) + + @property + def started(self) -> bool: + return self.runner is not None + + @property + def closed(self) -> bool: + return self._closed + + @property + def handler(self) -> Server: + # for backward compatibility + # web.Server instance + runner = self.runner + assert runner is not None + assert runner.server is not None + return runner.server + + async def close(self) -> None: + """Close all fixtures created by the test client. + + After that point, the TestClient is no longer usable. + + This is an idempotent function: running close multiple times + will not have any additional effects. + + close is also run when the object is garbage collected, and on + exit when used as a context manager. + + """ + if self.started and not self.closed: + assert self.runner is not None + await self.runner.cleanup() + self._root = None + self.port = None + self._closed = True + + def __enter__(self) -> None: + raise TypeError("Use async with instead") + + def __exit__( + self, + exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + traceback: Optional[TracebackType], + ) -> None: + # __exit__ should exist in pair with __enter__ but never executed + pass # pragma: no cover + + async def __aenter__(self) -> "BaseTestServer": + await self.start_server(loop=self._loop) + return self + + async def __aexit__( + self, + exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + traceback: Optional[TracebackType], + ) -> None: + await self.close() + + +class TestServer(BaseTestServer): + def __init__( + self, + app: Application, + *, + scheme: Union[str, object] = sentinel, + host: str = "127.0.0.1", + port: Optional[int] = None, + **kwargs: Any, + ): + self.app = app + super().__init__(scheme=scheme, host=host, port=port, **kwargs) + + async def _make_runner(self, **kwargs: Any) -> BaseRunner: + return AppRunner(self.app, **kwargs) + + +class RawTestServer(BaseTestServer): + def __init__( + self, + handler: _RequestHandler, + *, + scheme: Union[str, object] = sentinel, + host: str = "127.0.0.1", + port: Optional[int] = None, + **kwargs: Any, + ) -> None: + self._handler = handler + super().__init__(scheme=scheme, host=host, port=port, **kwargs) + + async def _make_runner(self, debug: bool = True, **kwargs: Any) -> ServerRunner: + srv = Server(self._handler, loop=self._loop, debug=debug, **kwargs) + return ServerRunner(srv, debug=debug, **kwargs) + + +class TestClient: + """ + A test client implementation. + + To write functional tests for aiohttp based servers. + + """ + + __test__ = False + + def __init__( + self, + server: BaseTestServer, + *, + cookie_jar: Optional[AbstractCookieJar] = None, + loop: Optional[asyncio.AbstractEventLoop] = None, + **kwargs: Any, + ) -> None: + if not isinstance(server, BaseTestServer): + raise TypeError( + "server must be TestServer " "instance, found type: %r" % type(server) + ) + self._server = server + self._loop = loop + if cookie_jar is None: + cookie_jar = aiohttp.CookieJar(unsafe=True, loop=loop) + self._session = ClientSession(loop=loop, cookie_jar=cookie_jar, **kwargs) + self._closed = False + self._responses: List[ClientResponse] = [] + self._websockets: List[ClientWebSocketResponse] = [] + + async def start_server(self) -> None: + await self._server.start_server(loop=self._loop) + + @property + def host(self) -> str: + return self._server.host + + @property + def port(self) -> Optional[int]: + return self._server.port + + @property + def server(self) -> BaseTestServer: + return self._server + + @property + def app(self) -> Optional[Application]: + return cast(Optional[Application], getattr(self._server, "app", None)) + + @property + def session(self) -> ClientSession: + """An internal aiohttp.ClientSession. + + Unlike the methods on the TestClient, client session requests + do not automatically include the host in the url queried, and + will require an absolute path to the resource. + + """ + return self._session + + def make_url(self, path: str) -> URL: + return self._server.make_url(path) + + async def _request(self, method: str, path: str, **kwargs: Any) -> ClientResponse: + resp = await self._session.request(method, self.make_url(path), **kwargs) + # save it to close later + self._responses.append(resp) + return resp + + def request(self, method: str, path: str, **kwargs: Any) -> _RequestContextManager: + """Routes a request to tested http server. + + The interface is identical to aiohttp.ClientSession.request, + except the loop kwarg is overridden by the instance used by the + test server. + + """ + return _RequestContextManager(self._request(method, path, **kwargs)) + + def get(self, path: str, **kwargs: Any) -> _RequestContextManager: + """Perform an HTTP GET request.""" + return _RequestContextManager(self._request(hdrs.METH_GET, path, **kwargs)) + + def post(self, path: str, **kwargs: Any) -> _RequestContextManager: + """Perform an HTTP POST request.""" + return _RequestContextManager(self._request(hdrs.METH_POST, path, **kwargs)) + + def options(self, path: str, **kwargs: Any) -> _RequestContextManager: + """Perform an HTTP OPTIONS request.""" + return _RequestContextManager(self._request(hdrs.METH_OPTIONS, path, **kwargs)) + + def head(self, path: str, **kwargs: Any) -> _RequestContextManager: + """Perform an HTTP HEAD request.""" + return _RequestContextManager(self._request(hdrs.METH_HEAD, path, **kwargs)) + + def put(self, path: str, **kwargs: Any) -> _RequestContextManager: + """Perform an HTTP PUT request.""" + return _RequestContextManager(self._request(hdrs.METH_PUT, path, **kwargs)) + + def patch(self, path: str, **kwargs: Any) -> _RequestContextManager: + """Perform an HTTP PATCH request.""" + return _RequestContextManager(self._request(hdrs.METH_PATCH, path, **kwargs)) + + def delete(self, path: str, **kwargs: Any) -> _RequestContextManager: + """Perform an HTTP PATCH request.""" + return _RequestContextManager(self._request(hdrs.METH_DELETE, path, **kwargs)) + + def ws_connect(self, path: str, **kwargs: Any) -> _WSRequestContextManager: + """Initiate websocket connection. + + The api corresponds to aiohttp.ClientSession.ws_connect. + + """ + return _WSRequestContextManager(self._ws_connect(path, **kwargs)) + + async def _ws_connect(self, path: str, **kwargs: Any) -> ClientWebSocketResponse: + ws = await self._session.ws_connect(self.make_url(path), **kwargs) + self._websockets.append(ws) + return ws + + async def close(self) -> None: + """Close all fixtures created by the test client. + + After that point, the TestClient is no longer usable. + + This is an idempotent function: running close multiple times + will not have any additional effects. + + close is also run on exit when used as a(n) (asynchronous) + context manager. + + """ + if not self._closed: + for resp in self._responses: + resp.close() + for ws in self._websockets: + await ws.close() + await self._session.close() + await self._server.close() + self._closed = True + + def __enter__(self) -> None: + raise TypeError("Use async with instead") + + def __exit__( + self, + exc_type: Optional[Type[BaseException]], + exc: Optional[BaseException], + tb: Optional[TracebackType], + ) -> None: + # __exit__ should exist in pair with __enter__ but never executed + pass # pragma: no cover + + async def __aenter__(self) -> "TestClient": + await self.start_server() + return self + + async def __aexit__( + self, + exc_type: Optional[Type[BaseException]], + exc: Optional[BaseException], + tb: Optional[TracebackType], + ) -> None: + await self.close() + + +class AioHTTPTestCase(TestCase): + """A base class to allow for unittest web applications using aiohttp. + + Provides the following: + + * self.client (aiohttp.test_utils.TestClient): an aiohttp test client. + * self.loop (asyncio.BaseEventLoop): the event loop in which the + application and server are running. + * self.app (aiohttp.web.Application): the application returned by + self.get_application() + + Note that the TestClient's methods are asynchronous: you have to + execute function on the test client using asynchronous methods. + """ + + async def get_application(self) -> Application: + """Get application. + + This method should be overridden + to return the aiohttp.web.Application + object to test. + """ + return self.get_app() + + def get_app(self) -> Application: + """Obsolete method used to constructing web application. + + Use .get_application() coroutine instead. + """ + raise RuntimeError("Did you forget to define get_application()?") + + def setUp(self) -> None: + if not PY_38: + asyncio.get_event_loop().run_until_complete(self.asyncSetUp()) + + async def asyncSetUp(self) -> None: + try: + self.loop = asyncio.get_running_loop() + except (AttributeError, RuntimeError): # AttributeError->py36 + self.loop = asyncio.get_event_loop_policy().get_event_loop() + + return await self.setUpAsync() + + async def setUpAsync(self) -> None: + self.app = await self.get_application() + self.server = await self.get_server(self.app) + self.client = await self.get_client(self.server) + + await self.client.start_server() + + def tearDown(self) -> None: + if not PY_38: + self.loop.run_until_complete(self.asyncTearDown()) + + async def asyncTearDown(self) -> None: + return await self.tearDownAsync() + + async def tearDownAsync(self) -> None: + await self.client.close() + + async def get_server(self, app: Application) -> TestServer: + """Return a TestServer instance.""" + return TestServer(app, loop=self.loop) + + async def get_client(self, server: TestServer) -> TestClient: + """Return a TestClient instance.""" + return TestClient(server, loop=self.loop) + + +def unittest_run_loop(func: Any, *args: Any, **kwargs: Any) -> Any: + """ + A decorator dedicated to use with asynchronous AioHTTPTestCase test methods. + + In 3.8+, this does nothing. + """ + warnings.warn( + "Decorator `@unittest_run_loop` is no longer needed in aiohttp 3.8+", + DeprecationWarning, + stacklevel=2, + ) + return func + + +_LOOP_FACTORY = Callable[[], asyncio.AbstractEventLoop] + + +@contextlib.contextmanager +def loop_context( + loop_factory: _LOOP_FACTORY = asyncio.new_event_loop, fast: bool = False +) -> Iterator[asyncio.AbstractEventLoop]: + """A contextmanager that creates an event_loop, for test purposes. + + Handles the creation and cleanup of a test loop. + """ + loop = setup_test_loop(loop_factory) + yield loop + teardown_test_loop(loop, fast=fast) + + +def setup_test_loop( + loop_factory: _LOOP_FACTORY = asyncio.new_event_loop, +) -> asyncio.AbstractEventLoop: + """Create and return an asyncio.BaseEventLoop instance. + + The caller should also call teardown_test_loop, + once they are done with the loop. + """ + loop = loop_factory() + try: + module = loop.__class__.__module__ + skip_watcher = "uvloop" in module + except AttributeError: # pragma: no cover + # Just in case + skip_watcher = True + asyncio.set_event_loop(loop) + if sys.platform != "win32" and not skip_watcher: + policy = asyncio.get_event_loop_policy() + watcher: asyncio.AbstractChildWatcher + try: # Python >= 3.8 + # Refs: + # * https://github.com/pytest-dev/pytest-xdist/issues/620 + # * https://stackoverflow.com/a/58614689/595220 + # * https://bugs.python.org/issue35621 + # * https://github.com/python/cpython/pull/14344 + watcher = asyncio.ThreadedChildWatcher() + except AttributeError: # Python < 3.8 + watcher = asyncio.SafeChildWatcher() + watcher.attach_loop(loop) + with contextlib.suppress(NotImplementedError): + policy.set_child_watcher(watcher) + return loop + + +def teardown_test_loop(loop: asyncio.AbstractEventLoop, fast: bool = False) -> None: + """Teardown and cleanup an event_loop created by setup_test_loop.""" + closed = loop.is_closed() + if not closed: + loop.call_soon(loop.stop) + loop.run_forever() + loop.close() + + if not fast: + gc.collect() + + asyncio.set_event_loop(None) + + +def _create_app_mock() -> mock.MagicMock: + def get_dict(app: Any, key: str) -> Any: + return app.__app_dict[key] + + def set_dict(app: Any, key: str, value: Any) -> None: + app.__app_dict[key] = value + + app = mock.MagicMock(spec=Application) + app.__app_dict = {} + app.__getitem__ = get_dict + app.__setitem__ = set_dict + + app._debug = False + app.on_response_prepare = Signal(app) + app.on_response_prepare.freeze() + return app + + +def _create_transport(sslcontext: Optional[SSLContext] = None) -> mock.Mock: + transport = mock.Mock() + + def get_extra_info(key: str) -> Optional[SSLContext]: + if key == "sslcontext": + return sslcontext + else: + return None + + transport.get_extra_info.side_effect = get_extra_info + return transport + + +def make_mocked_request( + method: str, + path: str, + headers: Any = None, + *, + match_info: Any = sentinel, + version: HttpVersion = HttpVersion(1, 1), + closing: bool = False, + app: Any = None, + writer: Any = sentinel, + protocol: Any = sentinel, + transport: Any = sentinel, + payload: Any = sentinel, + sslcontext: Optional[SSLContext] = None, + client_max_size: int = 1024**2, + loop: Any = ..., +) -> Request: + """Creates mocked web.Request testing purposes. + + Useful in unit tests, when spinning full web server is overkill or + specific conditions and errors are hard to trigger. + """ + task = mock.Mock() + if loop is ...: + loop = mock.Mock() + loop.create_future.return_value = () + + if version < HttpVersion(1, 1): + closing = True + + if headers: + headers = CIMultiDictProxy(CIMultiDict(headers)) + raw_hdrs = tuple( + (k.encode("utf-8"), v.encode("utf-8")) for k, v in headers.items() + ) + else: + headers = CIMultiDictProxy(CIMultiDict()) + raw_hdrs = () + + chunked = "chunked" in headers.get(hdrs.TRANSFER_ENCODING, "").lower() + + message = RawRequestMessage( + method, + path, + version, + headers, + raw_hdrs, + closing, + None, + False, + chunked, + URL(path), + ) + if app is None: + app = _create_app_mock() + + if transport is sentinel: + transport = _create_transport(sslcontext) + + if protocol is sentinel: + protocol = mock.Mock() + protocol.transport = transport + + if writer is sentinel: + writer = mock.Mock() + writer.write_headers = make_mocked_coro(None) + writer.write = make_mocked_coro(None) + writer.write_eof = make_mocked_coro(None) + writer.drain = make_mocked_coro(None) + writer.transport = transport + + protocol.transport = transport + protocol.writer = writer + + if payload is sentinel: + payload = mock.Mock() + + req = Request( + message, payload, protocol, writer, task, loop, client_max_size=client_max_size + ) + + match_info = UrlMappingMatchInfo( + {} if match_info is sentinel else match_info, mock.Mock() + ) + match_info.add_app(app) + req._match_info = match_info + + return req + + +def make_mocked_coro( + return_value: Any = sentinel, raise_exception: Any = sentinel +) -> Any: + """Creates a coroutine mock.""" + + async def mock_coro(*args: Any, **kwargs: Any) -> Any: + if raise_exception is not sentinel: + raise raise_exception + if not inspect.isawaitable(return_value): + return return_value + await return_value + + return mock.Mock(wraps=mock_coro) diff --git a/runtime/Lib/site-packages/aiohttp/tracing.py b/runtime/Lib/site-packages/aiohttp/tracing.py new file mode 100644 index 0000000000000000000000000000000000000000..11b168dcdd0514bc300a337cd73cbc9655c413bb --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/tracing.py @@ -0,0 +1,472 @@ +from types import SimpleNamespace +from typing import TYPE_CHECKING, Awaitable, Optional, Type, TypeVar + +import attr +from aiosignal import Signal +from multidict import CIMultiDict +from yarl import URL + +from .client_reqrep import ClientResponse + +if TYPE_CHECKING: # pragma: no cover + from .client import ClientSession + from .typedefs import Protocol + + _ParamT_contra = TypeVar("_ParamT_contra", contravariant=True) + + class _SignalCallback(Protocol[_ParamT_contra]): + def __call__( + self, + __client_session: ClientSession, + __trace_config_ctx: SimpleNamespace, + __params: _ParamT_contra, + ) -> Awaitable[None]: + ... + + +__all__ = ( + "TraceConfig", + "TraceRequestStartParams", + "TraceRequestEndParams", + "TraceRequestExceptionParams", + "TraceConnectionQueuedStartParams", + "TraceConnectionQueuedEndParams", + "TraceConnectionCreateStartParams", + "TraceConnectionCreateEndParams", + "TraceConnectionReuseconnParams", + "TraceDnsResolveHostStartParams", + "TraceDnsResolveHostEndParams", + "TraceDnsCacheHitParams", + "TraceDnsCacheMissParams", + "TraceRequestRedirectParams", + "TraceRequestChunkSentParams", + "TraceResponseChunkReceivedParams", + "TraceRequestHeadersSentParams", +) + + +class TraceConfig: + """First-class used to trace requests launched via ClientSession objects.""" + + def __init__( + self, trace_config_ctx_factory: Type[SimpleNamespace] = SimpleNamespace + ) -> None: + self._on_request_start: Signal[ + _SignalCallback[TraceRequestStartParams] + ] = Signal(self) + self._on_request_chunk_sent: Signal[ + _SignalCallback[TraceRequestChunkSentParams] + ] = Signal(self) + self._on_response_chunk_received: Signal[ + _SignalCallback[TraceResponseChunkReceivedParams] + ] = Signal(self) + self._on_request_end: Signal[_SignalCallback[TraceRequestEndParams]] = Signal( + self + ) + self._on_request_exception: Signal[ + _SignalCallback[TraceRequestExceptionParams] + ] = Signal(self) + self._on_request_redirect: Signal[ + _SignalCallback[TraceRequestRedirectParams] + ] = Signal(self) + self._on_connection_queued_start: Signal[ + _SignalCallback[TraceConnectionQueuedStartParams] + ] = Signal(self) + self._on_connection_queued_end: Signal[ + _SignalCallback[TraceConnectionQueuedEndParams] + ] = Signal(self) + self._on_connection_create_start: Signal[ + _SignalCallback[TraceConnectionCreateStartParams] + ] = Signal(self) + self._on_connection_create_end: Signal[ + _SignalCallback[TraceConnectionCreateEndParams] + ] = Signal(self) + self._on_connection_reuseconn: Signal[ + _SignalCallback[TraceConnectionReuseconnParams] + ] = Signal(self) + self._on_dns_resolvehost_start: Signal[ + _SignalCallback[TraceDnsResolveHostStartParams] + ] = Signal(self) + self._on_dns_resolvehost_end: Signal[ + _SignalCallback[TraceDnsResolveHostEndParams] + ] = Signal(self) + self._on_dns_cache_hit: Signal[ + _SignalCallback[TraceDnsCacheHitParams] + ] = Signal(self) + self._on_dns_cache_miss: Signal[ + _SignalCallback[TraceDnsCacheMissParams] + ] = Signal(self) + self._on_request_headers_sent: Signal[ + _SignalCallback[TraceRequestHeadersSentParams] + ] = Signal(self) + + self._trace_config_ctx_factory = trace_config_ctx_factory + + def trace_config_ctx( + self, trace_request_ctx: Optional[SimpleNamespace] = None + ) -> SimpleNamespace: + """Return a new trace_config_ctx instance""" + return self._trace_config_ctx_factory(trace_request_ctx=trace_request_ctx) + + def freeze(self) -> None: + self._on_request_start.freeze() + self._on_request_chunk_sent.freeze() + self._on_response_chunk_received.freeze() + self._on_request_end.freeze() + self._on_request_exception.freeze() + self._on_request_redirect.freeze() + self._on_connection_queued_start.freeze() + self._on_connection_queued_end.freeze() + self._on_connection_create_start.freeze() + self._on_connection_create_end.freeze() + self._on_connection_reuseconn.freeze() + self._on_dns_resolvehost_start.freeze() + self._on_dns_resolvehost_end.freeze() + self._on_dns_cache_hit.freeze() + self._on_dns_cache_miss.freeze() + self._on_request_headers_sent.freeze() + + @property + def on_request_start(self) -> "Signal[_SignalCallback[TraceRequestStartParams]]": + return self._on_request_start + + @property + def on_request_chunk_sent( + self, + ) -> "Signal[_SignalCallback[TraceRequestChunkSentParams]]": + return self._on_request_chunk_sent + + @property + def on_response_chunk_received( + self, + ) -> "Signal[_SignalCallback[TraceResponseChunkReceivedParams]]": + return self._on_response_chunk_received + + @property + def on_request_end(self) -> "Signal[_SignalCallback[TraceRequestEndParams]]": + return self._on_request_end + + @property + def on_request_exception( + self, + ) -> "Signal[_SignalCallback[TraceRequestExceptionParams]]": + return self._on_request_exception + + @property + def on_request_redirect( + self, + ) -> "Signal[_SignalCallback[TraceRequestRedirectParams]]": + return self._on_request_redirect + + @property + def on_connection_queued_start( + self, + ) -> "Signal[_SignalCallback[TraceConnectionQueuedStartParams]]": + return self._on_connection_queued_start + + @property + def on_connection_queued_end( + self, + ) -> "Signal[_SignalCallback[TraceConnectionQueuedEndParams]]": + return self._on_connection_queued_end + + @property + def on_connection_create_start( + self, + ) -> "Signal[_SignalCallback[TraceConnectionCreateStartParams]]": + return self._on_connection_create_start + + @property + def on_connection_create_end( + self, + ) -> "Signal[_SignalCallback[TraceConnectionCreateEndParams]]": + return self._on_connection_create_end + + @property + def on_connection_reuseconn( + self, + ) -> "Signal[_SignalCallback[TraceConnectionReuseconnParams]]": + return self._on_connection_reuseconn + + @property + def on_dns_resolvehost_start( + self, + ) -> "Signal[_SignalCallback[TraceDnsResolveHostStartParams]]": + return self._on_dns_resolvehost_start + + @property + def on_dns_resolvehost_end( + self, + ) -> "Signal[_SignalCallback[TraceDnsResolveHostEndParams]]": + return self._on_dns_resolvehost_end + + @property + def on_dns_cache_hit(self) -> "Signal[_SignalCallback[TraceDnsCacheHitParams]]": + return self._on_dns_cache_hit + + @property + def on_dns_cache_miss(self) -> "Signal[_SignalCallback[TraceDnsCacheMissParams]]": + return self._on_dns_cache_miss + + @property + def on_request_headers_sent( + self, + ) -> "Signal[_SignalCallback[TraceRequestHeadersSentParams]]": + return self._on_request_headers_sent + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class TraceRequestStartParams: + """Parameters sent by the `on_request_start` signal""" + + method: str + url: URL + headers: "CIMultiDict[str]" + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class TraceRequestChunkSentParams: + """Parameters sent by the `on_request_chunk_sent` signal""" + + method: str + url: URL + chunk: bytes + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class TraceResponseChunkReceivedParams: + """Parameters sent by the `on_response_chunk_received` signal""" + + method: str + url: URL + chunk: bytes + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class TraceRequestEndParams: + """Parameters sent by the `on_request_end` signal""" + + method: str + url: URL + headers: "CIMultiDict[str]" + response: ClientResponse + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class TraceRequestExceptionParams: + """Parameters sent by the `on_request_exception` signal""" + + method: str + url: URL + headers: "CIMultiDict[str]" + exception: BaseException + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class TraceRequestRedirectParams: + """Parameters sent by the `on_request_redirect` signal""" + + method: str + url: URL + headers: "CIMultiDict[str]" + response: ClientResponse + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class TraceConnectionQueuedStartParams: + """Parameters sent by the `on_connection_queued_start` signal""" + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class TraceConnectionQueuedEndParams: + """Parameters sent by the `on_connection_queued_end` signal""" + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class TraceConnectionCreateStartParams: + """Parameters sent by the `on_connection_create_start` signal""" + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class TraceConnectionCreateEndParams: + """Parameters sent by the `on_connection_create_end` signal""" + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class TraceConnectionReuseconnParams: + """Parameters sent by the `on_connection_reuseconn` signal""" + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class TraceDnsResolveHostStartParams: + """Parameters sent by the `on_dns_resolvehost_start` signal""" + + host: str + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class TraceDnsResolveHostEndParams: + """Parameters sent by the `on_dns_resolvehost_end` signal""" + + host: str + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class TraceDnsCacheHitParams: + """Parameters sent by the `on_dns_cache_hit` signal""" + + host: str + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class TraceDnsCacheMissParams: + """Parameters sent by the `on_dns_cache_miss` signal""" + + host: str + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class TraceRequestHeadersSentParams: + """Parameters sent by the `on_request_headers_sent` signal""" + + method: str + url: URL + headers: "CIMultiDict[str]" + + +class Trace: + """Internal dependency holder class. + + Used to keep together the main dependencies used + at the moment of send a signal. + """ + + def __init__( + self, + session: "ClientSession", + trace_config: TraceConfig, + trace_config_ctx: SimpleNamespace, + ) -> None: + self._trace_config = trace_config + self._trace_config_ctx = trace_config_ctx + self._session = session + + async def send_request_start( + self, method: str, url: URL, headers: "CIMultiDict[str]" + ) -> None: + return await self._trace_config.on_request_start.send( + self._session, + self._trace_config_ctx, + TraceRequestStartParams(method, url, headers), + ) + + async def send_request_chunk_sent( + self, method: str, url: URL, chunk: bytes + ) -> None: + return await self._trace_config.on_request_chunk_sent.send( + self._session, + self._trace_config_ctx, + TraceRequestChunkSentParams(method, url, chunk), + ) + + async def send_response_chunk_received( + self, method: str, url: URL, chunk: bytes + ) -> None: + return await self._trace_config.on_response_chunk_received.send( + self._session, + self._trace_config_ctx, + TraceResponseChunkReceivedParams(method, url, chunk), + ) + + async def send_request_end( + self, + method: str, + url: URL, + headers: "CIMultiDict[str]", + response: ClientResponse, + ) -> None: + return await self._trace_config.on_request_end.send( + self._session, + self._trace_config_ctx, + TraceRequestEndParams(method, url, headers, response), + ) + + async def send_request_exception( + self, + method: str, + url: URL, + headers: "CIMultiDict[str]", + exception: BaseException, + ) -> None: + return await self._trace_config.on_request_exception.send( + self._session, + self._trace_config_ctx, + TraceRequestExceptionParams(method, url, headers, exception), + ) + + async def send_request_redirect( + self, + method: str, + url: URL, + headers: "CIMultiDict[str]", + response: ClientResponse, + ) -> None: + return await self._trace_config._on_request_redirect.send( + self._session, + self._trace_config_ctx, + TraceRequestRedirectParams(method, url, headers, response), + ) + + async def send_connection_queued_start(self) -> None: + return await self._trace_config.on_connection_queued_start.send( + self._session, self._trace_config_ctx, TraceConnectionQueuedStartParams() + ) + + async def send_connection_queued_end(self) -> None: + return await self._trace_config.on_connection_queued_end.send( + self._session, self._trace_config_ctx, TraceConnectionQueuedEndParams() + ) + + async def send_connection_create_start(self) -> None: + return await self._trace_config.on_connection_create_start.send( + self._session, self._trace_config_ctx, TraceConnectionCreateStartParams() + ) + + async def send_connection_create_end(self) -> None: + return await self._trace_config.on_connection_create_end.send( + self._session, self._trace_config_ctx, TraceConnectionCreateEndParams() + ) + + async def send_connection_reuseconn(self) -> None: + return await self._trace_config.on_connection_reuseconn.send( + self._session, self._trace_config_ctx, TraceConnectionReuseconnParams() + ) + + async def send_dns_resolvehost_start(self, host: str) -> None: + return await self._trace_config.on_dns_resolvehost_start.send( + self._session, self._trace_config_ctx, TraceDnsResolveHostStartParams(host) + ) + + async def send_dns_resolvehost_end(self, host: str) -> None: + return await self._trace_config.on_dns_resolvehost_end.send( + self._session, self._trace_config_ctx, TraceDnsResolveHostEndParams(host) + ) + + async def send_dns_cache_hit(self, host: str) -> None: + return await self._trace_config.on_dns_cache_hit.send( + self._session, self._trace_config_ctx, TraceDnsCacheHitParams(host) + ) + + async def send_dns_cache_miss(self, host: str) -> None: + return await self._trace_config.on_dns_cache_miss.send( + self._session, self._trace_config_ctx, TraceDnsCacheMissParams(host) + ) + + async def send_request_headers( + self, method: str, url: URL, headers: "CIMultiDict[str]" + ) -> None: + return await self._trace_config._on_request_headers_sent.send( + self._session, + self._trace_config_ctx, + TraceRequestHeadersSentParams(method, url, headers), + ) diff --git a/runtime/Lib/site-packages/aiohttp/typedefs.py b/runtime/Lib/site-packages/aiohttp/typedefs.py new file mode 100644 index 0000000000000000000000000000000000000000..3fc1e81d0459edea00ad11ae52cef51a98e462c6 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/typedefs.py @@ -0,0 +1,64 @@ +import json +import os +import sys +from typing import ( + TYPE_CHECKING, + Any, + Awaitable, + Callable, + Iterable, + Mapping, + Tuple, + Union, +) + +from multidict import CIMultiDict, CIMultiDictProxy, MultiDict, MultiDictProxy, istr +from yarl import URL + +# These are for other modules to use (to avoid repeating the conditional import). +if sys.version_info >= (3, 8): + from typing import Final as Final, Protocol as Protocol, TypedDict as TypedDict +else: + from typing_extensions import ( # noqa: F401 + Final, + Protocol as Protocol, + TypedDict as TypedDict, + ) + +DEFAULT_JSON_ENCODER = json.dumps +DEFAULT_JSON_DECODER = json.loads + +if TYPE_CHECKING: # pragma: no cover + _CIMultiDict = CIMultiDict[str] + _CIMultiDictProxy = CIMultiDictProxy[str] + _MultiDict = MultiDict[str] + _MultiDictProxy = MultiDictProxy[str] + from http.cookies import BaseCookie, Morsel + + from .web import Request, StreamResponse +else: + _CIMultiDict = CIMultiDict + _CIMultiDictProxy = CIMultiDictProxy + _MultiDict = MultiDict + _MultiDictProxy = MultiDictProxy + +Byteish = Union[bytes, bytearray, memoryview] +JSONEncoder = Callable[[Any], str] +JSONDecoder = Callable[[str], Any] +LooseHeaders = Union[Mapping[Union[str, istr], str], _CIMultiDict, _CIMultiDictProxy] +RawHeaders = Tuple[Tuple[bytes, bytes], ...] +StrOrURL = Union[str, URL] + +LooseCookiesMappings = Mapping[str, Union[str, "BaseCookie[str]", "Morsel[Any]"]] +LooseCookiesIterables = Iterable[ + Tuple[str, Union[str, "BaseCookie[str]", "Morsel[Any]"]] +] +LooseCookies = Union[ + LooseCookiesMappings, + LooseCookiesIterables, + "BaseCookie[str]", +] + +Handler = Callable[["Request"], Awaitable["StreamResponse"]] + +PathLike = Union[str, "os.PathLike[str]"] diff --git a/runtime/Lib/site-packages/aiohttp/web.py b/runtime/Lib/site-packages/aiohttp/web.py new file mode 100644 index 0000000000000000000000000000000000000000..1380bc051ddd64ed1b4713aec6284a198e746a1d --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/web.py @@ -0,0 +1,588 @@ +import asyncio +import logging +import socket +import sys +from argparse import ArgumentParser +from collections.abc import Iterable +from importlib import import_module +from typing import ( + Any, + Awaitable, + Callable, + Iterable as TypingIterable, + List, + Optional, + Set, + Type, + Union, + cast, +) + +from .abc import AbstractAccessLogger +from .helpers import all_tasks +from .log import access_logger +from .web_app import Application as Application, CleanupError as CleanupError +from .web_exceptions import ( + HTTPAccepted as HTTPAccepted, + HTTPBadGateway as HTTPBadGateway, + HTTPBadRequest as HTTPBadRequest, + HTTPClientError as HTTPClientError, + HTTPConflict as HTTPConflict, + HTTPCreated as HTTPCreated, + HTTPError as HTTPError, + HTTPException as HTTPException, + HTTPExpectationFailed as HTTPExpectationFailed, + HTTPFailedDependency as HTTPFailedDependency, + HTTPForbidden as HTTPForbidden, + HTTPFound as HTTPFound, + HTTPGatewayTimeout as HTTPGatewayTimeout, + HTTPGone as HTTPGone, + HTTPInsufficientStorage as HTTPInsufficientStorage, + HTTPInternalServerError as HTTPInternalServerError, + HTTPLengthRequired as HTTPLengthRequired, + HTTPMethodNotAllowed as HTTPMethodNotAllowed, + HTTPMisdirectedRequest as HTTPMisdirectedRequest, + HTTPMovedPermanently as HTTPMovedPermanently, + HTTPMultipleChoices as HTTPMultipleChoices, + HTTPNetworkAuthenticationRequired as HTTPNetworkAuthenticationRequired, + HTTPNoContent as HTTPNoContent, + HTTPNonAuthoritativeInformation as HTTPNonAuthoritativeInformation, + HTTPNotAcceptable as HTTPNotAcceptable, + HTTPNotExtended as HTTPNotExtended, + HTTPNotFound as HTTPNotFound, + HTTPNotImplemented as HTTPNotImplemented, + HTTPNotModified as HTTPNotModified, + HTTPOk as HTTPOk, + HTTPPartialContent as HTTPPartialContent, + HTTPPaymentRequired as HTTPPaymentRequired, + HTTPPermanentRedirect as HTTPPermanentRedirect, + HTTPPreconditionFailed as HTTPPreconditionFailed, + HTTPPreconditionRequired as HTTPPreconditionRequired, + HTTPProxyAuthenticationRequired as HTTPProxyAuthenticationRequired, + HTTPRedirection as HTTPRedirection, + HTTPRequestEntityTooLarge as HTTPRequestEntityTooLarge, + HTTPRequestHeaderFieldsTooLarge as HTTPRequestHeaderFieldsTooLarge, + HTTPRequestRangeNotSatisfiable as HTTPRequestRangeNotSatisfiable, + HTTPRequestTimeout as HTTPRequestTimeout, + HTTPRequestURITooLong as HTTPRequestURITooLong, + HTTPResetContent as HTTPResetContent, + HTTPSeeOther as HTTPSeeOther, + HTTPServerError as HTTPServerError, + HTTPServiceUnavailable as HTTPServiceUnavailable, + HTTPSuccessful as HTTPSuccessful, + HTTPTemporaryRedirect as HTTPTemporaryRedirect, + HTTPTooManyRequests as HTTPTooManyRequests, + HTTPUnauthorized as HTTPUnauthorized, + HTTPUnavailableForLegalReasons as HTTPUnavailableForLegalReasons, + HTTPUnprocessableEntity as HTTPUnprocessableEntity, + HTTPUnsupportedMediaType as HTTPUnsupportedMediaType, + HTTPUpgradeRequired as HTTPUpgradeRequired, + HTTPUseProxy as HTTPUseProxy, + HTTPVariantAlsoNegotiates as HTTPVariantAlsoNegotiates, + HTTPVersionNotSupported as HTTPVersionNotSupported, +) +from .web_fileresponse import FileResponse as FileResponse +from .web_log import AccessLogger +from .web_middlewares import ( + middleware as middleware, + normalize_path_middleware as normalize_path_middleware, +) +from .web_protocol import ( + PayloadAccessError as PayloadAccessError, + RequestHandler as RequestHandler, + RequestPayloadError as RequestPayloadError, +) +from .web_request import ( + BaseRequest as BaseRequest, + FileField as FileField, + Request as Request, +) +from .web_response import ( + ContentCoding as ContentCoding, + Response as Response, + StreamResponse as StreamResponse, + json_response as json_response, +) +from .web_routedef import ( + AbstractRouteDef as AbstractRouteDef, + RouteDef as RouteDef, + RouteTableDef as RouteTableDef, + StaticDef as StaticDef, + delete as delete, + get as get, + head as head, + options as options, + patch as patch, + post as post, + put as put, + route as route, + static as static, + view as view, +) +from .web_runner import ( + AppRunner as AppRunner, + BaseRunner as BaseRunner, + BaseSite as BaseSite, + GracefulExit as GracefulExit, + NamedPipeSite as NamedPipeSite, + ServerRunner as ServerRunner, + SockSite as SockSite, + TCPSite as TCPSite, + UnixSite as UnixSite, +) +from .web_server import Server as Server +from .web_urldispatcher import ( + AbstractResource as AbstractResource, + AbstractRoute as AbstractRoute, + DynamicResource as DynamicResource, + PlainResource as PlainResource, + PrefixedSubAppResource as PrefixedSubAppResource, + Resource as Resource, + ResourceRoute as ResourceRoute, + StaticResource as StaticResource, + UrlDispatcher as UrlDispatcher, + UrlMappingMatchInfo as UrlMappingMatchInfo, + View as View, +) +from .web_ws import ( + WebSocketReady as WebSocketReady, + WebSocketResponse as WebSocketResponse, + WSMsgType as WSMsgType, +) + +__all__ = ( + # web_app + "Application", + "CleanupError", + # web_exceptions + "HTTPAccepted", + "HTTPBadGateway", + "HTTPBadRequest", + "HTTPClientError", + "HTTPConflict", + "HTTPCreated", + "HTTPError", + "HTTPException", + "HTTPExpectationFailed", + "HTTPFailedDependency", + "HTTPForbidden", + "HTTPFound", + "HTTPGatewayTimeout", + "HTTPGone", + "HTTPInsufficientStorage", + "HTTPInternalServerError", + "HTTPLengthRequired", + "HTTPMethodNotAllowed", + "HTTPMisdirectedRequest", + "HTTPMovedPermanently", + "HTTPMultipleChoices", + "HTTPNetworkAuthenticationRequired", + "HTTPNoContent", + "HTTPNonAuthoritativeInformation", + "HTTPNotAcceptable", + "HTTPNotExtended", + "HTTPNotFound", + "HTTPNotImplemented", + "HTTPNotModified", + "HTTPOk", + "HTTPPartialContent", + "HTTPPaymentRequired", + "HTTPPermanentRedirect", + "HTTPPreconditionFailed", + "HTTPPreconditionRequired", + "HTTPProxyAuthenticationRequired", + "HTTPRedirection", + "HTTPRequestEntityTooLarge", + "HTTPRequestHeaderFieldsTooLarge", + "HTTPRequestRangeNotSatisfiable", + "HTTPRequestTimeout", + "HTTPRequestURITooLong", + "HTTPResetContent", + "HTTPSeeOther", + "HTTPServerError", + "HTTPServiceUnavailable", + "HTTPSuccessful", + "HTTPTemporaryRedirect", + "HTTPTooManyRequests", + "HTTPUnauthorized", + "HTTPUnavailableForLegalReasons", + "HTTPUnprocessableEntity", + "HTTPUnsupportedMediaType", + "HTTPUpgradeRequired", + "HTTPUseProxy", + "HTTPVariantAlsoNegotiates", + "HTTPVersionNotSupported", + # web_fileresponse + "FileResponse", + # web_middlewares + "middleware", + "normalize_path_middleware", + # web_protocol + "PayloadAccessError", + "RequestHandler", + "RequestPayloadError", + # web_request + "BaseRequest", + "FileField", + "Request", + # web_response + "ContentCoding", + "Response", + "StreamResponse", + "json_response", + # web_routedef + "AbstractRouteDef", + "RouteDef", + "RouteTableDef", + "StaticDef", + "delete", + "get", + "head", + "options", + "patch", + "post", + "put", + "route", + "static", + "view", + # web_runner + "AppRunner", + "BaseRunner", + "BaseSite", + "GracefulExit", + "ServerRunner", + "SockSite", + "TCPSite", + "UnixSite", + "NamedPipeSite", + # web_server + "Server", + # web_urldispatcher + "AbstractResource", + "AbstractRoute", + "DynamicResource", + "PlainResource", + "PrefixedSubAppResource", + "Resource", + "ResourceRoute", + "StaticResource", + "UrlDispatcher", + "UrlMappingMatchInfo", + "View", + # web_ws + "WebSocketReady", + "WebSocketResponse", + "WSMsgType", + # web + "run_app", +) + + +try: + from ssl import SSLContext +except ImportError: # pragma: no cover + SSLContext = Any # type: ignore[misc,assignment] + +HostSequence = TypingIterable[str] + + +async def _run_app( + app: Union[Application, Awaitable[Application]], + *, + host: Optional[Union[str, HostSequence]] = None, + port: Optional[int] = None, + path: Optional[str] = None, + sock: Optional[Union[socket.socket, TypingIterable[socket.socket]]] = None, + shutdown_timeout: float = 60.0, + keepalive_timeout: float = 75.0, + ssl_context: Optional[SSLContext] = None, + print: Callable[..., None] = print, + backlog: int = 128, + access_log_class: Type[AbstractAccessLogger] = AccessLogger, + access_log_format: str = AccessLogger.LOG_FORMAT, + access_log: Optional[logging.Logger] = access_logger, + handle_signals: bool = True, + reuse_address: Optional[bool] = None, + reuse_port: Optional[bool] = None, +) -> None: + # A internal functio to actually do all dirty job for application running + if asyncio.iscoroutine(app): + app = await app # type: ignore[misc] + + app = cast(Application, app) + + runner = AppRunner( + app, + handle_signals=handle_signals, + access_log_class=access_log_class, + access_log_format=access_log_format, + access_log=access_log, + keepalive_timeout=keepalive_timeout, + ) + + await runner.setup() + + sites: List[BaseSite] = [] + + try: + if host is not None: + if isinstance(host, (str, bytes, bytearray, memoryview)): + sites.append( + TCPSite( + runner, + host, + port, + shutdown_timeout=shutdown_timeout, + ssl_context=ssl_context, + backlog=backlog, + reuse_address=reuse_address, + reuse_port=reuse_port, + ) + ) + else: + for h in host: + sites.append( + TCPSite( + runner, + h, + port, + shutdown_timeout=shutdown_timeout, + ssl_context=ssl_context, + backlog=backlog, + reuse_address=reuse_address, + reuse_port=reuse_port, + ) + ) + elif path is None and sock is None or port is not None: + sites.append( + TCPSite( + runner, + port=port, + shutdown_timeout=shutdown_timeout, + ssl_context=ssl_context, + backlog=backlog, + reuse_address=reuse_address, + reuse_port=reuse_port, + ) + ) + + if path is not None: + if isinstance(path, (str, bytes, bytearray, memoryview)): + sites.append( + UnixSite( + runner, + path, + shutdown_timeout=shutdown_timeout, + ssl_context=ssl_context, + backlog=backlog, + ) + ) + else: + for p in path: + sites.append( + UnixSite( + runner, + p, + shutdown_timeout=shutdown_timeout, + ssl_context=ssl_context, + backlog=backlog, + ) + ) + + if sock is not None: + if not isinstance(sock, Iterable): + sites.append( + SockSite( + runner, + sock, + shutdown_timeout=shutdown_timeout, + ssl_context=ssl_context, + backlog=backlog, + ) + ) + else: + for s in sock: + sites.append( + SockSite( + runner, + s, + shutdown_timeout=shutdown_timeout, + ssl_context=ssl_context, + backlog=backlog, + ) + ) + for site in sites: + await site.start() + + if print: # pragma: no branch + names = sorted(str(s.name) for s in runner.sites) + print( + "======== Running on {} ========\n" + "(Press CTRL+C to quit)".format(", ".join(names)) + ) + + # sleep forever by 1 hour intervals, + # on Windows before Python 3.8 wake up every 1 second to handle + # Ctrl+C smoothly + if sys.platform == "win32" and sys.version_info < (3, 8): + delay = 1 + else: + delay = 3600 + + while True: + await asyncio.sleep(delay) + finally: + await runner.cleanup() + + +def _cancel_tasks( + to_cancel: Set["asyncio.Task[Any]"], loop: asyncio.AbstractEventLoop +) -> None: + if not to_cancel: + return + + for task in to_cancel: + task.cancel() + + loop.run_until_complete(asyncio.gather(*to_cancel, return_exceptions=True)) + + for task in to_cancel: + if task.cancelled(): + continue + if task.exception() is not None: + loop.call_exception_handler( + { + "message": "unhandled exception during asyncio.run() shutdown", + "exception": task.exception(), + "task": task, + } + ) + + +def run_app( + app: Union[Application, Awaitable[Application]], + *, + host: Optional[Union[str, HostSequence]] = None, + port: Optional[int] = None, + path: Optional[str] = None, + sock: Optional[Union[socket.socket, TypingIterable[socket.socket]]] = None, + shutdown_timeout: float = 60.0, + keepalive_timeout: float = 75.0, + ssl_context: Optional[SSLContext] = None, + print: Callable[..., None] = print, + backlog: int = 128, + access_log_class: Type[AbstractAccessLogger] = AccessLogger, + access_log_format: str = AccessLogger.LOG_FORMAT, + access_log: Optional[logging.Logger] = access_logger, + handle_signals: bool = True, + reuse_address: Optional[bool] = None, + reuse_port: Optional[bool] = None, + loop: Optional[asyncio.AbstractEventLoop] = None, +) -> None: + """Run an app locally""" + if loop is None: + loop = asyncio.new_event_loop() + + # Configure if and only if in debugging mode and using the default logger + if loop.get_debug() and access_log and access_log.name == "aiohttp.access": + if access_log.level == logging.NOTSET: + access_log.setLevel(logging.DEBUG) + if not access_log.hasHandlers(): + access_log.addHandler(logging.StreamHandler()) + + main_task = loop.create_task( + _run_app( + app, + host=host, + port=port, + path=path, + sock=sock, + shutdown_timeout=shutdown_timeout, + keepalive_timeout=keepalive_timeout, + ssl_context=ssl_context, + print=print, + backlog=backlog, + access_log_class=access_log_class, + access_log_format=access_log_format, + access_log=access_log, + handle_signals=handle_signals, + reuse_address=reuse_address, + reuse_port=reuse_port, + ) + ) + + try: + asyncio.set_event_loop(loop) + loop.run_until_complete(main_task) + except (GracefulExit, KeyboardInterrupt): # pragma: no cover + pass + finally: + _cancel_tasks({main_task}, loop) + _cancel_tasks(all_tasks(loop), loop) + loop.run_until_complete(loop.shutdown_asyncgens()) + loop.close() + + +def main(argv: List[str]) -> None: + arg_parser = ArgumentParser( + description="aiohttp.web Application server", prog="aiohttp.web" + ) + arg_parser.add_argument( + "entry_func", + help=( + "Callable returning the `aiohttp.web.Application` instance to " + "run. Should be specified in the 'module:function' syntax." + ), + metavar="entry-func", + ) + arg_parser.add_argument( + "-H", + "--hostname", + help="TCP/IP hostname to serve on (default: %(default)r)", + default="localhost", + ) + arg_parser.add_argument( + "-P", + "--port", + help="TCP/IP port to serve on (default: %(default)r)", + type=int, + default="8080", + ) + arg_parser.add_argument( + "-U", + "--path", + help="Unix file system path to serve on. Specifying a path will cause " + "hostname and port arguments to be ignored.", + ) + args, extra_argv = arg_parser.parse_known_args(argv) + + # Import logic + mod_str, _, func_str = args.entry_func.partition(":") + if not func_str or not mod_str: + arg_parser.error("'entry-func' not in 'module:function' syntax") + if mod_str.startswith("."): + arg_parser.error("relative module names not supported") + try: + module = import_module(mod_str) + except ImportError as ex: + arg_parser.error(f"unable to import {mod_str}: {ex}") + try: + func = getattr(module, func_str) + except AttributeError: + arg_parser.error(f"module {mod_str!r} has no attribute {func_str!r}") + + # Compatibility logic + if args.path is not None and not hasattr(socket, "AF_UNIX"): + arg_parser.error( + "file system paths not supported by your operating" " environment" + ) + + logging.basicConfig(level=logging.DEBUG) + + app = func(extra_argv) + run_app(app, host=args.hostname, port=args.port, path=args.path) + arg_parser.exit(message="Stopped\n") + + +if __name__ == "__main__": # pragma: no branch + main(sys.argv[1:]) # pragma: no cover diff --git a/runtime/Lib/site-packages/aiohttp/web_app.py b/runtime/Lib/site-packages/aiohttp/web_app.py new file mode 100644 index 0000000000000000000000000000000000000000..d4df772c08392d4c50dec7df15359b0307718761 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/web_app.py @@ -0,0 +1,557 @@ +import asyncio +import logging +import warnings +from functools import partial, update_wrapper +from typing import ( + TYPE_CHECKING, + Any, + AsyncIterator, + Awaitable, + Callable, + Dict, + Iterable, + Iterator, + List, + Mapping, + MutableMapping, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from aiosignal import Signal +from frozenlist import FrozenList + +from . import hdrs +from .abc import ( + AbstractAccessLogger, + AbstractMatchInfo, + AbstractRouter, + AbstractStreamWriter, +) +from .helpers import DEBUG +from .http_parser import RawRequestMessage +from .log import web_logger +from .streams import StreamReader +from .web_log import AccessLogger +from .web_middlewares import _fix_request_current_app +from .web_protocol import RequestHandler +from .web_request import Request +from .web_response import StreamResponse +from .web_routedef import AbstractRouteDef +from .web_server import Server +from .web_urldispatcher import ( + AbstractResource, + AbstractRoute, + Domain, + MaskDomain, + MatchedSubAppResource, + PrefixedSubAppResource, + UrlDispatcher, +) + +__all__ = ("Application", "CleanupError") + + +if TYPE_CHECKING: # pragma: no cover + from .typedefs import Handler + + _AppSignal = Signal[Callable[["Application"], Awaitable[None]]] + _RespPrepareSignal = Signal[Callable[[Request, StreamResponse], Awaitable[None]]] + _Middleware = Union[ + Callable[[Request, Handler], Awaitable[StreamResponse]], + Callable[["Application", Handler], Awaitable[Handler]], # old-style + ] + _Middlewares = FrozenList[_Middleware] + _MiddlewaresHandlers = Optional[Sequence[Tuple[_Middleware, bool]]] + _Subapps = List["Application"] +else: + # No type checker mode, skip types + _AppSignal = Signal + _RespPrepareSignal = Signal + _Middleware = Callable + _Middlewares = FrozenList + _MiddlewaresHandlers = Optional[Sequence] + _Subapps = List + + +class Application(MutableMapping[str, Any]): + ATTRS = frozenset( + [ + "logger", + "_debug", + "_router", + "_loop", + "_handler_args", + "_middlewares", + "_middlewares_handlers", + "_run_middlewares", + "_state", + "_frozen", + "_pre_frozen", + "_subapps", + "_on_response_prepare", + "_on_startup", + "_on_shutdown", + "_on_cleanup", + "_client_max_size", + "_cleanup_ctx", + ] + ) + + def __init__( + self, + *, + logger: logging.Logger = web_logger, + router: Optional[UrlDispatcher] = None, + middlewares: Iterable[_Middleware] = (), + handler_args: Optional[Mapping[str, Any]] = None, + client_max_size: int = 1024**2, + loop: Optional[asyncio.AbstractEventLoop] = None, + debug: Any = ..., # mypy doesn't support ellipsis + ) -> None: + if router is None: + router = UrlDispatcher() + else: + warnings.warn( + "router argument is deprecated", DeprecationWarning, stacklevel=2 + ) + assert isinstance(router, AbstractRouter), router + + if loop is not None: + warnings.warn( + "loop argument is deprecated", DeprecationWarning, stacklevel=2 + ) + + if debug is not ...: + warnings.warn( + "debug argument is deprecated", DeprecationWarning, stacklevel=2 + ) + self._debug = debug + self._router: UrlDispatcher = router + self._loop = loop + self._handler_args = handler_args + self.logger = logger + + self._middlewares: _Middlewares = FrozenList(middlewares) + + # initialized on freezing + self._middlewares_handlers: _MiddlewaresHandlers = None + # initialized on freezing + self._run_middlewares: Optional[bool] = None + + self._state: Dict[str, Any] = {} + self._frozen = False + self._pre_frozen = False + self._subapps: _Subapps = [] + + self._on_response_prepare: _RespPrepareSignal = Signal(self) + self._on_startup: _AppSignal = Signal(self) + self._on_shutdown: _AppSignal = Signal(self) + self._on_cleanup: _AppSignal = Signal(self) + self._cleanup_ctx = CleanupContext() + self._on_startup.append(self._cleanup_ctx._on_startup) + self._on_cleanup.append(self._cleanup_ctx._on_cleanup) + self._client_max_size = client_max_size + + def __init_subclass__(cls: Type["Application"]) -> None: + warnings.warn( + "Inheritance class {} from web.Application " + "is discouraged".format(cls.__name__), + DeprecationWarning, + stacklevel=2, + ) + + if DEBUG: # pragma: no cover + + def __setattr__(self, name: str, val: Any) -> None: + if name not in self.ATTRS: + warnings.warn( + "Setting custom web.Application.{} attribute " + "is discouraged".format(name), + DeprecationWarning, + stacklevel=2, + ) + super().__setattr__(name, val) + + # MutableMapping API + + def __eq__(self, other: object) -> bool: + return self is other + + def __getitem__(self, key: str) -> Any: + return self._state[key] + + def _check_frozen(self) -> None: + if self._frozen: + warnings.warn( + "Changing state of started or joined " "application is deprecated", + DeprecationWarning, + stacklevel=3, + ) + + def __setitem__(self, key: str, value: Any) -> None: + self._check_frozen() + self._state[key] = value + + def __delitem__(self, key: str) -> None: + self._check_frozen() + del self._state[key] + + def __len__(self) -> int: + return len(self._state) + + def __iter__(self) -> Iterator[str]: + return iter(self._state) + + ######## + @property + def loop(self) -> asyncio.AbstractEventLoop: + # Technically the loop can be None + # but we mask it by explicit type cast + # to provide more convinient type annotation + warnings.warn("loop property is deprecated", DeprecationWarning, stacklevel=2) + return cast(asyncio.AbstractEventLoop, self._loop) + + def _set_loop(self, loop: Optional[asyncio.AbstractEventLoop]) -> None: + if loop is None: + loop = asyncio.get_event_loop() + if self._loop is not None and self._loop is not loop: + raise RuntimeError( + "web.Application instance initialized with different loop" + ) + + self._loop = loop + + # set loop debug + if self._debug is ...: + self._debug = loop.get_debug() + + # set loop to sub applications + for subapp in self._subapps: + subapp._set_loop(loop) + + @property + def pre_frozen(self) -> bool: + return self._pre_frozen + + def pre_freeze(self) -> None: + if self._pre_frozen: + return + + self._pre_frozen = True + self._middlewares.freeze() + self._router.freeze() + self._on_response_prepare.freeze() + self._cleanup_ctx.freeze() + self._on_startup.freeze() + self._on_shutdown.freeze() + self._on_cleanup.freeze() + self._middlewares_handlers = tuple(self._prepare_middleware()) + + # If current app and any subapp do not have middlewares avoid run all + # of the code footprint that it implies, which have a middleware + # hardcoded per app that sets up the current_app attribute. If no + # middlewares are configured the handler will receive the proper + # current_app without needing all of this code. + self._run_middlewares = True if self.middlewares else False + + for subapp in self._subapps: + subapp.pre_freeze() + self._run_middlewares = self._run_middlewares or subapp._run_middlewares + + @property + def frozen(self) -> bool: + return self._frozen + + def freeze(self) -> None: + if self._frozen: + return + + self.pre_freeze() + self._frozen = True + for subapp in self._subapps: + subapp.freeze() + + @property + def debug(self) -> bool: + warnings.warn("debug property is deprecated", DeprecationWarning, stacklevel=2) + return self._debug # type: ignore[no-any-return] + + def _reg_subapp_signals(self, subapp: "Application") -> None: + def reg_handler(signame: str) -> None: + subsig = getattr(subapp, signame) + + async def handler(app: "Application") -> None: + await subsig.send(subapp) + + appsig = getattr(self, signame) + appsig.append(handler) + + reg_handler("on_startup") + reg_handler("on_shutdown") + reg_handler("on_cleanup") + + def add_subapp(self, prefix: str, subapp: "Application") -> AbstractResource: + if not isinstance(prefix, str): + raise TypeError("Prefix must be str") + prefix = prefix.rstrip("/") + if not prefix: + raise ValueError("Prefix cannot be empty") + factory = partial(PrefixedSubAppResource, prefix, subapp) + return self._add_subapp(factory, subapp) + + def _add_subapp( + self, resource_factory: Callable[[], AbstractResource], subapp: "Application" + ) -> AbstractResource: + if self.frozen: + raise RuntimeError("Cannot add sub application to frozen application") + if subapp.frozen: + raise RuntimeError("Cannot add frozen application") + resource = resource_factory() + self.router.register_resource(resource) + self._reg_subapp_signals(subapp) + self._subapps.append(subapp) + subapp.pre_freeze() + if self._loop is not None: + subapp._set_loop(self._loop) + return resource + + def add_domain(self, domain: str, subapp: "Application") -> AbstractResource: + if not isinstance(domain, str): + raise TypeError("Domain must be str") + elif "*" in domain: + rule: Domain = MaskDomain(domain) + else: + rule = Domain(domain) + factory = partial(MatchedSubAppResource, rule, subapp) + return self._add_subapp(factory, subapp) + + def add_routes(self, routes: Iterable[AbstractRouteDef]) -> List[AbstractRoute]: + return self.router.add_routes(routes) + + @property + def on_response_prepare(self) -> _RespPrepareSignal: + return self._on_response_prepare + + @property + def on_startup(self) -> _AppSignal: + return self._on_startup + + @property + def on_shutdown(self) -> _AppSignal: + return self._on_shutdown + + @property + def on_cleanup(self) -> _AppSignal: + return self._on_cleanup + + @property + def cleanup_ctx(self) -> "CleanupContext": + return self._cleanup_ctx + + @property + def router(self) -> UrlDispatcher: + return self._router + + @property + def middlewares(self) -> _Middlewares: + return self._middlewares + + def _make_handler( + self, + *, + loop: Optional[asyncio.AbstractEventLoop] = None, + access_log_class: Type[AbstractAccessLogger] = AccessLogger, + **kwargs: Any, + ) -> Server: + + if not issubclass(access_log_class, AbstractAccessLogger): + raise TypeError( + "access_log_class must be subclass of " + "aiohttp.abc.AbstractAccessLogger, got {}".format(access_log_class) + ) + + self._set_loop(loop) + self.freeze() + + kwargs["debug"] = self._debug + kwargs["access_log_class"] = access_log_class + if self._handler_args: + for k, v in self._handler_args.items(): + kwargs[k] = v + + return Server( + self._handle, # type: ignore[arg-type] + request_factory=self._make_request, + loop=self._loop, + **kwargs, + ) + + def make_handler( + self, + *, + loop: Optional[asyncio.AbstractEventLoop] = None, + access_log_class: Type[AbstractAccessLogger] = AccessLogger, + **kwargs: Any, + ) -> Server: + + warnings.warn( + "Application.make_handler(...) is deprecated, " "use AppRunner API instead", + DeprecationWarning, + stacklevel=2, + ) + + return self._make_handler( + loop=loop, access_log_class=access_log_class, **kwargs + ) + + async def startup(self) -> None: + """Causes on_startup signal + + Should be called in the event loop along with the request handler. + """ + await self.on_startup.send(self) + + async def shutdown(self) -> None: + """Causes on_shutdown signal + + Should be called before cleanup() + """ + await self.on_shutdown.send(self) + + async def cleanup(self) -> None: + """Causes on_cleanup signal + + Should be called after shutdown() + """ + if self.on_cleanup.frozen: + await self.on_cleanup.send(self) + else: + # If an exception occurs in startup, ensure cleanup contexts are completed. + await self._cleanup_ctx._on_cleanup(self) + + def _make_request( + self, + message: RawRequestMessage, + payload: StreamReader, + protocol: RequestHandler, + writer: AbstractStreamWriter, + task: "asyncio.Task[None]", + _cls: Type[Request] = Request, + ) -> Request: + return _cls( + message, + payload, + protocol, + writer, + task, + self._loop, + client_max_size=self._client_max_size, + ) + + def _prepare_middleware(self) -> Iterator[Tuple[_Middleware, bool]]: + for m in reversed(self._middlewares): + if getattr(m, "__middleware_version__", None) == 1: + yield m, True + else: + warnings.warn( + 'old-style middleware "{!r}" deprecated, ' "see #2252".format(m), + DeprecationWarning, + stacklevel=2, + ) + yield m, False + + yield _fix_request_current_app(self), True + + async def _handle(self, request: Request) -> StreamResponse: + loop = asyncio.get_event_loop() + debug = loop.get_debug() + match_info = await self._router.resolve(request) + if debug: # pragma: no cover + if not isinstance(match_info, AbstractMatchInfo): + raise TypeError( + "match_info should be AbstractMatchInfo " + "instance, not {!r}".format(match_info) + ) + match_info.add_app(self) + + match_info.freeze() + + resp = None + request._match_info = match_info + expect = request.headers.get(hdrs.EXPECT) + if expect: + resp = await match_info.expect_handler(request) + await request.writer.drain() + + if resp is None: + handler = match_info.handler + + if self._run_middlewares: + for app in match_info.apps[::-1]: + for m, new_style in app._middlewares_handlers: # type: ignore[union-attr] # noqa + if new_style: + handler = update_wrapper( + partial(m, handler=handler), handler + ) + else: + handler = await m(app, handler) # type: ignore[arg-type] + + resp = await handler(request) + + return resp + + def __call__(self) -> "Application": + """gunicorn compatibility""" + return self + + def __repr__(self) -> str: + return f"" + + def __bool__(self) -> bool: + return True + + +class CleanupError(RuntimeError): + @property + def exceptions(self) -> List[BaseException]: + return cast(List[BaseException], self.args[1]) + + +if TYPE_CHECKING: # pragma: no cover + _CleanupContextBase = FrozenList[Callable[[Application], AsyncIterator[None]]] +else: + _CleanupContextBase = FrozenList + + +class CleanupContext(_CleanupContextBase): + def __init__(self) -> None: + super().__init__() + self._exits: List[AsyncIterator[None]] = [] + + async def _on_startup(self, app: Application) -> None: + for cb in self: + it = cb(app).__aiter__() + await it.__anext__() + self._exits.append(it) + + async def _on_cleanup(self, app: Application) -> None: + errors = [] + for it in reversed(self._exits): + try: + await it.__anext__() + except StopAsyncIteration: + pass + except Exception as exc: + errors.append(exc) + else: + errors.append(RuntimeError(f"{it!r} has more than one 'yield'")) + if errors: + if len(errors) == 1: + raise errors[0] + else: + raise CleanupError("Multiple errors on cleanup stage", errors) diff --git a/runtime/Lib/site-packages/aiohttp/web_exceptions.py b/runtime/Lib/site-packages/aiohttp/web_exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..a32d50bc93b6a4877ec29abdfa4c61129373ecef --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/web_exceptions.py @@ -0,0 +1,441 @@ +import warnings +from typing import Any, Dict, Iterable, List, Optional, Set # noqa + +from yarl import URL + +from .typedefs import LooseHeaders, StrOrURL +from .web_response import Response + +__all__ = ( + "HTTPException", + "HTTPError", + "HTTPRedirection", + "HTTPSuccessful", + "HTTPOk", + "HTTPCreated", + "HTTPAccepted", + "HTTPNonAuthoritativeInformation", + "HTTPNoContent", + "HTTPResetContent", + "HTTPPartialContent", + "HTTPMultipleChoices", + "HTTPMovedPermanently", + "HTTPFound", + "HTTPSeeOther", + "HTTPNotModified", + "HTTPUseProxy", + "HTTPTemporaryRedirect", + "HTTPPermanentRedirect", + "HTTPClientError", + "HTTPBadRequest", + "HTTPUnauthorized", + "HTTPPaymentRequired", + "HTTPForbidden", + "HTTPNotFound", + "HTTPMethodNotAllowed", + "HTTPNotAcceptable", + "HTTPProxyAuthenticationRequired", + "HTTPRequestTimeout", + "HTTPConflict", + "HTTPGone", + "HTTPLengthRequired", + "HTTPPreconditionFailed", + "HTTPRequestEntityTooLarge", + "HTTPRequestURITooLong", + "HTTPUnsupportedMediaType", + "HTTPRequestRangeNotSatisfiable", + "HTTPExpectationFailed", + "HTTPMisdirectedRequest", + "HTTPUnprocessableEntity", + "HTTPFailedDependency", + "HTTPUpgradeRequired", + "HTTPPreconditionRequired", + "HTTPTooManyRequests", + "HTTPRequestHeaderFieldsTooLarge", + "HTTPUnavailableForLegalReasons", + "HTTPServerError", + "HTTPInternalServerError", + "HTTPNotImplemented", + "HTTPBadGateway", + "HTTPServiceUnavailable", + "HTTPGatewayTimeout", + "HTTPVersionNotSupported", + "HTTPVariantAlsoNegotiates", + "HTTPInsufficientStorage", + "HTTPNotExtended", + "HTTPNetworkAuthenticationRequired", +) + + +############################################################ +# HTTP Exceptions +############################################################ + + +class HTTPException(Response, Exception): + + # You should set in subclasses: + # status = 200 + + status_code = -1 + empty_body = False + + __http_exception__ = True + + def __init__( + self, + *, + headers: Optional[LooseHeaders] = None, + reason: Optional[str] = None, + body: Any = None, + text: Optional[str] = None, + content_type: Optional[str] = None, + ) -> None: + if body is not None: + warnings.warn( + "body argument is deprecated for http web exceptions", + DeprecationWarning, + ) + Response.__init__( + self, + status=self.status_code, + headers=headers, + reason=reason, + body=body, + text=text, + content_type=content_type, + ) + Exception.__init__(self, self.reason) + if self.body is None and not self.empty_body: + self.text = f"{self.status}: {self.reason}" + + def __bool__(self) -> bool: + return True + + +class HTTPError(HTTPException): + """Base class for exceptions with status codes in the 400s and 500s.""" + + +class HTTPRedirection(HTTPException): + """Base class for exceptions with status codes in the 300s.""" + + +class HTTPSuccessful(HTTPException): + """Base class for exceptions with status codes in the 200s.""" + + +class HTTPOk(HTTPSuccessful): + status_code = 200 + + +class HTTPCreated(HTTPSuccessful): + status_code = 201 + + +class HTTPAccepted(HTTPSuccessful): + status_code = 202 + + +class HTTPNonAuthoritativeInformation(HTTPSuccessful): + status_code = 203 + + +class HTTPNoContent(HTTPSuccessful): + status_code = 204 + empty_body = True + + +class HTTPResetContent(HTTPSuccessful): + status_code = 205 + empty_body = True + + +class HTTPPartialContent(HTTPSuccessful): + status_code = 206 + + +############################################################ +# 3xx redirection +############################################################ + + +class _HTTPMove(HTTPRedirection): + def __init__( + self, + location: StrOrURL, + *, + headers: Optional[LooseHeaders] = None, + reason: Optional[str] = None, + body: Any = None, + text: Optional[str] = None, + content_type: Optional[str] = None, + ) -> None: + if not location: + raise ValueError("HTTP redirects need a location to redirect to.") + super().__init__( + headers=headers, + reason=reason, + body=body, + text=text, + content_type=content_type, + ) + self.headers["Location"] = str(URL(location)) + self.location = location + + +class HTTPMultipleChoices(_HTTPMove): + status_code = 300 + + +class HTTPMovedPermanently(_HTTPMove): + status_code = 301 + + +class HTTPFound(_HTTPMove): + status_code = 302 + + +# This one is safe after a POST (the redirected location will be +# retrieved with GET): +class HTTPSeeOther(_HTTPMove): + status_code = 303 + + +class HTTPNotModified(HTTPRedirection): + # FIXME: this should include a date or etag header + status_code = 304 + empty_body = True + + +class HTTPUseProxy(_HTTPMove): + # Not a move, but looks a little like one + status_code = 305 + + +class HTTPTemporaryRedirect(_HTTPMove): + status_code = 307 + + +class HTTPPermanentRedirect(_HTTPMove): + status_code = 308 + + +############################################################ +# 4xx client error +############################################################ + + +class HTTPClientError(HTTPError): + pass + + +class HTTPBadRequest(HTTPClientError): + status_code = 400 + + +class HTTPUnauthorized(HTTPClientError): + status_code = 401 + + +class HTTPPaymentRequired(HTTPClientError): + status_code = 402 + + +class HTTPForbidden(HTTPClientError): + status_code = 403 + + +class HTTPNotFound(HTTPClientError): + status_code = 404 + + +class HTTPMethodNotAllowed(HTTPClientError): + status_code = 405 + + def __init__( + self, + method: str, + allowed_methods: Iterable[str], + *, + headers: Optional[LooseHeaders] = None, + reason: Optional[str] = None, + body: Any = None, + text: Optional[str] = None, + content_type: Optional[str] = None, + ) -> None: + allow = ",".join(sorted(allowed_methods)) + super().__init__( + headers=headers, + reason=reason, + body=body, + text=text, + content_type=content_type, + ) + self.headers["Allow"] = allow + self.allowed_methods: Set[str] = set(allowed_methods) + self.method = method.upper() + + +class HTTPNotAcceptable(HTTPClientError): + status_code = 406 + + +class HTTPProxyAuthenticationRequired(HTTPClientError): + status_code = 407 + + +class HTTPRequestTimeout(HTTPClientError): + status_code = 408 + + +class HTTPConflict(HTTPClientError): + status_code = 409 + + +class HTTPGone(HTTPClientError): + status_code = 410 + + +class HTTPLengthRequired(HTTPClientError): + status_code = 411 + + +class HTTPPreconditionFailed(HTTPClientError): + status_code = 412 + + +class HTTPRequestEntityTooLarge(HTTPClientError): + status_code = 413 + + def __init__(self, max_size: float, actual_size: float, **kwargs: Any) -> None: + kwargs.setdefault( + "text", + "Maximum request body size {} exceeded, " + "actual body size {}".format(max_size, actual_size), + ) + super().__init__(**kwargs) + + +class HTTPRequestURITooLong(HTTPClientError): + status_code = 414 + + +class HTTPUnsupportedMediaType(HTTPClientError): + status_code = 415 + + +class HTTPRequestRangeNotSatisfiable(HTTPClientError): + status_code = 416 + + +class HTTPExpectationFailed(HTTPClientError): + status_code = 417 + + +class HTTPMisdirectedRequest(HTTPClientError): + status_code = 421 + + +class HTTPUnprocessableEntity(HTTPClientError): + status_code = 422 + + +class HTTPFailedDependency(HTTPClientError): + status_code = 424 + + +class HTTPUpgradeRequired(HTTPClientError): + status_code = 426 + + +class HTTPPreconditionRequired(HTTPClientError): + status_code = 428 + + +class HTTPTooManyRequests(HTTPClientError): + status_code = 429 + + +class HTTPRequestHeaderFieldsTooLarge(HTTPClientError): + status_code = 431 + + +class HTTPUnavailableForLegalReasons(HTTPClientError): + status_code = 451 + + def __init__( + self, + link: str, + *, + headers: Optional[LooseHeaders] = None, + reason: Optional[str] = None, + body: Any = None, + text: Optional[str] = None, + content_type: Optional[str] = None, + ) -> None: + super().__init__( + headers=headers, + reason=reason, + body=body, + text=text, + content_type=content_type, + ) + self.headers["Link"] = '<%s>; rel="blocked-by"' % link + self.link = link + + +############################################################ +# 5xx Server Error +############################################################ +# Response status codes beginning with the digit "5" indicate cases in +# which the server is aware that it has erred or is incapable of +# performing the request. Except when responding to a HEAD request, the +# server SHOULD include an entity containing an explanation of the error +# situation, and whether it is a temporary or permanent condition. User +# agents SHOULD display any included entity to the user. These response +# codes are applicable to any request method. + + +class HTTPServerError(HTTPError): + pass + + +class HTTPInternalServerError(HTTPServerError): + status_code = 500 + + +class HTTPNotImplemented(HTTPServerError): + status_code = 501 + + +class HTTPBadGateway(HTTPServerError): + status_code = 502 + + +class HTTPServiceUnavailable(HTTPServerError): + status_code = 503 + + +class HTTPGatewayTimeout(HTTPServerError): + status_code = 504 + + +class HTTPVersionNotSupported(HTTPServerError): + status_code = 505 + + +class HTTPVariantAlsoNegotiates(HTTPServerError): + status_code = 506 + + +class HTTPInsufficientStorage(HTTPServerError): + status_code = 507 + + +class HTTPNotExtended(HTTPServerError): + status_code = 510 + + +class HTTPNetworkAuthenticationRequired(HTTPServerError): + status_code = 511 diff --git a/runtime/Lib/site-packages/aiohttp/web_fileresponse.py b/runtime/Lib/site-packages/aiohttp/web_fileresponse.py new file mode 100644 index 0000000000000000000000000000000000000000..163082bb3fc1881a54ac4d9462db7a97cadb0ee7 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/web_fileresponse.py @@ -0,0 +1,288 @@ +import asyncio +import mimetypes +import os +import pathlib +import sys +from typing import ( # noqa + IO, + TYPE_CHECKING, + Any, + Awaitable, + Callable, + Iterator, + List, + Optional, + Tuple, + Union, + cast, +) + +from . import hdrs +from .abc import AbstractStreamWriter +from .helpers import ETAG_ANY, ETag +from .typedefs import Final, LooseHeaders +from .web_exceptions import ( + HTTPNotModified, + HTTPPartialContent, + HTTPPreconditionFailed, + HTTPRequestRangeNotSatisfiable, +) +from .web_response import StreamResponse + +__all__ = ("FileResponse",) + +if TYPE_CHECKING: # pragma: no cover + from .web_request import BaseRequest + + +_T_OnChunkSent = Optional[Callable[[bytes], Awaitable[None]]] + + +NOSENDFILE: Final[bool] = bool(os.environ.get("AIOHTTP_NOSENDFILE")) + + +class FileResponse(StreamResponse): + """A response object can be used to send files.""" + + def __init__( + self, + path: Union[str, pathlib.Path], + chunk_size: int = 256 * 1024, + status: int = 200, + reason: Optional[str] = None, + headers: Optional[LooseHeaders] = None, + ) -> None: + super().__init__(status=status, reason=reason, headers=headers) + + if isinstance(path, str): + path = pathlib.Path(path) + + self._path = path + self._chunk_size = chunk_size + + async def _sendfile_fallback( + self, writer: AbstractStreamWriter, fobj: IO[Any], offset: int, count: int + ) -> AbstractStreamWriter: + # To keep memory usage low,fobj is transferred in chunks + # controlled by the constructor's chunk_size argument. + + chunk_size = self._chunk_size + loop = asyncio.get_event_loop() + + await loop.run_in_executor(None, fobj.seek, offset) + + chunk = await loop.run_in_executor(None, fobj.read, chunk_size) + while chunk: + await writer.write(chunk) + count = count - chunk_size + if count <= 0: + break + chunk = await loop.run_in_executor(None, fobj.read, min(chunk_size, count)) + + await writer.drain() + return writer + + async def _sendfile( + self, request: "BaseRequest", fobj: IO[Any], offset: int, count: int + ) -> AbstractStreamWriter: + writer = await super().prepare(request) + assert writer is not None + + if NOSENDFILE or sys.version_info < (3, 7) or self.compression: + return await self._sendfile_fallback(writer, fobj, offset, count) + + loop = request._loop + transport = request.transport + assert transport is not None + + try: + await loop.sendfile(transport, fobj, offset, count) + except NotImplementedError: + return await self._sendfile_fallback(writer, fobj, offset, count) + + await super().write_eof() + return writer + + @staticmethod + def _strong_etag_match(etag_value: str, etags: Tuple[ETag, ...]) -> bool: + if len(etags) == 1 and etags[0].value == ETAG_ANY: + return True + return any(etag.value == etag_value for etag in etags if not etag.is_weak) + + async def _not_modified( + self, request: "BaseRequest", etag_value: str, last_modified: float + ) -> Optional[AbstractStreamWriter]: + self.set_status(HTTPNotModified.status_code) + self._length_check = False + self.etag = etag_value # type: ignore[assignment] + self.last_modified = last_modified # type: ignore[assignment] + # Delete any Content-Length headers provided by user. HTTP 304 + # should always have empty response body + return await super().prepare(request) + + async def _precondition_failed( + self, request: "BaseRequest" + ) -> Optional[AbstractStreamWriter]: + self.set_status(HTTPPreconditionFailed.status_code) + self.content_length = 0 + return await super().prepare(request) + + async def prepare(self, request: "BaseRequest") -> Optional[AbstractStreamWriter]: + filepath = self._path + + gzip = False + if "gzip" in request.headers.get(hdrs.ACCEPT_ENCODING, ""): + gzip_path = filepath.with_name(filepath.name + ".gz") + + if gzip_path.is_file(): + filepath = gzip_path + gzip = True + + loop = asyncio.get_event_loop() + st: os.stat_result = await loop.run_in_executor(None, filepath.stat) + + etag_value = f"{st.st_mtime_ns:x}-{st.st_size:x}" + last_modified = st.st_mtime + + # https://tools.ietf.org/html/rfc7232#section-6 + ifmatch = request.if_match + if ifmatch is not None and not self._strong_etag_match(etag_value, ifmatch): + return await self._precondition_failed(request) + + unmodsince = request.if_unmodified_since + if ( + unmodsince is not None + and ifmatch is None + and st.st_mtime > unmodsince.timestamp() + ): + return await self._precondition_failed(request) + + ifnonematch = request.if_none_match + if ifnonematch is not None and self._strong_etag_match(etag_value, ifnonematch): + return await self._not_modified(request, etag_value, last_modified) + + modsince = request.if_modified_since + if ( + modsince is not None + and ifnonematch is None + and st.st_mtime <= modsince.timestamp() + ): + return await self._not_modified(request, etag_value, last_modified) + + if hdrs.CONTENT_TYPE not in self.headers: + ct, encoding = mimetypes.guess_type(str(filepath)) + if not ct: + ct = "application/octet-stream" + should_set_ct = True + else: + encoding = "gzip" if gzip else None + should_set_ct = False + + status = self._status + file_size = st.st_size + count = file_size + + start = None + + ifrange = request.if_range + if ifrange is None or st.st_mtime <= ifrange.timestamp(): + # If-Range header check: + # condition = cached date >= last modification date + # return 206 if True else 200. + # if False: + # Range header would not be processed, return 200 + # if True but Range header missing + # return 200 + try: + rng = request.http_range + start = rng.start + end = rng.stop + except ValueError: + # https://tools.ietf.org/html/rfc7233: + # A server generating a 416 (Range Not Satisfiable) response to + # a byte-range request SHOULD send a Content-Range header field + # with an unsatisfied-range value. + # The complete-length in a 416 response indicates the current + # length of the selected representation. + # + # Will do the same below. Many servers ignore this and do not + # send a Content-Range header with HTTP 416 + self.headers[hdrs.CONTENT_RANGE] = f"bytes */{file_size}" + self.set_status(HTTPRequestRangeNotSatisfiable.status_code) + return await super().prepare(request) + + # If a range request has been made, convert start, end slice + # notation into file pointer offset and count + if start is not None or end is not None: + if start < 0 and end is None: # return tail of file + start += file_size + if start < 0: + # if Range:bytes=-1000 in request header but file size + # is only 200, there would be trouble without this + start = 0 + count = file_size - start + else: + # rfc7233:If the last-byte-pos value is + # absent, or if the value is greater than or equal to + # the current length of the representation data, + # the byte range is interpreted as the remainder + # of the representation (i.e., the server replaces the + # value of last-byte-pos with a value that is one less than + # the current length of the selected representation). + count = ( + min(end if end is not None else file_size, file_size) - start + ) + + if start >= file_size: + # HTTP 416 should be returned in this case. + # + # According to https://tools.ietf.org/html/rfc7233: + # If a valid byte-range-set includes at least one + # byte-range-spec with a first-byte-pos that is less than + # the current length of the representation, or at least one + # suffix-byte-range-spec with a non-zero suffix-length, + # then the byte-range-set is satisfiable. Otherwise, the + # byte-range-set is unsatisfiable. + self.headers[hdrs.CONTENT_RANGE] = f"bytes */{file_size}" + self.set_status(HTTPRequestRangeNotSatisfiable.status_code) + return await super().prepare(request) + + status = HTTPPartialContent.status_code + # Even though you are sending the whole file, you should still + # return a HTTP 206 for a Range request. + self.set_status(status) + + if should_set_ct: + self.content_type = ct # type: ignore[assignment] + if encoding: + self.headers[hdrs.CONTENT_ENCODING] = encoding + if gzip: + self.headers[hdrs.VARY] = hdrs.ACCEPT_ENCODING + + self.etag = etag_value # type: ignore[assignment] + self.last_modified = st.st_mtime # type: ignore[assignment] + self.content_length = count + + self.headers[hdrs.ACCEPT_RANGES] = "bytes" + + real_start = cast(int, start) + + if status == HTTPPartialContent.status_code: + self.headers[hdrs.CONTENT_RANGE] = "bytes {}-{}/{}".format( + real_start, real_start + count - 1, file_size + ) + + # If we are sending 0 bytes calling sendfile() will throw a ValueError + if count == 0 or request.method == hdrs.METH_HEAD or self.status in [204, 304]: + return await super().prepare(request) + + fobj = await loop.run_in_executor(None, filepath.open, "rb") + if start: # be aware that start could be None or int=0 here. + offset = start + else: + offset = 0 + + try: + return await self._sendfile(request, fobj, offset, count) + finally: + await loop.run_in_executor(None, fobj.close) diff --git a/runtime/Lib/site-packages/aiohttp/web_log.py b/runtime/Lib/site-packages/aiohttp/web_log.py new file mode 100644 index 0000000000000000000000000000000000000000..5c808d40a8fd231617c0957cb63d002f9e7bcaa5 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/web_log.py @@ -0,0 +1,208 @@ +import datetime +import functools +import logging +import os +import re +from collections import namedtuple +from typing import Any, Callable, Dict, Iterable, List, Tuple # noqa + +from .abc import AbstractAccessLogger +from .web_request import BaseRequest +from .web_response import StreamResponse + +KeyMethod = namedtuple("KeyMethod", "key method") + + +class AccessLogger(AbstractAccessLogger): + """Helper object to log access. + + Usage: + log = logging.getLogger("spam") + log_format = "%a %{User-Agent}i" + access_logger = AccessLogger(log, log_format) + access_logger.log(request, response, time) + + Format: + %% The percent sign + %a Remote IP-address (IP-address of proxy if using reverse proxy) + %t Time when the request was started to process + %P The process ID of the child that serviced the request + %r First line of request + %s Response status code + %b Size of response in bytes, including HTTP headers + %T Time taken to serve the request, in seconds + %Tf Time taken to serve the request, in seconds with floating fraction + in .06f format + %D Time taken to serve the request, in microseconds + %{FOO}i request.headers['FOO'] + %{FOO}o response.headers['FOO'] + %{FOO}e os.environ['FOO'] + + """ + + LOG_FORMAT_MAP = { + "a": "remote_address", + "t": "request_start_time", + "P": "process_id", + "r": "first_request_line", + "s": "response_status", + "b": "response_size", + "T": "request_time", + "Tf": "request_time_frac", + "D": "request_time_micro", + "i": "request_header", + "o": "response_header", + } + + LOG_FORMAT = '%a %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"' + FORMAT_RE = re.compile(r"%(\{([A-Za-z0-9\-_]+)\}([ioe])|[atPrsbOD]|Tf?)") + CLEANUP_RE = re.compile(r"(%[^s])") + _FORMAT_CACHE: Dict[str, Tuple[str, List[KeyMethod]]] = {} + + def __init__(self, logger: logging.Logger, log_format: str = LOG_FORMAT) -> None: + """Initialise the logger. + + logger is a logger object to be used for logging. + log_format is a string with apache compatible log format description. + + """ + super().__init__(logger, log_format=log_format) + + _compiled_format = AccessLogger._FORMAT_CACHE.get(log_format) + if not _compiled_format: + _compiled_format = self.compile_format(log_format) + AccessLogger._FORMAT_CACHE[log_format] = _compiled_format + + self._log_format, self._methods = _compiled_format + + def compile_format(self, log_format: str) -> Tuple[str, List[KeyMethod]]: + """Translate log_format into form usable by modulo formatting + + All known atoms will be replaced with %s + Also methods for formatting of those atoms will be added to + _methods in appropriate order + + For example we have log_format = "%a %t" + This format will be translated to "%s %s" + Also contents of _methods will be + [self._format_a, self._format_t] + These method will be called and results will be passed + to translated string format. + + Each _format_* method receive 'args' which is list of arguments + given to self.log + + Exceptions are _format_e, _format_i and _format_o methods which + also receive key name (by functools.partial) + + """ + # list of (key, method) tuples, we don't use an OrderedDict as users + # can repeat the same key more than once + methods = list() + + for atom in self.FORMAT_RE.findall(log_format): + if atom[1] == "": + format_key1 = self.LOG_FORMAT_MAP[atom[0]] + m = getattr(AccessLogger, "_format_%s" % atom[0]) + key_method = KeyMethod(format_key1, m) + else: + format_key2 = (self.LOG_FORMAT_MAP[atom[2]], atom[1]) + m = getattr(AccessLogger, "_format_%s" % atom[2]) + key_method = KeyMethod(format_key2, functools.partial(m, atom[1])) + + methods.append(key_method) + + log_format = self.FORMAT_RE.sub(r"%s", log_format) + log_format = self.CLEANUP_RE.sub(r"%\1", log_format) + return log_format, methods + + @staticmethod + def _format_i( + key: str, request: BaseRequest, response: StreamResponse, time: float + ) -> str: + if request is None: + return "(no headers)" + + # suboptimal, make istr(key) once + return request.headers.get(key, "-") + + @staticmethod + def _format_o( + key: str, request: BaseRequest, response: StreamResponse, time: float + ) -> str: + # suboptimal, make istr(key) once + return response.headers.get(key, "-") + + @staticmethod + def _format_a(request: BaseRequest, response: StreamResponse, time: float) -> str: + if request is None: + return "-" + ip = request.remote + return ip if ip is not None else "-" + + @staticmethod + def _format_t(request: BaseRequest, response: StreamResponse, time: float) -> str: + now = datetime.datetime.utcnow() + start_time = now - datetime.timedelta(seconds=time) + return start_time.strftime("[%d/%b/%Y:%H:%M:%S +0000]") + + @staticmethod + def _format_P(request: BaseRequest, response: StreamResponse, time: float) -> str: + return "<%s>" % os.getpid() + + @staticmethod + def _format_r(request: BaseRequest, response: StreamResponse, time: float) -> str: + if request is None: + return "-" + return "{} {} HTTP/{}.{}".format( + request.method, + request.path_qs, + request.version.major, + request.version.minor, + ) + + @staticmethod + def _format_s(request: BaseRequest, response: StreamResponse, time: float) -> int: + return response.status + + @staticmethod + def _format_b(request: BaseRequest, response: StreamResponse, time: float) -> int: + return response.body_length + + @staticmethod + def _format_T(request: BaseRequest, response: StreamResponse, time: float) -> str: + return str(round(time)) + + @staticmethod + def _format_Tf(request: BaseRequest, response: StreamResponse, time: float) -> str: + return "%06f" % time + + @staticmethod + def _format_D(request: BaseRequest, response: StreamResponse, time: float) -> str: + return str(round(time * 1000000)) + + def _format_line( + self, request: BaseRequest, response: StreamResponse, time: float + ) -> Iterable[Tuple[str, Callable[[BaseRequest, StreamResponse, float], str]]]: + return [(key, method(request, response, time)) for key, method in self._methods] + + def log(self, request: BaseRequest, response: StreamResponse, time: float) -> None: + try: + fmt_info = self._format_line(request, response, time) + + values = list() + extra = dict() + for key, value in fmt_info: + values.append(value) + + if key.__class__ is str: + extra[key] = value + else: + k1, k2 = key # type: ignore[misc] + dct = extra.get(k1, {}) # type: ignore[var-annotated,has-type] + dct[k2] = value # type: ignore[index,has-type] + extra[k1] = dct # type: ignore[has-type,assignment] + + self.logger.info(self._log_format % tuple(values), extra=extra) + except Exception: + self.logger.exception("Error in logging") diff --git a/runtime/Lib/site-packages/aiohttp/web_middlewares.py b/runtime/Lib/site-packages/aiohttp/web_middlewares.py new file mode 100644 index 0000000000000000000000000000000000000000..80fb40e221dd8b6a34ec594cadacc0dfa84076dd --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/web_middlewares.py @@ -0,0 +1,119 @@ +import re +from typing import TYPE_CHECKING, Awaitable, Callable, Tuple, Type, TypeVar + +from .typedefs import Handler +from .web_exceptions import HTTPPermanentRedirect, _HTTPMove +from .web_request import Request +from .web_response import StreamResponse +from .web_urldispatcher import SystemRoute + +__all__ = ( + "middleware", + "normalize_path_middleware", +) + +if TYPE_CHECKING: # pragma: no cover + from .web_app import Application + +_Func = TypeVar("_Func") + + +async def _check_request_resolves(request: Request, path: str) -> Tuple[bool, Request]: + alt_request = request.clone(rel_url=path) + + match_info = await request.app.router.resolve(alt_request) + alt_request._match_info = match_info + + if match_info.http_exception is None: + return True, alt_request + + return False, request + + +def middleware(f: _Func) -> _Func: + f.__middleware_version__ = 1 # type: ignore[attr-defined] + return f + + +_Middleware = Callable[[Request, Handler], Awaitable[StreamResponse]] + + +def normalize_path_middleware( + *, + append_slash: bool = True, + remove_slash: bool = False, + merge_slashes: bool = True, + redirect_class: Type[_HTTPMove] = HTTPPermanentRedirect, +) -> _Middleware: + """Factory for producing a middleware that normalizes the path of a request. + + Normalizing means: + - Add or remove a trailing slash to the path. + - Double slashes are replaced by one. + + The middleware returns as soon as it finds a path that resolves + correctly. The order if both merge and append/remove are enabled is + 1) merge slashes + 2) append/remove slash + 3) both merge slashes and append/remove slash. + If the path resolves with at least one of those conditions, it will + redirect to the new path. + + Only one of `append_slash` and `remove_slash` can be enabled. If both + are `True` the factory will raise an assertion error + + If `append_slash` is `True` the middleware will append a slash when + needed. If a resource is defined with trailing slash and the request + comes without it, it will append it automatically. + + If `remove_slash` is `True`, `append_slash` must be `False`. When enabled + the middleware will remove trailing slashes and redirect if the resource + is defined + + If merge_slashes is True, merge multiple consecutive slashes in the + path into one. + """ + correct_configuration = not (append_slash and remove_slash) + assert correct_configuration, "Cannot both remove and append slash" + + @middleware + async def impl(request: Request, handler: Handler) -> StreamResponse: + if isinstance(request.match_info.route, SystemRoute): + paths_to_check = [] + if "?" in request.raw_path: + path, query = request.raw_path.split("?", 1) + query = "?" + query + else: + query = "" + path = request.raw_path + + if merge_slashes: + paths_to_check.append(re.sub("//+", "/", path)) + if append_slash and not request.path.endswith("/"): + paths_to_check.append(path + "/") + if remove_slash and request.path.endswith("/"): + paths_to_check.append(path[:-1]) + if merge_slashes and append_slash: + paths_to_check.append(re.sub("//+", "/", path + "/")) + if merge_slashes and remove_slash: + merged_slashes = re.sub("//+", "/", path) + paths_to_check.append(merged_slashes[:-1]) + + for path in paths_to_check: + path = re.sub("^//+", "/", path) # SECURITY: GHSA-v6wp-4m6f-gcjg + resolves, request = await _check_request_resolves(request, path) + if resolves: + raise redirect_class(request.raw_path + query) + + return await handler(request) + + return impl + + +def _fix_request_current_app(app: "Application") -> _Middleware: + @middleware + async def impl(request: Request, handler: Handler) -> StreamResponse: + with request.match_info.set_current_app(app): + return await handler(request) + + return impl diff --git a/runtime/Lib/site-packages/aiohttp/web_protocol.py b/runtime/Lib/site-packages/aiohttp/web_protocol.py new file mode 100644 index 0000000000000000000000000000000000000000..7f24d2928a16c7bdaebe4518276226224e66d141 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/web_protocol.py @@ -0,0 +1,679 @@ +import asyncio +import asyncio.streams +import traceback +import warnings +from collections import deque +from contextlib import suppress +from html import escape as html_escape +from http import HTTPStatus +from logging import Logger +from typing import ( + TYPE_CHECKING, + Any, + Awaitable, + Callable, + Deque, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +import attr +import yarl + +from .abc import AbstractAccessLogger, AbstractStreamWriter +from .base_protocol import BaseProtocol +from .helpers import ceil_timeout +from .http import ( + HttpProcessingError, + HttpRequestParser, + HttpVersion10, + RawRequestMessage, + StreamWriter, +) +from .log import access_logger, server_logger +from .streams import EMPTY_PAYLOAD, StreamReader +from .tcp_helpers import tcp_keepalive +from .web_exceptions import HTTPException +from .web_log import AccessLogger +from .web_request import BaseRequest +from .web_response import Response, StreamResponse + +__all__ = ("RequestHandler", "RequestPayloadError", "PayloadAccessError") + +if TYPE_CHECKING: # pragma: no cover + from .web_server import Server + + +_RequestFactory = Callable[ + [ + RawRequestMessage, + StreamReader, + "RequestHandler", + AbstractStreamWriter, + "asyncio.Task[None]", + ], + BaseRequest, +] + +_RequestHandler = Callable[[BaseRequest], Awaitable[StreamResponse]] + +ERROR = RawRequestMessage( + "UNKNOWN", + "/", + HttpVersion10, + {}, # type: ignore[arg-type] + {}, # type: ignore[arg-type] + True, + None, + False, + False, + yarl.URL("/"), +) + + +class RequestPayloadError(Exception): + """Payload parsing error.""" + + +class PayloadAccessError(Exception): + """Payload was accessed after response was sent.""" + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class _ErrInfo: + status: int + exc: BaseException + message: str + + +_MsgType = Tuple[Union[RawRequestMessage, _ErrInfo], StreamReader] + + +class RequestHandler(BaseProtocol): + """HTTP protocol implementation. + + RequestHandler handles incoming HTTP request. It reads request line, + request headers and request payload and calls handle_request() method. + By default it always returns with 404 response. + + RequestHandler handles errors in incoming request, like bad + status line, bad headers or incomplete payload. If any error occurs, + connection gets closed. + + keepalive_timeout -- number of seconds before closing + keep-alive connection + + tcp_keepalive -- TCP keep-alive is on, default is on + + debug -- enable debug mode + + logger -- custom logger object + + access_log_class -- custom class for access_logger + + access_log -- custom logging object + + access_log_format -- access log format string + + loop -- Optional event loop + + max_line_size -- Optional maximum header line size + + max_field_size -- Optional maximum header field size + + max_headers -- Optional maximum header size + + """ + + KEEPALIVE_RESCHEDULE_DELAY = 1 + + __slots__ = ( + "_request_count", + "_keepalive", + "_manager", + "_request_handler", + "_request_factory", + "_tcp_keepalive", + "_keepalive_time", + "_keepalive_handle", + "_keepalive_timeout", + "_lingering_time", + "_messages", + "_message_tail", + "_waiter", + "_task_handler", + "_upgrade", + "_payload_parser", + "_request_parser", + "_reading_paused", + "logger", + "debug", + "access_log", + "access_logger", + "_close", + "_force_close", + "_current_request", + ) + + def __init__( + self, + manager: "Server", + *, + loop: asyncio.AbstractEventLoop, + keepalive_timeout: float = 75.0, # NGINX default is 75 secs + tcp_keepalive: bool = True, + logger: Logger = server_logger, + access_log_class: Type[AbstractAccessLogger] = AccessLogger, + access_log: Logger = access_logger, + access_log_format: str = AccessLogger.LOG_FORMAT, + debug: bool = False, + max_line_size: int = 8190, + max_headers: int = 32768, + max_field_size: int = 8190, + lingering_time: float = 10.0, + read_bufsize: int = 2**16, + auto_decompress: bool = True, + ): + super().__init__(loop) + + self._request_count = 0 + self._keepalive = False + self._current_request: Optional[BaseRequest] = None + self._manager: Optional[Server] = manager + self._request_handler: Optional[_RequestHandler] = manager.request_handler + self._request_factory: Optional[_RequestFactory] = manager.request_factory + + self._tcp_keepalive = tcp_keepalive + # placeholder to be replaced on keepalive timeout setup + self._keepalive_time = 0.0 + self._keepalive_handle: Optional[asyncio.Handle] = None + self._keepalive_timeout = keepalive_timeout + self._lingering_time = float(lingering_time) + + self._messages: Deque[_MsgType] = deque() + self._message_tail = b"" + + self._waiter: Optional[asyncio.Future[None]] = None + self._task_handler: Optional[asyncio.Task[None]] = None + + self._upgrade = False + self._payload_parser: Any = None + self._request_parser: Optional[HttpRequestParser] = HttpRequestParser( + self, + loop, + read_bufsize, + max_line_size=max_line_size, + max_field_size=max_field_size, + max_headers=max_headers, + payload_exception=RequestPayloadError, + auto_decompress=auto_decompress, + ) + + self.logger = logger + self.debug = debug + self.access_log = access_log + if access_log: + self.access_logger: Optional[AbstractAccessLogger] = access_log_class( + access_log, access_log_format + ) + else: + self.access_logger = None + + self._close = False + self._force_close = False + + def __repr__(self) -> str: + return "<{} {}>".format( + self.__class__.__name__, + "connected" if self.transport is not None else "disconnected", + ) + + @property + def keepalive_timeout(self) -> float: + return self._keepalive_timeout + + async def shutdown(self, timeout: Optional[float] = 15.0) -> None: + """Do worker process exit preparations. + + We need to clean up everything and stop accepting requests. + It is especially important for keep-alive connections. + """ + self._force_close = True + + if self._keepalive_handle is not None: + self._keepalive_handle.cancel() + + if self._waiter: + self._waiter.cancel() + + # wait for handlers + with suppress(asyncio.CancelledError, asyncio.TimeoutError): + async with ceil_timeout(timeout): + if self._current_request is not None: + self._current_request._cancel(asyncio.CancelledError()) + + if self._task_handler is not None and not self._task_handler.done(): + await self._task_handler + + # force-close non-idle handler + if self._task_handler is not None: + self._task_handler.cancel() + + if self.transport is not None: + self.transport.close() + self.transport = None + + def connection_made(self, transport: asyncio.BaseTransport) -> None: + super().connection_made(transport) + + real_transport = cast(asyncio.Transport, transport) + if self._tcp_keepalive: + tcp_keepalive(real_transport) + + self._task_handler = self._loop.create_task(self.start()) + assert self._manager is not None + self._manager.connection_made(self, real_transport) + + def connection_lost(self, exc: Optional[BaseException]) -> None: + if self._manager is None: + return + self._manager.connection_lost(self, exc) + + super().connection_lost(exc) + + self._manager = None + self._force_close = True + self._request_factory = None + self._request_handler = None + self._request_parser = None + + if self._keepalive_handle is not None: + self._keepalive_handle.cancel() + + if self._current_request is not None: + if exc is None: + exc = ConnectionResetError("Connection lost") + self._current_request._cancel(exc) + + if self._waiter is not None: + self._waiter.cancel() + + self._task_handler = None + + if self._payload_parser is not None: + self._payload_parser.feed_eof() + self._payload_parser = None + + def set_parser(self, parser: Any) -> None: + # Actual type is WebReader + assert self._payload_parser is None + + self._payload_parser = parser + + if self._message_tail: + self._payload_parser.feed_data(self._message_tail) + self._message_tail = b"" + + def eof_received(self) -> None: + pass + + def data_received(self, data: bytes) -> None: + if self._force_close or self._close: + return + # parse http messages + messages: Sequence[_MsgType] + if self._payload_parser is None and not self._upgrade: + assert self._request_parser is not None + try: + messages, upgraded, tail = self._request_parser.feed_data(data) + except HttpProcessingError as exc: + messages = [ + (_ErrInfo(status=400, exc=exc, message=exc.message), EMPTY_PAYLOAD) + ] + upgraded = False + tail = b"" + + for msg, payload in messages or (): + self._request_count += 1 + self._messages.append((msg, payload)) + + waiter = self._waiter + if messages and waiter is not None and not waiter.done(): + # don't set result twice + waiter.set_result(None) + + self._upgrade = upgraded + if upgraded and tail: + self._message_tail = tail + + # no parser, just store + elif self._payload_parser is None and self._upgrade and data: + self._message_tail += data + + # feed payload + elif data: + eof, tail = self._payload_parser.feed_data(data) + if eof: + self.close() + + def keep_alive(self, val: bool) -> None: + """Set keep-alive connection mode. + + :param bool val: new state. + """ + self._keepalive = val + if self._keepalive_handle: + self._keepalive_handle.cancel() + self._keepalive_handle = None + + def close(self) -> None: + """Close connection. + + Stop accepting new pipelining messages and close + connection when handlers done processing messages. + """ + self._close = True + if self._waiter: + self._waiter.cancel() + + def force_close(self) -> None: + """Forcefully close connection.""" + self._force_close = True + if self._waiter: + self._waiter.cancel() + if self.transport is not None: + self.transport.close() + self.transport = None + + def log_access( + self, request: BaseRequest, response: StreamResponse, time: float + ) -> None: + if self.access_logger is not None: + self.access_logger.log(request, response, self._loop.time() - time) + + def log_debug(self, *args: Any, **kw: Any) -> None: + if self.debug: + self.logger.debug(*args, **kw) + + def log_exception(self, *args: Any, **kw: Any) -> None: + self.logger.exception(*args, **kw) + + def _process_keepalive(self) -> None: + if self._force_close or not self._keepalive: + return + + next = self._keepalive_time + self._keepalive_timeout + + # handler in idle state + if self._waiter: + if self._loop.time() > next: + self.force_close() + return + + # not all request handlers are done, + # reschedule itself to next second + self._keepalive_handle = self._loop.call_later( + self.KEEPALIVE_RESCHEDULE_DELAY, self._process_keepalive + ) + + async def _handle_request( + self, + request: BaseRequest, + start_time: float, + request_handler: Callable[[BaseRequest], Awaitable[StreamResponse]], + ) -> Tuple[StreamResponse, bool]: + assert self._request_handler is not None + try: + try: + self._current_request = request + resp = await request_handler(request) + finally: + self._current_request = None + except HTTPException as exc: + resp = exc + reset = await self.finish_response(request, resp, start_time) + except asyncio.CancelledError: + raise + except asyncio.TimeoutError as exc: + self.log_debug("Request handler timed out.", exc_info=exc) + resp = self.handle_error(request, 504) + reset = await self.finish_response(request, resp, start_time) + except Exception as exc: + resp = self.handle_error(request, 500, exc) + reset = await self.finish_response(request, resp, start_time) + else: + # Deprecation warning (See #2415) + if getattr(resp, "__http_exception__", False): + warnings.warn( + "returning HTTPException object is deprecated " + "(#2415) and will be removed, " + "please raise the exception instead", + DeprecationWarning, + ) + + reset = await self.finish_response(request, resp, start_time) + + return resp, reset + + async def start(self) -> None: + """Process incoming request. + + It reads request line, request headers and request payload, then + calls handle_request() method. Subclass has to override + handle_request(). start() handles various exceptions in request + or response handling. Connection is being closed always unless + keep_alive(True) specified. + """ + loop = self._loop + handler = self._task_handler + assert handler is not None + manager = self._manager + assert manager is not None + keepalive_timeout = self._keepalive_timeout + resp = None + assert self._request_factory is not None + assert self._request_handler is not None + + while not self._force_close: + if not self._messages: + try: + # wait for next request + self._waiter = loop.create_future() + await self._waiter + except asyncio.CancelledError: + break + finally: + self._waiter = None + + message, payload = self._messages.popleft() + + start = loop.time() + + manager.requests_count += 1 + writer = StreamWriter(self, loop) + if isinstance(message, _ErrInfo): + # make request_factory work + request_handler = self._make_error_handler(message) + message = ERROR + else: + request_handler = self._request_handler + + request = self._request_factory(message, payload, self, writer, handler) + try: + # a new task is used for copy context vars (#3406) + task = self._loop.create_task( + self._handle_request(request, start, request_handler) + ) + try: + resp, reset = await task + except (asyncio.CancelledError, ConnectionError): + self.log_debug("Ignored premature client disconnection") + break + + # Drop the processed task from asyncio.Task.all_tasks() early + del task + if reset: + self.log_debug("Ignored premature client disconnection 2") + break + + # notify server about keep-alive + self._keepalive = bool(resp.keep_alive) + + # check payload + if not payload.is_eof(): + lingering_time = self._lingering_time + if not self._force_close and lingering_time: + self.log_debug( + "Start lingering close timer for %s sec.", lingering_time + ) + + now = loop.time() + end_t = now + lingering_time + + with suppress(asyncio.TimeoutError, asyncio.CancelledError): + while not payload.is_eof() and now < end_t: + async with ceil_timeout(end_t - now): + # read and ignore + await payload.readany() + now = loop.time() + + # if payload still uncompleted + if not payload.is_eof() and not self._force_close: + self.log_debug("Uncompleted request.") + self.close() + + payload.set_exception(PayloadAccessError()) + + except asyncio.CancelledError: + self.log_debug("Ignored premature client disconnection ") + break + except RuntimeError as exc: + if self.debug: + self.log_exception("Unhandled runtime exception", exc_info=exc) + self.force_close() + except Exception as exc: + self.log_exception("Unhandled exception", exc_info=exc) + self.force_close() + finally: + if self.transport is None and resp is not None: + self.log_debug("Ignored premature client disconnection.") + elif not self._force_close: + if self._keepalive and not self._close: + # start keep-alive timer + if keepalive_timeout is not None: + now = self._loop.time() + self._keepalive_time = now + if self._keepalive_handle is None: + self._keepalive_handle = loop.call_at( + now + keepalive_timeout, self._process_keepalive + ) + else: + break + + # remove handler, close transport if no handlers left + if not self._force_close: + self._task_handler = None + if self.transport is not None: + self.transport.close() + + async def finish_response( + self, request: BaseRequest, resp: StreamResponse, start_time: float + ) -> bool: + """Prepare the response and write_eof, then log access. + + This has to + be called within the context of any exception so the access logger + can get exception information. Returns True if the client disconnects + prematurely. + """ + if self._request_parser is not None: + self._request_parser.set_upgraded(False) + self._upgrade = False + if self._message_tail: + self._request_parser.feed_data(self._message_tail) + self._message_tail = b"" + try: + prepare_meth = resp.prepare + except AttributeError: + if resp is None: + raise RuntimeError("Missing return " "statement on request handler") + else: + raise RuntimeError( + "Web-handler should return " + "a response instance, " + "got {!r}".format(resp) + ) + try: + await prepare_meth(request) + await resp.write_eof() + except ConnectionError: + self.log_access(request, resp, start_time) + return True + else: + self.log_access(request, resp, start_time) + return False + + def handle_error( + self, + request: BaseRequest, + status: int = 500, + exc: Optional[BaseException] = None, + message: Optional[str] = None, + ) -> StreamResponse: + """Handle errors. + + Returns HTTP response with specific status code. Logs additional + information. It always closes current connection. + """ + self.log_exception("Error handling request", exc_info=exc) + + # some data already got sent, connection is broken + if request.writer.output_size > 0: + raise ConnectionError( + "Response is sent already, cannot send another response " + "with the error message" + ) + + ct = "text/plain" + if status == HTTPStatus.INTERNAL_SERVER_ERROR: + title = "{0.value} {0.phrase}".format(HTTPStatus.INTERNAL_SERVER_ERROR) + msg = HTTPStatus.INTERNAL_SERVER_ERROR.description + tb = None + if self.debug: + with suppress(Exception): + tb = traceback.format_exc() + + if "text/html" in request.headers.get("Accept", ""): + if tb: + tb = html_escape(tb) + msg = f"

Traceback:

\n
{tb}
" + message = ( + "" + "{title}" + "\n

{title}

" + "\n{msg}\n\n" + ).format(title=title, msg=msg) + ct = "text/html" + else: + if tb: + msg = tb + message = title + "\n\n" + msg + + resp = Response(status=status, text=message, content_type=ct) + resp.force_close() + + return resp + + def _make_error_handler( + self, err_info: _ErrInfo + ) -> Callable[[BaseRequest], Awaitable[StreamResponse]]: + async def handler(request: BaseRequest) -> StreamResponse: + return self.handle_error( + request, err_info.status, err_info.exc, err_info.message + ) + + return handler diff --git a/runtime/Lib/site-packages/aiohttp/web_request.py b/runtime/Lib/site-packages/aiohttp/web_request.py new file mode 100644 index 0000000000000000000000000000000000000000..6115fa994195b6e05d1dea1112e3aef819718ca6 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/web_request.py @@ -0,0 +1,882 @@ +import asyncio +import datetime +import io +import re +import socket +import string +import tempfile +import types +import warnings +from http.cookies import SimpleCookie +from types import MappingProxyType +from typing import ( + TYPE_CHECKING, + Any, + Dict, + Iterator, + Mapping, + MutableMapping, + Optional, + Pattern, + Tuple, + Union, + cast, +) +from urllib.parse import parse_qsl + +import attr +from multidict import CIMultiDict, CIMultiDictProxy, MultiDict, MultiDictProxy +from yarl import URL + +from . import hdrs +from .abc import AbstractStreamWriter +from .helpers import ( + DEBUG, + ETAG_ANY, + LIST_QUOTED_ETAG_RE, + ChainMapProxy, + ETag, + HeadersMixin, + parse_http_date, + reify, + sentinel, +) +from .http_parser import RawRequestMessage +from .http_writer import HttpVersion +from .multipart import BodyPartReader, MultipartReader +from .streams import EmptyStreamReader, StreamReader +from .typedefs import ( + DEFAULT_JSON_DECODER, + Final, + JSONDecoder, + LooseHeaders, + RawHeaders, + StrOrURL, +) +from .web_exceptions import HTTPRequestEntityTooLarge +from .web_response import StreamResponse + +__all__ = ("BaseRequest", "FileField", "Request") + + +if TYPE_CHECKING: # pragma: no cover + from .web_app import Application + from .web_protocol import RequestHandler + from .web_urldispatcher import UrlMappingMatchInfo + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class FileField: + name: str + filename: str + file: io.BufferedReader + content_type: str + headers: "CIMultiDictProxy[str]" + + +_TCHAR: Final[str] = string.digits + string.ascii_letters + r"!#$%&'*+.^_`|~-" +# '-' at the end to prevent interpretation as range in a char class + +_TOKEN: Final[str] = rf"[{_TCHAR}]+" + +_QDTEXT: Final[str] = r"[{}]".format( + r"".join(chr(c) for c in (0x09, 0x20, 0x21) + tuple(range(0x23, 0x7F))) +) +# qdtext includes 0x5C to escape 0x5D ('\]') +# qdtext excludes obs-text (because obsoleted, and encoding not specified) + +_QUOTED_PAIR: Final[str] = r"\\[\t !-~]" + +_QUOTED_STRING: Final[str] = r'"(?:{quoted_pair}|{qdtext})*"'.format( + qdtext=_QDTEXT, quoted_pair=_QUOTED_PAIR +) + +_FORWARDED_PAIR: Final[ + str +] = r"({token})=({token}|{quoted_string})(:\d{{1,4}})?".format( + token=_TOKEN, quoted_string=_QUOTED_STRING +) + +_QUOTED_PAIR_REPLACE_RE: Final[Pattern[str]] = re.compile(r"\\([\t !-~])") +# same pattern as _QUOTED_PAIR but contains a capture group + +_FORWARDED_PAIR_RE: Final[Pattern[str]] = re.compile(_FORWARDED_PAIR) + +############################################################ +# HTTP Request +############################################################ + + +class BaseRequest(MutableMapping[str, Any], HeadersMixin): + + POST_METHODS = { + hdrs.METH_PATCH, + hdrs.METH_POST, + hdrs.METH_PUT, + hdrs.METH_TRACE, + hdrs.METH_DELETE, + } + + ATTRS = HeadersMixin.ATTRS | frozenset( + [ + "_message", + "_protocol", + "_payload_writer", + "_payload", + "_headers", + "_method", + "_version", + "_rel_url", + "_post", + "_read_bytes", + "_state", + "_cache", + "_task", + "_client_max_size", + "_loop", + "_transport_sslcontext", + "_transport_peername", + ] + ) + + def __init__( + self, + message: RawRequestMessage, + payload: StreamReader, + protocol: "RequestHandler", + payload_writer: AbstractStreamWriter, + task: "asyncio.Task[None]", + loop: asyncio.AbstractEventLoop, + *, + client_max_size: int = 1024**2, + state: Optional[Dict[str, Any]] = None, + scheme: Optional[str] = None, + host: Optional[str] = None, + remote: Optional[str] = None, + ) -> None: + if state is None: + state = {} + self._message = message + self._protocol = protocol + self._payload_writer = payload_writer + + self._payload = payload + self._headers = message.headers + self._method = message.method + self._version = message.version + self._cache: Dict[str, Any] = {} + url = message.url + if url.is_absolute(): + # absolute URL is given, + # override auto-calculating url, host, and scheme + # all other properties should be good + self._cache["url"] = url + self._cache["host"] = url.host + self._cache["scheme"] = url.scheme + self._rel_url = url.relative() + else: + self._rel_url = message.url + self._post: Optional[MultiDictProxy[Union[str, bytes, FileField]]] = None + self._read_bytes: Optional[bytes] = None + + self._state = state + self._task = task + self._client_max_size = client_max_size + self._loop = loop + + transport = self._protocol.transport + assert transport is not None + self._transport_sslcontext = transport.get_extra_info("sslcontext") + self._transport_peername = transport.get_extra_info("peername") + + if scheme is not None: + self._cache["scheme"] = scheme + if host is not None: + self._cache["host"] = host + if remote is not None: + self._cache["remote"] = remote + + def clone( + self, + *, + method: str = sentinel, + rel_url: StrOrURL = sentinel, + headers: LooseHeaders = sentinel, + scheme: str = sentinel, + host: str = sentinel, + remote: str = sentinel, + ) -> "BaseRequest": + """Clone itself with replacement some attributes. + + Creates and returns a new instance of Request object. If no parameters + are given, an exact copy is returned. If a parameter is not passed, it + will reuse the one from the current request object. + """ + if self._read_bytes: + raise RuntimeError("Cannot clone request " "after reading its content") + + dct: Dict[str, Any] = {} + if method is not sentinel: + dct["method"] = method + if rel_url is not sentinel: + new_url = URL(rel_url) + dct["url"] = new_url + dct["path"] = str(new_url) + if headers is not sentinel: + # a copy semantic + dct["headers"] = CIMultiDictProxy(CIMultiDict(headers)) + dct["raw_headers"] = tuple( + (k.encode("utf-8"), v.encode("utf-8")) for k, v in headers.items() + ) + + message = self._message._replace(**dct) + + kwargs = {} + if scheme is not sentinel: + kwargs["scheme"] = scheme + if host is not sentinel: + kwargs["host"] = host + if remote is not sentinel: + kwargs["remote"] = remote + + return self.__class__( + message, + self._payload, + self._protocol, + self._payload_writer, + self._task, + self._loop, + client_max_size=self._client_max_size, + state=self._state.copy(), + **kwargs, + ) + + @property + def task(self) -> "asyncio.Task[None]": + return self._task + + @property + def protocol(self) -> "RequestHandler": + return self._protocol + + @property + def transport(self) -> Optional[asyncio.Transport]: + if self._protocol is None: + return None + return self._protocol.transport + + @property + def writer(self) -> AbstractStreamWriter: + return self._payload_writer + + @reify + def message(self) -> RawRequestMessage: + warnings.warn("Request.message is deprecated", DeprecationWarning, stacklevel=3) + return self._message + + @reify + def rel_url(self) -> URL: + return self._rel_url + + @reify + def loop(self) -> asyncio.AbstractEventLoop: + warnings.warn( + "request.loop property is deprecated", DeprecationWarning, stacklevel=2 + ) + return self._loop + + # MutableMapping API + + def __getitem__(self, key: str) -> Any: + return self._state[key] + + def __setitem__(self, key: str, value: Any) -> None: + self._state[key] = value + + def __delitem__(self, key: str) -> None: + del self._state[key] + + def __len__(self) -> int: + return len(self._state) + + def __iter__(self) -> Iterator[str]: + return iter(self._state) + + ######## + + @reify + def secure(self) -> bool: + """A bool indicating if the request is handled with SSL.""" + return self.scheme == "https" + + @reify + def forwarded(self) -> Tuple[Mapping[str, str], ...]: + """A tuple containing all parsed Forwarded header(s). + + Makes an effort to parse Forwarded headers as specified by RFC 7239: + + - It adds one (immutable) dictionary per Forwarded 'field-value', ie + per proxy. The element corresponds to the data in the Forwarded + field-value added by the first proxy encountered by the client. Each + subsequent item corresponds to those added by later proxies. + - It checks that every value has valid syntax in general as specified + in section 4: either a 'token' or a 'quoted-string'. + - It un-escapes found escape sequences. + - It does NOT validate 'by' and 'for' contents as specified in section + 6. + - It does NOT validate 'host' contents (Host ABNF). + - It does NOT validate 'proto' contents for valid URI scheme names. + + Returns a tuple containing one or more immutable dicts + """ + elems = [] + for field_value in self._message.headers.getall(hdrs.FORWARDED, ()): + length = len(field_value) + pos = 0 + need_separator = False + elem: Dict[str, str] = {} + elems.append(types.MappingProxyType(elem)) + while 0 <= pos < length: + match = _FORWARDED_PAIR_RE.match(field_value, pos) + if match is not None: # got a valid forwarded-pair + if need_separator: + # bad syntax here, skip to next comma + pos = field_value.find(",", pos) + else: + name, value, port = match.groups() + if value[0] == '"': + # quoted string: remove quotes and unescape + value = _QUOTED_PAIR_REPLACE_RE.sub(r"\1", value[1:-1]) + if port: + value += port + elem[name.lower()] = value + pos += len(match.group(0)) + need_separator = True + elif field_value[pos] == ",": # next forwarded-element + need_separator = False + elem = {} + elems.append(types.MappingProxyType(elem)) + pos += 1 + elif field_value[pos] == ";": # next forwarded-pair + need_separator = False + pos += 1 + elif field_value[pos] in " \t": + # Allow whitespace even between forwarded-pairs, though + # RFC 7239 doesn't. This simplifies code and is in line + # with Postel's law. + pos += 1 + else: + # bad syntax here, skip to next comma + pos = field_value.find(",", pos) + return tuple(elems) + + @reify + def scheme(self) -> str: + """A string representing the scheme of the request. + + Hostname is resolved in this order: + + - overridden value by .clone(scheme=new_scheme) call. + - type of connection to peer: HTTPS if socket is SSL, HTTP otherwise. + + 'http' or 'https'. + """ + if self._transport_sslcontext: + return "https" + else: + return "http" + + @reify + def method(self) -> str: + """Read only property for getting HTTP method. + + The value is upper-cased str like 'GET', 'POST', 'PUT' etc. + """ + return self._method + + @reify + def version(self) -> HttpVersion: + """Read only property for getting HTTP version of request. + + Returns aiohttp.protocol.HttpVersion instance. + """ + return self._version + + @reify + def host(self) -> str: + """Hostname of the request. + + Hostname is resolved in this order: + + - overridden value by .clone(host=new_host) call. + - HOST HTTP header + - socket.getfqdn() value + """ + host = self._message.headers.get(hdrs.HOST) + if host is not None: + return host + return socket.getfqdn() + + @reify + def remote(self) -> Optional[str]: + """Remote IP of client initiated HTTP request. + + The IP is resolved in this order: + + - overridden value by .clone(remote=new_remote) call. + - peername of opened socket + """ + if self._transport_peername is None: + return None + if isinstance(self._transport_peername, (list, tuple)): + return str(self._transport_peername[0]) + return str(self._transport_peername) + + @reify + def url(self) -> URL: + url = URL.build(scheme=self.scheme, host=self.host) + return url.join(self._rel_url) + + @reify + def path(self) -> str: + """The URL including *PATH INFO* without the host or scheme. + + E.g., ``/app/blog`` + """ + return self._rel_url.path + + @reify + def path_qs(self) -> str: + """The URL including PATH_INFO and the query string. + + E.g, /app/blog?id=10 + """ + return str(self._rel_url) + + @reify + def raw_path(self) -> str: + """The URL including raw *PATH INFO* without the host or scheme. + + Warning, the path is unquoted and may contains non valid URL characters + + E.g., ``/my%2Fpath%7Cwith%21some%25strange%24characters`` + """ + return self._message.path + + @reify + def query(self) -> "MultiDictProxy[str]": + """A multidict with all the variables in the query string.""" + return MultiDictProxy(self._rel_url.query) + + @reify + def query_string(self) -> str: + """The query string in the URL. + + E.g., id=10 + """ + return self._rel_url.query_string + + @reify + def headers(self) -> "CIMultiDictProxy[str]": + """A case-insensitive multidict proxy with all headers.""" + return self._headers + + @reify + def raw_headers(self) -> RawHeaders: + """A sequence of pairs for all headers.""" + return self._message.raw_headers + + @reify + def if_modified_since(self) -> Optional[datetime.datetime]: + """The value of If-Modified-Since HTTP header, or None. + + This header is represented as a `datetime` object. + """ + return parse_http_date(self.headers.get(hdrs.IF_MODIFIED_SINCE)) + + @reify + def if_unmodified_since(self) -> Optional[datetime.datetime]: + """The value of If-Unmodified-Since HTTP header, or None. + + This header is represented as a `datetime` object. + """ + return parse_http_date(self.headers.get(hdrs.IF_UNMODIFIED_SINCE)) + + @staticmethod + def _etag_values(etag_header: str) -> Iterator[ETag]: + """Extract `ETag` objects from raw header.""" + if etag_header == ETAG_ANY: + yield ETag( + is_weak=False, + value=ETAG_ANY, + ) + else: + for match in LIST_QUOTED_ETAG_RE.finditer(etag_header): + is_weak, value, garbage = match.group(2, 3, 4) + # Any symbol captured by 4th group means + # that the following sequence is invalid. + if garbage: + break + + yield ETag( + is_weak=bool(is_weak), + value=value, + ) + + @classmethod + def _if_match_or_none_impl( + cls, header_value: Optional[str] + ) -> Optional[Tuple[ETag, ...]]: + if not header_value: + return None + + return tuple(cls._etag_values(header_value)) + + @reify + def if_match(self) -> Optional[Tuple[ETag, ...]]: + """The value of If-Match HTTP header, or None. + + This header is represented as a `tuple` of `ETag` objects. + """ + return self._if_match_or_none_impl(self.headers.get(hdrs.IF_MATCH)) + + @reify + def if_none_match(self) -> Optional[Tuple[ETag, ...]]: + """The value of If-None-Match HTTP header, or None. + + This header is represented as a `tuple` of `ETag` objects. + """ + return self._if_match_or_none_impl(self.headers.get(hdrs.IF_NONE_MATCH)) + + @reify + def if_range(self) -> Optional[datetime.datetime]: + """The value of If-Range HTTP header, or None. + + This header is represented as a `datetime` object. + """ + return parse_http_date(self.headers.get(hdrs.IF_RANGE)) + + @reify + def keep_alive(self) -> bool: + """Is keepalive enabled by client?""" + return not self._message.should_close + + @reify + def cookies(self) -> Mapping[str, str]: + """Return request cookies. + + A read-only dictionary-like object. + """ + raw = self.headers.get(hdrs.COOKIE, "") + parsed: SimpleCookie[str] = SimpleCookie(raw) + return MappingProxyType({key: val.value for key, val in parsed.items()}) + + @reify + def http_range(self) -> slice: + """The content of Range HTTP header. + + Return a slice instance. + + """ + rng = self._headers.get(hdrs.RANGE) + start, end = None, None + if rng is not None: + try: + pattern = r"^bytes=(\d*)-(\d*)$" + start, end = re.findall(pattern, rng)[0] + except IndexError: # pattern was not found in header + raise ValueError("range not in acceptable format") + + end = int(end) if end else None + start = int(start) if start else None + + if start is None and end is not None: + # end with no start is to return tail of content + start = -end + end = None + + if start is not None and end is not None: + # end is inclusive in range header, exclusive for slice + end += 1 + + if start >= end: + raise ValueError("start cannot be after end") + + if start is end is None: # No valid range supplied + raise ValueError("No start or end of range specified") + + return slice(start, end, 1) + + @reify + def content(self) -> StreamReader: + """Return raw payload stream.""" + return self._payload + + @property + def has_body(self) -> bool: + """Return True if request's HTTP BODY can be read, False otherwise.""" + warnings.warn( + "Deprecated, use .can_read_body #2005", DeprecationWarning, stacklevel=2 + ) + return not self._payload.at_eof() + + @property + def can_read_body(self) -> bool: + """Return True if request's HTTP BODY can be read, False otherwise.""" + return not self._payload.at_eof() + + @reify + def body_exists(self) -> bool: + """Return True if request has HTTP BODY, False otherwise.""" + return type(self._payload) is not EmptyStreamReader + + async def release(self) -> None: + """Release request. + + Eat unread part of HTTP BODY if present. + """ + while not self._payload.at_eof(): + await self._payload.readany() + + async def read(self) -> bytes: + """Read request body if present. + + Returns bytes object with full request content. + """ + if self._read_bytes is None: + body = bytearray() + while True: + chunk = await self._payload.readany() + body.extend(chunk) + if self._client_max_size: + body_size = len(body) + if body_size >= self._client_max_size: + raise HTTPRequestEntityTooLarge( + max_size=self._client_max_size, actual_size=body_size + ) + if not chunk: + break + self._read_bytes = bytes(body) + return self._read_bytes + + async def text(self) -> str: + """Return BODY as text using encoding from .charset.""" + bytes_body = await self.read() + encoding = self.charset or "utf-8" + return bytes_body.decode(encoding) + + async def json(self, *, loads: JSONDecoder = DEFAULT_JSON_DECODER) -> Any: + """Return BODY as JSON.""" + body = await self.text() + return loads(body) + + async def multipart(self) -> MultipartReader: + """Return async iterator to process BODY as multipart.""" + return MultipartReader(self._headers, self._payload) + + async def post(self) -> "MultiDictProxy[Union[str, bytes, FileField]]": + """Return POST parameters.""" + if self._post is not None: + return self._post + if self._method not in self.POST_METHODS: + self._post = MultiDictProxy(MultiDict()) + return self._post + + content_type = self.content_type + if content_type not in ( + "", + "application/x-www-form-urlencoded", + "multipart/form-data", + ): + self._post = MultiDictProxy(MultiDict()) + return self._post + + out: MultiDict[Union[str, bytes, FileField]] = MultiDict() + + if content_type == "multipart/form-data": + multipart = await self.multipart() + max_size = self._client_max_size + + field = await multipart.next() + while field is not None: + size = 0 + field_ct = field.headers.get(hdrs.CONTENT_TYPE) + + if isinstance(field, BodyPartReader): + assert field.name is not None + + # Note that according to RFC 7578, the Content-Type header + # is optional, even for files, so we can't assume it's + # present. + # https://tools.ietf.org/html/rfc7578#section-4.4 + if field.filename: + # store file in temp file + tmp = tempfile.TemporaryFile() + chunk = await field.read_chunk(size=2**16) + while chunk: + chunk = field.decode(chunk) + tmp.write(chunk) + size += len(chunk) + if 0 < max_size < size: + tmp.close() + raise HTTPRequestEntityTooLarge( + max_size=max_size, actual_size=size + ) + chunk = await field.read_chunk(size=2**16) + tmp.seek(0) + + if field_ct is None: + field_ct = "application/octet-stream" + + ff = FileField( + field.name, + field.filename, + cast(io.BufferedReader, tmp), + field_ct, + field.headers, + ) + out.add(field.name, ff) + else: + # deal with ordinary data + value = await field.read(decode=True) + if field_ct is None or field_ct.startswith("text/"): + charset = field.get_charset(default="utf-8") + out.add(field.name, value.decode(charset)) + else: + out.add(field.name, value) + size += len(value) + if 0 < max_size < size: + raise HTTPRequestEntityTooLarge( + max_size=max_size, actual_size=size + ) + else: + raise ValueError( + "To decode nested multipart you need " "to use custom reader", + ) + + field = await multipart.next() + else: + data = await self.read() + if data: + charset = self.charset or "utf-8" + out.extend( + parse_qsl( + data.rstrip().decode(charset), + keep_blank_values=True, + encoding=charset, + ) + ) + + self._post = MultiDictProxy(out) + return self._post + + def get_extra_info(self, name: str, default: Any = None) -> Any: + """Extra info from protocol transport""" + protocol = self._protocol + if protocol is None: + return default + + transport = protocol.transport + if transport is None: + return default + + return transport.get_extra_info(name, default) + + def __repr__(self) -> str: + ascii_encodable_path = self.path.encode("ascii", "backslashreplace").decode( + "ascii" + ) + return "<{} {} {} >".format( + self.__class__.__name__, self._method, ascii_encodable_path + ) + + def __eq__(self, other: object) -> bool: + return id(self) == id(other) + + def __bool__(self) -> bool: + return True + + async def _prepare_hook(self, response: StreamResponse) -> None: + return + + def _cancel(self, exc: BaseException) -> None: + self._payload.set_exception(exc) + + +class Request(BaseRequest): + + ATTRS = BaseRequest.ATTRS | frozenset(["_match_info"]) + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + # matchdict, route_name, handler + # or information about traversal lookup + + # initialized after route resolving + self._match_info: Optional[UrlMappingMatchInfo] = None + + if DEBUG: + + def __setattr__(self, name: str, val: Any) -> None: + if name not in self.ATTRS: + warnings.warn( + "Setting custom {}.{} attribute " + "is discouraged".format(self.__class__.__name__, name), + DeprecationWarning, + stacklevel=2, + ) + super().__setattr__(name, val) + + def clone( + self, + *, + method: str = sentinel, + rel_url: StrOrURL = sentinel, + headers: LooseHeaders = sentinel, + scheme: str = sentinel, + host: str = sentinel, + remote: str = sentinel, + ) -> "Request": + ret = super().clone( + method=method, + rel_url=rel_url, + headers=headers, + scheme=scheme, + host=host, + remote=remote, + ) + new_ret = cast(Request, ret) + new_ret._match_info = self._match_info + return new_ret + + @reify + def match_info(self) -> "UrlMappingMatchInfo": + """Result of route resolving.""" + match_info = self._match_info + assert match_info is not None + return match_info + + @property + def app(self) -> "Application": + """Application instance.""" + match_info = self._match_info + assert match_info is not None + return match_info.current_app + + @property + def config_dict(self) -> ChainMapProxy: + match_info = self._match_info + assert match_info is not None + lst = match_info.apps + app = self.app + idx = lst.index(app) + sublist = list(reversed(lst[: idx + 1])) + return ChainMapProxy(sublist) + + async def _prepare_hook(self, response: StreamResponse) -> None: + match_info = self._match_info + if match_info is None: + return + for app in match_info._apps: + await app.on_response_prepare.send(self, response) diff --git a/runtime/Lib/site-packages/aiohttp/web_response.py b/runtime/Lib/site-packages/aiohttp/web_response.py new file mode 100644 index 0000000000000000000000000000000000000000..b2ef66140e866a7a1d6b0ebe12d3a3b6b4a022c5 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/web_response.py @@ -0,0 +1,825 @@ +import asyncio +import collections.abc +import datetime +import enum +import json +import math +import time +import warnings +import zlib +from concurrent.futures import Executor +from http.cookies import Morsel, SimpleCookie +from typing import ( + TYPE_CHECKING, + Any, + Dict, + Iterator, + Mapping, + MutableMapping, + Optional, + Tuple, + Union, + cast, +) + +from multidict import CIMultiDict, istr + +from . import hdrs, payload +from .abc import AbstractStreamWriter +from .helpers import ( + ETAG_ANY, + PY_38, + QUOTED_ETAG_RE, + ETag, + HeadersMixin, + parse_http_date, + rfc822_formatted_time, + sentinel, + validate_etag_value, +) +from .http import RESPONSES, SERVER_SOFTWARE, HttpVersion10, HttpVersion11 +from .payload import Payload +from .typedefs import JSONEncoder, LooseHeaders + +__all__ = ("ContentCoding", "StreamResponse", "Response", "json_response") + + +if TYPE_CHECKING: # pragma: no cover + from .web_request import BaseRequest + + BaseClass = MutableMapping[str, Any] +else: + BaseClass = collections.abc.MutableMapping + + +if not PY_38: + # allow samesite to be used in python < 3.8 + # already permitted in python 3.8, see https://bugs.python.org/issue29613 + Morsel._reserved["samesite"] = "SameSite" # type: ignore[attr-defined] + + +class ContentCoding(enum.Enum): + # The content codings that we have support for. + # + # Additional registered codings are listed at: + # https://www.iana.org/assignments/http-parameters/http-parameters.xhtml#content-coding + deflate = "deflate" + gzip = "gzip" + identity = "identity" + + +############################################################ +# HTTP Response classes +############################################################ + + +class StreamResponse(BaseClass, HeadersMixin): + + _length_check = True + + def __init__( + self, + *, + status: int = 200, + reason: Optional[str] = None, + headers: Optional[LooseHeaders] = None, + ) -> None: + self._body = None + self._keep_alive: Optional[bool] = None + self._chunked = False + self._compression = False + self._compression_force: Optional[ContentCoding] = None + self._cookies: SimpleCookie[str] = SimpleCookie() + + self._req: Optional[BaseRequest] = None + self._payload_writer: Optional[AbstractStreamWriter] = None + self._eof_sent = False + self._body_length = 0 + self._state: Dict[str, Any] = {} + + if headers is not None: + self._headers: CIMultiDict[str] = CIMultiDict(headers) + else: + self._headers = CIMultiDict() + + self.set_status(status, reason) + + @property + def prepared(self) -> bool: + return self._payload_writer is not None + + @property + def task(self) -> "Optional[asyncio.Task[None]]": + if self._req: + return self._req.task + else: + return None + + @property + def status(self) -> int: + return self._status + + @property + def chunked(self) -> bool: + return self._chunked + + @property + def compression(self) -> bool: + return self._compression + + @property + def reason(self) -> str: + return self._reason + + def set_status( + self, + status: int, + reason: Optional[str] = None, + _RESPONSES: Mapping[int, Tuple[str, str]] = RESPONSES, + ) -> None: + assert not self.prepared, ( + "Cannot change the response status code after " "the headers have been sent" + ) + self._status = int(status) + if reason is None: + try: + reason = _RESPONSES[self._status][0] + except Exception: + reason = "" + self._reason = reason + + @property + def keep_alive(self) -> Optional[bool]: + return self._keep_alive + + def force_close(self) -> None: + self._keep_alive = False + + @property + def body_length(self) -> int: + return self._body_length + + @property + def output_length(self) -> int: + warnings.warn("output_length is deprecated", DeprecationWarning) + assert self._payload_writer + return self._payload_writer.buffer_size + + def enable_chunked_encoding(self, chunk_size: Optional[int] = None) -> None: + """Enables automatic chunked transfer encoding.""" + self._chunked = True + + if hdrs.CONTENT_LENGTH in self._headers: + raise RuntimeError( + "You can't enable chunked encoding when " "a content length is set" + ) + if chunk_size is not None: + warnings.warn("Chunk size is deprecated #1615", DeprecationWarning) + + def enable_compression( + self, force: Optional[Union[bool, ContentCoding]] = None + ) -> None: + """Enables response compression encoding.""" + # Backwards compatibility for when force was a bool <0.17. + if type(force) == bool: + force = ContentCoding.deflate if force else ContentCoding.identity + warnings.warn( + "Using boolean for force is deprecated #3318", DeprecationWarning + ) + elif force is not None: + assert isinstance(force, ContentCoding), ( + "force should one of " "None, bool or " "ContentEncoding" + ) + + self._compression = True + self._compression_force = force + + @property + def headers(self) -> "CIMultiDict[str]": + return self._headers + + @property + def cookies(self) -> "SimpleCookie[str]": + return self._cookies + + def set_cookie( + self, + name: str, + value: str, + *, + expires: Optional[str] = None, + domain: Optional[str] = None, + max_age: Optional[Union[int, str]] = None, + path: str = "/", + secure: Optional[bool] = None, + httponly: Optional[bool] = None, + version: Optional[str] = None, + samesite: Optional[str] = None, + ) -> None: + """Set or update response cookie. + + Sets new cookie or updates existent with new value. + Also updates only those params which are not None. + """ + old = self._cookies.get(name) + if old is not None and old.coded_value == "": + # deleted cookie + self._cookies.pop(name, None) + + self._cookies[name] = value + c = self._cookies[name] + + if expires is not None: + c["expires"] = expires + elif c.get("expires") == "Thu, 01 Jan 1970 00:00:00 GMT": + del c["expires"] + + if domain is not None: + c["domain"] = domain + + if max_age is not None: + c["max-age"] = str(max_age) + elif "max-age" in c: + del c["max-age"] + + c["path"] = path + + if secure is not None: + c["secure"] = secure + if httponly is not None: + c["httponly"] = httponly + if version is not None: + c["version"] = version + if samesite is not None: + c["samesite"] = samesite + + def del_cookie( + self, name: str, *, domain: Optional[str] = None, path: str = "/" + ) -> None: + """Delete cookie. + + Creates new empty expired cookie. + """ + # TODO: do we need domain/path here? + self._cookies.pop(name, None) + self.set_cookie( + name, + "", + max_age=0, + expires="Thu, 01 Jan 1970 00:00:00 GMT", + domain=domain, + path=path, + ) + + @property + def content_length(self) -> Optional[int]: + # Just a placeholder for adding setter + return super().content_length + + @content_length.setter + def content_length(self, value: Optional[int]) -> None: + if value is not None: + value = int(value) + if self._chunked: + raise RuntimeError( + "You can't set content length when " "chunked encoding is enable" + ) + self._headers[hdrs.CONTENT_LENGTH] = str(value) + else: + self._headers.pop(hdrs.CONTENT_LENGTH, None) + + @property + def content_type(self) -> str: + # Just a placeholder for adding setter + return super().content_type + + @content_type.setter + def content_type(self, value: str) -> None: + self.content_type # read header values if needed + self._content_type = str(value) + self._generate_content_type_header() + + @property + def charset(self) -> Optional[str]: + # Just a placeholder for adding setter + return super().charset + + @charset.setter + def charset(self, value: Optional[str]) -> None: + ctype = self.content_type # read header values if needed + if ctype == "application/octet-stream": + raise RuntimeError( + "Setting charset for application/octet-stream " + "doesn't make sense, setup content_type first" + ) + assert self._content_dict is not None + if value is None: + self._content_dict.pop("charset", None) + else: + self._content_dict["charset"] = str(value).lower() + self._generate_content_type_header() + + @property + def last_modified(self) -> Optional[datetime.datetime]: + """The value of Last-Modified HTTP header, or None. + + This header is represented as a `datetime` object. + """ + return parse_http_date(self._headers.get(hdrs.LAST_MODIFIED)) + + @last_modified.setter + def last_modified( + self, value: Optional[Union[int, float, datetime.datetime, str]] + ) -> None: + if value is None: + self._headers.pop(hdrs.LAST_MODIFIED, None) + elif isinstance(value, (int, float)): + self._headers[hdrs.LAST_MODIFIED] = time.strftime( + "%a, %d %b %Y %H:%M:%S GMT", time.gmtime(math.ceil(value)) + ) + elif isinstance(value, datetime.datetime): + self._headers[hdrs.LAST_MODIFIED] = time.strftime( + "%a, %d %b %Y %H:%M:%S GMT", value.utctimetuple() + ) + elif isinstance(value, str): + self._headers[hdrs.LAST_MODIFIED] = value + + @property + def etag(self) -> Optional[ETag]: + quoted_value = self._headers.get(hdrs.ETAG) + if not quoted_value: + return None + elif quoted_value == ETAG_ANY: + return ETag(value=ETAG_ANY) + match = QUOTED_ETAG_RE.fullmatch(quoted_value) + if not match: + return None + is_weak, value = match.group(1, 2) + return ETag( + is_weak=bool(is_weak), + value=value, + ) + + @etag.setter + def etag(self, value: Optional[Union[ETag, str]]) -> None: + if value is None: + self._headers.pop(hdrs.ETAG, None) + elif (isinstance(value, str) and value == ETAG_ANY) or ( + isinstance(value, ETag) and value.value == ETAG_ANY + ): + self._headers[hdrs.ETAG] = ETAG_ANY + elif isinstance(value, str): + validate_etag_value(value) + self._headers[hdrs.ETAG] = f'"{value}"' + elif isinstance(value, ETag) and isinstance(value.value, str): + validate_etag_value(value.value) + hdr_value = f'W/"{value.value}"' if value.is_weak else f'"{value.value}"' + self._headers[hdrs.ETAG] = hdr_value + else: + raise ValueError( + f"Unsupported etag type: {type(value)}. " + f"etag must be str, ETag or None" + ) + + def _generate_content_type_header( + self, CONTENT_TYPE: istr = hdrs.CONTENT_TYPE + ) -> None: + assert self._content_dict is not None + assert self._content_type is not None + params = "; ".join(f"{k}={v}" for k, v in self._content_dict.items()) + if params: + ctype = self._content_type + "; " + params + else: + ctype = self._content_type + self._headers[CONTENT_TYPE] = ctype + + async def _do_start_compression(self, coding: ContentCoding) -> None: + if coding != ContentCoding.identity: + assert self._payload_writer is not None + self._headers[hdrs.CONTENT_ENCODING] = coding.value + self._payload_writer.enable_compression(coding.value) + # Compressed payload may have different content length, + # remove the header + self._headers.popall(hdrs.CONTENT_LENGTH, None) + + async def _start_compression(self, request: "BaseRequest") -> None: + if self._compression_force: + await self._do_start_compression(self._compression_force) + else: + accept_encoding = request.headers.get(hdrs.ACCEPT_ENCODING, "").lower() + for coding in ContentCoding: + if coding.value in accept_encoding: + await self._do_start_compression(coding) + return + + async def prepare(self, request: "BaseRequest") -> Optional[AbstractStreamWriter]: + if self._eof_sent: + return None + if self._payload_writer is not None: + return self._payload_writer + + return await self._start(request) + + async def _start(self, request: "BaseRequest") -> AbstractStreamWriter: + self._req = request + writer = self._payload_writer = request._payload_writer + + await self._prepare_headers() + await request._prepare_hook(self) + await self._write_headers() + + return writer + + async def _prepare_headers(self) -> None: + request = self._req + assert request is not None + writer = self._payload_writer + assert writer is not None + keep_alive = self._keep_alive + if keep_alive is None: + keep_alive = request.keep_alive + self._keep_alive = keep_alive + + version = request.version + + headers = self._headers + for cookie in self._cookies.values(): + value = cookie.output(header="")[1:] + headers.add(hdrs.SET_COOKIE, value) + + if self._compression: + await self._start_compression(request) + + if self._chunked: + if version != HttpVersion11: + raise RuntimeError( + "Using chunked encoding is forbidden " + "for HTTP/{0.major}.{0.minor}".format(request.version) + ) + writer.enable_chunking() + headers[hdrs.TRANSFER_ENCODING] = "chunked" + if hdrs.CONTENT_LENGTH in headers: + del headers[hdrs.CONTENT_LENGTH] + elif self._length_check: + writer.length = self.content_length + if writer.length is None: + if version >= HttpVersion11 and self.status != 204: + writer.enable_chunking() + headers[hdrs.TRANSFER_ENCODING] = "chunked" + if hdrs.CONTENT_LENGTH in headers: + del headers[hdrs.CONTENT_LENGTH] + else: + keep_alive = False + # HTTP 1.1: https://tools.ietf.org/html/rfc7230#section-3.3.2 + # HTTP 1.0: https://tools.ietf.org/html/rfc1945#section-10.4 + elif version >= HttpVersion11 and self.status in (100, 101, 102, 103, 204): + del headers[hdrs.CONTENT_LENGTH] + + if self.status not in (204, 304): + headers.setdefault(hdrs.CONTENT_TYPE, "application/octet-stream") + headers.setdefault(hdrs.DATE, rfc822_formatted_time()) + headers.setdefault(hdrs.SERVER, SERVER_SOFTWARE) + + # connection header + if hdrs.CONNECTION not in headers: + if keep_alive: + if version == HttpVersion10: + headers[hdrs.CONNECTION] = "keep-alive" + else: + if version == HttpVersion11: + headers[hdrs.CONNECTION] = "close" + + async def _write_headers(self) -> None: + request = self._req + assert request is not None + writer = self._payload_writer + assert writer is not None + # status line + version = request.version + status_line = "HTTP/{}.{} {} {}".format( + version[0], version[1], self._status, self._reason + ) + await writer.write_headers(status_line, self._headers) + + async def write(self, data: bytes) -> None: + assert isinstance( + data, (bytes, bytearray, memoryview) + ), "data argument must be byte-ish (%r)" % type(data) + + if self._eof_sent: + raise RuntimeError("Cannot call write() after write_eof()") + if self._payload_writer is None: + raise RuntimeError("Cannot call write() before prepare()") + + await self._payload_writer.write(data) + + async def drain(self) -> None: + assert not self._eof_sent, "EOF has already been sent" + assert self._payload_writer is not None, "Response has not been started" + warnings.warn( + "drain method is deprecated, use await resp.write()", + DeprecationWarning, + stacklevel=2, + ) + await self._payload_writer.drain() + + async def write_eof(self, data: bytes = b"") -> None: + assert isinstance( + data, (bytes, bytearray, memoryview) + ), "data argument must be byte-ish (%r)" % type(data) + + if self._eof_sent: + return + + assert self._payload_writer is not None, "Response has not been started" + + await self._payload_writer.write_eof(data) + self._eof_sent = True + self._req = None + self._body_length = self._payload_writer.output_size + self._payload_writer = None + + def __repr__(self) -> str: + if self._eof_sent: + info = "eof" + elif self.prepared: + assert self._req is not None + info = f"{self._req.method} {self._req.path} " + else: + info = "not prepared" + return f"<{self.__class__.__name__} {self.reason} {info}>" + + def __getitem__(self, key: str) -> Any: + return self._state[key] + + def __setitem__(self, key: str, value: Any) -> None: + self._state[key] = value + + def __delitem__(self, key: str) -> None: + del self._state[key] + + def __len__(self) -> int: + return len(self._state) + + def __iter__(self) -> Iterator[str]: + return iter(self._state) + + def __hash__(self) -> int: + return hash(id(self)) + + def __eq__(self, other: object) -> bool: + return self is other + + +class Response(StreamResponse): + def __init__( + self, + *, + body: Any = None, + status: int = 200, + reason: Optional[str] = None, + text: Optional[str] = None, + headers: Optional[LooseHeaders] = None, + content_type: Optional[str] = None, + charset: Optional[str] = None, + zlib_executor_size: Optional[int] = None, + zlib_executor: Optional[Executor] = None, + ) -> None: + if body is not None and text is not None: + raise ValueError("body and text are not allowed together") + + if headers is None: + real_headers: CIMultiDict[str] = CIMultiDict() + elif not isinstance(headers, CIMultiDict): + real_headers = CIMultiDict(headers) + else: + real_headers = headers # = cast('CIMultiDict[str]', headers) + + if content_type is not None and "charset" in content_type: + raise ValueError("charset must not be in content_type " "argument") + + if text is not None: + if hdrs.CONTENT_TYPE in real_headers: + if content_type or charset: + raise ValueError( + "passing both Content-Type header and " + "content_type or charset params " + "is forbidden" + ) + else: + # fast path for filling headers + if not isinstance(text, str): + raise TypeError("text argument must be str (%r)" % type(text)) + if content_type is None: + content_type = "text/plain" + if charset is None: + charset = "utf-8" + real_headers[hdrs.CONTENT_TYPE] = content_type + "; charset=" + charset + body = text.encode(charset) + text = None + else: + if hdrs.CONTENT_TYPE in real_headers: + if content_type is not None or charset is not None: + raise ValueError( + "passing both Content-Type header and " + "content_type or charset params " + "is forbidden" + ) + else: + if content_type is not None: + if charset is not None: + content_type += "; charset=" + charset + real_headers[hdrs.CONTENT_TYPE] = content_type + + super().__init__(status=status, reason=reason, headers=real_headers) + + if text is not None: + self.text = text + else: + self.body = body + + self._compressed_body: Optional[bytes] = None + self._zlib_executor_size = zlib_executor_size + self._zlib_executor = zlib_executor + + @property + def body(self) -> Optional[Union[bytes, Payload]]: + return self._body + + @body.setter + def body( + self, + body: bytes, + CONTENT_TYPE: istr = hdrs.CONTENT_TYPE, + CONTENT_LENGTH: istr = hdrs.CONTENT_LENGTH, + ) -> None: + if body is None: + self._body: Optional[bytes] = None + self._body_payload: bool = False + elif isinstance(body, (bytes, bytearray)): + self._body = body + self._body_payload = False + else: + try: + self._body = body = payload.PAYLOAD_REGISTRY.get(body) + except payload.LookupError: + raise ValueError("Unsupported body type %r" % type(body)) + + self._body_payload = True + + headers = self._headers + + # set content-length header if needed + if not self._chunked and CONTENT_LENGTH not in headers: + size = body.size + if size is not None: + headers[CONTENT_LENGTH] = str(size) + + # set content-type + if CONTENT_TYPE not in headers: + headers[CONTENT_TYPE] = body.content_type + + # copy payload headers + if body.headers: + for (key, value) in body.headers.items(): + if key not in headers: + headers[key] = value + + self._compressed_body = None + + @property + def text(self) -> Optional[str]: + if self._body is None: + return None + return self._body.decode(self.charset or "utf-8") + + @text.setter + def text(self, text: str) -> None: + assert text is None or isinstance( + text, str + ), "text argument must be str (%r)" % type(text) + + if self.content_type == "application/octet-stream": + self.content_type = "text/plain" + if self.charset is None: + self.charset = "utf-8" + + self._body = text.encode(self.charset) + self._body_payload = False + self._compressed_body = None + + @property + def content_length(self) -> Optional[int]: + if self._chunked: + return None + + if hdrs.CONTENT_LENGTH in self._headers: + return super().content_length + + if self._compressed_body is not None: + # Return length of the compressed body + return len(self._compressed_body) + elif self._body_payload: + # A payload without content length, or a compressed payload + return None + elif self._body is not None: + return len(self._body) + else: + return 0 + + @content_length.setter + def content_length(self, value: Optional[int]) -> None: + raise RuntimeError("Content length is set automatically") + + async def write_eof(self, data: bytes = b"") -> None: + if self._eof_sent: + return + if self._compressed_body is None: + body: Optional[Union[bytes, Payload]] = self._body + else: + body = self._compressed_body + assert not data, f"data arg is not supported, got {data!r}" + assert self._req is not None + assert self._payload_writer is not None + if body is not None: + if self._req._method == hdrs.METH_HEAD or self._status in [204, 304]: + await super().write_eof() + elif self._body_payload: + payload = cast(Payload, body) + await payload.write(self._payload_writer) + await super().write_eof() + else: + await super().write_eof(cast(bytes, body)) + else: + await super().write_eof() + + async def _start(self, request: "BaseRequest") -> AbstractStreamWriter: + if not self._chunked and hdrs.CONTENT_LENGTH not in self._headers: + if not self._body_payload: + if self._body is not None: + self._headers[hdrs.CONTENT_LENGTH] = str(len(self._body)) + else: + self._headers[hdrs.CONTENT_LENGTH] = "0" + + return await super()._start(request) + + def _compress_body(self, zlib_mode: int) -> None: + assert zlib_mode > 0 + compressobj = zlib.compressobj(wbits=zlib_mode) + body_in = self._body + assert body_in is not None + self._compressed_body = compressobj.compress(body_in) + compressobj.flush() + + async def _do_start_compression(self, coding: ContentCoding) -> None: + if self._body_payload or self._chunked: + return await super()._do_start_compression(coding) + + if coding != ContentCoding.identity: + # Instead of using _payload_writer.enable_compression, + # compress the whole body + zlib_mode = ( + 16 + zlib.MAX_WBITS if coding == ContentCoding.gzip else zlib.MAX_WBITS + ) + body_in = self._body + assert body_in is not None + if ( + self._zlib_executor_size is not None + and len(body_in) > self._zlib_executor_size + ): + await asyncio.get_event_loop().run_in_executor( + self._zlib_executor, self._compress_body, zlib_mode + ) + else: + self._compress_body(zlib_mode) + + body_out = self._compressed_body + assert body_out is not None + + self._headers[hdrs.CONTENT_ENCODING] = coding.value + self._headers[hdrs.CONTENT_LENGTH] = str(len(body_out)) + + +def json_response( + data: Any = sentinel, + *, + text: Optional[str] = None, + body: Optional[bytes] = None, + status: int = 200, + reason: Optional[str] = None, + headers: Optional[LooseHeaders] = None, + content_type: str = "application/json", + dumps: JSONEncoder = json.dumps, +) -> Response: + if data is not sentinel: + if text or body: + raise ValueError("only one of data, text, or body should be specified") + else: + text = dumps(data) + return Response( + text=text, + body=body, + status=status, + reason=reason, + headers=headers, + content_type=content_type, + ) diff --git a/runtime/Lib/site-packages/aiohttp/web_routedef.py b/runtime/Lib/site-packages/aiohttp/web_routedef.py new file mode 100644 index 0000000000000000000000000000000000000000..64ec535e427a5b3d973d96139e4e74d9e138d947 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/web_routedef.py @@ -0,0 +1,216 @@ +import abc +import os # noqa +from typing import ( + TYPE_CHECKING, + Any, + Callable, + Dict, + Iterator, + List, + Optional, + Sequence, + Type, + Union, + overload, +) + +import attr + +from . import hdrs +from .abc import AbstractView +from .typedefs import Handler, PathLike + +if TYPE_CHECKING: # pragma: no cover + from .web_request import Request + from .web_response import StreamResponse + from .web_urldispatcher import AbstractRoute, UrlDispatcher +else: + Request = StreamResponse = UrlDispatcher = AbstractRoute = None + + +__all__ = ( + "AbstractRouteDef", + "RouteDef", + "StaticDef", + "RouteTableDef", + "head", + "options", + "get", + "post", + "patch", + "put", + "delete", + "route", + "view", + "static", +) + + +class AbstractRouteDef(abc.ABC): + @abc.abstractmethod + def register(self, router: UrlDispatcher) -> List[AbstractRoute]: + pass # pragma: no cover + + +_HandlerType = Union[Type[AbstractView], Handler] + + +@attr.s(auto_attribs=True, frozen=True, repr=False, slots=True) +class RouteDef(AbstractRouteDef): + method: str + path: str + handler: _HandlerType + kwargs: Dict[str, Any] + + def __repr__(self) -> str: + info = [] + for name, value in sorted(self.kwargs.items()): + info.append(f", {name}={value!r}") + return " {handler.__name__!r}" "{info}>".format( + method=self.method, path=self.path, handler=self.handler, info="".join(info) + ) + + def register(self, router: UrlDispatcher) -> List[AbstractRoute]: + if self.method in hdrs.METH_ALL: + reg = getattr(router, "add_" + self.method.lower()) + return [reg(self.path, self.handler, **self.kwargs)] + else: + return [ + router.add_route(self.method, self.path, self.handler, **self.kwargs) + ] + + +@attr.s(auto_attribs=True, frozen=True, repr=False, slots=True) +class StaticDef(AbstractRouteDef): + prefix: str + path: PathLike + kwargs: Dict[str, Any] + + def __repr__(self) -> str: + info = [] + for name, value in sorted(self.kwargs.items()): + info.append(f", {name}={value!r}") + return " {path}" "{info}>".format( + prefix=self.prefix, path=self.path, info="".join(info) + ) + + def register(self, router: UrlDispatcher) -> List[AbstractRoute]: + resource = router.add_static(self.prefix, self.path, **self.kwargs) + routes = resource.get_info().get("routes", {}) + return list(routes.values()) + + +def route(method: str, path: str, handler: _HandlerType, **kwargs: Any) -> RouteDef: + return RouteDef(method, path, handler, kwargs) + + +def head(path: str, handler: _HandlerType, **kwargs: Any) -> RouteDef: + return route(hdrs.METH_HEAD, path, handler, **kwargs) + + +def options(path: str, handler: _HandlerType, **kwargs: Any) -> RouteDef: + return route(hdrs.METH_OPTIONS, path, handler, **kwargs) + + +def get( + path: str, + handler: _HandlerType, + *, + name: Optional[str] = None, + allow_head: bool = True, + **kwargs: Any, +) -> RouteDef: + return route( + hdrs.METH_GET, path, handler, name=name, allow_head=allow_head, **kwargs + ) + + +def post(path: str, handler: _HandlerType, **kwargs: Any) -> RouteDef: + return route(hdrs.METH_POST, path, handler, **kwargs) + + +def put(path: str, handler: _HandlerType, **kwargs: Any) -> RouteDef: + return route(hdrs.METH_PUT, path, handler, **kwargs) + + +def patch(path: str, handler: _HandlerType, **kwargs: Any) -> RouteDef: + return route(hdrs.METH_PATCH, path, handler, **kwargs) + + +def delete(path: str, handler: _HandlerType, **kwargs: Any) -> RouteDef: + return route(hdrs.METH_DELETE, path, handler, **kwargs) + + +def view(path: str, handler: Type[AbstractView], **kwargs: Any) -> RouteDef: + return route(hdrs.METH_ANY, path, handler, **kwargs) + + +def static(prefix: str, path: PathLike, **kwargs: Any) -> StaticDef: + return StaticDef(prefix, path, kwargs) + + +_Deco = Callable[[_HandlerType], _HandlerType] + + +class RouteTableDef(Sequence[AbstractRouteDef]): + """Route definition table""" + + def __init__(self) -> None: + self._items: List[AbstractRouteDef] = [] + + def __repr__(self) -> str: + return f"" + + @overload + def __getitem__(self, index: int) -> AbstractRouteDef: + ... + + @overload + def __getitem__(self, index: slice) -> List[AbstractRouteDef]: + ... + + def __getitem__(self, index): # type: ignore[no-untyped-def] + return self._items[index] + + def __iter__(self) -> Iterator[AbstractRouteDef]: + return iter(self._items) + + def __len__(self) -> int: + return len(self._items) + + def __contains__(self, item: object) -> bool: + return item in self._items + + def route(self, method: str, path: str, **kwargs: Any) -> _Deco: + def inner(handler: _HandlerType) -> _HandlerType: + self._items.append(RouteDef(method, path, handler, kwargs)) + return handler + + return inner + + def head(self, path: str, **kwargs: Any) -> _Deco: + return self.route(hdrs.METH_HEAD, path, **kwargs) + + def get(self, path: str, **kwargs: Any) -> _Deco: + return self.route(hdrs.METH_GET, path, **kwargs) + + def post(self, path: str, **kwargs: Any) -> _Deco: + return self.route(hdrs.METH_POST, path, **kwargs) + + def put(self, path: str, **kwargs: Any) -> _Deco: + return self.route(hdrs.METH_PUT, path, **kwargs) + + def patch(self, path: str, **kwargs: Any) -> _Deco: + return self.route(hdrs.METH_PATCH, path, **kwargs) + + def delete(self, path: str, **kwargs: Any) -> _Deco: + return self.route(hdrs.METH_DELETE, path, **kwargs) + + def options(self, path: str, **kwargs: Any) -> _Deco: + return self.route(hdrs.METH_OPTIONS, path, **kwargs) + + def view(self, path: str, **kwargs: Any) -> _Deco: + return self.route(hdrs.METH_ANY, path, **kwargs) + + def static(self, prefix: str, path: PathLike, **kwargs: Any) -> None: + self._items.append(StaticDef(prefix, path, kwargs)) diff --git a/runtime/Lib/site-packages/aiohttp/web_runner.py b/runtime/Lib/site-packages/aiohttp/web_runner.py new file mode 100644 index 0000000000000000000000000000000000000000..e4d8b70eb085866dc5e72a932e75ea6c10debdc9 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/web_runner.py @@ -0,0 +1,381 @@ +import asyncio +import signal +import socket +from abc import ABC, abstractmethod +from typing import Any, List, Optional, Set + +from yarl import URL + +from .web_app import Application +from .web_server import Server + +try: + from ssl import SSLContext +except ImportError: + SSLContext = object # type: ignore[misc,assignment] + + +__all__ = ( + "BaseSite", + "TCPSite", + "UnixSite", + "NamedPipeSite", + "SockSite", + "BaseRunner", + "AppRunner", + "ServerRunner", + "GracefulExit", +) + + +class GracefulExit(SystemExit): + code = 1 + + +def _raise_graceful_exit() -> None: + raise GracefulExit() + + +class BaseSite(ABC): + __slots__ = ("_runner", "_shutdown_timeout", "_ssl_context", "_backlog", "_server") + + def __init__( + self, + runner: "BaseRunner", + *, + shutdown_timeout: float = 60.0, + ssl_context: Optional[SSLContext] = None, + backlog: int = 128, + ) -> None: + if runner.server is None: + raise RuntimeError("Call runner.setup() before making a site") + self._runner = runner + self._shutdown_timeout = shutdown_timeout + self._ssl_context = ssl_context + self._backlog = backlog + self._server: Optional[asyncio.AbstractServer] = None + + @property + @abstractmethod + def name(self) -> str: + pass # pragma: no cover + + @abstractmethod + async def start(self) -> None: + self._runner._reg_site(self) + + async def stop(self) -> None: + self._runner._check_site(self) + if self._server is None: + self._runner._unreg_site(self) + return # not started yet + self._server.close() + # named pipes do not have wait_closed property + if hasattr(self._server, "wait_closed"): + await self._server.wait_closed() + await self._runner.shutdown() + assert self._runner.server + await self._runner.server.shutdown(self._shutdown_timeout) + self._runner._unreg_site(self) + + +class TCPSite(BaseSite): + __slots__ = ("_host", "_port", "_reuse_address", "_reuse_port") + + def __init__( + self, + runner: "BaseRunner", + host: Optional[str] = None, + port: Optional[int] = None, + *, + shutdown_timeout: float = 60.0, + ssl_context: Optional[SSLContext] = None, + backlog: int = 128, + reuse_address: Optional[bool] = None, + reuse_port: Optional[bool] = None, + ) -> None: + super().__init__( + runner, + shutdown_timeout=shutdown_timeout, + ssl_context=ssl_context, + backlog=backlog, + ) + self._host = host + if port is None: + port = 8443 if self._ssl_context else 8080 + self._port = port + self._reuse_address = reuse_address + self._reuse_port = reuse_port + + @property + def name(self) -> str: + scheme = "https" if self._ssl_context else "http" + host = "0.0.0.0" if self._host is None else self._host + return str(URL.build(scheme=scheme, host=host, port=self._port)) + + async def start(self) -> None: + await super().start() + loop = asyncio.get_event_loop() + server = self._runner.server + assert server is not None + self._server = await loop.create_server( + server, + self._host, + self._port, + ssl=self._ssl_context, + backlog=self._backlog, + reuse_address=self._reuse_address, + reuse_port=self._reuse_port, + ) + + +class UnixSite(BaseSite): + __slots__ = ("_path",) + + def __init__( + self, + runner: "BaseRunner", + path: str, + *, + shutdown_timeout: float = 60.0, + ssl_context: Optional[SSLContext] = None, + backlog: int = 128, + ) -> None: + super().__init__( + runner, + shutdown_timeout=shutdown_timeout, + ssl_context=ssl_context, + backlog=backlog, + ) + self._path = path + + @property + def name(self) -> str: + scheme = "https" if self._ssl_context else "http" + return f"{scheme}://unix:{self._path}:" + + async def start(self) -> None: + await super().start() + loop = asyncio.get_event_loop() + server = self._runner.server + assert server is not None + self._server = await loop.create_unix_server( + server, self._path, ssl=self._ssl_context, backlog=self._backlog + ) + + +class NamedPipeSite(BaseSite): + __slots__ = ("_path",) + + def __init__( + self, runner: "BaseRunner", path: str, *, shutdown_timeout: float = 60.0 + ) -> None: + loop = asyncio.get_event_loop() + if not isinstance( + loop, asyncio.ProactorEventLoop # type: ignore[attr-defined] + ): + raise RuntimeError( + "Named Pipes only available in proactor" "loop under windows" + ) + super().__init__(runner, shutdown_timeout=shutdown_timeout) + self._path = path + + @property + def name(self) -> str: + return self._path + + async def start(self) -> None: + await super().start() + loop = asyncio.get_event_loop() + server = self._runner.server + assert server is not None + _server = await loop.start_serving_pipe( # type: ignore[attr-defined] + server, self._path + ) + self._server = _server[0] + + +class SockSite(BaseSite): + __slots__ = ("_sock", "_name") + + def __init__( + self, + runner: "BaseRunner", + sock: socket.socket, + *, + shutdown_timeout: float = 60.0, + ssl_context: Optional[SSLContext] = None, + backlog: int = 128, + ) -> None: + super().__init__( + runner, + shutdown_timeout=shutdown_timeout, + ssl_context=ssl_context, + backlog=backlog, + ) + self._sock = sock + scheme = "https" if self._ssl_context else "http" + if hasattr(socket, "AF_UNIX") and sock.family == socket.AF_UNIX: + name = f"{scheme}://unix:{sock.getsockname()}:" + else: + host, port = sock.getsockname()[:2] + name = str(URL.build(scheme=scheme, host=host, port=port)) + self._name = name + + @property + def name(self) -> str: + return self._name + + async def start(self) -> None: + await super().start() + loop = asyncio.get_event_loop() + server = self._runner.server + assert server is not None + self._server = await loop.create_server( + server, sock=self._sock, ssl=self._ssl_context, backlog=self._backlog + ) + + +class BaseRunner(ABC): + __slots__ = ("_handle_signals", "_kwargs", "_server", "_sites") + + def __init__(self, *, handle_signals: bool = False, **kwargs: Any) -> None: + self._handle_signals = handle_signals + self._kwargs = kwargs + self._server: Optional[Server] = None + self._sites: List[BaseSite] = [] + + @property + def server(self) -> Optional[Server]: + return self._server + + @property + def addresses(self) -> List[Any]: + ret: List[Any] = [] + for site in self._sites: + server = site._server + if server is not None: + sockets = server.sockets + if sockets is not None: + for sock in sockets: + ret.append(sock.getsockname()) + return ret + + @property + def sites(self) -> Set[BaseSite]: + return set(self._sites) + + async def setup(self) -> None: + loop = asyncio.get_event_loop() + + if self._handle_signals: + try: + loop.add_signal_handler(signal.SIGINT, _raise_graceful_exit) + loop.add_signal_handler(signal.SIGTERM, _raise_graceful_exit) + except NotImplementedError: # pragma: no cover + # add_signal_handler is not implemented on Windows + pass + + self._server = await self._make_server() + + @abstractmethod + async def shutdown(self) -> None: + pass # pragma: no cover + + async def cleanup(self) -> None: + loop = asyncio.get_event_loop() + + # The loop over sites is intentional, an exception on gather() + # leaves self._sites in unpredictable state. + # The loop guaranties that a site is either deleted on success or + # still present on failure + for site in list(self._sites): + await site.stop() + await self._cleanup_server() + self._server = None + if self._handle_signals: + try: + loop.remove_signal_handler(signal.SIGINT) + loop.remove_signal_handler(signal.SIGTERM) + except NotImplementedError: # pragma: no cover + # remove_signal_handler is not implemented on Windows + pass + + @abstractmethod + async def _make_server(self) -> Server: + pass # pragma: no cover + + @abstractmethod + async def _cleanup_server(self) -> None: + pass # pragma: no cover + + def _reg_site(self, site: BaseSite) -> None: + if site in self._sites: + raise RuntimeError(f"Site {site} is already registered in runner {self}") + self._sites.append(site) + + def _check_site(self, site: BaseSite) -> None: + if site not in self._sites: + raise RuntimeError(f"Site {site} is not registered in runner {self}") + + def _unreg_site(self, site: BaseSite) -> None: + if site not in self._sites: + raise RuntimeError(f"Site {site} is not registered in runner {self}") + self._sites.remove(site) + + +class ServerRunner(BaseRunner): + """Low-level web server runner""" + + __slots__ = ("_web_server",) + + def __init__( + self, web_server: Server, *, handle_signals: bool = False, **kwargs: Any + ) -> None: + super().__init__(handle_signals=handle_signals, **kwargs) + self._web_server = web_server + + async def shutdown(self) -> None: + pass + + async def _make_server(self) -> Server: + return self._web_server + + async def _cleanup_server(self) -> None: + pass + + +class AppRunner(BaseRunner): + """Web Application runner""" + + __slots__ = ("_app",) + + def __init__( + self, app: Application, *, handle_signals: bool = False, **kwargs: Any + ) -> None: + super().__init__(handle_signals=handle_signals, **kwargs) + if not isinstance(app, Application): + raise TypeError( + "The first argument should be web.Application " + "instance, got {!r}".format(app) + ) + self._app = app + + @property + def app(self) -> Application: + return self._app + + async def shutdown(self) -> None: + await self._app.shutdown() + + async def _make_server(self) -> Server: + loop = asyncio.get_event_loop() + self._app._set_loop(loop) + self._app.on_startup.freeze() + await self._app.startup() + self._app.freeze() + + return self._app._make_handler(loop=loop, **self._kwargs) + + async def _cleanup_server(self) -> None: + await self._app.cleanup() diff --git a/runtime/Lib/site-packages/aiohttp/web_server.py b/runtime/Lib/site-packages/aiohttp/web_server.py new file mode 100644 index 0000000000000000000000000000000000000000..73b381653659b259e82c59db6d09dec42a0e3e19 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/web_server.py @@ -0,0 +1,62 @@ +"""Low level HTTP server.""" +import asyncio +from typing import Any, Awaitable, Callable, Dict, List, Optional # noqa + +from .abc import AbstractStreamWriter +from .helpers import get_running_loop +from .http_parser import RawRequestMessage +from .streams import StreamReader +from .web_protocol import RequestHandler, _RequestFactory, _RequestHandler +from .web_request import BaseRequest + +__all__ = ("Server",) + + +class Server: + def __init__( + self, + handler: _RequestHandler, + *, + request_factory: Optional[_RequestFactory] = None, + loop: Optional[asyncio.AbstractEventLoop] = None, + **kwargs: Any + ) -> None: + self._loop = get_running_loop(loop) + self._connections: Dict[RequestHandler, asyncio.Transport] = {} + self._kwargs = kwargs + self.requests_count = 0 + self.request_handler = handler + self.request_factory = request_factory or self._make_request + + @property + def connections(self) -> List[RequestHandler]: + return list(self._connections.keys()) + + def connection_made( + self, handler: RequestHandler, transport: asyncio.Transport + ) -> None: + self._connections[handler] = transport + + def connection_lost( + self, handler: RequestHandler, exc: Optional[BaseException] = None + ) -> None: + if handler in self._connections: + del self._connections[handler] + + def _make_request( + self, + message: RawRequestMessage, + payload: StreamReader, + protocol: RequestHandler, + writer: AbstractStreamWriter, + task: "asyncio.Task[None]", + ) -> BaseRequest: + return BaseRequest(message, payload, protocol, writer, task, self._loop) + + async def shutdown(self, timeout: Optional[float] = None) -> None: + coros = [conn.shutdown(timeout) for conn in self._connections] + await asyncio.gather(*coros) + self._connections.clear() + + def __call__(self) -> RequestHandler: + return RequestHandler(self, loop=self._loop, **self._kwargs) diff --git a/runtime/Lib/site-packages/aiohttp/web_urldispatcher.py b/runtime/Lib/site-packages/aiohttp/web_urldispatcher.py new file mode 100644 index 0000000000000000000000000000000000000000..161d965faff353fd43467e9685156a9f7dc307ea --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/web_urldispatcher.py @@ -0,0 +1,1220 @@ +import abc +import asyncio +import base64 +import hashlib +import inspect +import keyword +import os +import re +import warnings +from contextlib import contextmanager +from functools import wraps +from pathlib import Path +from types import MappingProxyType +from typing import ( + TYPE_CHECKING, + Any, + Awaitable, + Callable, + Container, + Dict, + Generator, + Iterable, + Iterator, + List, + Mapping, + Optional, + Pattern, + Set, + Sized, + Tuple, + Type, + Union, + cast, +) + +from yarl import URL, __version__ as yarl_version # type: ignore[attr-defined] + +from . import hdrs +from .abc import AbstractMatchInfo, AbstractRouter, AbstractView +from .helpers import DEBUG +from .http import HttpVersion11 +from .typedefs import Final, Handler, PathLike, TypedDict +from .web_exceptions import ( + HTTPException, + HTTPExpectationFailed, + HTTPForbidden, + HTTPMethodNotAllowed, + HTTPNotFound, +) +from .web_fileresponse import FileResponse +from .web_request import Request +from .web_response import Response, StreamResponse +from .web_routedef import AbstractRouteDef + +__all__ = ( + "UrlDispatcher", + "UrlMappingMatchInfo", + "AbstractResource", + "Resource", + "PlainResource", + "DynamicResource", + "AbstractRoute", + "ResourceRoute", + "StaticResource", + "View", +) + + +if TYPE_CHECKING: # pragma: no cover + from .web_app import Application + + BaseDict = Dict[str, str] +else: + BaseDict = dict + +YARL_VERSION: Final[Tuple[int, ...]] = tuple(map(int, yarl_version.split(".")[:2])) + +HTTP_METHOD_RE: Final[Pattern[str]] = re.compile( + r"^[0-9A-Za-z!#\$%&'\*\+\-\.\^_`\|~]+$" +) +ROUTE_RE: Final[Pattern[str]] = re.compile( + r"(\{[_a-zA-Z][^{}]*(?:\{[^{}]*\}[^{}]*)*\})" +) +PATH_SEP: Final[str] = re.escape("/") + + +_ExpectHandler = Callable[[Request], Awaitable[None]] +_Resolve = Tuple[Optional["UrlMappingMatchInfo"], Set[str]] + + +class _InfoDict(TypedDict, total=False): + path: str + + formatter: str + pattern: Pattern[str] + + directory: Path + prefix: str + routes: Mapping[str, "AbstractRoute"] + + app: "Application" + + domain: str + + rule: "AbstractRuleMatching" + + http_exception: HTTPException + + +class AbstractResource(Sized, Iterable["AbstractRoute"]): + def __init__(self, *, name: Optional[str] = None) -> None: + self._name = name + + @property + def name(self) -> Optional[str]: + return self._name + + @property + @abc.abstractmethod + def canonical(self) -> str: + """Exposes the resource's canonical path. + + For example '/foo/bar/{name}' + + """ + + @abc.abstractmethod # pragma: no branch + def url_for(self, **kwargs: str) -> URL: + """Construct url for resource with additional params.""" + + @abc.abstractmethod # pragma: no branch + async def resolve(self, request: Request) -> _Resolve: + """Resolve resource. + + Return (UrlMappingMatchInfo, allowed_methods) pair. + """ + + @abc.abstractmethod + def add_prefix(self, prefix: str) -> None: + """Add a prefix to processed URLs. + + Required for subapplications support. + """ + + @abc.abstractmethod + def get_info(self) -> _InfoDict: + """Return a dict with additional info useful for introspection""" + + def freeze(self) -> None: + pass + + @abc.abstractmethod + def raw_match(self, path: str) -> bool: + """Perform a raw match against path""" + + +class AbstractRoute(abc.ABC): + def __init__( + self, + method: str, + handler: Union[Handler, Type[AbstractView]], + *, + expect_handler: Optional[_ExpectHandler] = None, + resource: Optional[AbstractResource] = None, + ) -> None: + + if expect_handler is None: + expect_handler = _default_expect_handler + + assert asyncio.iscoroutinefunction( + expect_handler + ), f"Coroutine is expected, got {expect_handler!r}" + + method = method.upper() + if not HTTP_METHOD_RE.match(method): + raise ValueError(f"{method} is not allowed HTTP method") + + assert callable(handler), handler + if asyncio.iscoroutinefunction(handler): + pass + elif inspect.isgeneratorfunction(handler): + warnings.warn( + "Bare generators are deprecated, " "use @coroutine wrapper", + DeprecationWarning, + ) + elif isinstance(handler, type) and issubclass(handler, AbstractView): + pass + else: + warnings.warn( + "Bare functions are deprecated, " "use async ones", DeprecationWarning + ) + + @wraps(handler) + async def handler_wrapper(request: Request) -> StreamResponse: + result = old_handler(request) + if asyncio.iscoroutine(result): + return await result + return result # type: ignore[return-value] + + old_handler = handler + handler = handler_wrapper + + self._method = method + self._handler = handler + self._expect_handler = expect_handler + self._resource = resource + + @property + def method(self) -> str: + return self._method + + @property + def handler(self) -> Handler: + return self._handler + + @property + @abc.abstractmethod + def name(self) -> Optional[str]: + """Optional route's name, always equals to resource's name.""" + + @property + def resource(self) -> Optional[AbstractResource]: + return self._resource + + @abc.abstractmethod + def get_info(self) -> _InfoDict: + """Return a dict with additional info useful for introspection""" + + @abc.abstractmethod # pragma: no branch + def url_for(self, *args: str, **kwargs: str) -> URL: + """Construct url for route with additional params.""" + + async def handle_expect_header(self, request: Request) -> None: + await self._expect_handler(request) + + +class UrlMappingMatchInfo(BaseDict, AbstractMatchInfo): + def __init__(self, match_dict: Dict[str, str], route: AbstractRoute): + super().__init__(match_dict) + self._route = route + self._apps: List[Application] = [] + self._current_app: Optional[Application] = None + self._frozen = False + + @property + def handler(self) -> Handler: + return self._route.handler + + @property + def route(self) -> AbstractRoute: + return self._route + + @property + def expect_handler(self) -> _ExpectHandler: + return self._route.handle_expect_header + + @property + def http_exception(self) -> Optional[HTTPException]: + return None + + def get_info(self) -> _InfoDict: # type: ignore[override] + return self._route.get_info() + + @property + def apps(self) -> Tuple["Application", ...]: + return tuple(self._apps) + + def add_app(self, app: "Application") -> None: + if self._frozen: + raise RuntimeError("Cannot change apps stack after .freeze() call") + if self._current_app is None: + self._current_app = app + self._apps.insert(0, app) + + @property + def current_app(self) -> "Application": + app = self._current_app + assert app is not None + return app + + @contextmanager + def set_current_app(self, app: "Application") -> Generator[None, None, None]: + if DEBUG: # pragma: no cover + if app not in self._apps: + raise RuntimeError( + "Expected one of the following apps {!r}, got {!r}".format( + self._apps, app + ) + ) + prev = self._current_app + self._current_app = app + try: + yield + finally: + self._current_app = prev + + def freeze(self) -> None: + self._frozen = True + + def __repr__(self) -> str: + return f"" + + +class MatchInfoError(UrlMappingMatchInfo): + def __init__(self, http_exception: HTTPException) -> None: + self._exception = http_exception + super().__init__({}, SystemRoute(self._exception)) + + @property + def http_exception(self) -> HTTPException: + return self._exception + + def __repr__(self) -> str: + return "".format( + self._exception.status, self._exception.reason + ) + + +async def _default_expect_handler(request: Request) -> None: + """Default handler for Expect header. + + Just send "100 Continue" to client. + raise HTTPExpectationFailed if value of header is not "100-continue" + """ + expect = request.headers.get(hdrs.EXPECT, "") + if request.version == HttpVersion11: + if expect.lower() == "100-continue": + await request.writer.write(b"HTTP/1.1 100 Continue\r\n\r\n") + else: + raise HTTPExpectationFailed(text="Unknown Expect: %s" % expect) + + +class Resource(AbstractResource): + def __init__(self, *, name: Optional[str] = None) -> None: + super().__init__(name=name) + self._routes: List[ResourceRoute] = [] + + def add_route( + self, + method: str, + handler: Union[Type[AbstractView], Handler], + *, + expect_handler: Optional[_ExpectHandler] = None, + ) -> "ResourceRoute": + + for route_obj in self._routes: + if route_obj.method == method or route_obj.method == hdrs.METH_ANY: + raise RuntimeError( + "Added route will never be executed, " + "method {route.method} is already " + "registered".format(route=route_obj) + ) + + route_obj = ResourceRoute(method, handler, self, expect_handler=expect_handler) + self.register_route(route_obj) + return route_obj + + def register_route(self, route: "ResourceRoute") -> None: + assert isinstance( + route, ResourceRoute + ), f"Instance of Route class is required, got {route!r}" + self._routes.append(route) + + async def resolve(self, request: Request) -> _Resolve: + allowed_methods: Set[str] = set() + + match_dict = self._match(request.rel_url.raw_path) + if match_dict is None: + return None, allowed_methods + + for route_obj in self._routes: + route_method = route_obj.method + allowed_methods.add(route_method) + + if route_method == request.method or route_method == hdrs.METH_ANY: + return (UrlMappingMatchInfo(match_dict, route_obj), allowed_methods) + else: + return None, allowed_methods + + @abc.abstractmethod + def _match(self, path: str) -> Optional[Dict[str, str]]: + pass # pragma: no cover + + def __len__(self) -> int: + return len(self._routes) + + def __iter__(self) -> Iterator[AbstractRoute]: + return iter(self._routes) + + # TODO: implement all abstract methods + + +class PlainResource(Resource): + def __init__(self, path: str, *, name: Optional[str] = None) -> None: + super().__init__(name=name) + assert not path or path.startswith("/") + self._path = path + + @property + def canonical(self) -> str: + return self._path + + def freeze(self) -> None: + if not self._path: + self._path = "/" + + def add_prefix(self, prefix: str) -> None: + assert prefix.startswith("/") + assert not prefix.endswith("/") + assert len(prefix) > 1 + self._path = prefix + self._path + + def _match(self, path: str) -> Optional[Dict[str, str]]: + # string comparison is about 10 times faster than regexp matching + if self._path == path: + return {} + else: + return None + + def raw_match(self, path: str) -> bool: + return self._path == path + + def get_info(self) -> _InfoDict: + return {"path": self._path} + + def url_for(self) -> URL: # type: ignore[override] + return URL.build(path=self._path, encoded=True) + + def __repr__(self) -> str: + name = "'" + self.name + "' " if self.name is not None else "" + return f"" + + +class DynamicResource(Resource): + + DYN = re.compile(r"\{(?P[_a-zA-Z][_a-zA-Z0-9]*)\}") + DYN_WITH_RE = re.compile(r"\{(?P[_a-zA-Z][_a-zA-Z0-9]*):(?P.+)\}") + GOOD = r"[^{}/]+" + + def __init__(self, path: str, *, name: Optional[str] = None) -> None: + super().__init__(name=name) + pattern = "" + formatter = "" + for part in ROUTE_RE.split(path): + match = self.DYN.fullmatch(part) + if match: + pattern += "(?P<{}>{})".format(match.group("var"), self.GOOD) + formatter += "{" + match.group("var") + "}" + continue + + match = self.DYN_WITH_RE.fullmatch(part) + if match: + pattern += "(?P<{var}>{re})".format(**match.groupdict()) + formatter += "{" + match.group("var") + "}" + continue + + if "{" in part or "}" in part: + raise ValueError(f"Invalid path '{path}'['{part}']") + + part = _requote_path(part) + formatter += part + pattern += re.escape(part) + + try: + compiled = re.compile(pattern) + except re.error as exc: + raise ValueError(f"Bad pattern '{pattern}': {exc}") from None + assert compiled.pattern.startswith(PATH_SEP) + assert formatter.startswith("/") + self._pattern = compiled + self._formatter = formatter + + @property + def canonical(self) -> str: + return self._formatter + + def add_prefix(self, prefix: str) -> None: + assert prefix.startswith("/") + assert not prefix.endswith("/") + assert len(prefix) > 1 + self._pattern = re.compile(re.escape(prefix) + self._pattern.pattern) + self._formatter = prefix + self._formatter + + def _match(self, path: str) -> Optional[Dict[str, str]]: + match = self._pattern.fullmatch(path) + if match is None: + return None + else: + return { + key: _unquote_path(value) for key, value in match.groupdict().items() + } + + def raw_match(self, path: str) -> bool: + return self._formatter == path + + def get_info(self) -> _InfoDict: + return {"formatter": self._formatter, "pattern": self._pattern} + + def url_for(self, **parts: str) -> URL: + url = self._formatter.format_map({k: _quote_path(v) for k, v in parts.items()}) + return URL.build(path=url, encoded=True) + + def __repr__(self) -> str: + name = "'" + self.name + "' " if self.name is not None else "" + return "".format( + name=name, formatter=self._formatter + ) + + +class PrefixResource(AbstractResource): + def __init__(self, prefix: str, *, name: Optional[str] = None) -> None: + assert not prefix or prefix.startswith("/"), prefix + assert prefix in ("", "/") or not prefix.endswith("/"), prefix + super().__init__(name=name) + self._prefix = _requote_path(prefix) + self._prefix2 = self._prefix + "/" + + @property + def canonical(self) -> str: + return self._prefix + + def add_prefix(self, prefix: str) -> None: + assert prefix.startswith("/") + assert not prefix.endswith("/") + assert len(prefix) > 1 + self._prefix = prefix + self._prefix + self._prefix2 = self._prefix + "/" + + def raw_match(self, prefix: str) -> bool: + return False + + # TODO: impl missing abstract methods + + +class StaticResource(PrefixResource): + VERSION_KEY = "v" + + def __init__( + self, + prefix: str, + directory: PathLike, + *, + name: Optional[str] = None, + expect_handler: Optional[_ExpectHandler] = None, + chunk_size: int = 256 * 1024, + show_index: bool = False, + follow_symlinks: bool = False, + append_version: bool = False, + ) -> None: + super().__init__(prefix, name=name) + try: + directory = Path(directory) + if str(directory).startswith("~"): + directory = Path(os.path.expanduser(str(directory))) + directory = directory.resolve() + if not directory.is_dir(): + raise ValueError("Not a directory") + except (FileNotFoundError, ValueError) as error: + raise ValueError(f"No directory exists at '{directory}'") from error + self._directory = directory + self._show_index = show_index + self._chunk_size = chunk_size + self._follow_symlinks = follow_symlinks + self._expect_handler = expect_handler + self._append_version = append_version + + self._routes = { + "GET": ResourceRoute( + "GET", self._handle, self, expect_handler=expect_handler + ), + "HEAD": ResourceRoute( + "HEAD", self._handle, self, expect_handler=expect_handler + ), + } + + def url_for( # type: ignore[override] + self, + *, + filename: Union[str, Path], + append_version: Optional[bool] = None, + ) -> URL: + if append_version is None: + append_version = self._append_version + if isinstance(filename, Path): + filename = str(filename) + filename = filename.lstrip("/") + + url = URL.build(path=self._prefix, encoded=True) + # filename is not encoded + if YARL_VERSION < (1, 6): + url = url / filename.replace("%", "%25") + else: + url = url / filename + + if append_version: + try: + filepath = self._directory.joinpath(filename).resolve() + if not self._follow_symlinks: + filepath.relative_to(self._directory) + except (ValueError, FileNotFoundError): + # ValueError for case when path point to symlink + # with follow_symlinks is False + return url # relatively safe + if filepath.is_file(): + # TODO cache file content + # with file watcher for cache invalidation + with filepath.open("rb") as f: + file_bytes = f.read() + h = self._get_file_hash(file_bytes) + url = url.with_query({self.VERSION_KEY: h}) + return url + return url + + @staticmethod + def _get_file_hash(byte_array: bytes) -> str: + m = hashlib.sha256() # todo sha256 can be configurable param + m.update(byte_array) + b64 = base64.urlsafe_b64encode(m.digest()) + return b64.decode("ascii") + + def get_info(self) -> _InfoDict: + return { + "directory": self._directory, + "prefix": self._prefix, + "routes": self._routes, + } + + def set_options_route(self, handler: Handler) -> None: + if "OPTIONS" in self._routes: + raise RuntimeError("OPTIONS route was set already") + self._routes["OPTIONS"] = ResourceRoute( + "OPTIONS", handler, self, expect_handler=self._expect_handler + ) + + async def resolve(self, request: Request) -> _Resolve: + path = request.rel_url.raw_path + method = request.method + allowed_methods = set(self._routes) + if not path.startswith(self._prefix2) and path != self._prefix: + return None, set() + + if method not in allowed_methods: + return None, allowed_methods + + match_dict = {"filename": _unquote_path(path[len(self._prefix) + 1 :])} + return (UrlMappingMatchInfo(match_dict, self._routes[method]), allowed_methods) + + def __len__(self) -> int: + return len(self._routes) + + def __iter__(self) -> Iterator[AbstractRoute]: + return iter(self._routes.values()) + + async def _handle(self, request: Request) -> StreamResponse: + rel_url = request.match_info["filename"] + try: + filename = Path(rel_url) + if filename.anchor: + # rel_url is an absolute name like + # /static/\\machine_name\c$ or /static/D:\path + # where the static dir is totally different + raise HTTPForbidden() + filepath = self._directory.joinpath(filename).resolve() + if not self._follow_symlinks: + filepath.relative_to(self._directory) + except (ValueError, FileNotFoundError) as error: + # relatively safe + raise HTTPNotFound() from error + except HTTPForbidden: + raise + except Exception as error: + # perm error or other kind! + request.app.logger.exception(error) + raise HTTPNotFound() from error + + # on opening a dir, load its contents if allowed + if filepath.is_dir(): + if self._show_index: + try: + return Response( + text=self._directory_as_html(filepath), content_type="text/html" + ) + except PermissionError: + raise HTTPForbidden() + else: + raise HTTPForbidden() + elif filepath.is_file(): + return FileResponse(filepath, chunk_size=self._chunk_size) + else: + raise HTTPNotFound + + def _directory_as_html(self, filepath: Path) -> str: + # returns directory's index as html + + # sanity check + assert filepath.is_dir() + + relative_path_to_dir = filepath.relative_to(self._directory).as_posix() + index_of = f"Index of /{relative_path_to_dir}" + h1 = f"

{index_of}

" + + index_list = [] + dir_index = filepath.iterdir() + for _file in sorted(dir_index): + # show file url as relative to static path + rel_path = _file.relative_to(self._directory).as_posix() + file_url = self._prefix + "/" + rel_path + + # if file is a directory, add '/' to the end of the name + if _file.is_dir(): + file_name = f"{_file.name}/" + else: + file_name = _file.name + + index_list.append( + '
  • {name}
  • '.format( + url=file_url, name=file_name + ) + ) + ul = "
      \n{}\n
    ".format("\n".join(index_list)) + body = f"\n{h1}\n{ul}\n" + + head_str = f"\n{index_of}\n" + html = f"\n{head_str}\n{body}\n" + + return html + + def __repr__(self) -> str: + name = "'" + self.name + "'" if self.name is not None else "" + return " {directory!r}>".format( + name=name, path=self._prefix, directory=self._directory + ) + + +class PrefixedSubAppResource(PrefixResource): + def __init__(self, prefix: str, app: "Application") -> None: + super().__init__(prefix) + self._app = app + for resource in app.router.resources(): + resource.add_prefix(prefix) + + def add_prefix(self, prefix: str) -> None: + super().add_prefix(prefix) + for resource in self._app.router.resources(): + resource.add_prefix(prefix) + + def url_for(self, *args: str, **kwargs: str) -> URL: + raise RuntimeError(".url_for() is not supported " "by sub-application root") + + def get_info(self) -> _InfoDict: + return {"app": self._app, "prefix": self._prefix} + + async def resolve(self, request: Request) -> _Resolve: + if ( + not request.url.raw_path.startswith(self._prefix2) + and request.url.raw_path != self._prefix + ): + return None, set() + match_info = await self._app.router.resolve(request) + match_info.add_app(self._app) + if isinstance(match_info.http_exception, HTTPMethodNotAllowed): + methods = match_info.http_exception.allowed_methods + else: + methods = set() + return match_info, methods + + def __len__(self) -> int: + return len(self._app.router.routes()) + + def __iter__(self) -> Iterator[AbstractRoute]: + return iter(self._app.router.routes()) + + def __repr__(self) -> str: + return " {app!r}>".format( + prefix=self._prefix, app=self._app + ) + + +class AbstractRuleMatching(abc.ABC): + @abc.abstractmethod # pragma: no branch + async def match(self, request: Request) -> bool: + """Return bool if the request satisfies the criteria""" + + @abc.abstractmethod # pragma: no branch + def get_info(self) -> _InfoDict: + """Return a dict with additional info useful for introspection""" + + @property + @abc.abstractmethod # pragma: no branch + def canonical(self) -> str: + """Return a str""" + + +class Domain(AbstractRuleMatching): + re_part = re.compile(r"(?!-)[a-z\d-]{1,63}(? None: + super().__init__() + self._domain = self.validation(domain) + + @property + def canonical(self) -> str: + return self._domain + + def validation(self, domain: str) -> str: + if not isinstance(domain, str): + raise TypeError("Domain must be str") + domain = domain.rstrip(".").lower() + if not domain: + raise ValueError("Domain cannot be empty") + elif "://" in domain: + raise ValueError("Scheme not supported") + url = URL("http://" + domain) + assert url.raw_host is not None + if not all(self.re_part.fullmatch(x) for x in url.raw_host.split(".")): + raise ValueError("Domain not valid") + if url.port == 80: + return url.raw_host + return f"{url.raw_host}:{url.port}" + + async def match(self, request: Request) -> bool: + host = request.headers.get(hdrs.HOST) + if not host: + return False + return self.match_domain(host) + + def match_domain(self, host: str) -> bool: + return host.lower() == self._domain + + def get_info(self) -> _InfoDict: + return {"domain": self._domain} + + +class MaskDomain(Domain): + re_part = re.compile(r"(?!-)[a-z\d\*-]{1,63}(? None: + super().__init__(domain) + mask = self._domain.replace(".", r"\.").replace("*", ".*") + self._mask = re.compile(mask) + + @property + def canonical(self) -> str: + return self._mask.pattern + + def match_domain(self, host: str) -> bool: + return self._mask.fullmatch(host) is not None + + +class MatchedSubAppResource(PrefixedSubAppResource): + def __init__(self, rule: AbstractRuleMatching, app: "Application") -> None: + AbstractResource.__init__(self) + self._prefix = "" + self._app = app + self._rule = rule + + @property + def canonical(self) -> str: + return self._rule.canonical + + def get_info(self) -> _InfoDict: + return {"app": self._app, "rule": self._rule} + + async def resolve(self, request: Request) -> _Resolve: + if not await self._rule.match(request): + return None, set() + match_info = await self._app.router.resolve(request) + match_info.add_app(self._app) + if isinstance(match_info.http_exception, HTTPMethodNotAllowed): + methods = match_info.http_exception.allowed_methods + else: + methods = set() + return match_info, methods + + def __repr__(self) -> str: + return " {app!r}>" "".format(app=self._app) + + +class ResourceRoute(AbstractRoute): + """A route with resource""" + + def __init__( + self, + method: str, + handler: Union[Handler, Type[AbstractView]], + resource: AbstractResource, + *, + expect_handler: Optional[_ExpectHandler] = None, + ) -> None: + super().__init__( + method, handler, expect_handler=expect_handler, resource=resource + ) + + def __repr__(self) -> str: + return " {handler!r}".format( + method=self.method, resource=self._resource, handler=self.handler + ) + + @property + def name(self) -> Optional[str]: + if self._resource is None: + return None + return self._resource.name + + def url_for(self, *args: str, **kwargs: str) -> URL: + """Construct url for route with additional params.""" + assert self._resource is not None + return self._resource.url_for(*args, **kwargs) + + def get_info(self) -> _InfoDict: + assert self._resource is not None + return self._resource.get_info() + + +class SystemRoute(AbstractRoute): + def __init__(self, http_exception: HTTPException) -> None: + super().__init__(hdrs.METH_ANY, self._handle) + self._http_exception = http_exception + + def url_for(self, *args: str, **kwargs: str) -> URL: + raise RuntimeError(".url_for() is not allowed for SystemRoute") + + @property + def name(self) -> Optional[str]: + return None + + def get_info(self) -> _InfoDict: + return {"http_exception": self._http_exception} + + async def _handle(self, request: Request) -> StreamResponse: + raise self._http_exception + + @property + def status(self) -> int: + return self._http_exception.status + + @property + def reason(self) -> str: + return self._http_exception.reason + + def __repr__(self) -> str: + return "".format(self=self) + + +class View(AbstractView): + async def _iter(self) -> StreamResponse: + if self.request.method not in hdrs.METH_ALL: + self._raise_allowed_methods() + method: Callable[[], Awaitable[StreamResponse]] = getattr( + self, self.request.method.lower(), None + ) + if method is None: + self._raise_allowed_methods() + resp = await method() + return resp + + def __await__(self) -> Generator[Any, None, StreamResponse]: + return self._iter().__await__() + + def _raise_allowed_methods(self) -> None: + allowed_methods = {m for m in hdrs.METH_ALL if hasattr(self, m.lower())} + raise HTTPMethodNotAllowed(self.request.method, allowed_methods) + + +class ResourcesView(Sized, Iterable[AbstractResource], Container[AbstractResource]): + def __init__(self, resources: List[AbstractResource]) -> None: + self._resources = resources + + def __len__(self) -> int: + return len(self._resources) + + def __iter__(self) -> Iterator[AbstractResource]: + yield from self._resources + + def __contains__(self, resource: object) -> bool: + return resource in self._resources + + +class RoutesView(Sized, Iterable[AbstractRoute], Container[AbstractRoute]): + def __init__(self, resources: List[AbstractResource]): + self._routes: List[AbstractRoute] = [] + for resource in resources: + for route in resource: + self._routes.append(route) + + def __len__(self) -> int: + return len(self._routes) + + def __iter__(self) -> Iterator[AbstractRoute]: + yield from self._routes + + def __contains__(self, route: object) -> bool: + return route in self._routes + + +class UrlDispatcher(AbstractRouter, Mapping[str, AbstractResource]): + + NAME_SPLIT_RE = re.compile(r"[.:-]") + + def __init__(self) -> None: + super().__init__() + self._resources: List[AbstractResource] = [] + self._named_resources: Dict[str, AbstractResource] = {} + + async def resolve(self, request: Request) -> UrlMappingMatchInfo: + method = request.method + allowed_methods: Set[str] = set() + + for resource in self._resources: + match_dict, allowed = await resource.resolve(request) + if match_dict is not None: + return match_dict + else: + allowed_methods |= allowed + + if allowed_methods: + return MatchInfoError(HTTPMethodNotAllowed(method, allowed_methods)) + else: + return MatchInfoError(HTTPNotFound()) + + def __iter__(self) -> Iterator[str]: + return iter(self._named_resources) + + def __len__(self) -> int: + return len(self._named_resources) + + def __contains__(self, resource: object) -> bool: + return resource in self._named_resources + + def __getitem__(self, name: str) -> AbstractResource: + return self._named_resources[name] + + def resources(self) -> ResourcesView: + return ResourcesView(self._resources) + + def routes(self) -> RoutesView: + return RoutesView(self._resources) + + def named_resources(self) -> Mapping[str, AbstractResource]: + return MappingProxyType(self._named_resources) + + def register_resource(self, resource: AbstractResource) -> None: + assert isinstance( + resource, AbstractResource + ), f"Instance of AbstractResource class is required, got {resource!r}" + if self.frozen: + raise RuntimeError("Cannot register a resource into frozen router.") + + name = resource.name + + if name is not None: + parts = self.NAME_SPLIT_RE.split(name) + for part in parts: + if keyword.iskeyword(part): + raise ValueError( + f"Incorrect route name {name!r}, " + "python keywords cannot be used " + "for route name" + ) + if not part.isidentifier(): + raise ValueError( + "Incorrect route name {!r}, " + "the name should be a sequence of " + "python identifiers separated " + "by dash, dot or column".format(name) + ) + if name in self._named_resources: + raise ValueError( + "Duplicate {!r}, " + "already handled by {!r}".format(name, self._named_resources[name]) + ) + self._named_resources[name] = resource + self._resources.append(resource) + + def add_resource(self, path: str, *, name: Optional[str] = None) -> Resource: + if path and not path.startswith("/"): + raise ValueError("path should be started with / or be empty") + # Reuse last added resource if path and name are the same + if self._resources: + resource = self._resources[-1] + if resource.name == name and resource.raw_match(path): + return cast(Resource, resource) + if not ("{" in path or "}" in path or ROUTE_RE.search(path)): + resource = PlainResource(_requote_path(path), name=name) + self.register_resource(resource) + return resource + resource = DynamicResource(path, name=name) + self.register_resource(resource) + return resource + + def add_route( + self, + method: str, + path: str, + handler: Union[Handler, Type[AbstractView]], + *, + name: Optional[str] = None, + expect_handler: Optional[_ExpectHandler] = None, + ) -> AbstractRoute: + resource = self.add_resource(path, name=name) + return resource.add_route(method, handler, expect_handler=expect_handler) + + def add_static( + self, + prefix: str, + path: PathLike, + *, + name: Optional[str] = None, + expect_handler: Optional[_ExpectHandler] = None, + chunk_size: int = 256 * 1024, + show_index: bool = False, + follow_symlinks: bool = False, + append_version: bool = False, + ) -> AbstractResource: + """Add static files view. + + prefix - url prefix + path - folder with files + + """ + assert prefix.startswith("/") + if prefix.endswith("/"): + prefix = prefix[:-1] + resource = StaticResource( + prefix, + path, + name=name, + expect_handler=expect_handler, + chunk_size=chunk_size, + show_index=show_index, + follow_symlinks=follow_symlinks, + append_version=append_version, + ) + self.register_resource(resource) + return resource + + def add_head(self, path: str, handler: Handler, **kwargs: Any) -> AbstractRoute: + """Shortcut for add_route with method HEAD.""" + return self.add_route(hdrs.METH_HEAD, path, handler, **kwargs) + + def add_options(self, path: str, handler: Handler, **kwargs: Any) -> AbstractRoute: + """Shortcut for add_route with method OPTIONS.""" + return self.add_route(hdrs.METH_OPTIONS, path, handler, **kwargs) + + def add_get( + self, + path: str, + handler: Handler, + *, + name: Optional[str] = None, + allow_head: bool = True, + **kwargs: Any, + ) -> AbstractRoute: + """Shortcut for add_route with method GET. + + If allow_head is true, another + route is added allowing head requests to the same endpoint. + """ + resource = self.add_resource(path, name=name) + if allow_head: + resource.add_route(hdrs.METH_HEAD, handler, **kwargs) + return resource.add_route(hdrs.METH_GET, handler, **kwargs) + + def add_post(self, path: str, handler: Handler, **kwargs: Any) -> AbstractRoute: + """Shortcut for add_route with method POST.""" + return self.add_route(hdrs.METH_POST, path, handler, **kwargs) + + def add_put(self, path: str, handler: Handler, **kwargs: Any) -> AbstractRoute: + """Shortcut for add_route with method PUT.""" + return self.add_route(hdrs.METH_PUT, path, handler, **kwargs) + + def add_patch(self, path: str, handler: Handler, **kwargs: Any) -> AbstractRoute: + """Shortcut for add_route with method PATCH.""" + return self.add_route(hdrs.METH_PATCH, path, handler, **kwargs) + + def add_delete(self, path: str, handler: Handler, **kwargs: Any) -> AbstractRoute: + """Shortcut for add_route with method DELETE.""" + return self.add_route(hdrs.METH_DELETE, path, handler, **kwargs) + + def add_view( + self, path: str, handler: Type[AbstractView], **kwargs: Any + ) -> AbstractRoute: + """Shortcut for add_route with ANY methods for a class-based view.""" + return self.add_route(hdrs.METH_ANY, path, handler, **kwargs) + + def freeze(self) -> None: + super().freeze() + for resource in self._resources: + resource.freeze() + + def add_routes(self, routes: Iterable[AbstractRouteDef]) -> List[AbstractRoute]: + """Append routes to route table. + + Parameter should be a sequence of RouteDef objects. + + Returns a list of registered AbstractRoute instances. + """ + registered_routes = [] + for route_def in routes: + registered_routes.extend(route_def.register(self)) + return registered_routes + + +def _quote_path(value: str) -> str: + if YARL_VERSION < (1, 6): + value = value.replace("%", "%25") + return URL.build(path=value, encoded=False).raw_path + + +def _unquote_path(value: str) -> str: + return URL.build(path=value, encoded=True).path + + +def _requote_path(value: str) -> str: + # Quote non-ascii characters and other characters which must be quoted, + # but preserve existing %-sequences. + result = _quote_path(value) + if "%" in value: + result = result.replace("%25", "%") + return result diff --git a/runtime/Lib/site-packages/aiohttp/web_ws.py b/runtime/Lib/site-packages/aiohttp/web_ws.py new file mode 100644 index 0000000000000000000000000000000000000000..a90241350f0a8f22bcb59a0505d186e3b246af58 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/web_ws.py @@ -0,0 +1,487 @@ +import asyncio +import base64 +import binascii +import hashlib +import json +from typing import Any, Iterable, Optional, Tuple, cast + +import async_timeout +import attr +from multidict import CIMultiDict + +from . import hdrs +from .abc import AbstractStreamWriter +from .helpers import call_later, set_result +from .http import ( + WS_CLOSED_MESSAGE, + WS_CLOSING_MESSAGE, + WS_KEY, + WebSocketError, + WebSocketReader, + WebSocketWriter, + WSCloseCode, + WSMessage, + WSMsgType as WSMsgType, + ws_ext_gen, + ws_ext_parse, +) +from .log import ws_logger +from .streams import EofStream, FlowControlDataQueue +from .typedefs import Final, JSONDecoder, JSONEncoder +from .web_exceptions import HTTPBadRequest, HTTPException +from .web_request import BaseRequest +from .web_response import StreamResponse + +__all__ = ( + "WebSocketResponse", + "WebSocketReady", + "WSMsgType", +) + +THRESHOLD_CONNLOST_ACCESS: Final[int] = 5 + + +@attr.s(auto_attribs=True, frozen=True, slots=True) +class WebSocketReady: + ok: bool + protocol: Optional[str] + + def __bool__(self) -> bool: + return self.ok + + +class WebSocketResponse(StreamResponse): + + _length_check = False + + def __init__( + self, + *, + timeout: float = 10.0, + receive_timeout: Optional[float] = None, + autoclose: bool = True, + autoping: bool = True, + heartbeat: Optional[float] = None, + protocols: Iterable[str] = (), + compress: bool = True, + max_msg_size: int = 4 * 1024 * 1024, + ) -> None: + super().__init__(status=101) + self._protocols = protocols + self._ws_protocol: Optional[str] = None + self._writer: Optional[WebSocketWriter] = None + self._reader: Optional[FlowControlDataQueue[WSMessage]] = None + self._closed = False + self._closing = False + self._conn_lost = 0 + self._close_code: Optional[int] = None + self._loop: Optional[asyncio.AbstractEventLoop] = None + self._waiting: Optional[asyncio.Future[bool]] = None + self._exception: Optional[BaseException] = None + self._timeout = timeout + self._receive_timeout = receive_timeout + self._autoclose = autoclose + self._autoping = autoping + self._heartbeat = heartbeat + self._heartbeat_cb: Optional[asyncio.TimerHandle] = None + if heartbeat is not None: + self._pong_heartbeat = heartbeat / 2.0 + self._pong_response_cb: Optional[asyncio.TimerHandle] = None + self._compress = compress + self._max_msg_size = max_msg_size + + def _cancel_heartbeat(self) -> None: + if self._pong_response_cb is not None: + self._pong_response_cb.cancel() + self._pong_response_cb = None + + if self._heartbeat_cb is not None: + self._heartbeat_cb.cancel() + self._heartbeat_cb = None + + def _reset_heartbeat(self) -> None: + self._cancel_heartbeat() + + if self._heartbeat is not None: + assert self._loop is not None + self._heartbeat_cb = call_later( + self._send_heartbeat, self._heartbeat, self._loop + ) + + def _send_heartbeat(self) -> None: + if self._heartbeat is not None and not self._closed: + assert self._loop is not None + # fire-and-forget a task is not perfect but maybe ok for + # sending ping. Otherwise we need a long-living heartbeat + # task in the class. + self._loop.create_task(self._writer.ping()) # type: ignore[union-attr] + + if self._pong_response_cb is not None: + self._pong_response_cb.cancel() + self._pong_response_cb = call_later( + self._pong_not_received, self._pong_heartbeat, self._loop + ) + + def _pong_not_received(self) -> None: + if self._req is not None and self._req.transport is not None: + self._closed = True + self._close_code = WSCloseCode.ABNORMAL_CLOSURE + self._exception = asyncio.TimeoutError() + self._req.transport.close() + + async def prepare(self, request: BaseRequest) -> AbstractStreamWriter: + # make pre-check to don't hide it by do_handshake() exceptions + if self._payload_writer is not None: + return self._payload_writer + + protocol, writer = self._pre_start(request) + payload_writer = await super().prepare(request) + assert payload_writer is not None + self._post_start(request, protocol, writer) + await payload_writer.drain() + return payload_writer + + def _handshake( + self, request: BaseRequest + ) -> Tuple["CIMultiDict[str]", str, bool, bool]: + headers = request.headers + if "websocket" != headers.get(hdrs.UPGRADE, "").lower().strip(): + raise HTTPBadRequest( + text=( + "No WebSocket UPGRADE hdr: {}\n Can " + '"Upgrade" only to "WebSocket".' + ).format(headers.get(hdrs.UPGRADE)) + ) + + if "upgrade" not in headers.get(hdrs.CONNECTION, "").lower(): + raise HTTPBadRequest( + text="No CONNECTION upgrade hdr: {}".format( + headers.get(hdrs.CONNECTION) + ) + ) + + # find common sub-protocol between client and server + protocol = None + if hdrs.SEC_WEBSOCKET_PROTOCOL in headers: + req_protocols = [ + str(proto.strip()) + for proto in headers[hdrs.SEC_WEBSOCKET_PROTOCOL].split(",") + ] + + for proto in req_protocols: + if proto in self._protocols: + protocol = proto + break + else: + # No overlap found: Return no protocol as per spec + ws_logger.warning( + "Client protocols %r don’t overlap server-known ones %r", + req_protocols, + self._protocols, + ) + + # check supported version + version = headers.get(hdrs.SEC_WEBSOCKET_VERSION, "") + if version not in ("13", "8", "7"): + raise HTTPBadRequest(text=f"Unsupported version: {version}") + + # check client handshake for validity + key = headers.get(hdrs.SEC_WEBSOCKET_KEY) + try: + if not key or len(base64.b64decode(key)) != 16: + raise HTTPBadRequest(text=f"Handshake error: {key!r}") + except binascii.Error: + raise HTTPBadRequest(text=f"Handshake error: {key!r}") from None + + accept_val = base64.b64encode( + hashlib.sha1(key.encode() + WS_KEY).digest() + ).decode() + response_headers = CIMultiDict( + { + hdrs.UPGRADE: "websocket", + hdrs.CONNECTION: "upgrade", + hdrs.SEC_WEBSOCKET_ACCEPT: accept_val, + } + ) + + notakeover = False + compress = 0 + if self._compress: + extensions = headers.get(hdrs.SEC_WEBSOCKET_EXTENSIONS) + # Server side always get return with no exception. + # If something happened, just drop compress extension + compress, notakeover = ws_ext_parse(extensions, isserver=True) + if compress: + enabledext = ws_ext_gen( + compress=compress, isserver=True, server_notakeover=notakeover + ) + response_headers[hdrs.SEC_WEBSOCKET_EXTENSIONS] = enabledext + + if protocol: + response_headers[hdrs.SEC_WEBSOCKET_PROTOCOL] = protocol + return ( + response_headers, + protocol, + compress, + notakeover, + ) # type: ignore[return-value] + + def _pre_start(self, request: BaseRequest) -> Tuple[str, WebSocketWriter]: + self._loop = request._loop + + headers, protocol, compress, notakeover = self._handshake(request) + + self.set_status(101) + self.headers.update(headers) + self.force_close() + self._compress = compress + transport = request._protocol.transport + assert transport is not None + writer = WebSocketWriter( + request._protocol, transport, compress=compress, notakeover=notakeover + ) + + return protocol, writer + + def _post_start( + self, request: BaseRequest, protocol: str, writer: WebSocketWriter + ) -> None: + self._ws_protocol = protocol + self._writer = writer + + self._reset_heartbeat() + + loop = self._loop + assert loop is not None + self._reader = FlowControlDataQueue(request._protocol, 2**16, loop=loop) + request.protocol.set_parser( + WebSocketReader(self._reader, self._max_msg_size, compress=self._compress) + ) + # disable HTTP keepalive for WebSocket + request.protocol.keep_alive(False) + + def can_prepare(self, request: BaseRequest) -> WebSocketReady: + if self._writer is not None: + raise RuntimeError("Already started") + try: + _, protocol, _, _ = self._handshake(request) + except HTTPException: + return WebSocketReady(False, None) + else: + return WebSocketReady(True, protocol) + + @property + def closed(self) -> bool: + return self._closed + + @property + def close_code(self) -> Optional[int]: + return self._close_code + + @property + def ws_protocol(self) -> Optional[str]: + return self._ws_protocol + + @property + def compress(self) -> bool: + return self._compress + + def exception(self) -> Optional[BaseException]: + return self._exception + + async def ping(self, message: bytes = b"") -> None: + if self._writer is None: + raise RuntimeError("Call .prepare() first") + await self._writer.ping(message) + + async def pong(self, message: bytes = b"") -> None: + # unsolicited pong + if self._writer is None: + raise RuntimeError("Call .prepare() first") + await self._writer.pong(message) + + async def send_str(self, data: str, compress: Optional[bool] = None) -> None: + if self._writer is None: + raise RuntimeError("Call .prepare() first") + if not isinstance(data, str): + raise TypeError("data argument must be str (%r)" % type(data)) + await self._writer.send(data, binary=False, compress=compress) + + async def send_bytes(self, data: bytes, compress: Optional[bool] = None) -> None: + if self._writer is None: + raise RuntimeError("Call .prepare() first") + if not isinstance(data, (bytes, bytearray, memoryview)): + raise TypeError("data argument must be byte-ish (%r)" % type(data)) + await self._writer.send(data, binary=True, compress=compress) + + async def send_json( + self, + data: Any, + compress: Optional[bool] = None, + *, + dumps: JSONEncoder = json.dumps, + ) -> None: + await self.send_str(dumps(data), compress=compress) + + async def write_eof(self) -> None: # type: ignore[override] + if self._eof_sent: + return + if self._payload_writer is None: + raise RuntimeError("Response has not been started") + + await self.close() + self._eof_sent = True + + async def close(self, *, code: int = WSCloseCode.OK, message: bytes = b"") -> bool: + if self._writer is None: + raise RuntimeError("Call .prepare() first") + + self._cancel_heartbeat() + reader = self._reader + assert reader is not None + + # we need to break `receive()` cycle first, + # `close()` may be called from different task + if self._waiting is not None and not self._closed: + reader.feed_data(WS_CLOSING_MESSAGE, 0) + await self._waiting + + if not self._closed: + self._closed = True + try: + await self._writer.close(code, message) + writer = self._payload_writer + assert writer is not None + await writer.drain() + except (asyncio.CancelledError, asyncio.TimeoutError): + self._close_code = WSCloseCode.ABNORMAL_CLOSURE + raise + except Exception as exc: + self._close_code = WSCloseCode.ABNORMAL_CLOSURE + self._exception = exc + return True + + if self._closing: + return True + + reader = self._reader + assert reader is not None + try: + async with async_timeout.timeout(self._timeout): + msg = await reader.read() + except asyncio.CancelledError: + self._close_code = WSCloseCode.ABNORMAL_CLOSURE + raise + except Exception as exc: + self._close_code = WSCloseCode.ABNORMAL_CLOSURE + self._exception = exc + return True + + if msg.type == WSMsgType.CLOSE: + self._close_code = msg.data + return True + + self._close_code = WSCloseCode.ABNORMAL_CLOSURE + self._exception = asyncio.TimeoutError() + return True + else: + return False + + async def receive(self, timeout: Optional[float] = None) -> WSMessage: + if self._reader is None: + raise RuntimeError("Call .prepare() first") + + loop = self._loop + assert loop is not None + while True: + if self._waiting is not None: + raise RuntimeError("Concurrent call to receive() is not allowed") + + if self._closed: + self._conn_lost += 1 + if self._conn_lost >= THRESHOLD_CONNLOST_ACCESS: + raise RuntimeError("WebSocket connection is closed.") + return WS_CLOSED_MESSAGE + elif self._closing: + return WS_CLOSING_MESSAGE + + try: + self._waiting = loop.create_future() + try: + async with async_timeout.timeout(timeout or self._receive_timeout): + msg = await self._reader.read() + self._reset_heartbeat() + finally: + waiter = self._waiting + set_result(waiter, True) + self._waiting = None + except (asyncio.CancelledError, asyncio.TimeoutError): + self._close_code = WSCloseCode.ABNORMAL_CLOSURE + raise + except EofStream: + self._close_code = WSCloseCode.OK + await self.close() + return WSMessage(WSMsgType.CLOSED, None, None) + except WebSocketError as exc: + self._close_code = exc.code + await self.close(code=exc.code) + return WSMessage(WSMsgType.ERROR, exc, None) + except Exception as exc: + self._exception = exc + self._closing = True + self._close_code = WSCloseCode.ABNORMAL_CLOSURE + await self.close() + return WSMessage(WSMsgType.ERROR, exc, None) + + if msg.type == WSMsgType.CLOSE: + self._closing = True + self._close_code = msg.data + if not self._closed and self._autoclose: + await self.close() + elif msg.type == WSMsgType.CLOSING: + self._closing = True + elif msg.type == WSMsgType.PING and self._autoping: + await self.pong(msg.data) + continue + elif msg.type == WSMsgType.PONG and self._autoping: + continue + + return msg + + async def receive_str(self, *, timeout: Optional[float] = None) -> str: + msg = await self.receive(timeout) + if msg.type != WSMsgType.TEXT: + raise TypeError( + "Received message {}:{!r} is not WSMsgType.TEXT".format( + msg.type, msg.data + ) + ) + return cast(str, msg.data) + + async def receive_bytes(self, *, timeout: Optional[float] = None) -> bytes: + msg = await self.receive(timeout) + if msg.type != WSMsgType.BINARY: + raise TypeError(f"Received message {msg.type}:{msg.data!r} is not bytes") + return cast(bytes, msg.data) + + async def receive_json( + self, *, loads: JSONDecoder = json.loads, timeout: Optional[float] = None + ) -> Any: + data = await self.receive_str(timeout=timeout) + return loads(data) + + async def write(self, data: bytes) -> None: + raise RuntimeError("Cannot call .write() for websocket") + + def __aiter__(self) -> "WebSocketResponse": + return self + + async def __anext__(self) -> WSMessage: + msg = await self.receive() + if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSING, WSMsgType.CLOSED): + raise StopAsyncIteration + return msg + + def _cancel(self, exc: BaseException) -> None: + if self._reader is not None: + self._reader.set_exception(exc) diff --git a/runtime/Lib/site-packages/aiohttp/worker.py b/runtime/Lib/site-packages/aiohttp/worker.py new file mode 100644 index 0000000000000000000000000000000000000000..8e75f086a6ba930f3c04e5b1c36eb4a031dec5e0 --- /dev/null +++ b/runtime/Lib/site-packages/aiohttp/worker.py @@ -0,0 +1,269 @@ +"""Async gunicorn worker for aiohttp.web""" + +import asyncio +import os +import re +import signal +import sys +from types import FrameType +from typing import Any, Awaitable, Callable, Optional, Union # noqa + +from gunicorn.config import AccessLogFormat as GunicornAccessLogFormat +from gunicorn.workers import base + +from aiohttp import web + +from .helpers import set_result +from .web_app import Application +from .web_log import AccessLogger + +try: + import ssl + + SSLContext = ssl.SSLContext +except ImportError: # pragma: no cover + ssl = None # type: ignore[assignment] + SSLContext = object # type: ignore[misc,assignment] + + +__all__ = ("GunicornWebWorker", "GunicornUVLoopWebWorker", "GunicornTokioWebWorker") + + +class GunicornWebWorker(base.Worker): # type: ignore[misc,no-any-unimported] + + DEFAULT_AIOHTTP_LOG_FORMAT = AccessLogger.LOG_FORMAT + DEFAULT_GUNICORN_LOG_FORMAT = GunicornAccessLogFormat.default + + def __init__(self, *args: Any, **kw: Any) -> None: # pragma: no cover + super().__init__(*args, **kw) + + self._task: Optional[asyncio.Task[None]] = None + self.exit_code = 0 + self._notify_waiter: Optional[asyncio.Future[bool]] = None + + def init_process(self) -> None: + # create new event_loop after fork + asyncio.get_event_loop().close() + + self.loop = asyncio.new_event_loop() + asyncio.set_event_loop(self.loop) + + super().init_process() + + def run(self) -> None: + self._task = self.loop.create_task(self._run()) + + try: # ignore all finalization problems + self.loop.run_until_complete(self._task) + except Exception: + self.log.exception("Exception in gunicorn worker") + self.loop.run_until_complete(self.loop.shutdown_asyncgens()) + self.loop.close() + + sys.exit(self.exit_code) + + async def _run(self) -> None: + runner = None + if isinstance(self.wsgi, Application): + app = self.wsgi + elif asyncio.iscoroutinefunction(self.wsgi): + wsgi = await self.wsgi() + if isinstance(wsgi, web.AppRunner): + runner = wsgi + app = runner.app + else: + app = wsgi + else: + raise RuntimeError( + "wsgi app should be either Application or " + "async function returning Application, got {}".format(self.wsgi) + ) + + if runner is None: + access_log = self.log.access_log if self.cfg.accesslog else None + runner = web.AppRunner( + app, + logger=self.log, + keepalive_timeout=self.cfg.keepalive, + access_log=access_log, + access_log_format=self._get_valid_log_format( + self.cfg.access_log_format + ), + ) + await runner.setup() + + ctx = self._create_ssl_context(self.cfg) if self.cfg.is_ssl else None + + runner = runner + assert runner is not None + server = runner.server + assert server is not None + for sock in self.sockets: + site = web.SockSite( + runner, + sock, + ssl_context=ctx, + shutdown_timeout=self.cfg.graceful_timeout / 100 * 95, + ) + await site.start() + + # If our parent changed then we shut down. + pid = os.getpid() + try: + while self.alive: # type: ignore[has-type] + self.notify() + + cnt = server.requests_count + if self.cfg.max_requests and cnt > self.cfg.max_requests: + self.alive = False + self.log.info("Max requests, shutting down: %s", self) + + elif pid == os.getpid() and self.ppid != os.getppid(): + self.alive = False + self.log.info("Parent changed, shutting down: %s", self) + else: + await self._wait_next_notify() + except BaseException: + pass + + await runner.cleanup() + + def _wait_next_notify(self) -> "asyncio.Future[bool]": + self._notify_waiter_done() + + loop = self.loop + assert loop is not None + self._notify_waiter = waiter = loop.create_future() + self.loop.call_later(1.0, self._notify_waiter_done, waiter) + + return waiter + + def _notify_waiter_done( + self, waiter: Optional["asyncio.Future[bool]"] = None + ) -> None: + if waiter is None: + waiter = self._notify_waiter + if waiter is not None: + set_result(waiter, True) + + if waiter is self._notify_waiter: + self._notify_waiter = None + + def init_signals(self) -> None: + # Set up signals through the event loop API. + + self.loop.add_signal_handler( + signal.SIGQUIT, self.handle_quit, signal.SIGQUIT, None + ) + + self.loop.add_signal_handler( + signal.SIGTERM, self.handle_exit, signal.SIGTERM, None + ) + + self.loop.add_signal_handler( + signal.SIGINT, self.handle_quit, signal.SIGINT, None + ) + + self.loop.add_signal_handler( + signal.SIGWINCH, self.handle_winch, signal.SIGWINCH, None + ) + + self.loop.add_signal_handler( + signal.SIGUSR1, self.handle_usr1, signal.SIGUSR1, None + ) + + self.loop.add_signal_handler( + signal.SIGABRT, self.handle_abort, signal.SIGABRT, None + ) + + # Don't let SIGTERM and SIGUSR1 disturb active requests + # by interrupting system calls + signal.siginterrupt(signal.SIGTERM, False) + signal.siginterrupt(signal.SIGUSR1, False) + # Reset signals so Gunicorn doesn't swallow subprocess return codes + # See: https://github.com/aio-libs/aiohttp/issues/6130 + if sys.version_info < (3, 8): + # Starting from Python 3.8, + # the default child watcher is ThreadedChildWatcher. + # The watcher doesn't depend on SIGCHLD signal, + # there is no need to reset it. + signal.signal(signal.SIGCHLD, signal.SIG_DFL) + + def handle_quit(self, sig: int, frame: FrameType) -> None: + self.alive = False + + # worker_int callback + self.cfg.worker_int(self) + + # wakeup closing process + self._notify_waiter_done() + + def handle_abort(self, sig: int, frame: FrameType) -> None: + self.alive = False + self.exit_code = 1 + self.cfg.worker_abort(self) + sys.exit(1) + + @staticmethod + def _create_ssl_context(cfg: Any) -> "SSLContext": + """Creates SSLContext instance for usage in asyncio.create_server. + + See ssl.SSLSocket.__init__ for more details. + """ + if ssl is None: # pragma: no cover + raise RuntimeError("SSL is not supported.") + + ctx = ssl.SSLContext(cfg.ssl_version) + ctx.load_cert_chain(cfg.certfile, cfg.keyfile) + ctx.verify_mode = cfg.cert_reqs + if cfg.ca_certs: + ctx.load_verify_locations(cfg.ca_certs) + if cfg.ciphers: + ctx.set_ciphers(cfg.ciphers) + return ctx + + def _get_valid_log_format(self, source_format: str) -> str: + if source_format == self.DEFAULT_GUNICORN_LOG_FORMAT: + return self.DEFAULT_AIOHTTP_LOG_FORMAT + elif re.search(r"%\([^\)]+\)", source_format): + raise ValueError( + "Gunicorn's style options in form of `%(name)s` are not " + "supported for the log formatting. Please use aiohttp's " + "format specification to configure access log formatting: " + "http://docs.aiohttp.org/en/stable/logging.html" + "#format-specification" + ) + else: + return source_format + + +class GunicornUVLoopWebWorker(GunicornWebWorker): + def init_process(self) -> None: + import uvloop + + # Close any existing event loop before setting a + # new policy. + asyncio.get_event_loop().close() + + # Setup uvloop policy, so that every + # asyncio.get_event_loop() will create an instance + # of uvloop event loop. + asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) + + super().init_process() + + +class GunicornTokioWebWorker(GunicornWebWorker): + def init_process(self) -> None: # pragma: no cover + import tokio + + # Close any existing event loop before setting a + # new policy. + asyncio.get_event_loop().close() + + # Setup tokio policy, so that every + # asyncio.get_event_loop() will create an instance + # of tokio event loop. + asyncio.set_event_loop_policy(tokio.EventLoopPolicy()) + + super().init_process() diff --git a/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/INSTALLER b/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/LICENSE b/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..7082a2d5b9047bfc09589f387053e24ea490bc54 --- /dev/null +++ b/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2013-2019 Nikolay Kim and Andrew Svetlov + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/METADATA b/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..fc964525f05e8e34961f0398b1930b8dec64ef26 --- /dev/null +++ b/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/METADATA @@ -0,0 +1,128 @@ +Metadata-Version: 2.1 +Name: aiosignal +Version: 1.3.1 +Summary: aiosignal: a list of registered asynchronous callbacks +Home-page: https://github.com/aio-libs/aiosignal +Maintainer: aiohttp team +Maintainer-email: team@aiohttp.org +License: Apache 2.0 +Project-URL: Chat: Gitter, https://gitter.im/aio-libs/Lobby +Project-URL: CI: GitHub Actions, https://github.com/aio-libs/aiosignal/actions +Project-URL: Coverage: codecov, https://codecov.io/github/aio-libs/aiosignal +Project-URL: Docs: RTD, https://docs.aiosignal.org +Project-URL: GitHub: issues, https://github.com/aio-libs/aiosignal/issues +Project-URL: GitHub: repo, https://github.com/aio-libs/aiosignal +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Intended Audience :: Developers +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Development Status :: 5 - Production/Stable +Classifier: Operating System :: POSIX +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Operating System :: Microsoft :: Windows +Classifier: Framework :: AsyncIO +Requires-Python: >=3.7 +Description-Content-Type: text/x-rst +License-File: LICENSE +Requires-Dist: frozenlist (>=1.1.0) + +========= +aiosignal +========= + +.. image:: https://github.com/aio-libs/aiosignal/workflows/CI/badge.svg + :target: https://github.com/aio-libs/aiosignal/actions?query=workflow%3ACI + :alt: GitHub status for master branch + +.. image:: https://codecov.io/gh/aio-libs/aiosignal/branch/master/graph/badge.svg + :target: https://codecov.io/gh/aio-libs/aiosignal + :alt: codecov.io status for master branch + +.. image:: https://badge.fury.io/py/aiosignal.svg + :target: https://pypi.org/project/aiosignal + :alt: Latest PyPI package version + +.. image:: https://readthedocs.org/projects/aiosignal/badge/?version=latest + :target: https://aiosignal.readthedocs.io/ + :alt: Latest Read The Docs + +.. image:: https://img.shields.io/discourse/topics?server=https%3A%2F%2Faio-libs.discourse.group%2F + :target: https://aio-libs.discourse.group/ + :alt: Discourse group for io-libs + +.. image:: https://badges.gitter.im/Join%20Chat.svg + :target: https://gitter.im/aio-libs/Lobby + :alt: Chat on Gitter + +Introduction +============ + +A project to manage callbacks in `asyncio` projects. + +``Signal`` is a list of registered asynchronous callbacks. + +The signal's life-cycle has two stages: after creation its content +could be filled by using standard list operations: ``sig.append()`` +etc. + +After you call ``sig.freeze()`` the signal is *frozen*: adding, removing +and dropping callbacks is forbidden. + +The only available operation is calling the previously registered +callbacks by using ``await sig.send(data)``. + +For concrete usage examples see the `Signals + +section of the `Web Server Advanced +` chapter of the `aiohttp +documentation`_. + + +Installation +------------ + +:: + + $ pip install aiosignal + +The library requires Python 3.6 or newer. + + +Documentation +============= + +https://aiosignal.readthedocs.io/ + +Communication channels +====================== + +*gitter chat* https://gitter.im/aio-libs/Lobby + +Requirements +============ + +- Python >= 3.6 +- frozenlist >= 1.0.0 + +License +======= + +``aiosignal`` is offered under the Apache 2 license. + +Source code +=========== + +The project is hosted on GitHub_ + +Please file an issue in the `bug tracker +`_ if you have found a bug +or have some suggestions to improve the library. + +.. _GitHub: https://github.com/aio-libs/aiosignal +.. _aiohttp documentation: https://docs.aiohttp.org/ diff --git a/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/RECORD b/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..7dd0a0db732365251c8b45954587eed9d9139708 --- /dev/null +++ b/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/RECORD @@ -0,0 +1,10 @@ +aiosignal-1.3.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +aiosignal-1.3.1.dist-info/LICENSE,sha256=b9UkPpLdf5jsacesN3co50kFcJ_1J6W_mNbQJjwE9bY,11332 +aiosignal-1.3.1.dist-info/METADATA,sha256=c0HRnlYzfXKztZPTFDlPfygizTherhG5WdwXlvco0Ug,4008 +aiosignal-1.3.1.dist-info/RECORD,, +aiosignal-1.3.1.dist-info/WHEEL,sha256=ZL1lC_LiPDNRgDnOl2taCMc83aPEUZgHHv2h-LDgdiM,92 +aiosignal-1.3.1.dist-info/top_level.txt,sha256=z45aNOKGDdrI1roqZY3BGXQ22kJFPHBmVdwtLYLtXC0,10 +aiosignal/__init__.py,sha256=zQNfFYRSd84bswvpFv8ZWjEr5DeYwV3LXbMSyo2222s,867 +aiosignal/__init__.pyi,sha256=xeCddYSS8fZAkz8S4HuKSR2IDe3N7RW_LKcXDPPA1Xk,311 +aiosignal/__pycache__/__init__.cpython-39.pyc,, +aiosignal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 diff --git a/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/WHEEL b/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..5e1f087ca1ac49327ef76b101df80489a03c2e7f --- /dev/null +++ b/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.38.2) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/top_level.txt b/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..ac6df3afe74a5fd43afc7ab7f8393571a495fdc5 --- /dev/null +++ b/runtime/Lib/site-packages/aiosignal-1.3.1.dist-info/top_level.txt @@ -0,0 +1 @@ +aiosignal diff --git a/runtime/Lib/site-packages/aiosignal/__init__.py b/runtime/Lib/site-packages/aiosignal/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3d288e6ede67df2bb8e5660e30372e190eb23e65 --- /dev/null +++ b/runtime/Lib/site-packages/aiosignal/__init__.py @@ -0,0 +1,36 @@ +from frozenlist import FrozenList + +__version__ = "1.3.1" + +__all__ = ("Signal",) + + +class Signal(FrozenList): + """Coroutine-based signal implementation. + + To connect a callback to a signal, use any list method. + + Signals are fired using the send() coroutine, which takes named + arguments. + """ + + __slots__ = ("_owner",) + + def __init__(self, owner): + super().__init__() + self._owner = owner + + def __repr__(self): + return "".format( + self._owner, self.frozen, list(self) + ) + + async def send(self, *args, **kwargs): + """ + Sends data to all registered receivers. + """ + if not self.frozen: + raise RuntimeError("Cannot send non-frozen signal.") + + for receiver in self: + await receiver(*args, **kwargs) # type: ignore diff --git a/runtime/Lib/site-packages/aiosignal/__init__.pyi b/runtime/Lib/site-packages/aiosignal/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..d4e3416d72246058259061578a82697e2bc0706e --- /dev/null +++ b/runtime/Lib/site-packages/aiosignal/__init__.pyi @@ -0,0 +1,12 @@ +from typing import Any, Generic, TypeVar + +from frozenlist import FrozenList + +__all__ = ("Signal",) + +_T = TypeVar("_T") + +class Signal(FrozenList[_T], Generic[_T]): + def __init__(self, owner: Any) -> None: ... + def __repr__(self) -> str: ... + async def send(self, *args: Any, **kwargs: Any) -> None: ... diff --git a/runtime/Lib/site-packages/aiosignal/py.typed b/runtime/Lib/site-packages/aiosignal/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/INSTALLER b/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/LICENSE b/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..fbb206de046197c1af7ab6e1083fbbf1291f76c4 --- /dev/null +++ b/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/LICENSE @@ -0,0 +1,13 @@ +Copyright 1999-present Alibaba Group Holding Ltd. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/METADATA b/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..03da658a407d7284034845d74a37bbfcbb02c928 --- /dev/null +++ b/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/METADATA @@ -0,0 +1,44 @@ +Metadata-Version: 2.1 +Name: aliyun-python-sdk-core +Version: 2.13.36 +Summary: The core module of Aliyun Python SDK. +Home-page: https://github.com/aliyun/aliyun-openapi-python-sdk +Author: Alibaba Cloud +Author-email: alibaba-cloud-sdk-dev-team@list.alibaba-inc.com +License: Apache License 2.0 +Keywords: aliyun,sdk,core +Platform: any +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Topic :: Software Development +License-File: LICENSE +Requires-Dist: jmespath (<1.0.0,>=0.9.3) +Requires-Dist: cryptography (>=2.6.0) + +====================== +aliyun-python-sdk-core +====================== + + +This is the core module of Aliyun Python SDK. + +Aliyun Python SDK is the official software development kit. It makes things easy to integrate your Python application, +library, or script with Aliyun services. + +This module works on Python versions: + + * 2.7 and greater + + +Documentation: + +Please visit http://develop.aliyun.com/sdk/python diff --git a/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/RECORD b/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..ee6d59a223b95a857f27a1d8a0caab4711f9c0c9 --- /dev/null +++ b/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/RECORD @@ -0,0 +1,326 @@ +aliyun_python_sdk_core-2.13.36.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +aliyun_python_sdk_core-2.13.36.dist-info/LICENSE,sha256=njPfBA3g3PlW0LQJIb0iZjq2cKHD07zUlUTAQhufmV8,576 +aliyun_python_sdk_core-2.13.36.dist-info/METADATA,sha256=lbHzsTtu2CIVW0xS3lZkyPPaZ61dw7lZiYnW4yrPcc0,1479 +aliyun_python_sdk_core-2.13.36.dist-info/RECORD,, +aliyun_python_sdk_core-2.13.36.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92 +aliyun_python_sdk_core-2.13.36.dist-info/top_level.txt,sha256=0A72AJ-SfvIy8kLlXZhpyruUkjs6Jsn2LBCUbXP2J4U,14 +aliyunsdkcore/__init__.py,sha256=lljO7qCkFunEXxdnJzCAQfBD0KvSbSgkOHnqWgvnzYc,183 +aliyunsdkcore/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/__pycache__/client.cpython-39.pyc,, +aliyunsdkcore/__pycache__/compat.cpython-39.pyc,, +aliyunsdkcore/__pycache__/request.cpython-39.pyc,, +aliyunsdkcore/acs_exception/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +aliyunsdkcore/acs_exception/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/acs_exception/__pycache__/error_code.cpython-39.pyc,, +aliyunsdkcore/acs_exception/__pycache__/error_msg.cpython-39.pyc,, +aliyunsdkcore/acs_exception/__pycache__/error_type.cpython-39.pyc,, +aliyunsdkcore/acs_exception/__pycache__/exceptions.cpython-39.pyc,, +aliyunsdkcore/acs_exception/error_code.py,sha256=3odgoygC8jTFQ-EVofagoG5AWN7QUi0Hk0MOuy8agjM,1539 +aliyunsdkcore/acs_exception/error_msg.py,sha256=CDEdOxanpC47PMnKw2KnIAq0TKaJuY70Kv865sInUls,2138 +aliyunsdkcore/acs_exception/error_type.py,sha256=XnrpTRayBuGBzxrh2DI8tfIm71gr5YSMZu9olx5uKng,1013 +aliyunsdkcore/acs_exception/exceptions.py,sha256=dyUCtXhUkF3RfJRV3LVPHbJVJwftlREZERJldrLEhgE,2702 +aliyunsdkcore/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +aliyunsdkcore/auth/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/auth/__pycache__/credentials.cpython-39.pyc,, +aliyunsdkcore/auth/algorithm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +aliyunsdkcore/auth/algorithm/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/auth/algorithm/__pycache__/sha_hmac1.cpython-39.pyc,, +aliyunsdkcore/auth/algorithm/__pycache__/sha_hmac256.cpython-39.pyc,, +aliyunsdkcore/auth/algorithm/sha_hmac1.py,sha256=ursrYeqytir3xNrLPG2ZWenqdUV9UNBvA1zJm-sxJgE,1351 +aliyunsdkcore/auth/algorithm/sha_hmac256.py,sha256=ucSul6ZXPgJHXRRHMyF64ZPigWOWjBU3QtnkqBjw-wY,1839 +aliyunsdkcore/auth/composer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +aliyunsdkcore/auth/composer/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/auth/composer/__pycache__/roa_signature_composer.cpython-39.pyc,, +aliyunsdkcore/auth/composer/__pycache__/rpc_signature_composer.cpython-39.pyc,, +aliyunsdkcore/auth/composer/roa_signature_composer.py,sha256=13qXuXQqNbk47FeB984WiHX1XyHIg3nUzxfHvIUsJac,5750 +aliyunsdkcore/auth/composer/rpc_signature_composer.py,sha256=OMf9L8orBJYMuQZ84Qs3gLyea2iId4CDFptgrcCGw-8,3244 +aliyunsdkcore/auth/credentials.py,sha256=FYj5dYE18YdeIfNL73qaZ7wWorKkWjluiIqYJ88qP-s,1078 +aliyunsdkcore/auth/signers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +aliyunsdkcore/auth/signers/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/auth/signers/__pycache__/access_key_signer.cpython-39.pyc,, +aliyunsdkcore/auth/signers/__pycache__/ecs_ram_role_signer.cpython-39.pyc,, +aliyunsdkcore/auth/signers/__pycache__/ram_role_arn_signer.cpython-39.pyc,, +aliyunsdkcore/auth/signers/__pycache__/rsa_key_pair_signer.cpython-39.pyc,, +aliyunsdkcore/auth/signers/__pycache__/signer.cpython-39.pyc,, +aliyunsdkcore/auth/signers/__pycache__/signer_factory.cpython-39.pyc,, +aliyunsdkcore/auth/signers/__pycache__/sts_token_signer.cpython-39.pyc,, +aliyunsdkcore/auth/signers/access_key_signer.py,sha256=3zvkW7tP8PuA-2ImFvEON_faRTSHL-KMhWF1Du-F5Sw,1326 +aliyunsdkcore/auth/signers/ecs_ram_role_signer.py,sha256=_ekBvKQQ5puCc3FSlKsCORykPCWAfY1GacM0a4gQSu8,2773 +aliyunsdkcore/auth/signers/ram_role_arn_signer.py,sha256=fEPSkE472oQZ9UADiv838t7uAVFgFdy9d-NoJXYnhig,4054 +aliyunsdkcore/auth/signers/rsa_key_pair_signer.py,sha256=Sc-qSq81EgXQjWp08fwqOVF0yr3NYHN43fjQwqrYIGk,3928 +aliyunsdkcore/auth/signers/signer.py,sha256=04ejCQNOXGVYzjMp3ulTKkyaaV8E4TEZTVA_mBX6_T4,1026 +aliyunsdkcore/auth/signers/signer_factory.py,sha256=Dxi1n01UsNM64qDJMneBbTy9wni7Ni62uQmelYXw9bo,2924 +aliyunsdkcore/auth/signers/sts_token_signer.py,sha256=lEKhox0sqHfhx6v0WciflVdJmzEmaduzPApDAdsd9Bo,1594 +aliyunsdkcore/auth/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +aliyunsdkcore/auth/utils/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/client.py,sha256=fRJdnhw046TuBiEjXMXS3Kh9Ah-o8US0JON62C8mDYI,21464 +aliyunsdkcore/compat.py,sha256=Hp98yD82P3WxufWs9mFgnqfkRsmo1gsKi9nUgWsrE7Q,1519 +aliyunsdkcore/data/endpoints.json,sha256=1nfyOO6BAySn64cBjmqbYGYugGB08KplK5VCWxeDvCY,46773 +aliyunsdkcore/data/retry_config.json,sha256=fyaIaedhvyqYnUijIM8Ns0ok7w2xyJKUt4jJBwtgb1E,3497 +aliyunsdkcore/data/timeout_config.json,sha256=Kgi4u3htUuWxvuu1NFI8RVGAn4G9f9kEBrNimhKC-2o,7756 +aliyunsdkcore/endpoint/__init__.py,sha256=7GD6QdY3-TTGUXa9MrGm0HxIB-WY6zaIQp4lirBWCsI,870 +aliyunsdkcore/endpoint/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/endpoint/__pycache__/chained_endpoint_resolver.cpython-39.pyc,, +aliyunsdkcore/endpoint/__pycache__/default_endpoint_resolver.cpython-39.pyc,, +aliyunsdkcore/endpoint/__pycache__/endpoint_resolver_base.cpython-39.pyc,, +aliyunsdkcore/endpoint/__pycache__/endpoint_resolver_rules.cpython-39.pyc,, +aliyunsdkcore/endpoint/__pycache__/local_config_global_endpoint_resolver.cpython-39.pyc,, +aliyunsdkcore/endpoint/__pycache__/local_config_regional_endpoint_resolver.cpython-39.pyc,, +aliyunsdkcore/endpoint/__pycache__/location_service_endpoint_resolver.cpython-39.pyc,, +aliyunsdkcore/endpoint/__pycache__/resolver_endpoint_request.cpython-39.pyc,, +aliyunsdkcore/endpoint/__pycache__/user_customized_endpoint_resolver.cpython-39.pyc,, +aliyunsdkcore/endpoint/chained_endpoint_resolver.py,sha256=dCcjFV3k66TUK6QqNdi-Gv99KzrYgL7RyyfdKq-9gfU,3182 +aliyunsdkcore/endpoint/default_endpoint_resolver.py,sha256=YkEtiE6xYxAmVHzjNkySh5ZBJZH3WqbYn4XsuB1wBqs,2337 +aliyunsdkcore/endpoint/endpoint_resolver_base.py,sha256=MGYJ4zN-UUdcADumawavFDhy9fgSHbRm5D37ZRq70Qo,1968 +aliyunsdkcore/endpoint/endpoint_resolver_rules.py,sha256=gRslm0dMCoY5wWxTHDap7zV0YkSRHL-ulj_6-IY9K2A,2796 +aliyunsdkcore/endpoint/local_config_global_endpoint_resolver.py,sha256=n78fPtESpSb0VQSZ-mIX6PkdA2tEHVfWxBGl8Ze2J1M,1986 +aliyunsdkcore/endpoint/local_config_regional_endpoint_resolver.py,sha256=0N4xdvQ5Sw8nNHKaMlZrBsGwdxlEpYZOV6ogj_EfOws,4230 +aliyunsdkcore/endpoint/location/DescribeEndpointsRequest.py,sha256=wP-PmP-wI-eQCb2Gg-VLe8TgFk9au21wk4oFTBZlQSI,1397 +aliyunsdkcore/endpoint/location/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +aliyunsdkcore/endpoint/location/__pycache__/DescribeEndpointsRequest.cpython-39.pyc,, +aliyunsdkcore/endpoint/location/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/endpoint/location_service_endpoint_resolver.py,sha256=fP48fvbYrnCFlUdv1wHEotsZSHEgNDTo_y3A2Jo7Zs4,5553 +aliyunsdkcore/endpoint/resolver_endpoint_request.py,sha256=CArWu4y_dObp4HuCbIfiJX9822mPP-nvY4VfeEZLv1E,1564 +aliyunsdkcore/endpoint/user_customized_endpoint_resolver.py,sha256=c1njguCk-xErnAG4gn_1nVVBInClgtvSF-55YFlSwPc,1808 +aliyunsdkcore/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +aliyunsdkcore/http/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/http/__pycache__/format_type.cpython-39.pyc,, +aliyunsdkcore/http/__pycache__/http_request.cpython-39.pyc,, +aliyunsdkcore/http/__pycache__/http_response.cpython-39.pyc,, +aliyunsdkcore/http/__pycache__/method_type.cpython-39.pyc,, +aliyunsdkcore/http/__pycache__/protocol_type.cpython-39.pyc,, +aliyunsdkcore/http/format_type.py,sha256=Y9Q3V5bCgDFp-TG1Yghf-coVSK451iB6ks8hxkuaBCY,1433 +aliyunsdkcore/http/http_request.py,sha256=dZPKjMK-sLoInc-VUBTFVI8eK2i1Ku1FYoX_8uqxEoc,3278 +aliyunsdkcore/http/http_response.py,sha256=Vc-hyupAFMp4o7zmHKCM4tr5RvtInTy-dCbnDwOZgsk,5235 +aliyunsdkcore/http/method_type.py,sha256=kR58Km7arz6d3jbyiK04hy62tvgZF1z3monJArKtv3g,894 +aliyunsdkcore/http/protocol_type.py,sha256=UWvbDPONbRY_gTKRttxa46LBU3Q5BZlRMnhij4xH8s0,834 +aliyunsdkcore/profile/__init__.py,sha256=nOENHlKGx1UbxNCCAouoy9FibjpWbSbM3VAqRGUwLS0,29 +aliyunsdkcore/profile/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/profile/__pycache__/region_provider.cpython-39.pyc,, +aliyunsdkcore/profile/region_provider.py,sha256=LZbP2VdmItCPrYLZRjyELw4rMcL1Zlj91pqXQ2NVGkQ,1475 +aliyunsdkcore/request.py,sha256=lNfGjgRYaJO2Otchn5ZpAIdxZ-Yx2YtIeaIEarvgd60,17320 +aliyunsdkcore/retry/__init__.py,sha256=hQXF4np7X8VfCoais6qs_xsuJUmfPlHEnlx676DoYTE,602 +aliyunsdkcore/retry/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/retry/__pycache__/backoff_strategy.cpython-39.pyc,, +aliyunsdkcore/retry/__pycache__/retry_condition.cpython-39.pyc,, +aliyunsdkcore/retry/__pycache__/retry_policy.cpython-39.pyc,, +aliyunsdkcore/retry/__pycache__/retry_policy_context.cpython-39.pyc,, +aliyunsdkcore/retry/backoff_strategy.py,sha256=U-VF08Wq3e9-S2d5sRvOp6n2Lu3p2KgWFHYcMnY7Hp4,3242 +aliyunsdkcore/retry/retry_condition.py,sha256=-nmGAan3qQAjI6a0I3qLcBqdSAAlkACYmD1Mc7VrWNA,8295 +aliyunsdkcore/retry/retry_policy.py,sha256=r63NHfHoN6LdtswI1HPlRaOVj73sTxF8RiukIbXjrIQ,1629 +aliyunsdkcore/retry/retry_policy_context.py,sha256=QM5MyNq-iT4VanLs_l5MuRzXlSO5Xyh9OhrwEapy_Dw,1022 +aliyunsdkcore/utils/__init__.py,sha256=JVUaOaQJxqeHMPPmrBP8AEm408lg-bzYazstI7FXRXE,891 +aliyunsdkcore/utils/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/utils/__pycache__/parameter_helper.cpython-39.pyc,, +aliyunsdkcore/utils/__pycache__/validation.cpython-39.pyc,, +aliyunsdkcore/utils/parameter_helper.py,sha256=PDsxUqZmS-mPqcIoBJoCkMhoo34vDOawwGpwZYuS0Po,2799 +aliyunsdkcore/utils/validation.py,sha256=BRu1H5dLRHlN1BkvY7u24BDrgJgJVvlQabYa7RVwjDw,1268 +aliyunsdkcore/vendored/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +aliyunsdkcore/vendored/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/vendored/__pycache__/six.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__init__.py,sha256=51aPd5WGIJZt1zhJvCZKdnzPKEwSPU_d_QEsJLH5RJw,1845 +aliyunsdkcore/vendored/requests/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/__version__.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/_internal_utils.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/adapters.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/api.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/auth.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/certs.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/compat.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/cookies.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/exceptions.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/help.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/hooks.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/models.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/packages.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/sessions.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/status_codes.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/structures.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__pycache__/utils.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/__version__.py,sha256=ctiRGpu-LnhZTURszVizoyxz4PcaO4ryys_-OFFGwdA,436 +aliyunsdkcore/vendored/requests/_internal_utils.py,sha256=Zx3PnEUccyfsB-ie11nZVAW8qClJy0gx1qNME7rgT18,1096 +aliyunsdkcore/vendored/requests/adapters.py,sha256=woXjTQ3bsijLq9qxlTjmX3n85mVWIMONUCEBpMuNlHw,20986 +aliyunsdkcore/vendored/requests/api.py,sha256=BqVZnvsWu6Pwm0vQ3fw_Dj9_I-gcOR9CbScB2htPArA,6237 +aliyunsdkcore/vendored/requests/auth.py,sha256=4KCFQHrL1Lcox3uMh4tjOh3OrJhw-F5zti91wY-ZyTY,9728 +aliyunsdkcore/vendored/requests/certs.py,sha256=1u2AVY8b326Lj2Ea7_0c2UBnkgcb3I0d7O-188IYC6c,479 +aliyunsdkcore/vendored/requests/compat.py,sha256=w7OBiIvoWwqFJ7L_yR1hX5LQbcbH0K41f0J8QXmADx8,1748 +aliyunsdkcore/vendored/requests/cookies.py,sha256=MW68cYOpEPeuMXht9A_uKqRBMCcCdWLoFetb_XtK2DY,18193 +aliyunsdkcore/vendored/requests/exceptions.py,sha256=1_51dSoVNiSToSW5mlO47YKoZqIWt9f0ptLUgsofAkA,3113 +aliyunsdkcore/vendored/requests/help.py,sha256=vQxbWU20pU742CQn9EoOFMW6pBkdrfmPRsDfpC1BMDA,3616 +aliyunsdkcore/vendored/requests/hooks.py,sha256=HXAHoC1FNTFRZX6-lNdvPM7Tst4kvGwYTN-AOKRxoRU,767 +aliyunsdkcore/vendored/requests/models.py,sha256=bRrKVuysvKH3BXTip-DGD6htaiDbqzz8K0tpZ_aPLfU,34011 +aliyunsdkcore/vendored/requests/packages.py,sha256=Q2rF0L5mc3wQAvc6q_lAVtPTDOaOeFgD-7kWSQLkjEQ,542 +aliyunsdkcore/vendored/requests/packages/__init__.py,sha256=q6ygdeAyyhqEqwpFyfbIiKc4KD31Mu6SDr4_PpKNaV0,61 +aliyunsdkcore/vendored/requests/packages/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/certifi/__init__.py,sha256=QSRy1UztE-i09IuGIKKuc190k07lt6ktabbelPMIZoc,63 +aliyunsdkcore/vendored/requests/packages/certifi/__main__.py,sha256=FiOYt1Fltst7wk9DRa6GCoBr8qBUxlNQu_MKJf04E6s,41 +aliyunsdkcore/vendored/requests/packages/certifi/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/certifi/__pycache__/__main__.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/certifi/__pycache__/core.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/certifi/cacert.pem,sha256=7CEXfLHxDwvDpwVu0y_2lfJYk63cU-KUKI_DL1Lq8Uo,271088 +aliyunsdkcore/vendored/requests/packages/certifi/core.py,sha256=xPQDdG_siy5A7BfqGWa7RJhcA61xXEqPiSrw9GNyhHE,836 +aliyunsdkcore/vendored/requests/packages/chardet/__init__.py,sha256=Ae2GRu4Qv3cczOw1nB8PXnDW8FO9IYZahCZMuptepMo,1580 +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/big5freq.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/big5prober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/chardistribution.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/charsetgroupprober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/charsetprober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/codingstatemachine.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/compat.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/cp949prober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/enums.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/escprober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/escsm.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/eucjpprober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/euckrfreq.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/euckrprober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/euctwfreq.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/euctwprober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/gb2312freq.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/gb2312prober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/hebrewprober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/jisfreq.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/jpcntx.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/langbulgarianmodel.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/langcyrillicmodel.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/langgreekmodel.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/langhebrewmodel.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/langhungarianmodel.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/langthaimodel.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/langturkishmodel.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/latin1prober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/mbcharsetprober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/mbcsgroupprober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/mbcssm.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/sbcharsetprober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/sbcsgroupprober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/sjisprober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/universaldetector.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/utf8prober.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/__pycache__/version.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/big5freq.py,sha256=D_zK5GyzoVsRes0HkLJziltFQX0bKCLOrFe9_xDvO_8,31254 +aliyunsdkcore/vendored/requests/packages/chardet/big5prober.py,sha256=kBxHbdetBpPe7xrlb-e990iot64g_eGSLd32lB7_h3M,1757 +aliyunsdkcore/vendored/requests/packages/chardet/chardistribution.py,sha256=3woWS62KrGooKyqz4zQSnjFbJpa6V7g02daAibTwcl8,9411 +aliyunsdkcore/vendored/requests/packages/chardet/charsetgroupprober.py,sha256=6bDu8YIiRuScX4ca9Igb0U69TA2PGXXDej6Cc4_9kO4,3787 +aliyunsdkcore/vendored/requests/packages/chardet/charsetprober.py,sha256=KSmwJErjypyj0bRZmC5F5eM7c8YQgLYIjZXintZNstg,5110 +aliyunsdkcore/vendored/requests/packages/chardet/cli/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1 +aliyunsdkcore/vendored/requests/packages/chardet/cli/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/cli/__pycache__/chardetect.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/chardet/cli/chardetect.py,sha256=YBO8L4mXo0WR6_-Fjh_8QxPBoEBNqB9oNxNrdc54AQs,2738 +aliyunsdkcore/vendored/requests/packages/chardet/codingstatemachine.py,sha256=VYp_6cyyki5sHgXDSZnXW4q1oelHc3cu9AyQTX7uug8,3590 +aliyunsdkcore/vendored/requests/packages/chardet/compat.py,sha256=PKTzHkSbtbHDqS9PyujMbX74q1a8mMpeQTDVsQhZMRw,1134 +aliyunsdkcore/vendored/requests/packages/chardet/cp949prober.py,sha256=TZ434QX8zzBsnUvL_8wm4AQVTZ2ZkqEEQL_lNw9f9ow,1855 +aliyunsdkcore/vendored/requests/packages/chardet/enums.py,sha256=Aimwdb9as1dJKZaFNUH2OhWIVBVd6ZkJJ_WK5sNY8cU,1661 +aliyunsdkcore/vendored/requests/packages/chardet/escprober.py,sha256=kkyqVg1Yw3DIOAMJ2bdlyQgUFQhuHAW8dUGskToNWSc,3950 +aliyunsdkcore/vendored/requests/packages/chardet/escsm.py,sha256=RuXlgNvTIDarndvllNCk5WZBIpdCxQ0kcd9EAuxUh84,10510 +aliyunsdkcore/vendored/requests/packages/chardet/eucjpprober.py,sha256=iD8Jdp0ISRjgjiVN7f0e8xGeQJ5GM2oeZ1dA8nbSeUw,3749 +aliyunsdkcore/vendored/requests/packages/chardet/euckrfreq.py,sha256=-7GdmvgWez4-eO4SuXpa7tBiDi5vRXQ8WvdFAzVaSfo,13546 +aliyunsdkcore/vendored/requests/packages/chardet/euckrprober.py,sha256=MqFMTQXxW4HbzIpZ9lKDHB3GN8SP4yiHenTmf8g_PxY,1748 +aliyunsdkcore/vendored/requests/packages/chardet/euctwfreq.py,sha256=No1WyduFOgB5VITUA7PLyC5oJRNzRyMbBxaKI1l16MA,31621 +aliyunsdkcore/vendored/requests/packages/chardet/euctwprober.py,sha256=13p6EP4yRaxqnP4iHtxHOJ6R2zxHq1_m8hTRjzVZ95c,1747 +aliyunsdkcore/vendored/requests/packages/chardet/gb2312freq.py,sha256=JX8lsweKLmnCwmk8UHEQsLgkr_rP_kEbvivC4qPOrlc,20715 +aliyunsdkcore/vendored/requests/packages/chardet/gb2312prober.py,sha256=gGvIWi9WhDjE-xQXHvNIyrnLvEbMAYgyUSZ65HUfylw,1754 +aliyunsdkcore/vendored/requests/packages/chardet/hebrewprober.py,sha256=c3SZ-K7hvyzGY6JRAZxJgwJ_sUS9k0WYkvMY00YBYFo,13838 +aliyunsdkcore/vendored/requests/packages/chardet/jisfreq.py,sha256=vpmJv2Bu0J8gnMVRPHMFefTRvo_ha1mryLig8CBwgOg,25777 +aliyunsdkcore/vendored/requests/packages/chardet/jpcntx.py,sha256=PYlNqRUQT8LM3cT5FmHGP0iiscFlTWED92MALvBungo,19643 +aliyunsdkcore/vendored/requests/packages/chardet/langbulgarianmodel.py,sha256=1HqQS9Pbtnj1xQgxitJMvw8X6kKr5OockNCZWfEQrPE,12839 +aliyunsdkcore/vendored/requests/packages/chardet/langcyrillicmodel.py,sha256=LODajvsetH87yYDDQKA2CULXUH87tI223dhfjh9Zx9c,17948 +aliyunsdkcore/vendored/requests/packages/chardet/langgreekmodel.py,sha256=8YAW7bU8YwSJap0kIJSbPMw1BEqzGjWzqcqf0WgUKAA,12688 +aliyunsdkcore/vendored/requests/packages/chardet/langhebrewmodel.py,sha256=JSnqmE5E62tDLTPTvLpQsg5gOMO4PbdWRvV7Avkc0HA,11345 +aliyunsdkcore/vendored/requests/packages/chardet/langhungarianmodel.py,sha256=RhapYSG5l0ZaO-VV4Fan5sW0WRGQqhwBM61yx3yxyOA,12592 +aliyunsdkcore/vendored/requests/packages/chardet/langthaimodel.py,sha256=8l0173Gu_W6G8mxmQOTEF4ls2YdE7FxWf3QkSxEGXJQ,11290 +aliyunsdkcore/vendored/requests/packages/chardet/langturkishmodel.py,sha256=W22eRNJsqI6uWAfwXSKVWWnCerYqrI8dZQTm_M0lRFk,11102 +aliyunsdkcore/vendored/requests/packages/chardet/latin1prober.py,sha256=S2IoORhFk39FEFOlSFWtgVybRiP6h7BlLldHVclNkU8,5370 +aliyunsdkcore/vendored/requests/packages/chardet/mbcharsetprober.py,sha256=AR95eFH9vuqSfvLQZN-L5ijea25NOBCoXqw8s5O9xLQ,3413 +aliyunsdkcore/vendored/requests/packages/chardet/mbcsgroupprober.py,sha256=h6TRnnYq2OxG1WdD5JOyxcdVpn7dG0q-vB8nWr5mbh4,2012 +aliyunsdkcore/vendored/requests/packages/chardet/mbcssm.py,sha256=SY32wVIF3HzcjY3BaEspy9metbNSKxIIB0RKPn7tjpI,25481 +aliyunsdkcore/vendored/requests/packages/chardet/sbcharsetprober.py,sha256=LDSpCldDCFlYwUkGkwD2oFxLlPWIWXT09akH_2PiY74,5657 +aliyunsdkcore/vendored/requests/packages/chardet/sbcsgroupprober.py,sha256=1IprcCB_k1qfmnxGC6MBbxELlKqD3scW6S8YIwdeyXA,3546 +aliyunsdkcore/vendored/requests/packages/chardet/sjisprober.py,sha256=IIt-lZj0WJqK4rmUZzKZP4GJlE8KUEtFYVuY96ek5MQ,3774 +aliyunsdkcore/vendored/requests/packages/chardet/universaldetector.py,sha256=qL0174lSZE442eB21nnktT9_VcAye07laFWUeUrjttY,12485 +aliyunsdkcore/vendored/requests/packages/chardet/utf8prober.py,sha256=IdD8v3zWOsB8OLiyPi-y_fqwipRFxV9Nc1eKBLSuIEw,2766 +aliyunsdkcore/vendored/requests/packages/chardet/version.py,sha256=sp3B08mrDXB-pf3K9fqJ_zeDHOCLC8RrngQyDFap_7g,242 +aliyunsdkcore/vendored/requests/packages/urllib3/__init__.py,sha256=GpeMKPF9WY7DGYLFVr1ZLTdYOzCOLcOXnTr0dbwmvH8,2855 +aliyunsdkcore/vendored/requests/packages/urllib3/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/__pycache__/_collections.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/__pycache__/connection.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/__pycache__/connectionpool.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/__pycache__/exceptions.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/__pycache__/fields.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/__pycache__/filepost.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/__pycache__/poolmanager.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/__pycache__/request.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/__pycache__/response.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/_collections.py,sha256=iNeAU_we9L3lMGRUKKdq24Mf7o050TXP5U4Jm9AzAY4,10841 +aliyunsdkcore/vendored/requests/packages/urllib3/connection.py,sha256=-DKHWlL-AmJK7J5BErYVBBtHy5cmosphGPqwLWfhUcM,13834 +aliyunsdkcore/vendored/requests/packages/urllib3/connectionpool.py,sha256=r6gfflzFhiq784UfcMNLslgXWqWqO_RjB_zK0NHUH_Q,35092 +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/__pycache__/_appengine_environ.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/__pycache__/appengine.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/__pycache__/ntlmpool.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/__pycache__/pyopenssl.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/__pycache__/securetransport.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/__pycache__/socks.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_appengine_environ.py,sha256=lhYXvB5_oGKSeurX7za3XhcGyERvNjXRQ3eJp2GmQ3M,717 +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_securetransport/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_securetransport/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_securetransport/__pycache__/bindings.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_securetransport/__pycache__/low_level.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_securetransport/bindings.py,sha256=x2kLSh-ASZKsun0FxtraBuLVe3oHuth4YW6yZ5Vof-w,17560 +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_securetransport/low_level.py,sha256=Umy5u-3Z957GirdapnicXVOpHaM4xdOZABJuJxfaeJA,12162 +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/appengine.py,sha256=lB2Fame05OAlaSJs1a86QYF84v7Oymbqjs0OIcexq_s,10914 +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/ntlmpool.py,sha256=5ZpMF7N9B6NEjVU-r-xjDOV_-hkNvsDoNc84J2yqauI,4459 +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/pyopenssl.py,sha256=PZxW7CAUJfKUkrB3nq20kR02jtus_hRA7Ghsezp9O6o,15837 +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/securetransport.py,sha256=BqXSlChN9_hjCWgyN6JdcgvBUdc37QCCX4u3_8zE_9o,30309 +aliyunsdkcore/vendored/requests/packages/urllib3/contrib/socks.py,sha256=x8rDE6nHY0gxyqKVeJXkvLjbifmZ2ec5Ok_YPWMdlYc,6402 +aliyunsdkcore/vendored/requests/packages/urllib3/exceptions.py,sha256=rFeIfBNKC8KJ61ux-MtJyJlEC9G9ggkmCeF751JwVR4,6604 +aliyunsdkcore/vendored/requests/packages/urllib3/fields.py,sha256=D_TE_SK15YatdbhWDMN0OE3X6UCJn1RTkANINCYOobE,5943 +aliyunsdkcore/vendored/requests/packages/urllib3/filepost.py,sha256=40CROlpRKVBpFUkD0R6wJf_PpvbcRQRFUu0OOQlFkKM,2436 +aliyunsdkcore/vendored/requests/packages/urllib3/packages/__init__.py,sha256=nlChrGzkjCkmhCX9HrF_qHPUgosfsPQkVIJxiiLhk9g,109 +aliyunsdkcore/vendored/requests/packages/urllib3/packages/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/packages/__pycache__/ordered_dict.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/packages/__pycache__/six.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/packages/__pycache__/socks.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/packages/backports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +aliyunsdkcore/vendored/requests/packages/urllib3/packages/backports/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/packages/backports/__pycache__/makefile.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/packages/backports/makefile.py,sha256=so2z9BiNM8kh38Ve5tomQP_mp2_ubEqzdlCpLZKzzCI,1456 +aliyunsdkcore/vendored/requests/packages/urllib3/packages/ordered_dict.py,sha256=VQaPONfhVMsb8B63Xg7ZOydJqIE_jzeMhVN3Pec6ogw,8935 +aliyunsdkcore/vendored/requests/packages/urllib3/packages/six.py,sha256=A6hdJZVjI3t_geebZ9BzUvwRrIXo0lfwzQlM2LcKyas,30098 +aliyunsdkcore/vendored/requests/packages/urllib3/packages/socks.py,sha256=PFGAI_wAHuAARcX2R2bBz8CPcmKcIEZjGSLMQNpc-Xc,32351 +aliyunsdkcore/vendored/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py,sha256=WBVbxQBojNAxfZwNavkox3BgJiMA9BJmm-_fwd0jD_o,688 +aliyunsdkcore/vendored/requests/packages/urllib3/packages/ssl_match_hostname/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/packages/ssl_match_hostname/__pycache__/_implementation.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py,sha256=_foKOc3Los_n21TCW4IpjTTRHppsjw35vnu7dRBv-88,5683 +aliyunsdkcore/vendored/requests/packages/urllib3/poolmanager.py,sha256=UKGlTg8K_T1_a2ARS6ch1SsFeciFedL4IBfFEVfj_w4,16987 +aliyunsdkcore/vendored/requests/packages/urllib3/request.py,sha256=OfelFYzPnxGlU3amEz9uBLjCBOriwgJh4QC_aW9SF3U,5991 +aliyunsdkcore/vendored/requests/packages/urllib3/response.py,sha256=6O8N2nY4mk9-rm7AInrAHHv-N6RktqWuK1Ti-p_n9DY,25650 +aliyunsdkcore/vendored/requests/packages/urllib3/util/__init__.py,sha256=6Ran4oAVIy40Cu_oEPWnNV9bwF5rXx6G1DUZ7oehjPY,1044 +aliyunsdkcore/vendored/requests/packages/urllib3/util/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/util/__pycache__/connection.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/util/__pycache__/queue.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/util/__pycache__/request.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/util/__pycache__/response.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/util/__pycache__/retry.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/util/__pycache__/selectors.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/util/__pycache__/ssl_.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/util/__pycache__/timeout.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/util/__pycache__/url.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/util/__pycache__/wait.cpython-39.pyc,, +aliyunsdkcore/vendored/requests/packages/urllib3/util/connection.py,sha256=-AyqcRTuNUHuo5ndtsU0Og_nMyCGATC-kYqOUdBHwIQ,4639 +aliyunsdkcore/vendored/requests/packages/urllib3/util/queue.py,sha256=myTX3JDHntglKQNBf3b6dasHH-uF-W59vzGSQiFdAfI,497 +aliyunsdkcore/vendored/requests/packages/urllib3/util/request.py,sha256=H5_lrHvtwl2U2BbT1UYN9HpruNc1gsNFlz2njQmhPrQ,3705 +aliyunsdkcore/vendored/requests/packages/urllib3/util/response.py,sha256=028PNXDZhwBtnm2uXvnAHi_l9_AAGrAMH2Igh2AbgWg,2586 +aliyunsdkcore/vendored/requests/packages/urllib3/util/retry.py,sha256=1m-XI9_LORj1FLbwOzgWC6pTt2deycyGl4BWRI9r4Zc,15150 +aliyunsdkcore/vendored/requests/packages/urllib3/util/selectors.py,sha256=t19oe9d7GJRWyPX3juqfnJXfvBrtD6tIA0tXO92uwi0,21241 +aliyunsdkcore/vendored/requests/packages/urllib3/util/ssl_.py,sha256=o169dJAURbyZuVTQuCa5jS59aMG1WYZEsk-R_UJAiPc,13241 +aliyunsdkcore/vendored/requests/packages/urllib3/util/timeout.py,sha256=7lHNrgL5YH2cI1j-yZnzV_J8jBlRVdmFhQaNyM1_2b8,9757 +aliyunsdkcore/vendored/requests/packages/urllib3/util/url.py,sha256=E1y_zFljov4LBemEb5bZqmOw9AXT0023GuER-0n3QhE,6799 +aliyunsdkcore/vendored/requests/packages/urllib3/util/wait.py,sha256=p4BZo_Ukp5JF0Dn6jro7cUfqIjnU6WFtuoA6poaV5Jk,5403 +aliyunsdkcore/vendored/requests/sessions.py,sha256=BzARZ5w2BOXQvpRT7oEqbWzhDPBR6HN-iiLplxGGoss,27523 +aliyunsdkcore/vendored/requests/status_codes.py,sha256=a9bwuU7lMr4HshsRZdzBbUsYVsIo4Fu9GYg1XFTFFPc,3323 +aliyunsdkcore/vendored/requests/structures.py,sha256=12mFdrlYYgpPIArMJqgsuWigut0QwvMzs-yZeq4eOuw,3014 +aliyunsdkcore/vendored/requests/utils.py,sha256=qED6e0FPPSvWpuWlfnEvPZT9aghuWQmmVRPhyVNHvcw,27614 +aliyunsdkcore/vendored/six.py,sha256=A08MPb-Gi9FfInI3IW7HimXFmEH2T2IPzHgDvdhZPRA,30888 diff --git a/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/WHEEL b/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..57e3d840d59a650ac5bccbad5baeec47d155f0ad --- /dev/null +++ b/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.38.4) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/top_level.txt b/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..4c130ddfddb0987cda8b9024a58650b76eb166f5 --- /dev/null +++ b/runtime/Lib/site-packages/aliyun_python_sdk_core-2.13.36.dist-info/top_level.txt @@ -0,0 +1 @@ +aliyunsdkcore diff --git a/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/INSTALLER b/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/LICENSE b/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..85815c802700ac2e45bd2b204a86c57821581567 --- /dev/null +++ b/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/LICENSE @@ -0,0 +1,13 @@ +Copyright 1999-present Alibaba Group Holding Ltd. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/METADATA b/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..10264c84a0a7e8ca90bbce4022222456341878a4 --- /dev/null +++ b/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/METADATA @@ -0,0 +1,41 @@ +Metadata-Version: 2.1 +Name: aliyun-python-sdk-kms +Version: 2.16.2 +Summary: The kms module of Aliyun Python sdk. +Home-page: http://develop.aliyun.com/sdk/python +Author: Aliyun +Author-email: aliyun-developers-efficiency@list.alibaba-inc.com +License: Apache +Keywords: aliyun,sdk,kms +Platform: any +Classifier: Development Status :: 4 - Beta +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2.6 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.3 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Topic :: Software Development +Requires-Dist: aliyun-python-sdk-core (>=2.11.5) + +============================================================= +aliyun-python-sdk-kms +============================================================= + +.. This is the kms module of Aliyun Python SDK. + +Aliyun Python SDK is the official software development kit. It makes things easy to integrate your Python application, library, or script with Aliyun services. + +This module works on Python versions: + +2.6.5 and greater + +**Documentation:** + +Please visit `http://develop.aliyun.com/sdk/python `_ + + diff --git a/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/RECORD b/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..e69f277c6480be15826a33ebac6b854602a8e88e --- /dev/null +++ b/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/RECORD @@ -0,0 +1,190 @@ +aliyun_python_sdk_kms-2.16.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +aliyun_python_sdk_kms-2.16.2.dist-info/LICENSE,sha256=CvyZB4el1cZGT3cy9OYoITxta_Ea2maondKqmi8EcpU,575 +aliyun_python_sdk_kms-2.16.2.dist-info/METADATA,sha256=tFO8j6VWn7gw_JJg1eKRQlYAFyXhHIxF7YM8BX3hebs,1456 +aliyun_python_sdk_kms-2.16.2.dist-info/RECORD,, +aliyun_python_sdk_kms-2.16.2.dist-info/WHEEL,sha256=z9j0xAa_JmUKMpmz72K0ZGALSM_n-wQVmGbleXx2VHg,110 +aliyun_python_sdk_kms-2.16.2.dist-info/top_level.txt,sha256=CZ_1yFETsIiZ-BeztQ0jjcGujbiErxgUDf38khUWEvQ,13 +aliyunsdkkms/__init__.py,sha256=-zhxXr_LseiaDPsTA32m7jrGPo6QjjnaPG_SDBA-hBQ,22 +aliyunsdkkms/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkkms/__pycache__/endpoint.cpython-39.pyc,, +aliyunsdkkms/endpoint.py,sha256=sMY18QlXlQM2FwvoeHUMpRty-ZItdR5yKvzA0_N4KsI,1088 +aliyunsdkkms/request/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +aliyunsdkkms/request/__pycache__/__init__.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/AsymmetricDecryptRequest.py,sha256=LhwkFHMRiVm7y38p_ZRm6nQz3HJDIGcEhKoMIc-nyGQ,2075 +aliyunsdkkms/request/v20160120/AsymmetricEncryptRequest.py,sha256=YvKBfCyTAWKxa52XnEjWN_NhuV-ut6-Vtj9BsaRDp0U,2045 +aliyunsdkkms/request/v20160120/AsymmetricSignRequest.py,sha256=lH5T71AJGZpIZ8Rgh52NJSSQAfoKPyMCfiY1y-cpOk0,2021 +aliyunsdkkms/request/v20160120/AsymmetricVerifyRequest.py,sha256=Q_RpUY46TklC9528x_kpqxzl6O3Lc-qE2jPij_OagjU,2186 +aliyunsdkkms/request/v20160120/CancelKeyDeletionRequest.py,sha256=mWvbGxq1U0Tj8XwujheEVxe4lUzkCiabMbudGiej_WU,1472 +aliyunsdkkms/request/v20160120/CertificatePrivateKeyDecryptRequest.py,sha256=IKxFd2BxRajJkHFr_NUBfx-02eftUuB7DKUJndeeZtc,1942 +aliyunsdkkms/request/v20160120/CertificatePrivateKeySignRequest.py,sha256=h98VSIkoe3JANfrDn3w4zeb7pzDOYHK9hLCIfRAtksk,2091 +aliyunsdkkms/request/v20160120/CertificatePublicKeyEncryptRequest.py,sha256=cFj7h9ZQ48b6fh1zmiPy0Nso-xiK7CDQEM2dDzEsp5c,1910 +aliyunsdkkms/request/v20160120/CertificatePublicKeyVerifyRequest.py,sha256=3PXzOrZSJp7gtrRFESdR_PBR2ZhypL8_S8XXmww4xNo,2308 +aliyunsdkkms/request/v20160120/ConnectKmsInstanceRequest.py,sha256=gsQM19Z2hdo5nl2T02qHe4co8K39o58giUtNIT1jcdQ,2238 +aliyunsdkkms/request/v20160120/CreateAliasRequest.py,sha256=NbM4PV7AAdlezudPuKkaP5T1qHTDa9H9Zemi5-YinUA,1645 +aliyunsdkkms/request/v20160120/CreateApplicationAccessPointRequest.py,sha256=Oabl3zwGEINpVcGm_D_KA1QZdwdhu1j0O__Bh3NCy2A,2115 +aliyunsdkkms/request/v20160120/CreateCertificateRequest.py,sha256=WeASmEZnBj9RbGpe3QbwF9NSCP350xKlRk9kUjk5Peg,2175 +aliyunsdkkms/request/v20160120/CreateClientKeyRequest.py,sha256=AU5vXz5448B8QJk8dFsoSE_8S_SpHa3AMSIFNpCNC8c,2023 +aliyunsdkkms/request/v20160120/CreateKeyRequest.py,sha256=wrsYfqdPCrduJH2AywfcxZmA-HOM42D37nu--_GglOw,3100 +aliyunsdkkms/request/v20160120/CreateKeyVersionRequest.py,sha256=QA71TZ24AZ56k6Ha5xDWWo_e6mKqun3G0e7cFVWsxeg,1470 +aliyunsdkkms/request/v20160120/CreateNetworkRuleRequest.py,sha256=OYpHe0T7y2jZHcROh2EKVDbgB4KlXMpG1_17ED97rKg,2039 +aliyunsdkkms/request/v20160120/CreatePolicyRequest.py,sha256=nxXgsk5_VZ01IcaCvG_Nd6Cn8icZArsMmLPweYy4yfM,2471 +aliyunsdkkms/request/v20160120/CreateSecretRequest.py,sha256=kr5eLPxx-Q-rKTROTYPMwc3Lk1ZcGKSVuXI24qh4ma8,3775 +aliyunsdkkms/request/v20160120/DecryptRequest.py,sha256=wXHT0zAN--sLnEY1uJZqNOVJV_G5GSmhksCvZ01AqAY,1739 +aliyunsdkkms/request/v20160120/DeleteAliasRequest.py,sha256=Px2gl3OgD-_5ygvbGhbLwECM0-lDt6C3sFkW0CXU-18,1484 +aliyunsdkkms/request/v20160120/DeleteApplicationAccessPointRequest.py,sha256=a16_sHBjKlfR82aK9Rb8GUiPl7flroRhQVS7jexhGyg,1488 +aliyunsdkkms/request/v20160120/DeleteCertificateRequest.py,sha256=ymeLMPt00lxCCXrJlF8O8qWx7n5APGuoysOtFyD9pUo,1520 +aliyunsdkkms/request/v20160120/DeleteClientKeyRequest.py,sha256=SVrFmGAyjxiBUCdVsqhMnmXckXQHI6as25PNaFEbkuA,1504 +aliyunsdkkms/request/v20160120/DeleteKeyMaterialRequest.py,sha256=e5WPZygGY0_num5yDcDohDP0zpAmHJ0VpIeJHEHnOns,1472 +aliyunsdkkms/request/v20160120/DeleteNetworkRuleRequest.py,sha256=KxbxgQZt9uqdQc_OJqq01enygvpABd7qyMKHACegeyc,1466 +aliyunsdkkms/request/v20160120/DeletePolicyRequest.py,sha256=2U632DjMtdaMHnfb0JKvwFLBTqNLs4UjEDHTBA-ot7o,1456 +aliyunsdkkms/request/v20160120/DeleteSecretRequest.py,sha256=n1aOLGiMfg0Z2SYOeXDOOq78QruL9PbUCxOtJCC62hs,2030 +aliyunsdkkms/request/v20160120/DescribeAccountKmsStatusRequest.py,sha256=5j8f4ZthLfl3yPtzm98LdyEkUnfNPotbjL4Dy4-HJ7c,1325 +aliyunsdkkms/request/v20160120/DescribeApplicationAccessPointRequest.py,sha256=EFUny2odR5N29mUJQxym0sM950C43MgeZe_mxacujsU,1492 +aliyunsdkkms/request/v20160120/DescribeCertificateRequest.py,sha256=LunCSg0YnCCOqp_KHj2mFFJ7PQvNx4nUPXC3g4eKW-g,1524 +aliyunsdkkms/request/v20160120/DescribeKeyRequest.py,sha256=jY47-y3TMrhRf5FfRPEA_nbM83uEN_wOUOY04h2Z9EA,1460 +aliyunsdkkms/request/v20160120/DescribeKeyVersionRequest.py,sha256=JvuVfrWddOBQVB2IjTd51RLfLt8L_Pvy4MpTZyrFGsE,1677 +aliyunsdkkms/request/v20160120/DescribeNetworkRuleRequest.py,sha256=jgIe0p5zzYCvTkd1cBIRbyMd41l54maCNsbJpkpdImY,1470 +aliyunsdkkms/request/v20160120/DescribePolicyRequest.py,sha256=0YbceJUftM8xtlHlDDuyedu2H-MheYXV6CXqcy7vnA8,1460 +aliyunsdkkms/request/v20160120/DescribeRegionsRequest.py,sha256=VPr7mP53lhm2rTyzT5CuLwmzMXJZeJqaSIrQQr4mJ2g,1307 +aliyunsdkkms/request/v20160120/DescribeSecretRequest.py,sha256=bmwoKwufPRHfdspULcYKIx51rAisUqXtg47vm41tbkc,1681 +aliyunsdkkms/request/v20160120/DisableKeyRequest.py,sha256=rLeRRJIFZ8R1PrUfKORTeIj-yFEVoPAlZ5satuctmpc,1458 +aliyunsdkkms/request/v20160120/EnableKeyRequest.py,sha256=kYnU2g_j40-Hy3G2Hw3uQjSJM-f548j1l-dqezhRQ4I,1456 +aliyunsdkkms/request/v20160120/EncryptRequest.py,sha256=jJjaKb74DMj_NjBi9MEoV6gecGzRL2NEyl-T8Nh9WGs,1870 +aliyunsdkkms/request/v20160120/ExportDataKeyRequest.py,sha256=E7yWEHofEM3YUwsC2x72y1YNUIx3jSWCAGYK6AXRx38,2414 +aliyunsdkkms/request/v20160120/GenerateAndExportDataKeyRequest.py,sha256=F9hGT_YcnDUhhgKYWCY4dD1sIiMpQOSnYk1yrWcZOoc,2766 +aliyunsdkkms/request/v20160120/GenerateDataKeyRequest.py,sha256=hTgNa1gcqh_yDg2QP9oZiTcB90MfcNWhpmWsyNHvWCQ,2085 +aliyunsdkkms/request/v20160120/GenerateDataKeyWithoutPlaintextRequest.py,sha256=Iqy5CLa1G-mEt12YGIKHtxavTylfwLlW_tTLVroDLKM,2117 +aliyunsdkkms/request/v20160120/GetCertificateRequest.py,sha256=KC3DuYXyYEHjVBLB9Wj1wq86WSkYHWV0LPtF2mEG988,1514 +aliyunsdkkms/request/v20160120/GetClientKeyRequest.py,sha256=XZhr9bFNnmMc00-YmUB8kvgHVyTNYsHWbEJmsyFe7sc,1497 +aliyunsdkkms/request/v20160120/GetKmsInstanceRequest.py,sha256=Tr2PrspchG5EmdA2oyQjRp4VHo_P5WZz-rqALASQGHE,1514 +aliyunsdkkms/request/v20160120/GetParametersForImportRequest.py,sha256=qRgjNdKe7OpSkm0dsArPi3ORodbRAsBVwtWIY0O2OuQ,1936 +aliyunsdkkms/request/v20160120/GetPublicKeyRequest.py,sha256=3TzggvUyz4dk97-rpMwR-GeNrael1qKTkCWAn46T8-s,1665 +aliyunsdkkms/request/v20160120/GetRandomPasswordRequest.py,sha256=E6j3fFaG85osEhsDFUER2zUHlQig4ALp627DF2l1k0s,2936 +aliyunsdkkms/request/v20160120/GetSecretValueRequest.py,sha256=CklBbHqb0CMQYW_QFgeGN_X7w7wLpsbzQXjoKwIlXpU,2131 +aliyunsdkkms/request/v20160120/ImportKeyMaterialRequest.py,sha256=xN_ZYYli5nPknd-Ika8Gl27tHJ_ujFotCindkRZMkh4,2173 +aliyunsdkkms/request/v20160120/ListAliasesByKeyIdRequest.py,sha256=zBaCDi2PXNaVbv1Tm-EBNvfZfaX1whdgqEZTyRc8yr0,1848 +aliyunsdkkms/request/v20160120/ListAliasesRequest.py,sha256=zh_GP_RZ5ihTm92wxo8q4dmWeMHViMOe_VQ6ygos3jc,1673 +aliyunsdkkms/request/v20160120/ListApplicationAccessPointsRequest.py,sha256=nJ2vybXdy1mcguidSaOmDyPlcoaBG9GoxoEXZu45ThQ,1705 +aliyunsdkkms/request/v20160120/ListClientKeysRequest.py,sha256=0QFDSic1K8pCtoGDjlTI9I298T8W7IC3iRdSBDDS7UE,1477 +aliyunsdkkms/request/v20160120/ListKeyVersionsRequest.py,sha256=LJXyS2Qe7uCP3EAObzPWYqAMbpu-FwoHP_FRkR8tYy4,1842 +aliyunsdkkms/request/v20160120/ListKeysRequest.py,sha256=ECJm9ys0u0cR2zVD8l_dOawIFVpovXVsIuJaYgGFkAw,1840 +aliyunsdkkms/request/v20160120/ListKmsInstancesRequest.py,sha256=jqUT6rjgO-KWNr7w1F-Z2H-_XJiHqWiOSfUZBH0lfTE,1683 +aliyunsdkkms/request/v20160120/ListNetworkRulesRequest.py,sha256=MTDRwF8zPmsQBKzOhv9ITOX8eFJodIg-qxD8M5kXY8k,1683 +aliyunsdkkms/request/v20160120/ListPoliciesRequest.py,sha256=6VleBlclOO851AgKD8hBgfAtHDjx05_T2cMxHnDJ9jo,1675 +aliyunsdkkms/request/v20160120/ListResourceTagsRequest.py,sha256=FB-L2Og2x78hoXkg-4-e1eiqL6oHAl-ELTl60G0ZY68,1470 +aliyunsdkkms/request/v20160120/ListSecretVersionIdsRequest.py,sha256=q3YDvpxr42pKdHPFC949429jj1rgdGbT7pEPrpOITBA,2115 +aliyunsdkkms/request/v20160120/ListSecretsRequest.py,sha256=J0PmYeiYP8bRFoG6Ocm3xdLQPD3leqQivfi75buPpM4,2031 +aliyunsdkkms/request/v20160120/ListTagResourcesRequest.py,sha256=NnvbyR9CxOxNTXv4vugnUR5Il-ZXvZuR6WGnWVN9D1w,2386 +aliyunsdkkms/request/v20160120/OpenKmsServiceRequest.py,sha256=PkobpiS4pgqxqVxaeQL1mSMnux9IBp_7c6sj8CgoFf4,1305 +aliyunsdkkms/request/v20160120/PutSecretValueRequest.py,sha256=k0t-bqXuSAkYEqqvn-uBGf7Y9fm9TYg80cqFdTYpniA,2296 +aliyunsdkkms/request/v20160120/ReEncryptRequest.py,sha256=FI1ZSVbnaQLCXzO1MddDrAZd4ZDy4gTtTJZzD71FpUw,3022 +aliyunsdkkms/request/v20160120/RestoreSecretRequest.py,sha256=bO5NlWLGlsTwISposVe_CWVDKtCmFsTrj24_mKJwQH4,1494 +aliyunsdkkms/request/v20160120/RotateSecretRequest.py,sha256=kmiZec94a9rJaNY22TAQ7ruvvm1fWCfkF_7PHlURdQo,1677 +aliyunsdkkms/request/v20160120/ScheduleKeyDeletionRequest.py,sha256=a4K9WpR56fhJdaaLIyrspuqO1voKWevDL4H5G_Pi4rw,1723 +aliyunsdkkms/request/v20160120/SetDeletionProtectionRequest.py,sha256=ljtGjKnDlvdUbaTdziJu1HOzgqqjiUJnB16fIvCNuu8,2152 +aliyunsdkkms/request/v20160120/TagResourceRequest.py,sha256=2RHfroQdmgrxf0q4bge7gi54TgT_0IOoY15y0-uPbMs,2015 +aliyunsdkkms/request/v20160120/TagResourcesRequest.py,sha256=zgWvfBV3kitgZgxBRW7NYs9QmngVDSe4lqobvKRUNA4,2193 +aliyunsdkkms/request/v20160120/UntagResourceRequest.py,sha256=SEgeM8t0LmTlOqiwkD-SLFYM2aCxFOKzlgLdROpyJnA,2037 +aliyunsdkkms/request/v20160120/UntagResourcesRequest.py,sha256=jYVrhlzn8mVpCn3qRTjqLgpwSQKQQjK4LZdxn-h-90Q,2171 +aliyunsdkkms/request/v20160120/UpdateAliasRequest.py,sha256=XOU4-s-GFGVCIapOfPlHo0ug2pZwgKcF8WcA2jKTfhM,1645 +aliyunsdkkms/request/v20160120/UpdateApplicationAccessPointRequest.py,sha256=EB1gla3A_je8iZGO7Cf0h0vFyirYUeUbhMvneUCMRos,1864 +aliyunsdkkms/request/v20160120/UpdateCertificateStatusRequest.py,sha256=RQ-lX2elRpemQaYgu_4hDoLtOXvaWJPm0Bl5r4fbL5E,1699 +aliyunsdkkms/request/v20160120/UpdateKeyDescriptionRequest.py,sha256=HEQGTCInwwHk6g1PIUZMkbzzdvSLjN6jDK81tdfJUpo,1675 +aliyunsdkkms/request/v20160120/UpdateKmsInstanceBindVpcRequest.py,sha256=kqoSvDWEVaE9_IVJM6jbTe0ciSHQcTzZjtmHi_78I2w,1712 +aliyunsdkkms/request/v20160120/UpdateNetworkRuleRequest.py,sha256=_BH90pOaf21jx5mZpkAd40KFJlueqPJYaV1YCObwRMU,1884 +aliyunsdkkms/request/v20160120/UpdatePolicyRequest.py,sha256=cjX2TNepNmGXz5g9A6PohorW5b80YEZVlQAEUfeLyKI,2274 +aliyunsdkkms/request/v20160120/UpdateRotationPolicyRequest.py,sha256=Gw81JEzx7r4n-NtqBE-f3jPVW3rR2Rka0EwpVEAKPS8,1976 +aliyunsdkkms/request/v20160120/UpdateSecretRequest.py,sha256=nm5jqa60_yfGX9u6kWSFd-IybN5p5vcUPLT9zxszyZ0,1966 +aliyunsdkkms/request/v20160120/UpdateSecretRotationPolicyRequest.py,sha256=46vQBj7omq9E_B7m7lRIeOCPHAdK-ZSPXWA1fdxOOVw,2018 +aliyunsdkkms/request/v20160120/UpdateSecretVersionStageRequest.py,sha256=H4wwCH-dqwAVjoJotc3dJ7Z7VQIfbvKrD28GdjBaV4s,2161 +aliyunsdkkms/request/v20160120/UploadCertificateRequest.py,sha256=CQpmDVTU-3e8Q409zjS7hfob_AAGMWN_WfoiH1LVKjo,1944 +aliyunsdkkms/request/v20160120/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +aliyunsdkkms/request/v20160120/__pycache__/AsymmetricDecryptRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/AsymmetricEncryptRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/AsymmetricSignRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/AsymmetricVerifyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/CancelKeyDeletionRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/CertificatePrivateKeyDecryptRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/CertificatePrivateKeySignRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/CertificatePublicKeyEncryptRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/CertificatePublicKeyVerifyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ConnectKmsInstanceRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/CreateAliasRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/CreateApplicationAccessPointRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/CreateCertificateRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/CreateClientKeyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/CreateKeyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/CreateKeyVersionRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/CreateNetworkRuleRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/CreatePolicyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/CreateSecretRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DecryptRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DeleteAliasRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DeleteApplicationAccessPointRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DeleteCertificateRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DeleteClientKeyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DeleteKeyMaterialRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DeleteNetworkRuleRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DeletePolicyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DeleteSecretRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DescribeAccountKmsStatusRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DescribeApplicationAccessPointRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DescribeCertificateRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DescribeKeyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DescribeKeyVersionRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DescribeNetworkRuleRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DescribePolicyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DescribeRegionsRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DescribeSecretRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/DisableKeyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/EnableKeyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/EncryptRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ExportDataKeyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/GenerateAndExportDataKeyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/GenerateDataKeyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/GenerateDataKeyWithoutPlaintextRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/GetCertificateRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/GetClientKeyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/GetKmsInstanceRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/GetParametersForImportRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/GetPublicKeyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/GetRandomPasswordRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/GetSecretValueRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ImportKeyMaterialRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ListAliasesByKeyIdRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ListAliasesRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ListApplicationAccessPointsRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ListClientKeysRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ListKeyVersionsRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ListKeysRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ListKmsInstancesRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ListNetworkRulesRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ListPoliciesRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ListResourceTagsRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ListSecretVersionIdsRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ListSecretsRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ListTagResourcesRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/OpenKmsServiceRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/PutSecretValueRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ReEncryptRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/RestoreSecretRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/RotateSecretRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/ScheduleKeyDeletionRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/SetDeletionProtectionRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/TagResourceRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/TagResourcesRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/UntagResourceRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/UntagResourcesRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/UpdateAliasRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/UpdateApplicationAccessPointRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/UpdateCertificateStatusRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/UpdateKeyDescriptionRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/UpdateKmsInstanceBindVpcRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/UpdateNetworkRuleRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/UpdatePolicyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/UpdateRotationPolicyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/UpdateSecretRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/UpdateSecretRotationPolicyRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/UpdateSecretVersionStageRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/UploadCertificateRequest.cpython-39.pyc,, +aliyunsdkkms/request/v20160120/__pycache__/__init__.cpython-39.pyc,, diff --git a/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/WHEEL b/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..0b18a281107a0448a9980396d9d324ea2aa7a7f8 --- /dev/null +++ b/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.37.1) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/top_level.txt b/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..3028c61b1e78ee9393f16bff63dd5a247e054e2e --- /dev/null +++ b/runtime/Lib/site-packages/aliyun_python_sdk_kms-2.16.2.dist-info/top_level.txt @@ -0,0 +1 @@ +aliyunsdkkms diff --git a/runtime/Lib/site-packages/aliyunsdkcore/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..06dd772b0ef6ce3f9fa8bd7f740b0c0d880300e6 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/__init__.py @@ -0,0 +1,12 @@ +__version__ = "2.13.36" + + +import logging + + +class NullHandler(logging.Handler): + def emit(self, record): + pass + + +logging.getLogger('aliyunsdkcore').addHandler(NullHandler()) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/acs_exception/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/acs_exception/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/aliyunsdkcore/acs_exception/error_code.py b/runtime/Lib/site-packages/aliyunsdkcore/acs_exception/error_code.py new file mode 100644 index 0000000000000000000000000000000000000000..61a9efe2a93f733d64bf861a14d9a1b92a46869b --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/acs_exception/error_code.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 + +""" +Acs ERROR CODE module. +""" + +SDK_INVALID_REGION_ID = 'SDK.InvalidRegionId' +SDK_SERVER_UNREACHABLE = 'SDK.ServerUnreachable' +SDK_INVALID_REQUEST = 'SDK.InvalidRequest' +SDK_MISSING_ENDPOINTS_FILER = 'SDK.MissingEndpointsFiler' +SDK_UNKNOWN_SERVER_ERROR = 'SDK.UnknownServerError' +SDK_INVALID_CREDENTIAL = 'SDK.InvalidCredential' +SDK_INVALID_SESSION_EXPIRATION = 'SDK.InvalidSessionExpiration' +SDK_GET_SESSION_CREDENTIAL_FAILED = 'SDK.GetSessionCredentialFailed' +SDK_INVALID_PARAMS = 'SDK.InvalidParams' +SDK_NOT_SUPPORT = 'SDK.NotSupport' +SDK_ENDPOINT_RESOLVING_ERROR = 'SDK.EndpointResolvingError' +SDK_ENDPOINT_TESTABILITY = 'SDK.EndpointTestability' +SDK_HTTP_ERROR = 'SDK.HttpError' +SDK_INVALID_PARAMETER = "SDK.InvalidParameter" diff --git a/runtime/Lib/site-packages/aliyunsdkcore/acs_exception/error_msg.py b/runtime/Lib/site-packages/aliyunsdkcore/acs_exception/error_msg.py new file mode 100644 index 0000000000000000000000000000000000000000..b4853ba031a000673403cc593f608767d6208acd --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/acs_exception/error_msg.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 + +""" +Acs error message module. +""" + +SDK_ENDPOINT_MANAGEMENT_DOC_HTML = "https://www.alibabacloud.com/help/doc-detail/92074.htm" + +INVALID_REGION_ID = "No such region '{region_id}'. Please check your region ID." + +ENDPOINT_NO_REGION = "No endpoint in the region '{region_id}' for product '{product_code}'.\n" +\ + "You can set an endpoint for your request explicitly.{more}\n" +\ + "See " + SDK_ENDPOINT_MANAGEMENT_DOC_HTML + "\n" + +ENDPOINT_NO_PRODUCT = "No endpoint for product '{product_code}'.\n" +\ + "Please check the product code, " +\ + "or set an endpoint for your request explicitly.\n" +\ + "See " + SDK_ENDPOINT_MANAGEMENT_DOC_HTML + "\n" + +__dict = dict( + SDK_INVALID_REGION_ID='Can not find endpoint to access.', + SDK_SERVER_UNREACHABLE='Unable to connect server', + SDK_INVALID_REQUEST='The request is not a valid AcsRequest.', + SDK_MISSING_ENDPOINTS_FILER='Internal endpoints info is missing.', + SDK_UNKNOWN_SERVER_ERROR="Can not parse error message from server response.", + SDK_INVALID_CREDENTIAL="Need a ak&secret pair or public_key_id&private_key pair to auth.", + SDK_INVALID_SESSION_EXPIRATION="Session expiration must between {0} and {1} seconds") + + +def get_msg(code): + return __dict.get(code) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/acs_exception/error_type.py b/runtime/Lib/site-packages/aliyunsdkcore/acs_exception/error_type.py new file mode 100644 index 0000000000000000000000000000000000000000..3085273bdd9a78413ddeca5e2b231ee290933c83 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/acs_exception/error_type.py @@ -0,0 +1,33 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 + +""" +SDK exception error type module. + +Created on 6/15/2015 + +@author: alex +""" + +ERROR_TYPE_CLIENT = 'Client' +ERROR_TYPE_SERVER = 'Server' +ERROR_TYPE_THROTTLING = 'Throttling' +ERROR_TYPE_UNKNOWN = 'Unknown' diff --git a/runtime/Lib/site-packages/aliyunsdkcore/acs_exception/exceptions.py b/runtime/Lib/site-packages/aliyunsdkcore/acs_exception/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..a5352c417ac15b4888a4270e74867987a3467890 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/acs_exception/exceptions.py @@ -0,0 +1,106 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 + +""" +SDK exception module. +""" + +from aliyunsdkcore.acs_exception import error_type + + +class ClientException(Exception): + """client exception""" + + def __init__(self, code, msg): + """ + + :param code: error code + :param message: error message + :return: + """ + Exception.__init__(self) + self.__error_type = error_type.ERROR_TYPE_CLIENT + self.message = msg + self.error_code = code + + def __str__(self): + return "%s %s" % ( + self.error_code, + self.message, + ) + + def set_error_code(self, code): + self.error_code = code + + def set_error_msg(self, msg): + self.message = msg + + def get_error_type(self): + return self.__error_type + + def get_error_code(self): + return self.error_code + + def get_error_msg(self): + return self.message + + +class ServerException(Exception): + """ + server exception + """ + + def __init__(self, code, msg, http_status=None, request_id=None): + Exception.__init__(self) + self.error_code = code + self.message = msg + self.__error_type = error_type.ERROR_TYPE_SERVER + self.http_status = http_status + self.request_id = request_id + + def __str__(self): + return "HTTP Status: %s Error:%s %s RequestID: %s" % ( + str(self.http_status), + self.error_code, + self.message, + self.request_id + ) + + def set_error_code(self, code): + self.error_code = code + + def set_error_msg(self, msg): + self.message = msg + + def get_error_type(self): + return self.__error_type + + def get_error_code(self): + return self.error_code + + def get_error_msg(self): + return self.message + + def get_http_status(self): + return self.http_status + + def get_request_id(self): + return self.request_id diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/algorithm/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/algorithm/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/algorithm/sha_hmac1.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/algorithm/sha_hmac1.py new file mode 100644 index 0000000000000000000000000000000000000000..4de3434215b81a2d95fa75b1075b38baf53829bc --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/auth/algorithm/sha_hmac1.py @@ -0,0 +1,46 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 + + +import hashlib +import hmac + +from aliyunsdkcore.compat import ensure_string +from aliyunsdkcore.compat import ensure_bytes +from aliyunsdkcore.compat import b64_encode_bytes + + +def get_sign_string(source, secret): + source = ensure_bytes(source) + secret = ensure_bytes(secret) + h = hmac.new(secret, source, hashlib.sha1) + signature = ensure_string(b64_encode_bytes(h.digest()).strip()) + return signature + + +def get_signer_name(): + return "HMAC-SHA1" + + +def get_signer_version(): + return "1.0" + + +def get_signer_type(): + return "" diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/algorithm/sha_hmac256.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/algorithm/sha_hmac256.py new file mode 100644 index 0000000000000000000000000000000000000000..69d6d061e8f17f8f0f2375ad33175d85cd2d9512 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/auth/algorithm/sha_hmac256.py @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 + +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives import hashes +from cryptography.hazmat.primitives.asymmetric import padding +from cryptography.hazmat.primitives.serialization import load_der_private_key + +from aliyunsdkcore.compat import ensure_string +from aliyunsdkcore.compat import ensure_bytes +from aliyunsdkcore.compat import b64_encode_bytes +from aliyunsdkcore.compat import b64_decode_bytes + + +def get_sign_string(source, access_secret): + key = load_der_private_key( + b64_decode_bytes(ensure_bytes(access_secret)), + password=None, + backend=default_backend() + ) + signed_bytes = key.sign( + ensure_bytes(source), + padding.PKCS1v15(), + hashes.SHA256() + ) + signed_base64 = b64_encode_bytes(signed_bytes) + signature = ensure_string(signed_base64).replace('\n', '') + return signature + + +def get_signer_name(): + return "SHA256withRSA" + + +def get_signer_version(): + return "1.0" + + +def get_signer_type(): + return "PRIVATEKEY" diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/composer/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/composer/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/composer/roa_signature_composer.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/composer/roa_signature_composer.py new file mode 100644 index 0000000000000000000000000000000000000000..55e64ec7252c4b819158ef6532eb74ce8c9118a9 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/auth/composer/roa_signature_composer.py @@ -0,0 +1,177 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 +from aliyunsdkcore.vendored.six import iteritems +from aliyunsdkcore.vendored.six.moves.urllib.parse import urlencode +from aliyunsdkcore.auth.algorithm import sha_hmac1 as mac1 +from aliyunsdkcore.utils import parameter_helper as helper +from aliyunsdkcore.http import format_type as FormatType + + +ACCEPT = "Accept" +CONTENT_MD5 = "Content-MD5" +CONTENT_TYPE = "Content-Type" +DATE = "Date" +QUERY_SEPARATOR = "&" +HEADER_SEPARATOR = "\n" + + +# this function will append the necessary parameters for signers process. +# parameters: the orignal parameters +# signers: sha_hmac1 or sha_hmac256 +# accessKeyId: this is aliyun_access_key_id +# format: XML or JSON +# input parameters is headers +def refresh_sign_parameters(parameters, format=FormatType.RAW, signer=mac1): + if parameters is None or not isinstance(parameters, dict): + parameters = dict() + parameters["Date"] = helper.get_rfc_2616_date() + parameters["Accept"] = FormatType.map_format_to_accept(format) + parameters["x-acs-signature-method"] = signer.get_signer_name() + parameters["x-acs-signature-version"] = signer.get_signer_version() + return parameters + + +def compose_string_to_sign( + method, + queries, + uri_pattern=None, + headers={}, + paths=None, + signer=mac1): + sign_to_string = "" + sign_to_string += method + sign_to_string += HEADER_SEPARATOR + if ACCEPT in headers and headers[ACCEPT] is not None: + sign_to_string += headers[ACCEPT] + sign_to_string += HEADER_SEPARATOR + if CONTENT_MD5 in headers and headers[CONTENT_MD5] is not None: + sign_to_string += headers[CONTENT_MD5] + sign_to_string += HEADER_SEPARATOR + if CONTENT_TYPE in headers and headers[CONTENT_TYPE] is not None: + sign_to_string += headers[CONTENT_TYPE] + sign_to_string += HEADER_SEPARATOR + if DATE in headers and headers[DATE] is not None: + sign_to_string += headers[DATE] + sign_to_string += HEADER_SEPARATOR + uri = replace_occupied_parameters(uri_pattern, paths) + sign_to_string += build_canonical_headers(headers, "x-acs-") + sign_to_string += __build_query_string(uri, queries) + return sign_to_string + + +def replace_occupied_parameters(uri_pattern, paths): + result = uri_pattern + if paths is not None: + for (key, value) in iteritems(paths): + target = "[" + key + "]" + result = result.replace(target, value) + return result + +# change the give headerBegin to the lower() which in the headers +# and change it to key.lower():value + + +def build_canonical_headers(headers, header_begin): + result = "" + unsort_map = dict() + for (key, value) in iteritems(headers): + if key.lower().startswith(header_begin): + unsort_map[key.lower()] = value + sort_map = sorted(iteritems(unsort_map), key=lambda d: d[0]) + for (key, value) in sort_map: + result += key + ":" + value + result += HEADER_SEPARATOR + return result + + +def __build_query_string(uri, queries): + uri_parts = uri.split("?") + if len(uri_parts) > 1 and uri_parts[1] is not None: + queries[uri_parts[1]] = None + query_builder = uri_parts[0] + sorted_map = sorted(iteritems(queries), key=lambda queries: queries[0]) + if len(sorted_map) > 0: + query_builder += "?" + for (k, v) in sorted_map: + query_builder += k + if v is not None: + query_builder += "=" + query_builder += str(v) + query_builder += QUERY_SEPARATOR + if query_builder.endswith(QUERY_SEPARATOR): + query_builder = query_builder[0:(len(query_builder) - 1)] + return query_builder + + +def get_signature( + queries, + access_key, + secret, + format, + headers, + uri_pattern, + paths, + method, + signer=mac1): + headers = refresh_sign_parameters( + parameters=headers, + format=format) + sign_to_string = compose_string_to_sign( + method=method, + queries=queries, + headers=headers, + uri_pattern=uri_pattern, + paths=paths) + signature = signer.get_sign_string(sign_to_string, secret=secret) + return signature, sign_to_string + + +def get_signature_headers( + queries, + access_key, + secret, + format, + headers, + uri_pattern, + paths, + method, + signer=mac1): + signature, sign_to_string = get_signature( + queries, + access_key, + secret, + format, + headers, + uri_pattern, + paths, + method, + signer) + headers["Authorization"] = "acs " + str(access_key) + ":" + str(signature) + return headers, sign_to_string + + +def get_url(uri_pattern, queries, path_parameters): + url = "" + url += replace_occupied_parameters(uri_pattern, path_parameters) + if not url.endswith("?"): + url += "?" + url += urlencode(queries) + if url.endswith("?"): + url = url[0:(len(url) - 1)] + return url diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/composer/rpc_signature_composer.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/composer/rpc_signature_composer.py new file mode 100644 index 0000000000000000000000000000000000000000..aa7eaa0eba31e81d4ae7647948510bd4f99e6ae2 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/auth/composer/rpc_signature_composer.py @@ -0,0 +1,79 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 +from aliyunsdkcore.vendored.six import iteritems +from aliyunsdkcore.vendored.six.moves.urllib.parse import urlencode +from aliyunsdkcore.vendored.six.moves.urllib.request import pathname2url + +from aliyunsdkcore.auth.algorithm import sha_hmac1 as mac1 +from aliyunsdkcore.utils import parameter_helper as helper + + +# this function will append the necessary parameters for signers process. +# parameters: the orignal parameters +# signers: sha_hmac1 or sha_hmac256 +# accessKeyId: this is aliyun_access_key_id +# format: XML or JSON +def __refresh_sign_parameters( + parameters, + access_key_id, + accept_format="JSON", + signer=mac1): + if parameters is None or not isinstance(parameters, dict): + parameters = dict() + if 'Signature' in parameters: + del parameters['Signature'] + parameters["Timestamp"] = helper.get_iso_8061_date() + parameters["SignatureMethod"] = signer.get_signer_name() + parameters["SignatureType"] = signer.get_signer_type() + parameters["SignatureVersion"] = signer.get_signer_version() + parameters["SignatureNonce"] = helper.get_uuid() + parameters["AccessKeyId"] = access_key_id + if accept_format is not None: + parameters["Format"] = accept_format + return parameters + + +def __pop_standard_urlencode(query): + ret = query.replace('+', '%20') + ret = ret.replace('*', '%2A') + ret = ret.replace('%7E', '~') + return ret + + +def __compose_string_to_sign(method, queries): + sorted_parameters = sorted(iteritems(queries), key=lambda queries: queries[0]) + sorted_query_string = __pop_standard_urlencode(urlencode(sorted_parameters)) + canonicalized_query_string = __pop_standard_urlencode(pathname2url(sorted_query_string)) + string_to_sign = method + "&%2F&" + canonicalized_query_string + return string_to_sign + + +def __get_signature(string_to_sign, secret, signer=mac1): + return signer.get_sign_string(string_to_sign, secret + '&') + + +def get_signed_url(params, ak, secret, accept_format, method, body_params, signer=mac1): + url_params = __refresh_sign_parameters(params, ak, accept_format, signer) + sign_params = dict(url_params) + sign_params.update(body_params) + string_to_sign = __compose_string_to_sign(method, sign_params) + signature = __get_signature(string_to_sign, secret, signer) + url_params['Signature'] = signature + url = '/?' + __pop_standard_urlencode(urlencode(url_params)) + return url, string_to_sign diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/credentials.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/credentials.py new file mode 100644 index 0000000000000000000000000000000000000000..6923cacab5283f79cabb6043315548e562c471cc --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/auth/credentials.py @@ -0,0 +1,31 @@ +class AccessKeyCredential: + def __init__(self, access_key_id, access_key_secret): + self.access_key_id = access_key_id + self.access_key_secret = access_key_secret + + +class StsTokenCredential: + def __init__(self, sts_access_key_id, sts_access_key_secret, sts_token): + self.sts_access_key_id = sts_access_key_id + self.sts_access_key_secret = sts_access_key_secret + self.sts_token = sts_token + + +class RamRoleArnCredential: + def __init__(self, sts_access_key_id, sts_access_key_secret, role_arn, session_role_name): + self.sts_access_key_id = sts_access_key_id + self.sts_access_key_secret = sts_access_key_secret + self.role_arn = role_arn + self.session_role_name = session_role_name + + +class EcsRamRoleCredential: + def __init__(self, role_name): + self.role_name = role_name + + +class RsaKeyPairCredential: + def __init__(self, public_key_id, private_key, session_period=3600): + self.public_key_id = public_key_id + self.private_key = private_key + self.session_period = session_period diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/access_key_signer.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/access_key_signer.py new file mode 100644 index 0000000000000000000000000000000000000000..8dc4d485db8345145642c3f718438fe52585c405 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/access_key_signer.py @@ -0,0 +1,36 @@ +# coding:utf-8 + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import logging +from aliyunsdkcore.auth.signers.signer import Signer + +logger = logging.getLogger(__name__) + + +class AccessKeySigner(Signer): + def __init__(self, access_key_credential): + self._credential = access_key_credential + + def sign(self, region_id, request): + cred = self._credential + header = request.get_signed_header(region_id, cred.access_key_id, cred.access_key_secret) + url = request.get_url(region_id, cred.access_key_id, cred.access_key_secret) + return header, url diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/ecs_ram_role_signer.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/ecs_ram_role_signer.py new file mode 100644 index 0000000000000000000000000000000000000000..8c7081711510c1cc20c2909687b67590e6d29925 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/ecs_ram_role_signer.py @@ -0,0 +1,72 @@ +# coding:utf-8 + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import time +import logging +import json + +from aliyunsdkcore.vendored.six.moves.urllib.request import urlopen +from aliyunsdkcore.auth.signers.signer import Signer +from aliyunsdkcore.acs_exception.exceptions import ServerException + +logger = logging.getLogger(__name__) + + +class EcsRamRoleSigner(Signer): + _SESSION_PERIOD = 3600 + _REFRESH_SCALE = 0.9 + + def __init__(self, ecs_ram_role_credential): + self._credential = ecs_ram_role_credential + self._last_update_time = 0 + + def sign(self, region_id, request): + self._check_session_credential() + session_ak, session_sk, token = self._session_credential + if request.get_style() == 'RPC': + request.add_query_param("SecurityToken", token) + else: + request.add_header("x-acs-security-token", token) + header = request.get_signed_header(region_id, session_ak, session_sk) + url = request.get_url(region_id, session_ak, session_sk) + return header, url + + def _check_session_credential(self): + now = int(time.time()) + if now - self._last_update_time > (self._SESSION_PERIOD * self._REFRESH_SCALE): + self._refresh_session_ak_and_sk() + + def _refresh_session_ak_and_sk(self): + request_url = "http://100.100.100.200/latest/meta-data/ram/security-credentials/" + \ + self._credential.role_name + content = urlopen(request_url).read() + response = json.loads(content.decode('utf-8')) + if response.get("Code") != "Success": + message = 'refresh Ecs sts token err, code is ' + \ + response.get("Code") + raise ServerException( + response.get("Code"), message, None) + + session_ak = response.get("AccessKeyId") + session_sk = response.get("AccessKeySecret") + token = response.get("SecurityToken") + self._session_credential = session_ak, session_sk, token + self._last_update_time = int(time.time()) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/ram_role_arn_signer.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/ram_role_arn_signer.py new file mode 100644 index 0000000000000000000000000000000000000000..cf0e60bcb54d5b8bca6fe181825ec0f60bfc2603 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/ram_role_arn_signer.py @@ -0,0 +1,94 @@ +# coding:utf-8 + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import time +import json +import logging + +from aliyunsdkcore.auth.signers.signer import Signer +from aliyunsdkcore.auth.signers.access_key_signer import AccessKeySigner +from aliyunsdkcore.acs_exception import error_code +from aliyunsdkcore.acs_exception import exceptions +from aliyunsdkcore.auth.credentials import RamRoleArnCredential +from aliyunsdkcore.auth.credentials import AccessKeyCredential +from aliyunsdkcore.request import CommonRequest +from aliyunsdkcore.compat import ensure_string + +logger = logging.getLogger(__name__) + + +class RamRoleArnSigner(Signer): + _SESSION_PERIOD = 3600 + _REFRESH_SCALE = 0.8 + _RETRY_DELAY_FAST = 3 + _PRIORITY = 1 + + def __init__(self, credential, do_action_api): + if isinstance(credential, RamRoleArnCredential): + self._credential = credential + self._doAction = do_action_api + self._last_update_time = 0 + if len(self._credential.session_role_name) == 0: + self._credential.session_role_name = "aliyun-python-sdk-" + str(time.time()) + + def sign(self, region_id, request): + self._check_session_credential() + session_ak, session_sk, token = self._session_credential + if request.get_style() == 'RPC': + request.add_query_param("SecurityToken", token) + else: + request.add_header("x-acs-security-token", token) + header = request.get_signed_header(region_id, session_ak, session_sk) + url = request.get_url(region_id, session_ak, session_sk) + return header, url + + def _check_session_credential(self): + now = int(time.time()) + if now - self._last_update_time > (self._SESSION_PERIOD * self._REFRESH_SCALE): + self._refresh_session_ak_and_sk() + + def _refresh_session_ak_and_sk(self): + request = CommonRequest(product="Sts", version='2015-04-01', action_name='AssumeRole') + request.set_method('POST') + request.set_protocol_type('https') + request.add_query_param('RoleArn', self._credential.role_arn) + request.add_query_param('RoleSessionName', self._credential.session_role_name) + request.add_query_param('DurationSeconds', self._SESSION_PERIOD) + request.set_accept_format('JSON') + + access_key_credential = AccessKeyCredential(self._credential.sts_access_key_id, + self._credential.sts_access_key_secret) + signer = AccessKeySigner(access_key_credential) + + status, headers, body, exception = self._doAction(request, signer) + if status == 200: + response = json.loads(body.decode('utf-8')) + session_ak = response.get("Credentials").get("AccessKeyId") + session_sk = response.get("Credentials").get("AccessKeySecret") + token = response.get("Credentials").get("SecurityToken") + self._session_credential = session_ak, session_sk, token + self._last_update_time = int(time.time()) + else: + code = error_code.SDK_GET_SESSION_CREDENTIAL_FAILED + message = "refresh session token failed, server return: " + ensure_string(body) + http_status = status + + raise exceptions.ServerException(code, message, http_status) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/rsa_key_pair_signer.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/rsa_key_pair_signer.py new file mode 100644 index 0000000000000000000000000000000000000000..ad88bef13711e88a8a0804d8f8aa8169951f9273 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/rsa_key_pair_signer.py @@ -0,0 +1,98 @@ +# coding:utf-8 +import json +import time +import logging +import socket + +from aliyunsdkcore.auth.signers.signer import Signer +from aliyunsdkcore.acs_exception import error_code +from aliyunsdkcore.acs_exception import error_msg +from aliyunsdkcore.acs_exception import exceptions +from aliyunsdkcore.request import RpcRequest +from aliyunsdkcore.auth.algorithm import sha_hmac256 + +logger = logging.getLogger(__name__) + + +class RsaKeyPairSigner(Signer): + _MIN_SESSION_PERIOD = 900 + _MAX_SESSION_PERIOD = 3600 + + def __init__(self, credential, region_id, debug=False): + if credential.session_period < self._MIN_SESSION_PERIOD or \ + credential.session_period > self._MAX_SESSION_PERIOD: + raise exceptions.ClientException( + error_code.SDK_INVALID_SESSION_EXPIRATION, + error_msg.get_msg('SDK_INVALID_SESSION_EXPIRATION').format( + self._MIN_SESSION_PERIOD, + self._MAX_SESSION_PERIOD)) + credential.region_id = region_id + self._public_key_id = credential.public_key_id + self._private_key = credential.private_key + self._session_period = credential.session_period + self._last_update_time = 0 + # self._schedule_interval = credential.session_period if debug \ + # else max(credential.session_period * 0.8, 5) + from aliyunsdkcore.client import AcsClient + self._sts_client = AcsClient( + self._public_key_id, self._private_key, credential.region_id) + self._session_credential = None + + def sign(self, region_id, request): + self._check_session_credential() + session_ak, session_sk = self._session_credential + header = request.get_signed_header(region_id, session_ak, session_sk) + url = request.get_url(region_id, session_ak, session_sk) + return header, url + + def _check_session_credential(self): + if self._session_credential is None: + self._get_session_ak_and_sk() + return + + now = int(time.time()) + if now - self._last_update_time > (self._session_period * 0.8): + self._get_session_ak_and_sk() + + def _get_session_ak_and_sk(self): + request = GetSessionAkRequest() + request.set_method("GET") + request.set_duration_seconds(self._session_period) + + try: + response_str = self._sts_client.do_action_with_exception(request) + response = json.loads(response_str.decode('utf-8')) + session_ak = str(response.get( + "SessionAccessKey").get("SessionAccessKeyId")) + session_sk = str(response.get( + "SessionAccessKey").get("SessionAccessKeySecret")) + + self._session_credential = session_ak, session_sk + self._last_update_time = int(time.time()) + except exceptions.ServerException as srv_ex: + if srv_ex.error_code == 'InvalidAccessKeyId.NotFound' or \ + srv_ex.error_code == 'SignatureDoesNotMatch': + raise exceptions.ClientException(error_code.SDK_INVALID_CREDENTIAL, + error_msg.get_msg('SDK_INVALID_CREDENTIAL')) + else: + raise + + +class GetSessionAkRequest(RpcRequest): + def __init__(self): + RpcRequest.__init__(self, product='Sts', version='2015-04-01', + action_name='GenerateSessionAccessKey', + signer=sha_hmac256) + self.set_protocol_type('https') + + def get_duration_seconds(self): + return self.get_query_params().get("DurationSeconds") + + def set_duration_seconds(self, duration_seconds): + self.add_query_param('DurationSeconds', duration_seconds) + + def get_public_key_id(self): + return self.get_query_params().get('PublicKeyId') + + def set_public_key_id(self, public_key_id): + self.add_query_param('PublicKeyId', public_key_id) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/signer.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/signer.py new file mode 100644 index 0000000000000000000000000000000000000000..640e5bed62e6ea2c91183d05b3ab55b623ee3cd8 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/signer.py @@ -0,0 +1,31 @@ +# coding:utf-8 + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +from abc import ABCMeta, abstractmethod + +from aliyunsdkcore.vendored.six import with_metaclass + + +class Signer(with_metaclass(ABCMeta, object)): + @abstractmethod + def sign(self, region_id, request): + pass diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/signer_factory.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/signer_factory.py new file mode 100644 index 0000000000000000000000000000000000000000..cc2bc726be91cbf8b70e172e243037758ba40acf --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/signer_factory.py @@ -0,0 +1,50 @@ +# coding:utf-8 + +import logging +import os +from aliyunsdkcore.acs_exception import error_msg +from aliyunsdkcore.acs_exception import error_code +from aliyunsdkcore.acs_exception import exceptions +from aliyunsdkcore.auth import credentials +from aliyunsdkcore.auth.signers import access_key_signer +from aliyunsdkcore.auth.signers import sts_token_signer +from aliyunsdkcore.auth.signers import ram_role_arn_signer +from aliyunsdkcore.auth.signers import ecs_ram_role_signer +from aliyunsdkcore.auth.signers import rsa_key_pair_signer + + +class SignerFactory(object): + @staticmethod + def get_signer(cred, region_id, do_action_api, debug=False): + if cred.get('ak') is not None and cred.get('secret') is not None: + access_key_credential = credentials.AccessKeyCredential( + cred.get('ak'), cred.get('secret')) + return access_key_signer.AccessKeySigner(access_key_credential) + elif os.environ.get('ALIYUN_ACCESS_KEY_ID') is not None \ + and os.environ.get('ALIYUN_ACCESS_KEY_SECRET') is not None: + access_key_credential = credentials.AccessKeyCredential( + os.environ.get('ALIYUN_ACCESS_KEY_ID'), + os.environ.get('ALIYUN_ACCESS_KEY_SECRET')) + return access_key_signer.AccessKeySigner(access_key_credential) + elif cred.get('credential') is not None: + credential = cred.get('credential') + if isinstance(credential, credentials.AccessKeyCredential): + return access_key_signer.AccessKeySigner(credential) + elif isinstance(credential, credentials.StsTokenCredential): + return sts_token_signer.StsTokenSigner(credential) + elif isinstance(credential, credentials.RamRoleArnCredential): + return ram_role_arn_signer.RamRoleArnSigner(credential, do_action_api) + elif isinstance(credential, credentials.EcsRamRoleCredential): + return ecs_ram_role_signer.EcsRamRoleSigner(credential) + elif isinstance(credential, credentials.RsaKeyPairCredential): + return rsa_key_pair_signer.RsaKeyPairSigner(credential, region_id, debug) + elif cred.get('public_key_id') is not None and cred.get('private_key') is not None: + logging.info( + "'AcsClient(regionId, pub_key_id, pri_key)' is deprecated") + rsa_key_pair_credential = credentials.RsaKeyPairCredential(cred['public_key_id'], + cred['private_key'], + cred['session_period']) + return rsa_key_pair_signer.RsaKeyPairSigner(rsa_key_pair_credential, region_id, debug) + else: + raise exceptions.ClientException(error_code.SDK_INVALID_CREDENTIAL, + error_msg.get_msg('SDK_INVALID_CREDENTIAL')) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/sts_token_signer.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/sts_token_signer.py new file mode 100644 index 0000000000000000000000000000000000000000..85696592b7e0f33d016c389c6c979362056609a4 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/auth/signers/sts_token_signer.py @@ -0,0 +1,42 @@ +# coding:utf-8 + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import logging + +from aliyunsdkcore.auth.signers.signer import Signer + +logger = logging.getLogger(__name__) + + +class StsTokenSigner(Signer): + def __init__(self, sts_credential): + self._credential = sts_credential + + def sign(self, region_id, request): + sts_cred = self._credential + if request.get_style() == 'RPC': + request.add_query_param("SecurityToken", sts_cred.sts_token) + else: + request.add_header("x-acs-security-token", sts_cred.sts_token) + header = request.get_signed_header(region_id, sts_cred.sts_access_key_id, + sts_cred.sts_access_key_secret) + url = request.get_url(region_id, sts_cred.sts_access_key_id, sts_cred.sts_access_key_secret) + return header, url diff --git a/runtime/Lib/site-packages/aliyunsdkcore/auth/utils/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/auth/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/aliyunsdkcore/client.py b/runtime/Lib/site-packages/aliyunsdkcore/client.py new file mode 100644 index 0000000000000000000000000000000000000000..735a5be6348d74964134aee41793f3ba09872fd7 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/client.py @@ -0,0 +1,565 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 +import time +import warnings +import json +import logging +import jmespath +import copy +import platform +import sys + +import aliyunsdkcore +from aliyunsdkcore.vendored.six.moves.urllib.parse import urlencode +from aliyunsdkcore.vendored.requests import codes + +from aliyunsdkcore.acs_exception.exceptions import ClientException +from aliyunsdkcore.acs_exception.exceptions import ServerException +from aliyunsdkcore.acs_exception import error_code, error_msg +from aliyunsdkcore.http.http_response import HttpResponse +from aliyunsdkcore.request import AcsRequest +from aliyunsdkcore.http import format_type +from aliyunsdkcore.auth.signers.signer_factory import SignerFactory +from aliyunsdkcore.request import CommonRequest + +from aliyunsdkcore.endpoint.resolver_endpoint_request import ResolveEndpointRequest +from aliyunsdkcore.endpoint.default_endpoint_resolver import DefaultEndpointResolver +import aliyunsdkcore.retry.retry_policy as retry_policy +from aliyunsdkcore.retry.retry_condition import RetryCondition +from aliyunsdkcore.retry.retry_policy_context import RetryPolicyContext +import aliyunsdkcore.utils +import aliyunsdkcore.utils.parameter_helper +import aliyunsdkcore.utils.validation +from aliyunsdkcore.vendored.requests.structures import CaseInsensitiveDict +from aliyunsdkcore.vendored.requests.structures import OrderedDict +from aliyunsdkcore import compat + +from aliyunsdkcore.vendored.requests import Session +from aliyunsdkcore.vendored.requests.adapters import HTTPAdapter + + +""" +Acs default client module. +""" + +DEFAULT_READ_TIMEOUT = 10 +DEFAULT_CONNECTION_TIMEOUT = 5 +# number of keep-alive connections +DEFAULT_POOL_CONNECTIONS = 10 + +# TODO: replace it with TimeoutHandler +_api_timeout_config_data = aliyunsdkcore.utils._load_json_from_data_dir("timeout_config.json") + +logger = logging.getLogger(__name__) + + +class AcsClient: + LOG_FORMAT = '%(thread)d %(asctime)s %(name)s %(levelname)s %(message)s' + + def __init__( + self, + ak=None, + secret=None, + region_id="cn-hangzhou", + auto_retry=True, + max_retry_time=None, + user_agent=None, + port=80, + connect_timeout=None, + timeout=None, + public_key_id=None, + private_key=None, + session_period=3600, + credential=None, + debug=False, + verify=None, + pool_size=10, + proxy=None + ): + """ + constructor for AcsClient + :param ak: String, access key id + :param secret: String, access key secret + :param region_id: String, region id + :param auto_retry: Boolean + :param max_retry_time: Number + :param pool_size: + In a multithreaded environment, + you should set the maxsize of the pool to a higher number, + such as the number of threads. + :return: + """ + + self._max_retry_num = max_retry_time + self._auto_retry = auto_retry + self._ak = ak + self._secret = secret + self._region_id = region_id + self._user_agent = user_agent + self._port = port + self._connect_timeout = connect_timeout + self._read_timeout = timeout + self._extra_user_agent = {} + self._verify = verify + credential = { + 'ak': ak, + 'secret': secret, + 'public_key_id': public_key_id, + 'private_key': private_key, + 'session_period': session_period, + 'credential': credential, + } + self._signer = SignerFactory.get_signer( + credential, region_id, self._implementation_of_do_action, debug) + self._endpoint_resolver = DefaultEndpointResolver(self) + + self.session = Session() + self.session.mount('https://', HTTPAdapter(DEFAULT_POOL_CONNECTIONS, pool_size)) + self.session.mount('http://', HTTPAdapter(DEFAULT_POOL_CONNECTIONS, pool_size)) + + if self._auto_retry: + self._retry_policy = retry_policy.get_default_retry_policy( + max_retry_times=self._max_retry_num) + else: + self._retry_policy = retry_policy.NO_RETRY_POLICY + + self.proxy = proxy + + def get_region_id(self): + return self._region_id + + def get_access_key(self): + return self._ak + + def get_access_secret(self): + return self._secret + + def is_auto_retry(self): + return self._auto_retry + + def get_max_retry_num(self): + return self._max_retry_num + + def get_user_agent(self): + return self._user_agent + + def get_verify(self): + return self._verify + + def set_region_id(self, region): + self._region_id = region + + def set_max_retry_num(self, num): + self._max_retry_num = num + + def set_auto_retry(self, flag): + """ + set whether or not the client perform auto-retry + :param flag: Booleans + :return: None + """ + self._auto_retry = flag + + def set_user_agent(self, agent): + """ + User agent set to client will overwrite the request setting. + :param agent: + :return: + """ + self._user_agent = agent + + def set_verify(self, verify): + self._verify = verify + + def append_user_agent(self, key, value): + self._extra_user_agent.update({key: value}) + + @staticmethod + def user_agent_header(): + base = '%s (%s %s;%s)' \ + % ('AlibabaCloud', + platform.system(), + platform.release(), + platform.machine() + ) + return base + + @staticmethod + def default_user_agent(): + default_agent = OrderedDict() + default_agent['Python'] = platform.python_version() + default_agent['Core'] = __import__('aliyunsdkcore').__version__ + default_agent['python-requests'] = __import__( + 'aliyunsdkcore.vendored.requests.__version__', globals(), locals(), + ['vendored', 'requests', '__version__'], 0).__version__ + + return CaseInsensitiveDict(default_agent) + + def client_user_agent(self): + client_user_agent = {} + if self.get_user_agent() is not None: + client_user_agent.update({'client': self.get_user_agent()}) + else: + client_user_agent.update(self._extra_user_agent) + + return CaseInsensitiveDict(client_user_agent) + + def get_port(self): + return self._port + + def get_location_service(self): + return None + + @staticmethod + def merge_user_agent(default_agent, extra_agent): + if default_agent is None: + return extra_agent + + if extra_agent is None: + return default_agent + user_agent = default_agent.copy() + for key, value in extra_agent.items(): + if key not in default_agent: + user_agent[key] = value + return user_agent + + def __del__(self): + if self.session: + self.session.close() + + def handle_extra_agent(self, request): + client_agent = self.client_user_agent() + request_agent = request.request_user_agent() + + if client_agent is None: + return request_agent + + if request_agent is None: + return client_agent + for key in request_agent: + if key in client_agent: + client_agent.pop(key) + client_agent.update(request_agent) + return client_agent + + def _make_http_response(self, endpoint, request, read_timeout, connect_timeout, + specific_signer=None): + body_params = request.get_body_params() + if body_params: + content_type = request.get_headers().get('Content-Type') + if content_type and format_type.APPLICATION_JSON in content_type: + body = json.dumps(body_params) + request.set_content(body) + elif content_type and format_type.APPLICATION_XML in content_type: + body = aliyunsdkcore.utils.parameter_helper.to_xml(body_params) + request.set_content(body) + else: + body = urlencode(body_params) + request.set_content(body) + request.set_content_type(format_type.APPLICATION_FORM) + elif request.get_content() and "Content-Type" not in request.get_headers(): + request.set_content_type(format_type.APPLICATION_OCTET_STREAM) + method = request.get_method() + + if isinstance(request, CommonRequest): + request.trans_to_acs_request() + + signer = self._signer if specific_signer is None else specific_signer + header, url = signer.sign(self._region_id, request) + + base = self.user_agent_header() + + extra_agent = self.handle_extra_agent(request) + default_agent = self.default_user_agent() + user_agent = self.merge_user_agent(default_agent, extra_agent) + + for key, value in user_agent.items(): + base += ' %s/%s' % (key, value) + header['User-Agent'] = base + + header['x-sdk-client'] = 'python/2.0.0' + + protocol = request.get_protocol_type() + response = HttpResponse( + endpoint, + url, + method, + header, + protocol, + request.get_content(), + self._port, + read_timeout=read_timeout, + connect_timeout=connect_timeout, + verify=self.get_verify(), + session=self.session, + proxy=self.proxy + ) + if body_params: + response.set_content(body, "utf-8", request.get_headers().get('Content-Type')) + return response + + def _implementation_of_do_action(self, request, signer=None): + if not isinstance(request, AcsRequest): + raise ClientException( + error_code.SDK_INVALID_REQUEST, + error_msg.get_msg('SDK_INVALID_REQUEST')) + + # modify Accept-Encoding + request.add_header('Accept-Encoding', 'identity') + + if request.endpoint: + endpoint = request.endpoint + else: + endpoint = self._resolve_endpoint(request) + + return self._handle_retry_and_timeout(endpoint, request, signer) + + def implementation_of_do_action(self, request, signer=None): + # keep compatible + warnings.warn( + "implementation_of_do_action() method is deprecated", + DeprecationWarning) + + status, headers, body, exception = self._implementation_of_do_action(request, signer) + return status, headers, body + + def _add_request_client_token(self, request): + if hasattr(request, "set_ClientToken") and hasattr(request, "get_ClientToken"): + client_token = request.get_ClientToken() + if not client_token: + # ClientToken has not been set + client_token = aliyunsdkcore.utils.parameter_helper.get_uuid() # up to 60 chars + request.set_ClientToken(client_token) + + def _get_request_read_timeout(self, request): + # TODO: replace it with a timeout_handler + if request._request_read_timeout: + return request._request_read_timeout + + # if self._timeout: + # return self._timeout + if self._read_timeout: + return self._read_timeout + + if request.get_product() is None: + return DEFAULT_READ_TIMEOUT + path = '"{0}"."{1}"."{2}"'.format(request.get_product().lower(), request.get_version(), + request.get_action_name()) + timeout = jmespath.search(path, _api_timeout_config_data) + if timeout is None: + return DEFAULT_READ_TIMEOUT + else: + aliyunsdkcore.utils.validation.assert_integer_positive(timeout, "timeout") + return max(timeout, DEFAULT_READ_TIMEOUT) + + def _get_request_connect_timeout(self, request): + if request._request_connect_timeout: + return request._request_connect_timeout + + if self._connect_timeout: + return self._connect_timeout + + return DEFAULT_CONNECTION_TIMEOUT + + def _handle_retry_and_timeout(self, endpoint, request, signer): + # TODO: replace it with a retry_handler + # it's a temporary implementation. the long-term plan will be a group a normalized handlers + # which contains retry_handler and timeout_handler + + # decide whether we should initialize a ClientToken for the request + retry_policy_context = RetryPolicyContext(request, None, 0, None) + if self._retry_policy.should_retry(retry_policy_context) & \ + RetryCondition.SHOULD_RETRY_WITH_CLIENT_TOKEN: + self._add_request_client_token(request) + + request_read_timeout = self._get_request_read_timeout(request) + + request_connect_timeout = self._get_request_connect_timeout(request) + + retries = 0 + + while True: + + status, headers, body, exception = self._handle_single_request(endpoint, + request, + request_read_timeout, + request_connect_timeout, + signer) + retry_policy_context = RetryPolicyContext(request, exception, retries, status) + retryable = self._retry_policy.should_retry(retry_policy_context) + if retryable & RetryCondition.NO_RETRY: + break + logger.debug("Retry needed. Request:%s Retries :%d", + request.get_action_name(), retries) + retry_policy_context.retryable = retryable + time_to_sleep = self._retry_policy.compute_delay_before_next_retry(retry_policy_context) + time.sleep(time_to_sleep / 1000.0) + retries += 1 + + if isinstance(exception, ClientException): + raise exception + + return status, headers, body, exception + + def _handle_single_request(self, endpoint, request, read_timeout, connect_timeout, signer): + http_response = self._make_http_response(endpoint, request, read_timeout, connect_timeout, + signer) + params = copy.deepcopy(request.get_query_params()) + params.pop('AccessKeyId', None) + logger.debug('Request received. Product:%s Endpoint:%s Params: %s', + request.get_product(), endpoint, params) + + # Do the actual network thing + try: + status, headers, body = http_response.get_response_object() + except IOError as e: + + exception = ClientException(error_code.SDK_HTTP_ERROR, compat.ensure_string('%s' % e)) + msg = "HttpError occurred. Host:%s SDK-Version:%s ClientException:%s" % ( + endpoint, aliyunsdkcore.__version__, exception) + logger.error(compat.ensure_string(msg)) + return None, None, None, exception + + exception = self._get_server_exception(status, body, endpoint, request.string_to_sign) + return status, headers, body, exception + + @staticmethod + def _parse_error_info_from_response_body(response_body): + error_code_to_return = error_code.SDK_UNKNOWN_SERVER_ERROR + # TODO handle if response_body is too big + error_message_to_return = compat.ensure_string("ServerResponseBody: %s" % (response_body,)) + try: + body_obj = json.loads(response_body) + if 'Code' in body_obj: + error_code_to_return = body_obj['Code'] + if 'Message' in body_obj: + error_message_to_return = body_obj['Message'] + except ValueError: + # failed to parse body as json format + logger.warning('Failed to parse response as json format. Response:%s', response_body) + + return error_code_to_return, error_message_to_return + + def _get_server_exception(self, http_status, response_body, endpoint, string_to_sign): + request_id = None + + try: + body_obj = json.loads(response_body.decode('utf-8')) + request_id = body_obj.get('RequestId') + except (ValueError, TypeError, AttributeError): + # in case the response body is not a json string, return the raw + # data instead + logger.warning('Failed to parse response as json format. Response:%s', response_body) + + if http_status < codes.OK or http_status >= codes.MULTIPLE_CHOICES: + + server_error_code, server_error_message = self._parse_error_info_from_response_body( + response_body.decode('utf-8')) + if http_status == codes.BAD_REQUEST and server_error_code == 'SignatureDoesNotMatch': + if string_to_sign == server_error_message.split(':')[1]: + server_error_code = 'InvalidAccessKeySecret' + server_error_message = 'The AccessKeySecret is incorrect. ' \ + 'Please check your AccessKeyId and AccessKeySecret.' + exception = ServerException( + server_error_code, + server_error_message, + http_status=http_status, + request_id=request_id) + + msg = "ServerException occurred. Host:%s SDK-Version:%s ServerException:%s" % ( + endpoint, aliyunsdkcore.__version__, exception) + logger.error(compat.ensure_string(msg)) + + return exception + + def do_action_with_exception(self, acs_request): + + # set server response format as json, because this function will + # parse the response so which format doesn't matter + acs_request.set_accept_format('JSON') + status, headers, body, exception = self._implementation_of_do_action(acs_request) + + if exception: + raise exception + logger.debug('Response received. Product:%s Response-body: %s', + acs_request.get_product(), body) + return body + + def _resolve_endpoint(self, request): + if self._region_id: + aliyunsdkcore.utils.validation.validate_pattern( + self._region_id, 'region_id', '^[a-zA-Z0-9_-]+$' + ) + if request.product_suffix: + aliyunsdkcore.utils.validation.validate_pattern( + request.product_suffix, 'suffix', '^[a-zA-Z0-9_-]+$' + ) + if request.request_network: + aliyunsdkcore.utils.validation.validate_pattern( + request.request_network, 'network', '^[a-zA-Z0-9_-]+$' + ) + + resolve_request = ResolveEndpointRequest( + self._region_id, + request.get_product(), + request.get_location_service_code(), + request.get_location_endpoint_type(), + ) + resolve_request.request_network = request.request_network + resolve_request.product_suffix = request.product_suffix + resolve_request.endpoint_map = request.endpoint_map + resolve_request.endpoint_regional = request.endpoint_regional + return self._endpoint_resolver.resolve(resolve_request) + + def do_action(self, acs_request): + warnings.warn( + "do_action() method is deprecated, please use do_action_with_exception() instead.", + DeprecationWarning) + status, headers, body, exception = self._implementation_of_do_action(acs_request) + return body + + def get_response(self, acs_request): + return self.implementation_of_do_action(acs_request) + + def add_endpoint(self, region_id, product_code, endpoint): + self._endpoint_resolver.put_endpoint_entry( + region_id, product_code, endpoint) + + def set_stream_logger(self, log_level=logging.DEBUG, logger_name='aliyunsdkcore', stream=None, + format_string=None): + log = logging.getLogger(logger_name) + log.setLevel(log_level) + ch = logging.StreamHandler(stream) + ch.setLevel(log_level) + if format_string is None: + format_string = self.LOG_FORMAT + formatter = logging.Formatter(format_string) + ch.setFormatter(formatter) + log.addHandler(ch) + + def set_file_logger(self, path, log_level=logging.DEBUG, logger_name='aliyunsdkcore'): + log = logging.getLogger(logger_name) + log.setLevel(log_level) + fh = logging.FileHandler(path) + fh.setLevel(log_level) + formatter = logging.Formatter(self.LOG_FORMAT) + fh.setFormatter(formatter) + log.addHandler(fh) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/compat.py b/runtime/Lib/site-packages/aliyunsdkcore/compat.py new file mode 100644 index 0000000000000000000000000000000000000000..ae69e26b66ea89393fa83dd0522579d2a4489bb9 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/compat.py @@ -0,0 +1,44 @@ +import sys +from aliyunsdkcore.vendored import six + +if six.PY2: + from base64 import encodestring as b64_encode_bytes + from base64 import decodestring as b64_decode_bytes + + def ensure_bytes(s, encoding='utf-8', errors='strict'): + if isinstance(s, unicode): + return s.encode(encoding, errors) + if isinstance(s, str): + return s + raise ValueError("Expected str or unicode, received %s." % type(s)) + + def ensure_string(s, encoding='utf-8', errors='strict'): + if isinstance(s, unicode): + return s.encode(encoding, errors) + if isinstance(s, str): + return s + raise ValueError("Expected str or unicode, received %s." % type(s)) + +else: + from base64 import encodebytes as b64_encode_bytes + from base64 import decodebytes as b64_decode_bytes + + def ensure_bytes(s, encoding='utf-8', errors='strict'): + if isinstance(s, str): + return bytes(s, encoding=encoding) + if isinstance(s, bytes): + return s + if isinstance(s, bytearray): + return bytes(s) + raise ValueError( + "Expected str or bytes or bytearray, received %s." % + type(s)) + + def ensure_string(s, encoding='utf-8', errors='strict'): + if isinstance(s, str): + return s + if isinstance(s, (bytes, bytearray)): + return str(s, encoding='utf-8') + raise ValueError( + "Expected str or bytes or bytearray, received %s." % + type(s)) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/data/endpoints.json b/runtime/Lib/site-packages/aliyunsdkcore/data/endpoints.json new file mode 100644 index 0000000000000000000000000000000000000000..837eb67852b40a55f39876d507bacae1f1184872 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/data/endpoints.json @@ -0,0 +1,1147 @@ +{ + "global_endpoints": { + "domain": "domain.aliyuncs.com", + "cdn": "cdn.aliyuncs.com", + "ram": "ram.aliyuncs.com", + "cbn": "cbn.aliyuncs.com", + "drds": "drds.aliyuncs.com", + "emr": "emr.aliyuncs.com", + "sts": "sts.aliyuncs.com", + "cs": "cs.aliyuncs.com", + "cr": "cr.aliyuncs.com", + "hbase": "hbase.aliyuncs.com", + "ros": "ros.aliyuncs.com", + "ess": "ess.aliyuncs.com", + "gpdb": "gpdb.aliyuncs.com", + "dds": "mongodb.aliyuncs.com", + "jaq": "jaq.aliyuncs.com", + "cloudauth": "cloudauth.aliyuncs.com", + "live": "live.aliyuncs.com", + "hpc": "hpc.aliyuncs.com", + "ddosbasic": "antiddos.aliyuncs.com", + "dm": "dm.aliyuncs.com", + "domain-intl": "domain-intl.aliyuncs.com", + "cloudwf": "cloudwf.aliyuncs.com", + "ecs": "ecs-cn-hangzhou.aliyuncs.com", + "vpc": "vpc.aliyuncs.com", + "redisa": "r-kvstore.aliyuncs.com", + "codepipeline": "cds.cn-beijing.aliyuncs.com", + "vipaegis": "aegis.cn-hangzhou.aliyuncs.com", + "rds": "rds.aliyuncs.com", + "petadata": "petadata.aliyuncs.com", + "httpdns": "httpdns-api.aliyuncs.com", + "green": "green.aliyuncs.com", + "alidns": "alidns.aliyuncs.com", + "push": "cloudpush.aliyuncs.com", + "itaas": "itaas.aliyuncs.com", + "cms": "metrics.cn-hangzhou.aliyuncs.com", + "slb": "slb.aliyuncs.com" + }, + "location_code_mapping": { + "cloudapi": "apigateway", + "sas-api": "sas", + "chatbot": "beebot", + "aegis": "vipaegis", + "cds": "codepipeline", + "r-kvstore": "redisa" + }, + "regional_endpoint_pattern": { + "apigateway": "apigateway.[RegionId].aliyuncs.com", + "domain": "domain.aliyuncs.com", + "dm": "dm.[RegionId].aliyuncs.com", + "ess": "ess.[RegionId].aliyuncs.com", + "beebot": "chatbot.[RegionId].aliyuncs.com", + "domain-intl": "domain-intl.aliyuncs.com", + "batchcompute": "batchcompute.[RegionId].aliyuncs.com", + "dds": "mongodb.[RegionId].aliyuncs.com", + "iot": "iot.[RegionId].aliyuncs.com", + "drds": "drds.aliyuncs.com", + "arms": "arms.[RegionId].aliyuncs.com", + "emr": "emr.[RegionId].aliyuncs.com", + "csb": "csb.[RegionId].aliyuncs.com", + "polardb": "polardb.aliyuncs.com", + "ccc": "ccc.[RegionId].aliyuncs.com", + "cloudphoto": "cloudphoto.[RegionId].aliyuncs.com" + }, + "regions": [ + "ap-northeast-1", + "ap-northeast-2-pop", + "ap-south-1", + "ap-southeast-1", + "ap-southeast-2", + "ap-southeast-3", + "ap-southeast-5", + "cn-beijing", + "cn-beijing-finance-1", + "cn-beijing-finance-pop", + "cn-beijing-gov-1", + "cn-beijing-nu16-b01", + "cn-chengdu", + "cn-edge-1", + "cn-fujian", + "cn-haidian-cm12-c01", + "cn-hangzhou", + "cn-hangzhou-bj-b01", + "cn-hangzhou-finance", + "cn-hangzhou-internal-prod-1", + "cn-hangzhou-internal-test-1", + "cn-hangzhou-internal-test-2", + "cn-hangzhou-internal-test-3", + "cn-hangzhou-test-306", + "cn-heyuan", + "cn-hongkong", + "cn-hongkong-finance-pop", + "cn-huhehaote", + "cn-north-2-gov-1", + "cn-qingdao", + "cn-qingdao-nebula", + "cn-shanghai", + "cn-shanghai-et15-b01", + "cn-shanghai-et2-b01", + "cn-shanghai-finance-1", + "cn-shanghai-inner", + "cn-shanghai-internal-test-1", + "cn-shenzhen", + "cn-shenzhen-finance-1", + "cn-shenzhen-inner", + "cn-shenzhen-st4-d01", + "cn-shenzhen-su18-b01", + "cn-wuhan", + "cn-yushanfang", + "cn-zhangbei-na61-b01", + "cn-zhangjiakou", + "cn-zhangjiakou-na62-a01", + "cn-zhengzhou-nebula-1", + "eu-central-1", + "eu-west-1", + "eu-west-1-oxs", + "me-east-1", + "rus-west-1-pop", + "us-east-1", + "us-west-1" + ], + "regional_endpoints": { + "bastionhost": { + "cn-hangzhou": "yundun-bastionhost.aliyuncs.com" + }, + "xianzhi": { + "cn-hangzhou": "xianzhi.aliyuncs.com" + }, + "rtc": { + "cn-hangzhou": "rtc.aliyuncs.com" + }, + "nlp": { + "cn-shanghai": "nlp.cn-shanghai.aliyuncs.com" + }, + "trademark": { + "cn-hangzhou": "trademark.aliyuncs.com" + }, + "cdn": { + "cn-hangzhou": "cdn.aliyuncs.com" + }, + "sca": { + "cn-hangzhou": "qualitycheck.cn-hangzhou.aliyuncs.com" + }, + "drds": { + "ap-southeast-1": "drds.ap-southeast-1.aliyuncs.com", + "cn-hangzhou": "drds.cn-hangzhou.aliyuncs.com" + }, + "arms": { + "cn-beijing": "arms.cn-beijing.aliyuncs.com", + "cn-hangzhou": "arms.cn-hangzhou.aliyuncs.com", + "cn-shanghai": "arms.cn-shanghai.aliyuncs.com", + "cn-hongkong": "arms.cn-hongkong.aliyuncs.com", + "ap-southeast-1": "arms.ap-southeast-1.aliyuncs.com", + "cn-shenzhen": "arms.cn-shenzhen.aliyuncs.com", + "cn-qingdao": "arms.cn-qingdao.aliyuncs.com" + }, + "iovcc": { + "cn-shanghai": "iovcc.cn-shanghai.aliyuncs.com" + }, + "ddosrewards": { + "cn-hangzhou": "ddosright.cn-hangzhou.aliyuncs.com" + }, + "ons": { + "us-west-1": "ons.us-west-1.aliyuncs.com", + "cn-beijing": "ons.cn-beijing.aliyuncs.com", + "me-east-1": "ons.me-east-1.aliyuncs.com", + "us-east-1": "ons.us-east-1.aliyuncs.com", + "ap-northeast-1": "ons.ap-northeast-1.aliyuncs.com", + "ap-southeast-2": "ons.ap-southeast-2.aliyuncs.com", + "cn-shanghai": "ons.cn-shanghai.aliyuncs.com", + "cn-hongkong": "ons.cn-hongkong.aliyuncs.com", + "cn-shenzhen": "ons.cn-shenzhen.aliyuncs.com", + "ap-southeast-3": "ons.ap-southeast-3.aliyuncs.com", + "cn-hangzhou": "ons.cn-hangzhou.aliyuncs.com", + "ap-southeast-1": "ons.ap-southeast-1.aliyuncs.com", + "ap-south-1": "ons.ap-south-1.aliyuncs.com", + "eu-central-1": "ons.eu-central-1.aliyuncs.com", + "cn-qingdao": "ons.cn-qingdao.aliyuncs.com", + "cn-zhangjiakou": "ons.cn-zhangjiakou.aliyuncs.com", + "cn-huhehaote": "ons.cn-huhehaote.aliyuncs.com", + "eu-west-1": "ons.eu-west-1.aliyuncs.com" + }, + "hbase": { + "cn-huhehaote": "hbase.cn-huhehaote.aliyuncs.com", + "me-east-1": "hbase.me-east-1.aliyuncs.com", + "ap-southeast-2": "hbase.ap-southeast-2.aliyuncs.com", + "ap-southeast-3": "hbase.ap-southeast-3.aliyuncs.com", + "ap-southeast-5": "hbase.ap-southeast-5.aliyuncs.com", + "ap-south-1": "hbase.ap-south-1.aliyuncs.com", + "eu-central-1": "hbase.eu-central-1.aliyuncs.com", + "cn-qingdao": "hbase.aliyuncs.com", + "cn-beijing": "hbase.aliyuncs.com", + "cn-hangzhou": "hbase.aliyuncs.com", + "cn-shanghai": "hbase.aliyuncs.com", + "cn-shenzhen": "hbase.aliyuncs.com", + "ap-southeast-1": "hbase.aliyuncs.com", + "us-west-1": "hbase.aliyuncs.com", + "us-east-1": "hbase.aliyuncs.com" + }, + "ros": { + "cn-hangzhou": "ros.aliyuncs.com" + }, + "pts": { + "cn-hangzhou": "pts.aliyuncs.com" + }, + "polardb": { + "cn-huhehaote": "polardb.cn-huhehaote.aliyuncs.com", + "cn-qingdao": "polardb.aliyuncs.com", + "cn-beijing": "polardb.aliyuncs.com", + "cn-hangzhou": "polardb.aliyuncs.com", + "cn-shanghai": "polardb.aliyuncs.com", + "ap-southeast-5": "polardb.ap-southeast-5.aliyuncs.com", + "ap-south-1": "polardb.ap-south-1.aliyuncs.com", + "cn-shenzhen": "polardb.aliyuncs.com", + "cn-hongkong": "polardb.aliyuncs.com" + }, + "ddosdip": { + "ap-southeast-1": "ddosdip.ap-southeast-1.aliyuncs.com" + }, + "ehs": { + "cn-huhehaote": "ehpc.cn-huhehaote.aliyuncs.com", + "cn-beijing": "ehpc.cn-beijing.aliyuncs.com", + "cn-hangzhou": "ehpc.cn-hangzhou.aliyuncs.com", + "cn-shanghai": "ehpc.cn-shanghai.aliyuncs.com", + "cn-hongkong": "ehpc.cn-hongkong.aliyuncs.com", + "cn-shenzhen": "ehpc.cn-shenzhen.aliyuncs.com", + "ap-southeast-1": "ehpc.ap-southeast-1.aliyuncs.com", + "cn-qingdao": "ehpc.cn-qingdao.aliyuncs.com", + "eu-central-1": "ehpc.eu-central-1.aliyuncs.com", + "cn-zhangjiakou": "ehpc.cn-zhangjiakou.aliyuncs.com", + "ap-southeast-2": "ehpc.ap-southeast-2.aliyuncs.com" + }, + "gpdb": { + "cn-huhehaote": "gpdb.cn-huhehaote.aliyuncs.com", + "ap-south-1": "gpdb.ap-south-1.aliyuncs.com", + "ap-southeast-2": "gpdb.ap-southeast-2.aliyuncs.com", + "ap-southeast-3": "gpdb.ap-southeast-3.aliyuncs.com", + "ap-southeast-5": "gpdb.ap-southeast-5.aliyuncs.com", + "eu-central-1": "gpdb.eu-central-1.aliyuncs.com", + "cn-zhangjiakou": "gpdb.cn-zhangjiakou.aliyuncs.com", + "cn-beijing": "gpdb.aliyuncs.com", + "cn-hangzhou": "gpdb.aliyuncs.com", + "cn-shanghai": "gpdb.aliyuncs.com", + "cn-shenzhen": "gpdb.aliyuncs.com", + "ap-southeast-1": "gpdb.aliyuncs.com", + "ap-northeast-1": "gpdb.ap-northeast-1.aliyuncs.com", + "eu-west-1": "gpdb.eu-west-1.aliyuncs.com", + "us-west-1": "gpdb.aliyuncs.com", + "us-east-1": "gpdb.aliyuncs.com" + }, + "waf": { + "cn-hangzhou": "wafopenapi.cn-hangzhou.aliyuncs.com" + }, + "cloudfirewall": { + "cn-hangzhou": "cloudfw.cn-hangzhou.aliyuncs.com" + }, + "baas": { + "cn-hangzhou": "baas.cn-hangzhou.aliyuncs.com", + "ap-northeast-1": "baas.ap-northeast-1.aliyuncs.com", + "ap-southeast-1": "baas.ap-southeast-1.aliyuncs.com", + "cn-beijing": "baas.aliyuncs.com", + "cn-shanghai": "baas.aliyuncs.com", + "cn-shenzhen": "baas.aliyuncs.com" + }, + "imm": { + "cn-shanghai": "imm.cn-shanghai.aliyuncs.com", + "cn-hangzhou": "imm.cn-hangzhou.aliyuncs.com", + "cn-shenzhen": "imm.cn-shenzhen.aliyuncs.com", + "cn-beijing": "imm.cn-beijing.aliyuncs.com", + "ap-southeast-1": "imm.ap-southeast-1.aliyuncs.com", + "cn-zhangjiakou": "imm.cn-zhangjiakou.aliyuncs.com" + }, + "live": { + "cn-beijing": "live.aliyuncs.com", + "cn-hangzhou": "live.aliyuncs.com", + "ap-northeast-1": "live.aliyuncs.com", + "cn-shanghai": "live.aliyuncs.com", + "ap-southeast-1": "live.aliyuncs.com", + "eu-central-1": "live.aliyuncs.com", + "cn-shenzhen": "live.aliyuncs.com" + }, + "qualitycheck": { + "cn-hangzhou": "qualitycheck.cn-hangzhou.aliyuncs.com" + }, + "cloudauth": { + "cn-hangzhou": "cloudauth.aliyuncs.com" + }, + "ims": { + "cn-hangzhou": "ims.aliyuncs.com" + }, + "oas": { + "cn-hangzhou": "cn-hangzhou.oas.aliyuncs.com", + "cn-shenzhen": "cn-shenzhen.oas.aliyuncs.com", + "cn-beijing": "cn-beijing.oas.aliyuncs.com" + }, + "drdspre": { + "ap-southeast-1": "drds.ap-southeast-1.aliyuncs.com", + "cn-qingdao": "drds.cn-qingdao.aliyuncs.com", + "cn-beijing": "drds.cn-beijing.aliyuncs.com", + "cn-hangzhou": "drds.cn-hangzhou.aliyuncs.com", + "cn-shanghai": "drds.cn-shanghai.aliyuncs.com", + "cn-shenzhen": "drds.cn-shenzhen.aliyuncs.com", + "cn-hongkong": "drds.cn-hangzhou.aliyuncs.com" + }, + "oss": { + "cn-qingdao": "oss-cn-qingdao.aliyuncs.com", + "cn-beijing": "oss-cn-beijing.aliyuncs.com", + "cn-hangzhou": "oss-cn-hangzhou.aliyuncs.com", + "cn-shanghai": "oss-cn-shanghai.aliyuncs.com", + "cn-hongkong": "oss-cn-hongkong.aliyuncs.com", + "cn-shenzhen": "oss-cn-shenzhen.aliyuncs.com", + "ap-southeast-1": "oss-ap-southeast-1.aliyuncs.com", + "us-west-1": "oss-us-west-1.aliyuncs.com" + }, + "ddosbasic": { + "cn-huhehaote": "antiddos-openapi.cn-huhehaote.aliyuncs.com", + "me-east-1": "antiddos-openapi.me-east-1.aliyuncs.com", + "ap-northeast-1": "antiddos-openapi.ap-northeast-1.aliyuncs.com", + "ap-southeast-5": "antiddos-openapi.ap-southeast-5.aliyuncs.com", + "ap-southeast-3": "antiddos-openapi.ap-southeast-3.aliyuncs.com", + "ap-southeast-2": "antiddos-openapi.ap-southeast-2.aliyuncs.com", + "ap-south-1": "antiddos-openapi.ap-south-1.aliyuncs.com", + "eu-central-1": "antiddos-openapi.eu-central-1.aliyuncs.com", + "cn-zhangjiakou": "antiddos-openapi.cn-zhangjiakou.aliyuncs.com", + "cn-qingdao": "antiddos.aliyuncs.com", + "cn-beijing": "antiddos.aliyuncs.com", + "cn-hangzhou": "antiddos.aliyuncs.com", + "cn-shanghai": "antiddos.aliyuncs.com", + "cn-shenzhen": "antiddos.aliyuncs.com", + "cn-hongkong": "antiddos.aliyuncs.com", + "ap-southeast-1": "antiddos.aliyuncs.com", + "eu-west-1": "antiddos-openapi.eu-west-1.aliyuncs.com", + "us-west-1": "antiddos.aliyuncs.com", + "us-east-1": "antiddos.aliyuncs.com" + }, + "dm": { + "ap-southeast-2": "dm.ap-southeast-2.aliyuncs.com" + }, + "ddoscoo": { + "cn-hangzhou": "ddoscoo.cn-hangzhou.aliyuncs.com" + }, + "smartag": { + "cn-shanghai": "smartag.cn-shanghai.aliyuncs.com", + "cn-hongkong": "smartag.cn-hongkong.aliyuncs.com", + "ap-southeast-1": "smartag.ap-southeast-1.aliyuncs.com", + "ap-southeast-2": "smartag.ap-southeast-2.aliyuncs.com", + "ap-southeast-3": "smartag.ap-southeast-3.aliyuncs.com", + "ap-southeast-5": "smartag.ap-southeast-5.aliyuncs.com", + "eu-central-1": "smartag.eu-central-1.aliyuncs.com" + }, + "actiontrail": { + "cn-huhehaote": "actiontrail.cn-huhehaote.aliyuncs.com", + "ap-south-1": "actiontrail.ap-south-1.aliyuncs.com", + "cn-beijing": "actiontrail.cn-beijing.aliyuncs.com", + "me-east-1": "actiontrail.me-east-1.aliyuncs.com", + "us-east-1": "actiontrail.us-east-1.aliyuncs.com", + "ap-northeast-1": "actiontrail.ap-northeast-1.aliyuncs.com", + "ap-southeast-2": "actiontrail.ap-southeast-2.aliyuncs.com", + "cn-shanghai": "actiontrail.cn-shanghai.aliyuncs.com", + "cn-hongkong": "actiontrail.cn-hongkong.aliyuncs.com", + "cn-shenzhen": "actiontrail.cn-shenzhen.aliyuncs.com", + "ap-southeast-3": "actiontrail.ap-southeast-3.aliyuncs.com", + "cn-hangzhou": "actiontrail.cn-hangzhou.aliyuncs.com", + "ap-southeast-5": "actiontrail.ap-southeast-5.aliyuncs.com", + "ap-southeast-1": "actiontrail.ap-southeast-1.aliyuncs.com", + "us-west-1": "actiontrail.us-west-1.aliyuncs.com", + "eu-central-1": "actiontrail.eu-central-1.aliyuncs.com", + "cn-zhangjiakou": "actiontrail.cn-zhangjiakou.aliyuncs.com", + "cn-qingdao": "actiontrail.cn-qingdao.aliyuncs.com", + "eu-west-1": "actiontrail.eu-west-1.aliyuncs.com" + }, + "vpc": { + "cn-huhehaote": "vpc.cn-huhehaote.aliyuncs.com", + "me-east-1": "vpc.me-east-1.aliyuncs.com", + "ap-northeast-1": "vpc.ap-northeast-1.aliyuncs.com", + "ap-southeast-5": "vpc.ap-southeast-5.aliyuncs.com", + "ap-southeast-3": "vpc.ap-southeast-3.aliyuncs.com", + "ap-southeast-2": "vpc.ap-southeast-2.aliyuncs.com", + "ap-south-1": "vpc.ap-south-1.aliyuncs.com", + "eu-central-1": "vpc.eu-central-1.aliyuncs.com", + "cn-zhangjiakou": "vpc.cn-zhangjiakou.aliyuncs.com", + "cn-qingdao": "vpc.aliyuncs.com", + "cn-beijing": "vpc.aliyuncs.com", + "cn-hangzhou": "vpc.aliyuncs.com", + "cn-shanghai": "vpc.aliyuncs.com", + "cn-shenzhen": "vpc.aliyuncs.com", + "cn-hongkong": "vpc.aliyuncs.com", + "ap-southeast-1": "vpc.aliyuncs.com", + "eu-west-1": "vpc.eu-west-1.aliyuncs.com", + "us-west-1": "vpc.aliyuncs.com", + "us-east-1": "vpc.aliyuncs.com" + }, + "ots": { + "cn-huhehaote": "ots.cn-huhehaote.aliyuncs.com", + "cn-beijing": "ots.cn-beijing.aliyuncs.com", + "me-east-1": "ots.me-east-1.aliyuncs.com", + "cn-hangzhou": "ots.cn-hangzhou.aliyuncs.com", + "ap-northeast-1": "ots.ap-northeast-1.aliyuncs.com", + "cn-shanghai": "ots.cn-shanghai.aliyuncs.com", + "ap-southeast-1": "ots.ap-southeast-1.aliyuncs.com", + "ap-southeast-3": "ots.ap-southeast-3.aliyuncs.com", + "ap-southeast-2": "ots.ap-southeast-2.aliyuncs.com", + "ap-southeast-5": "ots.ap-southeast-5.aliyuncs.com", + "ap-south-1": "ots.ap-south-1.aliyuncs.com", + "eu-central-1": "ots.eu-central-1.aliyuncs.com", + "cn-zhangjiakou": "ots.cn-zhangjiakou.aliyuncs.com", + "eu-west-1": "ots.eu-west-1.aliyuncs.com", + "us-west-1": "ots.us-west-1.aliyuncs.com", + "us-east-1": "ots.us-east-1.aliyuncs.com" + }, + "redisa": { + "cn-huhehaote": "r-kvstore.cn-huhehaote.aliyuncs.com", + "me-east-1": "r-kvstore.me-east-1.aliyuncs.com", + "ap-northeast-1": "r-kvstore.ap-northeast-1.aliyuncs.com", + "ap-southeast-5": "r-kvstore.ap-southeast-5.aliyuncs.com", + "cn-hongkong": "r-kvstore.cn-hongkong.aliyuncs.com", + "ap-southeast-1": "r-kvstore.ap-southeast-1.aliyuncs.com", + "ap-southeast-3": "r-kvstore.ap-southeast-3.aliyuncs.com", + "ap-southeast-2": "r-kvstore.ap-southeast-2.aliyuncs.com", + "ap-south-1": "r-kvstore.ap-south-1.aliyuncs.com", + "eu-central-1": "r-kvstore.eu-central-1.aliyuncs.com", + "cn-zhangjiakou": "r-kvstore.cn-zhangjiakou.aliyuncs.com", + "cn-qingdao": "r-kvstore.aliyuncs.com", + "cn-beijing": "r-kvstore.aliyuncs.com", + "cn-hangzhou": "r-kvstore.aliyuncs.com", + "cn-shanghai": "r-kvstore.aliyuncs.com", + "cn-shenzhen": "r-kvstore.aliyuncs.com", + "eu-west-1": "r-kvstore.eu-west-1.aliyuncs.com", + "us-west-1": "r-kvstore.aliyuncs.com", + "us-east-1": "r-kvstore.aliyuncs.com" + }, + "codepipeline": { + "cn-beijing": "cds.cn-beijing.aliyuncs.com" + }, + "csb": { + "cn-hangzhou": "csb.cn-hangzhou.aliyuncs.com", + "cn-beijing": "csb.cn-beijing.aliyuncs.com" + }, + "apigateway": { + "cn-shanghai": "apigateway.cn-shanghai.aliyuncs.com", + "cn-qingdao": "apigateway.cn-qingdao.aliyuncs.com", + "cn-beijing": "apigateway.cn-beijing.aliyuncs.com", + "cn-hangzhou": "apigateway.cn-hangzhou.aliyuncs.com", + "ap-northeast-1": "apigateway.ap-northeast-1.aliyuncs.com", + "us-west-1": "apigateway.us-west-1.aliyuncs.com", + "ap-southeast-5": "apigateway.ap-southeast-5.aliyuncs.com", + "cn-hongkong": "apigateway.cn-hongkong.aliyuncs.com", + "cn-shenzhen": "apigateway.cn-shenzhen.aliyuncs.com", + "ap-southeast-3": "apigateway.ap-southeast-3.aliyuncs.com", + "ap-southeast-2": "apigateway.ap-southeast-2.aliyuncs.com", + "ap-southeast-1": "apigateway.ap-southeast-1.aliyuncs.com", + "ap-south-1": "apigateway.ap-south-1.aliyuncs.com", + "eu-central-1": "apigateway.eu-central-1.aliyuncs.com", + "cn-zhangjiakou": "apigateway.cn-zhangjiakou.aliyuncs.com", + "cn-huhehaote": "apigateway.cn-huhehaote.aliyuncs.com", + "eu-west-1": "apigateway.eu-west-1.aliyuncs.com", + "us-east-1": "apigateway.us-east-1.aliyuncs.com", + "me-east-1": "apigateway.me-east-1.aliyuncs.com" + }, + "beebot": { + "cn-shanghai": "chatbot.cn-shanghai.aliyuncs.com", + "cn-hangzhou": "chatbot.cn-hangzhou.aliyuncs.com" + }, + "cas": { + "cn-hangzhou": "cas.aliyuncs.com", + "ap-southeast-2": "cas.ap-southeast-2.aliyuncs.com", + "ap-northeast-1": "cas.ap-northeast-1.aliyuncs.com", + "eu-central-1": "cas.eu-central-1.aliyuncs.com", + "me-east-1": "cas.me-east-1.aliyuncs.com" + }, + "mts": { + "ap-south-1": "mts.ap-south-1.aliyuncs.com", + "cn-beijing": "mts.cn-beijing.aliyuncs.com", + "cn-hangzhou": "mts.cn-hangzhou.aliyuncs.com", + "ap-northeast-1": "mts.ap-northeast-1.aliyuncs.com", + "cn-shanghai": "mts.cn-shanghai.aliyuncs.com", + "cn-hongkong": "mts.cn-hongkong.aliyuncs.com", + "cn-shenzhen": "mts.cn-shenzhen.aliyuncs.com", + "ap-southeast-1": "mts.ap-southeast-1.aliyuncs.com", + "us-west-1": "mts.us-west-1.aliyuncs.com", + "eu-central-1": "mts.eu-central-1.aliyuncs.com", + "cn-zhangjiakou": "mts.cn-zhangjiakou.aliyuncs.com", + "eu-west-1": "mts.eu-west-1.aliyuncs.com" + }, + "pvtz": { + "cn-hangzhou": "pvtz.aliyuncs.com", + "ap-southeast-1": "pvtz.aliyuncs.com" + }, + "petadata": { + "cn-huhehaote": "petadata.cn-huhehaote.aliyuncs.com", + "me-east-1": "petadata.me-east-1.aliyuncs.com", + "ap-southeast-2": "petadata.ap-southeast-2.aliyuncs.com", + "ap-southeast-5": "petadata.ap-southeast-5.aliyuncs.com", + "eu-central-1": "petadata.eu-central-1.aliyuncs.com", + "cn-zhangjiakou": "petadata.cn-zhangjiakou.aliyuncs.com", + "cn-qingdao": "petadata.aliyuncs.com", + "cn-beijing": "petadata.aliyuncs.com", + "cn-hangzhou": "petadata.aliyuncs.com", + "cn-shanghai": "petadata.aliyuncs.com", + "cn-shenzhen": "petadata.aliyuncs.com", + "cn-hongkong": "petadata.aliyuncs.com", + "ap-southeast-1": "petadata.aliyuncs.com", + "us-west-1": "petadata.aliyuncs.com", + "us-east-1": "petadata.aliyuncs.com" + }, + "ensdisk": { + "cn-hangzhou": "ens.aliyuncs.com" + }, + "onsvip": { + "cn-beijing": "ons.cn-beijing.aliyuncs.com", + "cn-hangzhou": "ons.cn-hangzhou.aliyuncs.com", + "cn-shanghai": "ons.cn-shanghai.aliyuncs.com", + "cn-shenzhen": "ons.cn-shenzhen.aliyuncs.com", + "ap-southeast-1": "ons.ap-southeast-1.aliyuncs.com", + "cn-qingdao": "ons.cn-qingdao.aliyuncs.com" + }, + "emr": { + "cn-huhehaote": "emr.cn-huhehaote.aliyuncs.com", + "ap-south-1": "emr.ap-south-1.aliyuncs.com", + "me-east-1": "emr.me-east-1.aliyuncs.com", + "us-east-1": "emr.us-east-1.aliyuncs.com", + "ap-northeast-1": "emr.ap-northeast-1.aliyuncs.com", + "ap-southeast-2": "emr.ap-southeast-2.aliyuncs.com", + "ap-southeast-3": "emr.ap-southeast-3.aliyuncs.com", + "ap-southeast-5": "emr.ap-southeast-5.aliyuncs.com", + "eu-central-1": "emr.eu-central-1.aliyuncs.com", + "cn-zhangjiakou": "emr.cn-zhangjiakou.aliyuncs.com", + "cn-qingdao": "emr.cn-qingdao.aliyuncs.com", + "cn-beijing": "emr.aliyuncs.com", + "cn-hangzhou": "emr.aliyuncs.com", + "cn-shanghai": "emr.aliyuncs.com", + "cn-shenzhen": "emr.aliyuncs.com", + "cn-hongkong": "emr.cn-hongkong.aliyuncs.com", + "ap-southeast-1": "emr.aliyuncs.com", + "eu-west-1": "emr.eu-west-1.aliyuncs.com", + "us-west-1": "emr.aliyuncs.com" + }, + "hdm": { + "cn-shanghai": "hdm-api.aliyuncs.com" + }, + "cms": { + "ap-southeast-5": "metrics.ap-southeast-5.aliyuncs.com", + "cn-huhehaote": "metrics.cn-huhehaote.aliyuncs.com", + "ap-northeast-1": "metrics.ap-northeast-1.aliyuncs.com", + "ap-south-1": "metrics.ap-south-1.aliyuncs.com", + "ap-southeast-3": "metrics.ap-southeast-3.aliyuncs.com", + "cn-qingdao": "metrics.cn-hangzhou.aliyuncs.com", + "cn-beijing": "metrics.cn-hangzhou.aliyuncs.com", + "cn-zhangjiakou": "metrics.cn-hangzhou.aliyuncs.com", + "cn-hangzhou": "metrics.cn-hangzhou.aliyuncs.com", + "cn-shanghai": "metrics.cn-hangzhou.aliyuncs.com", + "cn-shenzhen": "metrics.cn-hangzhou.aliyuncs.com", + "cn-hongkong": "metrics.cn-hangzhou.aliyuncs.com", + "ap-southeast-1": "metrics.cn-hangzhou.aliyuncs.com", + "ap-southeast-2": "metrics.cn-hangzhou.aliyuncs.com", + "eu-west-1": "metrics.eu-west-1.aliyuncs.com", + "us-west-1": "metrics.cn-hangzhou.aliyuncs.com", + "us-east-1": "metrics.cn-hangzhou.aliyuncs.com", + "eu-central-1": "metrics.cn-hangzhou.aliyuncs.com", + "me-east-1": "metrics.cn-hangzhou.aliyuncs.com" + }, + "luban": { + "cn-shanghai": "luban.cn-shanghai.aliyuncs.com", + "cn-hangzhou": "luban.cn-hangzhou.aliyuncs.com" + }, + "slb": { + "cn-huhehaote": "slb.cn-huhehaote.aliyuncs.com", + "me-east-1": "slb.me-east-1.aliyuncs.com", + "ap-northeast-1": "slb.ap-northeast-1.aliyuncs.com", + "ap-southeast-5": "slb.ap-southeast-5.aliyuncs.com", + "ap-southeast-3": "slb.ap-southeast-3.aliyuncs.com", + "ap-southeast-2": "slb.ap-southeast-2.aliyuncs.com", + "ap-south-1": "slb.ap-south-1.aliyuncs.com", + "eu-central-1": "slb.eu-central-1.aliyuncs.com", + "cn-zhangjiakou": "slb.cn-zhangjiakou.aliyuncs.com", + "cn-qingdao": "slb.aliyuncs.com", + "cn-beijing": "slb.aliyuncs.com", + "cn-hangzhou": "slb.aliyuncs.com", + "cn-shanghai": "slb.aliyuncs.com", + "cn-shenzhen": "slb.aliyuncs.com", + "cn-hongkong": "slb.aliyuncs.com", + "ap-southeast-1": "slb.aliyuncs.com", + "eu-west-1": "slb.eu-west-1.aliyuncs.com", + "us-west-1": "slb.aliyuncs.com", + "us-east-1": "slb.aliyuncs.com" + }, + "vod": { + "cn-shanghai": "vod.cn-shanghai.aliyuncs.com", + "cn-hangzhou": "vod.cn-shanghai.aliyuncs.com", + "cn-shenzhen": "vod.cn-shanghai.aliyuncs.com", + "cn-beijing": "vod.cn-shanghai.aliyuncs.com", + "ap-southeast-1": "vod.ap-southeast-1.aliyuncs.com", + "eu-central-1": "vod.eu-central-1.aliyuncs.com" + }, + "domain": { + "cn-hangzhou": "domain.aliyuncs.com", + "ap-southeast-1": "domain-intl.aliyuncs.com" + }, + "imagesearch": { + "ap-southeast-1": "imagesearch.ap-southeast-1.aliyuncs.com", + "ap-southeast-2": "imagesearch.ap-southeast-2.aliyuncs.com", + "cn-shanghai": "imagesearch.cn-shanghai.aliyuncs.com", + "ap-northeast-1": "imagesearch.ap-northeast-1.aliyuncs.com" + }, + "ddos": { + "cn-hangzhou": "ddospro.cn-hangzhou.aliyuncs.com", + "cn-hongkong": "ddospro.cn-hongkong.aliyuncs.com" + }, + "odpsmayi": { + "cn-shanghai": "bsb.cloud.alipay.com", + "ap-southeast-1": "bsb.cloud.alipay.com" + }, + "gameshield": { + "cn-hangzhou": "gameshield.aliyuncs.com", + "cn-zhangjiakou": "gameshield.cn-zhangjiakou.aliyuncs.com" + }, + "kvstore": { + "ap-northeast-1": "r-kvstore.ap-northeast-1.aliyuncs.com" + }, + "ddosbgp": { + "cn-huhehaote": "ddosbgp.cn-hangzhou.aliyuncs.com", + "cn-qingdao": "ddosbgp.cn-hangzhou.aliyuncs.com", + "cn-beijing": "ddosbgp.cn-hangzhou.aliyuncs.com", + "cn-hangzhou": "ddosbgp.cn-hangzhou.aliyuncs.com", + "cn-shanghai": "ddosbgp.cn-hangzhou.aliyuncs.com", + "cn-hongkong": "ddosbgp.cn-hongkong.aliyuncs.com", + "cn-shenzhen": "ddosbgp.cn-hangzhou.aliyuncs.com", + "us-west-1": "ddosbgp.us-west-1.aliyuncs.com", + "cn-zhangjiakou": "ddosbgp.cn-hangzhou.aliyuncs.com" + }, + "ess": { + "cn-huhehaote": "ess.cn-huhehaote.aliyuncs.com", + "me-east-1": "ess.me-east-1.aliyuncs.com", + "ap-northeast-1": "ess.ap-northeast-1.aliyuncs.com", + "ap-southeast-5": "ess.ap-southeast-5.aliyuncs.com", + "ap-southeast-3": "ess.ap-southeast-3.aliyuncs.com", + "ap-southeast-2": "ess.ap-southeast-2.aliyuncs.com", + "ap-south-1": "ess.ap-south-1.aliyuncs.com", + "eu-central-1": "ess.eu-central-1.aliyuncs.com", + "cn-zhangjiakou": "ess.cn-zhangjiakou.aliyuncs.com", + "cn-qingdao": "ess.aliyuncs.com", + "cn-beijing": "ess.aliyuncs.com", + "cn-hangzhou": "ess.aliyuncs.com", + "cn-shanghai": "ess.aliyuncs.com", + "cn-shenzhen": "ess.aliyuncs.com", + "cn-hongkong": "ess.aliyuncs.com", + "ap-southeast-1": "ess.aliyuncs.com", + "eu-west-1": "ess.eu-west-1.aliyuncs.com", + "us-west-1": "ess.aliyuncs.com", + "us-east-1": "ess.aliyuncs.com" + }, + "clouddesktop": { + "cn-shanghai": "clouddesktop.cn-shanghai.aliyuncs.com", + "cn-hangzhou": "clouddesktop.cn-hangzhou.aliyuncs.com", + "cn-shenzhen": "clouddesktop.cn-shenzhen.aliyuncs.com", + "cn-beijing": "clouddesktop.cn-beijing.aliyuncs.com" + }, + "dds": { + "cn-huhehaote": "mongodb.cn-huhehaote.aliyuncs.com", + "me-east-1": "mongodb.me-east-1.aliyuncs.com", + "ap-southeast-2": "mongodb.ap-southeast-2.aliyuncs.com", + "cn-zhangjiakou": "mongodb.cn-zhangjiakou.aliyuncs.com", + "ap-southeast-3": "mongodb.ap-southeast-3.aliyuncs.com", + "ap-southeast-5": "mongodb.ap-southeast-5.aliyuncs.com", + "ap-south-1": "mongodb.ap-south-1.aliyuncs.com", + "eu-central-1": "mongodb.eu-central-1.aliyuncs.com", + "cn-qingdao": "mongodb.aliyuncs.com", + "cn-beijing": "mongodb.aliyuncs.com", + "cn-hangzhou": "mongodb.aliyuncs.com", + "cn-shanghai": "mongodb.aliyuncs.com", + "cn-shenzhen": "mongodb.aliyuncs.com", + "cn-hongkong": "mongodb.aliyuncs.com", + "ap-southeast-1": "mongodb.aliyuncs.com", + "ap-northeast-1": "mongodb.ap-northeast-1.aliyuncs.com", + "eu-west-1": "mongodb.eu-west-1.aliyuncs.com", + "us-west-1": "mongodb.aliyuncs.com", + "us-east-1": "mongodb.aliyuncs.com" + }, + "alidnsgtm": { + "cn-hangzhou": "alidns.aliyuncs.com", + "ap-southeast-1": "alidns.aliyuncs.com" + }, + "yunmarket": { + "cn-hangzhou": "market.aliyuncs.com" + }, + "pcdn": { + "cn-hangzhou": "pcdn.aliyuncs.com" + }, + "nas": { + "cn-huhehaote": "nas.cn-huhehaote.aliyuncs.com", + "cn-qingdao": "nas.cn-qingdao.aliyuncs.com", + "cn-beijing": "nas.cn-beijing.aliyuncs.com", + "us-east-1": "nas.us-east-1.aliyuncs.com", + "ap-southeast-2": "nas.ap-southeast-2.aliyuncs.com", + "cn-shanghai": "nas.cn-shanghai.aliyuncs.com", + "cn-hongkong": "nas.cn-hongkong.aliyuncs.com", + "cn-shenzhen": "nas.cn-shenzhen.aliyuncs.com", + "ap-southeast-3": "nas.ap-southeast-3.aliyuncs.com", + "cn-hangzhou": "nas.cn-hangzhou.aliyuncs.com", + "ap-southeast-5": "nas.ap-southeast-5.aliyuncs.com", + "ap-southeast-1": "nas.ap-southeast-1.aliyuncs.com", + "ap-south-1": "nas.ap-south-1.aliyuncs.com", + "eu-central-1": "nas.eu-central-1.aliyuncs.com", + "cn-zhangjiakou": "nas.cn-zhangjiakou.aliyuncs.com", + "ap-northeast-1": "nas.ap-northeast-1.aliyuncs.com", + "us-west-1": "nas.us-west-1.aliyuncs.com" + }, + "ivision": { + "cn-hangzhou": "ivision.cn-hangzhou.aliyuncs.com", + "cn-beijing": "ivision.cn-beijing.aliyuncs.com" + }, + "ens": { + "cn-hangzhou": "ens.aliyuncs.com" + }, + "kms": { + "cn-huhehaote": "kms.cn-huhehaote.aliyuncs.com", + "us-west-1": "kms.us-west-1.aliyuncs.com", + "cn-beijing": "kms.cn-beijing.aliyuncs.com", + "me-east-1": "kms.me-east-1.aliyuncs.com", + "us-east-1": "kms.us-east-1.aliyuncs.com", + "ap-northeast-1": "kms.ap-northeast-1.aliyuncs.com", + "ap-southeast-2": "kms.ap-southeast-2.aliyuncs.com", + "cn-zhangjiakou": "kms.cn-zhangjiakou.aliyuncs.com", + "cn-shanghai": "kms.cn-shanghai.aliyuncs.com", + "cn-hongkong": "kms.cn-hongkong.aliyuncs.com", + "cn-shenzhen": "kms.cn-shenzhen.aliyuncs.com", + "ap-southeast-3": "kms.ap-southeast-3.aliyuncs.com", + "cn-hangzhou": "kms.cn-hangzhou.aliyuncs.com", + "ap-southeast-5": "kms.ap-southeast-5.aliyuncs.com", + "ap-southeast-1": "kms.ap-southeast-1.aliyuncs.com", + "ap-south-1": "kms.ap-south-1.aliyuncs.com", + "eu-central-1": "kms.eu-central-1.aliyuncs.com", + "cn-qingdao": "kms.cn-qingdao.aliyuncs.com", + "eu-west-1": "kms.eu-west-1.aliyuncs.com" + }, + "hpc": { + "cn-hangzhou": "hpc.aliyuncs.com", + "cn-beijing": "hpc.aliyuncs.com" + }, + "green": { + "cn-shanghai": "green.cn-shanghai.aliyuncs.com", + "cn-hangzhou": "green.cn-hangzhou.aliyuncs.com", + "us-west-1": "green.us-west-1.aliyuncs.com", + "cn-beijing": "green.cn-beijing.aliyuncs.com", + "ap-southeast-1": "green.ap-southeast-1.aliyuncs.com" + }, + "odpsplusmayi": { + "cn-shanghai": "bsb.cloud.alipay.com", + "cn-hangzhou": "bsb.cloud.alipay.com", + "ap-southeast-1": "bsb.cloud.alipay.com" + }, + "hcs_sgw": { + "cn-shanghai": "sgw.cn-shanghai.aliyuncs.com", + "cn-hangzhou": "sgw.cn-shanghai.aliyuncs.com", + "cn-qingdao": "sgw.cn-shanghai.aliyuncs.com", + "cn-beijing": "sgw.cn-shanghai.aliyuncs.com", + "cn-zhangjiakou": "sgw.cn-shanghai.aliyuncs.com", + "cn-shenzhen": "sgw.cn-shanghai.aliyuncs.com", + "cn-hongkong": "sgw.cn-shanghai.aliyuncs.com", + "ap-southeast-1": "sgw.ap-southeast-1.aliyuncs.com", + "ap-southeast-2": "sgw.ap-southeast-2.aliyuncs.com", + "eu-central-1": "sgw.eu-central-1.aliyuncs.com" + }, + "emas": { + "cn-shanghai": "mhub.cn-shanghai.aliyuncs.com", + "cn-hangzhou": "mhub.cn-hangzhou.aliyuncs.com" + }, + "iot": { + "cn-shanghai": "iot.cn-shanghai.aliyuncs.com", + "ap-southeast-1": "iot.ap-southeast-1.aliyuncs.com", + "us-east-1": "iot.us-east-1.aliyuncs.com", + "ap-northeast-1": "iot.ap-northeast-1.aliyuncs.com", + "us-west-1": "iot.us-west-1.aliyuncs.com", + "eu-central-1": "iot.eu-central-1.aliyuncs.com" + }, + "eci": { + "cn-shanghai": "eci.aliyuncs.com", + "cn-hangzhou": "eci.aliyuncs.com", + "us-west-1": "eci.aliyuncs.com", + "cn-beijing": "eci.aliyuncs.com", + "cn-shenzhen": "eci.aliyuncs.com", + "ap-southeast-1": "eci.aliyuncs.com" + }, + "hsm": { + "cn-beijing": "hsm.aliyuncs.com", + "cn-hangzhou": "hsm.aliyuncs.com", + "cn-shanghai": "hsm.aliyuncs.com", + "cn-hongkong": "hsm.aliyuncs.com", + "cn-shenzhen": "hsm.aliyuncs.com", + "ap-southeast-1": "hsm.aliyuncs.com" + }, + "fc": { + "cn-shanghai": "cn-shanghai.fc.aliyuncs.com", + "cn-hangzhou": "cn-hangzhou.fc.aliyuncs.com", + "cn-shenzhen": "cn-shenzhen.fc.aliyuncs.com", + "cn-beijing": "cn-beijing.fc.aliyuncs.com", + "ap-southeast-2": "ap-southeast-2.fc.aliyuncs.com", + "cn-huhehaote": "cn-huhehaote.fc.aliyuncs.com" + }, + "ecs": { + "cn-huhehaote": "ecs.cn-huhehaote.aliyuncs.com", + "me-east-1": "ecs.me-east-1.aliyuncs.com", + "ap-northeast-1": "ecs.ap-northeast-1.aliyuncs.com", + "ap-southeast-5": "ecs.ap-southeast-5.aliyuncs.com", + "ap-southeast-3": "ecs.ap-southeast-3.aliyuncs.com", + "ap-southeast-2": "ecs.ap-southeast-2.aliyuncs.com", + "ap-south-1": "ecs.ap-south-1.aliyuncs.com", + "eu-central-1": "ecs.eu-central-1.aliyuncs.com", + "cn-zhangjiakou": "ecs.cn-zhangjiakou.aliyuncs.com", + "cn-qingdao": "ecs-cn-hangzhou.aliyuncs.com", + "cn-beijing": "ecs-cn-hangzhou.aliyuncs.com", + "cn-hangzhou": "ecs-cn-hangzhou.aliyuncs.com", + "cn-shanghai": "ecs-cn-hangzhou.aliyuncs.com", + "cn-shenzhen": "ecs-cn-hangzhou.aliyuncs.com", + "cn-hongkong": "ecs-cn-hangzhou.aliyuncs.com", + "ap-southeast-1": "ecs-cn-hangzhou.aliyuncs.com", + "eu-west-1": "ecs.eu-west-1.aliyuncs.com", + "us-west-1": "ecs-cn-hangzhou.aliyuncs.com", + "us-east-1": "ecs-cn-hangzhou.aliyuncs.com" + }, + "batchcompute": { + "cn-huhehaote": "batchcompute.cn-huhehaote.aliyuncs.com", + "us-west-1": "batchcompute.us-west-1.aliyuncs.com", + "cn-beijing": "batchcompute.cn-beijing.aliyuncs.com", + "cn-hangzhou": "batchcompute.cn-hangzhou.aliyuncs.com", + "cn-shanghai": "batchcompute.cn-shanghai.aliyuncs.com", + "ap-southeast-1": "batchcompute.ap-southeast-1.aliyuncs.com", + "cn-shenzhen": "batchcompute.cn-shenzhen.aliyuncs.com", + "cn-qingdao": "batchcompute.cn-qingdao.aliyuncs.com", + "cn-zhangjiakou": "batchcompute.cn-zhangjiakou.aliyuncs.com" + }, + "vipaegis": { + "cn-hangzhou": "aegis.cn-hangzhou.aliyuncs.com", + "ap-southeast-3": "aegis.ap-southeast-3.aliyuncs.com" + }, + "rds": { + "cn-huhehaote": "rds.cn-huhehaote.aliyuncs.com", + "me-east-1": "rds.me-east-1.aliyuncs.com", + "ap-northeast-1": "rds.ap-northeast-1.aliyuncs.com", + "ap-southeast-5": "rds.ap-southeast-5.aliyuncs.com", + "ap-southeast-3": "rds.ap-southeast-3.aliyuncs.com", + "ap-southeast-2": "rds.ap-southeast-2.aliyuncs.com", + "ap-south-1": "rds.ap-south-1.aliyuncs.com", + "eu-central-1": "rds.eu-central-1.aliyuncs.com", + "cn-zhangjiakou": "rds.cn-zhangjiakou.aliyuncs.com", + "cn-qingdao": "rds.aliyuncs.com", + "cn-beijing": "rds.aliyuncs.com", + "cn-hangzhou": "rds.aliyuncs.com", + "cn-shanghai": "rds.aliyuncs.com", + "cn-shenzhen": "rds.aliyuncs.com", + "cn-hongkong": "rds.aliyuncs.com", + "ap-southeast-1": "rds.aliyuncs.com", + "eu-west-1": "rds.eu-west-1.aliyuncs.com", + "us-west-1": "rds.aliyuncs.com", + "us-east-1": "rds.aliyuncs.com" + }, + "cloudap": { + "cn-hangzhou": "cloudwf.aliyuncs.com" + }, + "openanalytics": { + "cn-beijing": "openanalytics.cn-beijing.aliyuncs.com", + "cn-hangzhou": "openanalytics.cn-hangzhou.aliyuncs.com", + "cn-shanghai": "openanalytics.cn-shanghai.aliyuncs.com", + "ap-southeast-1": "openanalytics.ap-southeast-1.aliyuncs.com", + "ap-southeast-3": "openanalytics.ap-southeast-3.aliyuncs.com", + "cn-zhangjiakou": "openanalytics.cn-zhangjiakou.aliyuncs.com", + "cn-shenzhen": "openanalytics.cn-shenzhen.aliyuncs.com", + "eu-west-1": "openanalytics.eu-west-1.aliyuncs.com" + }, + "hcs_mgw": { + "cn-shanghai": "mgw.cn-shanghai.aliyuncs.com", + "cn-hangzhou": "mgw.cn-hangzhou.aliyuncs.com", + "ap-southeast-1": "mgw.ap-southeast-1.aliyuncs.com" + }, + "dcdn": { + "cn-hangzhou": "dcdn.aliyuncs.com", + "ap-southeast-1": "dcdn.aliyuncs.com" + }, + "elasticsearch": { + "ap-south-1": "elasticsearch.ap-south-1.aliyuncs.com", + "cn-hangzhou": "elasticsearch.cn-hangzhou.aliyuncs.com", + "cn-shanghai": "elasticsearch.cn-shanghai.aliyuncs.com", + "cn-hongkong": "elasticsearch.cn-hongkong.aliyuncs.com", + "cn-shenzhen": "elasticsearch.cn-shenzhen.aliyuncs.com", + "ap-southeast-3": "elasticsearch.ap-southeast-3.aliyuncs.com", + "ap-southeast-1": "elasticsearch.ap-southeast-1.aliyuncs.com", + "us-west-1": "elasticsearch.us-west-1.aliyuncs.com", + "cn-qingdao": "elasticsearch.cn-qingdao.aliyuncs.com", + "cn-beijing": "elasticsearch.cn-beijing.aliyuncs.com", + "cn-zhangjiakou": "elasticsearch.cn-zhangjiakou.aliyuncs.com", + "ap-southeast-2": "elasticsearch.ap-southeast-2.aliyuncs.com", + "ap-southeast-5": "elasticsearch.ap-southeast-5.aliyuncs.com", + "ap-northeast-1": "elasticsearch.ap-northeast-1.aliyuncs.com", + "eu-central-1": "elasticsearch.eu-central-1.aliyuncs.com" + }, + "alidns": { + "cn-hangzhou": "alidns.aliyuncs.com" + }, + "cps": { + "cn-hangzhou": "cloudpush.aliyuncs.com" + }, + "ccc": { + "cn-shanghai": "ccc.cn-shanghai.aliyuncs.com", + "cn-hangzhou": "ccc.cn-hangzhou.aliyuncs.com" + }, + "cloudphoto": { + "cn-shanghai": "cloudphoto.cn-shanghai.aliyuncs.com" + }, + "dts": { + "cn-qingdao": "dts.aliyuncs.com", + "cn-beijing": "dts.aliyuncs.com", + "cn-zhangjiakou": "dts.aliyuncs.com", + "cn-huhehaote": "dts.aliyuncs.com", + "cn-hangzhou": "dts.aliyuncs.com", + "cn-shanghai": "dts.aliyuncs.com", + "cn-shenzhen": "dts.aliyuncs.com", + "cn-hongkong": "dts.aliyuncs.com", + "ap-southeast-1": "dts.aliyuncs.com" + }, + "dysmsapi": { + "cn-shenzhen": "dysmsapi.aliyuncs.com", + "cn-huhehaote": "dysmsapi.aliyuncs.com", + "cn-qingdao": "dysmsapi.aliyuncs.com", + "cn-beijing": "dysmsapi.aliyuncs.com", + "cn-shanghai": "dysmsapi.aliyuncs.com", + "cn-hangzhou": "dysmsapi.aliyuncs.com", + "cn-zhangjiakou": "dysmsapi.aliyuncs.com", + "cn-chengdu": "dysmsapi.aliyuncs.com", + "cn-hongkong": "dysmsapi.ap-southeast-1.aliyuncs.com", + "me-east-1": "dysmsapi.ap-southeast-1.aliyuncs.com", + "us-east-1": "dysmsapi.ap-southeast-1.aliyuncs.com", + "ap-northeast-1": "dysmsapi.ap-southeast-1.aliyuncs.com", + "ap-southeast-5": "dysmsapi.ap-southeast-1.aliyuncs.com", + "ap-southeast-3": "dysmsapi.ap-southeast-1.aliyuncs.com", + "ap-southeast-2": "dysmsapi.ap-southeast-1.aliyuncs.com", + "ap-south-1": "dysmsapi.ap-southeast-1.aliyuncs.com", + "ap-southeast-1": "dysmsapi.ap-southeast-1.aliyuncs.com", + "us-west-1": "dysmsapi.ap-southeast-1.aliyuncs.com", + "eu-central-1": "dysmsapi.ap-southeast-1.aliyuncs.com" + }, + "dybaseapi": { + "cn-shenzhen": "dybaseapi.aliyuncs.com", + "cn-huhehaote": "dybaseapi.aliyuncs.com", + "cn-qingdao": "dybaseapi.aliyuncs.com", + "cn-beijing": "dybaseapi.aliyuncs.com", + "cn-shanghai": "dybaseapi.aliyuncs.com", + "cn-hangzhou": "dybaseapi.aliyuncs.com", + "cn-zhangjiakou": "dybaseapi.aliyuncs.com", + "cn-chengdu": "dybaseapi.aliyuncs.com", + "cn-hongkong": "dybaseapi.ap-southeast-1.aliyuncs.com", + "me-east-1": "dybaseapi.ap-southeast-1.aliyuncs.com", + "us-east-1": "dybaseapi.ap-southeast-1.aliyuncs.com", + "ap-northeast-1": "dybaseapi.ap-southeast-1.aliyuncs.com", + "ap-southeast-5": "dybaseapi.ap-southeast-1.aliyuncs.com", + "ap-southeast-3": "dybaseapi.ap-southeast-1.aliyuncs.com", + "ap-southeast-2": "dybaseapi.ap-southeast-1.aliyuncs.com", + "ap-south-1": "dybaseapi.ap-southeast-1.aliyuncs.com", + "ap-southeast-1": "dybaseapi.ap-southeast-1.aliyuncs.com", + "us-west-1": "dybaseapi.ap-southeast-1.aliyuncs.com", + "eu-central-1": "dybaseapi.ap-southeast-1.aliyuncs.com" + }, + "bssopenapi": { + "cn-qingdao": "business.aliyuncs.com", + "cn-beijing": "business.aliyuncs.com", + "cn-zhangjiakou": "business.aliyuncs.com", + "cn-huhehaote": "business.aliyuncs.com", + "cn-hangzhou": "business.aliyuncs.com", + "cn-shanghai": "business.aliyuncs.com", + "cn-shenzhen": "business.aliyuncs.com", + "cn-hongkong": "business.aliyuncs.com", + "ap-southeast-1": "business.ap-southeast-1.aliyuncs.com", + "ap-southeast-2": "business.ap-southeast-1.aliyuncs.com", + "ap-southeast-3": "business.ap-southeast-1.aliyuncs.com", + "ap-southeast-5": "business.ap-southeast-1.aliyuncs.com", + "ap-northeast-1": "business.ap-southeast-1.aliyuncs.com", + "us-west-1": "business.ap-southeast-1.aliyuncs.com", + "us-east-1": "business.ap-southeast-1.aliyuncs.com", + "eu-central-1": "business.ap-southeast-1.aliyuncs.com", + "eu-west-1": "business.ap-southeast-1.aliyuncs.com", + "me-east-1": "business.ap-southeast-1.aliyuncs.com", + "ap-south-1": "business.ap-southeast-1.aliyuncs.com" + }, + "faas": { + "cn-hangzhou": "faas.cn-hangzhou.aliyuncs.com", + "cn-shenzhen": "faas.cn-shenzhen.aliyuncs.com", + "cn-shanghai": "faas.cn-shanghai.aliyuncs.com", + "cn-beijing": "faas.cn-beijing.aliyuncs.com", + "cn-zhangjiakou": "faas.cn-zhangjiakou.aliyuncs.com" + }, + "dmsenterprise": { + "cn-qingdao": "dms-enterprise.aliyuncs.com", + "cn-beijing": "dms-enterprise.aliyuncs.com", + "cn-hangzhou": "dms-enterprise.aliyuncs.com", + "cn-shanghai": "dms-enterprise.aliyuncs.com", + "cn-shenzhen": "dms-enterprise.aliyuncs.com", + "ap-northeast-1": "dms-enterprise.aliyuncs.com" + }, + "alikafka": { + "cn-qingdao": "alikafka.cn-qingdao.aliyuncs.com", + "cn-beijing": "alikafka.cn-beijing.aliyuncs.com", + "cn-zhangjiakou": "alikafka.cn-zhangjiakou.aliyuncs.com", + "cn-huhehaote": "alikafka.cn-huhehaote.aliyuncs.com", + "cn-hangzhou": "alikafka.cn-hangzhou.aliyuncs.com", + "cn-shanghai": "alikafka.cn-shanghai.aliyuncs.com", + "cn-shenzhen": "alikafka.cn-shenzhen.aliyuncs.com", + "cn-hongkong": "alikafka.cn-hongkong.aliyuncs.com" + }, + "foas": { + "cn-qingdao": "foas.cn-qingdao.aliyuncs.com", + "cn-beijing": "foas.cn-beijing.aliyuncs.com", + "cn-zhangjiakou": "foas.cn-zhangjiakou.aliyuncs.com", + "cn-hangzhou": "foas.cn-hangzhou.aliyuncs.com", + "cn-shanghai": "foas.cn-shanghai.aliyuncs.com", + "cn-shenzhen": "foas.cn-shenzhen.aliyuncs.com", + "ap-northeast-1": "foas.ap-northeast-1.aliyuncs.com" + }, + "cbn": { + "cn-qingdao": "cbn.aliyuncs.com", + "cn-beijing": "cbn.aliyuncs.com", + "cn-zhangjiakou": "cbn.aliyuncs.com", + "cn-huhehaote": "cbn.aliyuncs.com", + "cn-hangzhou": "cbn.aliyuncs.com", + "cn-shanghai": "cbn.aliyuncs.com", + "cn-shenzhen": "cbn.aliyuncs.com", + "cn-hongkong": "cbn.aliyuncs.com", + "ap-southeast-1": "cbn.aliyuncs.com", + "ap-southeast-2": "cbn.aliyuncs.com", + "ap-southeast-3": "cbn.aliyuncs.com", + "ap-southeast-5": "cbn.aliyuncs.com", + "ap-northeast-1": "cbn.aliyuncs.com", + "eu-west-1": "cbn.aliyuncs.com", + "us-west-1": "cbn.aliyuncs.com", + "us-east-1": "cbn.aliyuncs.com", + "eu-central-1": "cbn.aliyuncs.com", + "me-east-1": "cbn.aliyuncs.com", + "ap-south-1": "cbn.aliyuncs.com" + }, + "alidfs": { + "cn-beijing": "dfs.cn-beijing.aliyuncs.com", + "cn-shanghai": "dfs.cn-shanghai.aliyuncs.com" + }, + "airec": { + "cn-beijing": "airec.cn-beijing.aliyuncs.com", + "cn-hangzhou": "airec.cn-hangzhou.aliyuncs.com", + "cn-shanghai": "airec.cn-shanghai.aliyuncs.com" + }, + "scdn": { + "cn-hangzhou": "scdn.aliyuncs.com" + }, + "saf": { + "cn-hangzhou": "saf.cn-shanghai.aliyuncs.com", + "cn-shanghai": "saf.cn-shanghai.aliyuncs.com", + "cn-shenzhen": "saf.cn-shenzhen.aliyuncs.com" + }, + "linkwan": { + "cn-hangzhou": "linkwan.cn-hangzhou.aliyuncs.com", + "cn-shanghai": "linkwan.cn-shanghai.aliyuncs.com" + }, + "linkedmall": { + "cn-hangzhou": "linkedmall.aliyuncs.com", + "cn-shanghai": "linkedmall.aliyuncs.com" + }, + "vs": { + "cn-hangzhou": "vs.cn-hangzhou.aliyuncs.com", + "cn-shanghai": "vs.cn-shanghai.aliyuncs.com" + }, + "ccs": { + "cn-hangzhou": "ccs.aliyuncs.com" + }, + "hitsdb": { + "cn-hangzhou": "hitsdb.aliyuncs.com" + }, + "uis": { + "cn-hangzhou": "uis.cn-hangzhou.aliyuncs.com" + }, + "alimt": { + "cn-hangzhou": "mt.cn-hangzhou.aliyuncs.com" + }, + "cccvn": { + "cn-shanghai": "voicenavigator.cn-shanghai.aliyuncs.com" + }, + "drdspost": { + "cn-shanghai": "drds.cn-shanghai.aliyuncs.com", + "cn-hongkong": "drds.cn-hangzhou.aliyuncs.com", + "ap-southeast-1": "drds.ap-southeast-1.aliyuncs.com" + }, + "dbs": { + "cn-hangzhou": "dbs-api.cn-hangzhou.aliyuncs.com", + "cn-shanghai": "dbs-api.cn-hangzhou.aliyuncs.com", + "cn-qingdao": "dbs-api.cn-hangzhou.aliyuncs.com", + "cn-beijing": "dbs-api.cn-hangzhou.aliyuncs.com", + "cn-shenzhen": "dbs-api.cn-hangzhou.aliyuncs.com", + "cn-hongkong": "dbs-api.cn-hangzhou.aliyuncs.com", + "ap-southeast-1": "dbs-api.ap-southeast-1.aliyuncs.com", + "ap-northeast-1": "dbs-api.ap-northeast-1.aliyuncs.com" + } + }, + "document_id": { + "vod": "60574", + "domain": "42875", + "cdn": "27148", + "ram": "28672", + "drds": "51111", + "sas": "28498", + "sts": "28756", + "csb": "64837", + "ons": "44416", + "cs": "26043", + "cr": "60716", + "ros": "28899", + "polardb": "58764", + "ess": "25925", + "batchcompute": "44717", + "dds": "61715", + "waf": "62847", + "arms": "42924", + "jaq": "35037", + "cloudauth": "60687", + "nas": "62598", + "live": "48207", + "hpc": "35201", + "slb": "27565", + "rds": "26223", + "dm": "29434", + "iot": "30557", + "cloudwf": "58111", + "ecs": "25484", + "vpc": "34962", + "redisa": "60831", + "codepipeline": "62887", + "apigateway": "43590", + "vipaegis": "28449", + "beebot": "60760", + "emr": "28140", + "mts": "29212", + "httpdns": "52679", + "green": "28427", + "ccc": "63027", + "alidns": "29739", + "push": "30074", + "itaas": "55759", + "cms": "28615", + "qualitycheck": "50807", + "cloudphoto": "59902" + } +} \ No newline at end of file diff --git a/runtime/Lib/site-packages/aliyunsdkcore/data/retry_config.json b/runtime/Lib/site-packages/aliyunsdkcore/data/retry_config.json new file mode 100644 index 0000000000000000000000000000000000000000..27b6fb70448d1f76781320eb295137b7d5e1e178 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/data/retry_config.json @@ -0,0 +1,111 @@ +{ + "ecs" : { + "2014-05-26": { + "RetryableAPIs": [ + "DescribeAccessPoints", + "DescribeAccountAttributes", + "DescribeAutoSnapshotPolicyEx", + "DescribeAvailableResource", + "DescribeBandwidthLimitation", + "DescribeBandwidthPackages", + "DescribeClassicLinkInstances", + "DescribeCloudAssistantStatus", + "DescribeClusters", + "DescribeCommands", + "DescribeDedicatedHostAutoRenew", + "DescribeDedicatedHosts", + "DescribeDedicatedHostTypes", + "DescribeDeploymentSets", + "DescribeDiskMonitorData", + "DescribeDisks", + "DescribeDisksFullStatus", + "DescribeEipAddresses", + "DescribeEipMonitorData", + "DescribeEniMonitorData", + "DescribeForwardTableEntries", + "DescribeHaVips", + "DescribeHpcClusters", + "DescribeImages", + "DescribeImageSharePermission", + "DescribeImageSupportInstanceTypes", + "DescribeInstanceAttribute", + "DescribeInstanceAutoRenewAttribute", + "DescribeInstanceHistoryEvents", + "DescribeInstanceMonitorData", + "DescribeInstancePhysicalAttribute", + "DescribeInstanceRamRole", + "DescribeInstances", + "DescribeInstancesFullStatus", + "DescribeInstanceStatus", + "DescribeInstanceTopology", + "DescribeInstanceTypeFamilies", + "DescribeInstanceTypes", + "DescribeInstanceVncPasswd", + "DescribeInstanceVncUrl", + "DescribeInvocationResults", + "DescribeInvocations", + "DescribeKeyPairs", + "DescribeLaunchTemplates", + "DescribeLaunchTemplateVersions", + "DescribeLimitation", + "DescribeNatGateways", + "DescribeNetworkInterfacePermissions", + "DescribeNetworkInterfaces", + "DescribeNewProjectEipMonitorData", + "DescribePhysicalConnections", + "DescribePrice", + "DescribeRecommendInstanceType", + "DescribeRegions", + "DescribeRenewalPrice", + "DescribeResourceByTags", + "DescribeResourcesModification", + "DescribeRouterInterfaces", + "DescribeRouteTables", + "DescribeSecurityGroupAttribute", + "DescribeSecurityGroupReferences", + "DescribeSecurityGroups", + "DescribeSnapshotLinks", + "DescribeSnapshotMonitorData", + "DescribeSnapshotPackage", + "DescribeSnapshots", + "DescribeSnapshotsUsage", + "DescribeSpotPriceHistory", + "DescribeTags", + "DescribeTaskAttribute", + "DescribeTasks", + "DescribeUserBusinessBehavior", + "DescribeUserData", + "DescribeVirtualBorderRouters", + "DescribeVirtualBorderRoutersForPhysicalConnection", + "DescribeVpcs", + "DescribeVRouters", + "DescribeVSwitches", + "DescribeZones" + ], + "RetryableAPIsWithClientToken": [ + "CreateDisk", + "CreateImage", + "CreateInstance", + "CreateNetworkInterface", + "CreateSnapshot", + "ModifyDiskChargeType", + "ModifyInstanceChargeType", + "ModifyInstanceNetworkSpec", + "ModifyInstanceSpec", + "ModifyPrepayInstanceSpec", + "RenewInstance", + "ReplaceSystemDisk", + "ResizeDisk", + "RunInstances" + ], + "RetryableThrottlingErrors": [ + "Throttling" + ], + "RetryableNormalErrors": [ + "InternalError", + "UnknownError", + "ServiceUnavailable" + ] + } + } +} \ No newline at end of file diff --git a/runtime/Lib/site-packages/aliyunsdkcore/data/timeout_config.json b/runtime/Lib/site-packages/aliyunsdkcore/data/timeout_config.json new file mode 100644 index 0000000000000000000000000000000000000000..667031fc086af3cb092b064d6cda33193b4806e4 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/data/timeout_config.json @@ -0,0 +1,227 @@ +{ + "ecs": { + "2014-05-26": { + "ActivateRouterInterface": 10, + "AddTags": 61, + "AllocateDedicatedHosts": 10, + "AllocateEipAddress": 17, + "AllocatePublicIpAddress": 36, + "ApplyAutoSnapshotPolicy": 10, + "AssignIpv6Addresses": 10, + "AssignPrivateIpAddresses": 10, + "AssociateEipAddress": 17, + "AttachClassicLinkVpc": 14, + "AttachDisk": 36, + "AttachInstanceRamRole": 11, + "AttachKeyPair": 16, + "AttachNetworkInterface": 16, + "AuthorizeSecurityGroupEgress": 16, + "AuthorizeSecurityGroup": 16, + "CancelAutoSnapshotPolicy": 10, + "CancelCopyImage": 10, + "CancelPhysicalConnection": 10, + "CancelSimulatedSystemEvents": 10, + "CancelTask": 10, + "ConnectRouterInterface": 10, + "ConvertNatPublicIpToEip": 12, + "CopyImage": 10, + "CreateAutoSnapshotPolicy": 10, + "CreateCommand": 16, + "CreateDeploymentSet": 16, + "CreateDisk": 36, + "CreateHpcCluster": 10, + "CreateImage": 36, + "CreateInstance": 86, + "CreateKeyPair": 10, + "CreateLaunchTemplate": 10, + "CreateLaunchTemplateVersion": 10, + "CreateNatGateway": 36, + "CreateNetworkInterfacePermission": 13, + "CreateNetworkInterface": 16, + "CreatePhysicalConnection": 10, + "CreateRouteEntry": 17, + "CreateRouterInterface": 10, + "CreateSecurityGroup": 86, + "CreateSimulatedSystemEvents": 10, + "CreateSnapshot": 86, + "CreateVirtualBorderRouter": 10, + "CreateVpc": 16, + "CreateVSwitch": 17, + "DeactivateRouterInterface": 10, + "DeleteAutoSnapshotPolicy": 10, + "DeleteBandwidthPackage": 10, + "DeleteCommand": 16, + "DeleteDeploymentSet": 12, + "DeleteDisk": 16, + "DeleteHpcCluster": 10, + "DeleteImage": 36, + "DeleteInstance": 66, + "DeleteKeyPairs": 10, + "DeleteLaunchTemplate": 10, + "DeleteLaunchTemplateVersion": 10, + "DeleteNatGateway": 10, + "DeleteNetworkInterfacePermission": 10, + "DeleteNetworkInterface": 16, + "DeletePhysicalConnection": 10, + "DeleteRouteEntry": 16, + "DeleteRouterInterface": 10, + "DeleteSecurityGroup": 87, + "DeleteSnapshot": 17, + "DeleteVirtualBorderRouter": 10, + "DeleteVpc": 17, + "DeleteVSwitch": 17, + "DescribeAccessPoints": 10, + "DescribeAccountAttributes": 10, + "DescribeAutoSnapshotPolicyEx": 16, + "DescribeAvailableResource": 10, + "DescribeBandwidthLimitation": 16, + "DescribeBandwidthPackages": 10, + "DescribeClassicLinkInstances": 15, + "DescribeCloudAssistantStatus": 16, + "DescribeClusters": 10, + "DescribeCommands": 16, + "DescribeDedicatedHosts": 10, + "DescribeDedicatedHostTypes": 10, + "DescribeDeploymentSets": 26, + "DescribeDiskMonitorData": 16, + "DescribeDisksFullStatus": 14, + "DescribeDisks": 19, + "DescribeEipAddresses": 16, + "DescribeEipMonitorData": 16, + "DescribeEniMonitorData": 10, + "DescribeHaVips": 10, + "DescribeHpcClusters": 16, + "DescribeImageSharePermission": 10, + "DescribeImages": 38, + "DescribeImageSupportInstanceTypes": 16, + "DescribeInstanceAttribute": 36, + "DescribeInstanceAutoRenewAttribute": 17, + "DescribeInstanceHistoryEvents": 19, + "DescribeInstanceMonitorData": 19, + "DescribeInstancePhysicalAttribute": 10, + "DescribeInstanceRamRole": 11, + "DescribeInstancesFullStatus": 14, + "DescribeInstances": 10, + "DescribeInstanceStatus": 26, + "DescribeInstanceTopology": 12, + "DescribeInstanceTypeFamilies": 17, + "DescribeInstanceTypes": 17, + "DescribeInstanceVncPasswd": 10, + "DescribeInstanceVncUrl": 36, + "DescribeInvocationResults": 16, + "DescribeInvocations": 16, + "DescribeKeyPairs": 12, + "DescribeLaunchTemplates": 16, + "DescribeLaunchTemplateVersions": 16, + "DescribeLimitation": 36, + "DescribeNatGateways": 10, + "DescribeNetworkInterfacePermissions": 13, + "DescribeNetworkInterfaces": 16, + "DescribeNewProjectEipMonitorData": 16, + "DescribePhysicalConnections": 10, + "DescribePrice": 16, + "DescribeRecommendInstanceType": 10, + "DescribeRegions": 19, + "DescribeRenewalPrice": 16, + "DescribeResourceByTags": 10, + "DescribeResourcesModification": 17, + "DescribeRouterInterfaces": 10, + "DescribeRouteTables": 17, + "DescribeSecurityGroupAttribute": 133, + "DescribeSecurityGroupReferences": 16, + "DescribeSecurityGroups": 25, + "DescribeSnapshotLinks": 17, + "DescribeSnapshotMonitorData": 12, + "DescribeSnapshotPackage": 10, + "DescribeSnapshots": 26, + "DescribeSnapshotsUsage": 26, + "DescribeSpotPriceHistory": 22, + "DescribeTags": 17, + "DescribeTaskAttribute": 10, + "DescribeTasks": 11, + "DescribeUserBusinessBehavior": 13, + "DescribeUserData": 10, + "DescribeVirtualBorderRoutersForPhysicalConnection": 10, + "DescribeVirtualBorderRouters": 10, + "DescribeVpcs": 41, + "DescribeVRouters": 17, + "DescribeVSwitches": 17, + "DescribeZones": 103, + "DetachClassicLinkVpc": 14, + "DetachDisk": 17, + "DetachInstanceRamRole": 10, + "DetachKeyPair": 10, + "DetachNetworkInterface": 16, + "EipFillParams": 19, + "EipFillProduct": 13, + "EipNotifyPaid": 10, + "EnablePhysicalConnection": 10, + "ExportImage": 10, + "GetInstanceConsoleOutput": 14, + "GetInstanceScreenshot": 14, + "ImportImage": 29, + "ImportKeyPair": 10, + "InstallCloudAssistant": 10, + "InvokeCommand": 16, + "JoinResourceGroup": 10, + "JoinSecurityGroup": 66, + "LeaveSecurityGroup": 66, + "ModifyAutoSnapshotPolicyEx": 10, + "ModifyBandwidthPackageSpec": 11, + "ModifyCommand": 10, + "ModifyDeploymentSetAttribute": 10, + "ModifyDiskAttribute": 16, + "ModifyDiskChargeType": 13, + "ModifyEipAddressAttribute": 14, + "ModifyImageAttribute": 10, + "ModifyImageSharePermission": 16, + "ModifyInstanceAttribute": 22, + "ModifyInstanceAutoReleaseTime": 15, + "ModifyInstanceAutoRenewAttribute": 16, + "ModifyInstanceChargeType": 22, + "ModifyInstanceDeployment": 10, + "ModifyInstanceNetworkSpec": 36, + "ModifyInstanceSpec": 62, + "ModifyInstanceVncPasswd": 35, + "ModifyInstanceVpcAttribute": 15, + "ModifyLaunchTemplateDefaultVersion": 10, + "ModifyNetworkInterfaceAttribute": 10, + "ModifyPhysicalConnectionAttribute": 10, + "ModifyPrepayInstanceSpec": 13, + "ModifyRouterInterfaceAttribute": 10, + "ModifySecurityGroupAttribute": 10, + "ModifySecurityGroupEgressRule": 10, + "ModifySecurityGroupPolicy": 10, + "ModifySecurityGroupRule": 16, + "ModifySnapshotAttribute": 10, + "ModifyUserBusinessBehavior": 10, + "ModifyVirtualBorderRouterAttribute": 10, + "ModifyVpcAttribute": 10, + "ModifyVRouterAttribute": 10, + "ModifyVSwitchAttribute": 10, + "ReActivateInstances": 10, + "RebootInstance": 27, + "RedeployInstance": 14, + "ReInitDisk": 16, + "ReleaseDedicatedHost": 10, + "ReleaseEipAddress": 16, + "ReleasePublicIpAddress": 10, + "RemoveTags": 10, + "RenewInstance": 19, + "ReplaceSystemDisk": 36, + "ResetDisk": 36, + "ResizeDisk": 11, + "RevokeSecurityGroupEgress": 13, + "RevokeSecurityGroup": 16, + "RunInstances": 86, + "StartInstance": 46, + "StopInstance": 27, + "StopInvocation": 10, + "TerminatePhysicalConnection": 10, + "TerminateVirtualBorderRouter": 10, + "UnassignIpv6Addresses": 10, + "UnassignPrivateIpAddresses": 10, + "UnassociateEipAddress": 16 + } + } +} \ No newline at end of file diff --git a/runtime/Lib/site-packages/aliyunsdkcore/endpoint/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ef5d4a3719af1e13e1a8339aefc0531a663ff25d --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/__init__.py @@ -0,0 +1,24 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with self work for additional information +# regarding copyright ownership. The ASF licenses self file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use self file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + + +class EndpointResolver(object): + + def resolve(self, request): + pass + diff --git a/runtime/Lib/site-packages/aliyunsdkcore/endpoint/chained_endpoint_resolver.py b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/chained_endpoint_resolver.py new file mode 100644 index 0000000000000000000000000000000000000000..2af9045ff7e3a2bb5e0cad77b80fcd4896c00aae --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/chained_endpoint_resolver.py @@ -0,0 +1,85 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with self work for additional information +# regarding copyright ownership. The ASF licenses self file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use self file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +from aliyunsdkcore.acs_exception.exceptions import ClientException +from aliyunsdkcore.endpoint import EndpointResolver + +import aliyunsdkcore.acs_exception.error_code as error_code +import aliyunsdkcore.acs_exception.error_msg as error_msg + + +class ChainedEndpointResolver(EndpointResolver): + + def __init__(self, resolver_chain): + EndpointResolver.__init__(self) + self.endpoint_resolvers = resolver_chain + + def _check_product_code(self, request): + for resolver in self.endpoint_resolvers: + if resolver.is_product_code_valid(request): + return + + raise ClientException( + error_code.SDK_ENDPOINT_RESOLVING_ERROR, + error_msg.ENDPOINT_NO_PRODUCT.format( + product_code=request.product_code) + ) + + def _check_region_id(self, request): + for resolver in self.endpoint_resolvers: + if resolver.is_region_id_valid(request): + return + + raise ClientException( + error_code.SDK_ENDPOINT_RESOLVING_ERROR, + error_msg.INVALID_REGION_ID.format(region_id=request.region_id) + ) + + def _get_available_regions_hint(self, product_code): + regions = None + hint = "" + for resolver in self.endpoint_resolvers: + regions = resolver.get_valid_region_ids_by_product(product_code) + if regions is not None: + hint = "\nOr you can use the other available regions:" + for region in regions: + hint += " " + region + break + return hint + + def resolve(self, request): + for resolver in self.endpoint_resolvers: + if request.request_network and request.request_network != 'public': + if resolver.__class__.__name__ == 'LocalConfigRegionalEndpointResolver': + continue + endpoint = resolver.resolve(request) + if endpoint is not None: + return endpoint + + self._check_product_code(request) + self._check_region_id(request) + + raise ClientException( + error_code.SDK_ENDPOINT_RESOLVING_ERROR, + error_msg.ENDPOINT_NO_REGION.format( + region_id=request.region_id, + product_code=request.product_code, + more=self._get_available_regions_hint(request.product_code) + ) + ) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/endpoint/default_endpoint_resolver.py b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/default_endpoint_resolver.py new file mode 100644 index 0000000000000000000000000000000000000000..1faf90d04a4cbe09c7ee382895db8e50c75cd01a --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/default_endpoint_resolver.py @@ -0,0 +1,53 @@ +# Copyright 2018 Alibaba Cloud Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from aliyunsdkcore.endpoint import EndpointResolver +from aliyunsdkcore.endpoint.chained_endpoint_resolver import ChainedEndpointResolver +from aliyunsdkcore.endpoint.user_customized_endpoint_resolver import UserCustomizedEndpointResolver +from aliyunsdkcore.endpoint.local_config_regional_endpoint_resolver \ + import LocalConfigRegionalEndpointResolver +from aliyunsdkcore.endpoint.local_config_global_endpoint_resolver \ + import LocalConfigGlobalEndpointResolver +from aliyunsdkcore.endpoint.location_service_endpoint_resolver \ + import LocationServiceEndpointResolver +from aliyunsdkcore.endpoint.endpoint_resolver_rules import EndpointResolverRules + + +class DefaultEndpointResolver(EndpointResolver): + + # Deprecated use for add_endpoint and modify_endpoint + # Not recommended + predefined_endpoint_resolver = UserCustomizedEndpointResolver() + + def __init__(self, client, user_config=None): + + self._user_customized_endpoint_resolver = UserCustomizedEndpointResolver() + + endpoint_resolvers = [ + self.predefined_endpoint_resolver, + self._user_customized_endpoint_resolver, + LocalConfigRegionalEndpointResolver(user_config), + EndpointResolverRules(), + LocalConfigGlobalEndpointResolver(user_config), + LocationServiceEndpointResolver(client), + ] + + self._resolver = ChainedEndpointResolver(endpoint_resolvers) + + def resolve(self, request): + return self._resolver.resolve(request) + + def put_endpoint_entry(self, region_id, product_code, endpoint): + self._user_customized_endpoint_resolver.put_endpoint_entry(region_id, product_code, + endpoint) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/endpoint/endpoint_resolver_base.py b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/endpoint_resolver_base.py new file mode 100644 index 0000000000000000000000000000000000000000..10960972c4e8ec1248c0beb855345244df1bff64 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/endpoint_resolver_base.py @@ -0,0 +1,56 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with self work for additional information +# regarding copyright ownership. The ASF licenses self file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use self file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +from aliyunsdkcore.endpoint import EndpointResolver + + +class EndpointResolverBase(EndpointResolver): + + def __init__(self): + EndpointResolver.__init__(self) + self.region_headers = ['cn', 'ap', 'eu', 'rus', 'us', 'me'] + self.endpoints_data = dict() + + def fetch_endpoint_entry(self, request): + key = self.get_endpoint_key_from_request(request) + return self.endpoints_data.get(key) + + def put_endpoint_entry(self, key, endpoint): + self.endpoints_data[key] = endpoint + + def is_product_code_valid(self, request): + for key in self.endpoints_data.keys(): + if key.startswith(request.product_code_lower): + return True + return False + + def is_region_id_valid(self, request): + raise NotImplementedError() + + def get_endpoint_key_from_request(self, request): + raise NotImplementedError() + + def get_valid_region_ids_by_product(self, product_code): + # Only local config can tell + return None + + def verify_region_id(self, region_id): + region = region_id.split('-') + if len(region) >= 2 and region[0] in self.region_headers: + return True diff --git a/runtime/Lib/site-packages/aliyunsdkcore/endpoint/endpoint_resolver_rules.py b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/endpoint_resolver_rules.py new file mode 100644 index 0000000000000000000000000000000000000000..f73aeddbe4e28a26a55821f625fc47f3d84508cb --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/endpoint_resolver_rules.py @@ -0,0 +1,69 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with self work for additional information +# regarding copyright ownership. The ASF licenses self file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use self file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +from aliyunsdkcore.endpoint.local_config_regional_endpoint_resolver \ + import LocalConfigRegionalEndpointResolver + + +class EndpointResolverRules(LocalConfigRegionalEndpointResolver): + def __init__(self, *args, **kwargs): + LocalConfigRegionalEndpointResolver.__init__(self) + self.product_code_valid = False + self.region_id_valid = False + self.endpoint_map = None + self.endpoint_regional = None + self.request_network = 'public' + self.product_suffix = '' + + def resolve(self, request): + if request.endpoint_map is None or request.endpoint_regional is None: + return None + request_network = "public" if not request.request_network else request.request_network + + endpoint_regional = request.endpoint_regional + endpoint = "" + if request_network == "public": + endpoint = request.endpoint_map.get(request.region_id, "") + + if endpoint == "": + if endpoint_regional == "regional": + if not self.verify_region_id(request.region_id.lower()): + return + endpoint_domain = ".{region_id}.aliyuncs.com".format( + region_id=request.region_id.lower()) + elif endpoint_regional == "central": + endpoint_domain = ".aliyuncs.com" + else: + return None + + network = "" if request_network == "public" else "-" + request_network + suffix = "-" + request.product_suffix if request.product_suffix else "" + endpoint_param_list = [request.product_code_lower, suffix, network, endpoint_domain] + + endpoint = "".join(list(filter(lambda x: x, endpoint_param_list))) + return endpoint + + def is_product_code_valid(self, request): + return self.product_code_valid + + def is_region_id_valid(self, request): + return self.region_id_valid + + @classmethod + def get_valid_region_ids_by_product(cls, product_code): + return None diff --git a/runtime/Lib/site-packages/aliyunsdkcore/endpoint/local_config_global_endpoint_resolver.py b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/local_config_global_endpoint_resolver.py new file mode 100644 index 0000000000000000000000000000000000000000..d8d459dbc8c01720e6828b0e650788f07ff321b6 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/local_config_global_endpoint_resolver.py @@ -0,0 +1,50 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with self work for additional information +# regarding copyright ownership. The ASF licenses self file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use self file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +from aliyunsdkcore.vendored.six import iteritems + +from aliyunsdkcore.endpoint.local_config_regional_endpoint_resolver \ + import LocalConfigRegionalEndpointResolver + + +class LocalConfigGlobalEndpointResolver(LocalConfigRegionalEndpointResolver): + + def _init_local_config(self, obj): + self._init_global_endpoint_data(obj) + self._init_region_ids(obj) + self._init_location_code_mapping(obj) + + def _init_global_endpoint_data(self, obj): + if "global_endpoints" not in obj: + return + + global_endpoints = obj["global_endpoints"] + for location_service_code, endpoint in iteritems(global_endpoints): + self.put_endpoint_entry(self._make_endpoint_entry_key(location_service_code), endpoint) + + def resolve(self, request): + if request.is_open_api_endpoint() and self.is_region_id_valid(request): + return self.fetch_endpoint_entry(request) + else: + return None + + def get_endpoint_key_from_request(self, request): + return self._make_endpoint_entry_key(request.product_code) + + def _make_endpoint_entry_key(self, product_code): + return self._get_normalized_product_code(product_code) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/endpoint/local_config_regional_endpoint_resolver.py b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/local_config_regional_endpoint_resolver.py new file mode 100644 index 0000000000000000000000000000000000000000..8e9feeb93dd5db8d9e58d89f0cf3a5940f8316b3 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/local_config_regional_endpoint_resolver.py @@ -0,0 +1,108 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with self work for additional information +# regarding copyright ownership. The ASF licenses self file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use self file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +import os.path +import json + +import aliyunsdkcore +from aliyunsdkcore.vendored.six import iteritems +from aliyunsdkcore.endpoint.endpoint_resolver_base import EndpointResolverBase +from aliyunsdkcore.endpoint.resolver_endpoint_request import ResolveEndpointRequest + + +class LocalConfigRegionalEndpointResolver(EndpointResolverBase): + + ENDPOINT_JSON = os.path.join(os.path.dirname(aliyunsdkcore.__file__), + "data", "endpoints.json") + + def __init__(self, config_json_str=None): + EndpointResolverBase.__init__(self) + self._valid_region_ids = [] + self._location_code_mapping = dict() + self._regional_endpoint_data = dict() + if config_json_str: + obj = json.loads(config_json_str) + else: + obj = self._read_from_endpoints_json() + self._init_local_config(obj) + + def _init_local_config(self, obj): + self._init_regional_endpoint_data(obj) + self._init_region_ids(obj) + self._init_location_code_mapping(obj) + + def _init_regional_endpoint_data(self, obj): + if "regional_endpoints" not in obj: + return + self._regional_endpoint_data = obj["regional_endpoints"] + for code, product_data in iteritems(obj["regional_endpoints"]): + for region_id, endpoint in iteritems(product_data): + self.put_endpoint_entry(self._make_endpoint_entry_key(code, region_id), endpoint) + + def _init_region_ids(self, obj): + if "regions" not in obj: + return + self._valid_region_ids = obj["regions"] + + def _init_location_code_mapping(self, obj): + if "location_code_mapping" not in obj: + return + self._location_code_mapping = obj["location_code_mapping"] + + def _get_normalized_product_code(self, product_code): + product_code_lower = product_code.lower() + if product_code_lower in self._location_code_mapping: + return self._location_code_mapping.get(product_code_lower) + return product_code_lower + + def _read_from_endpoints_json(self): + with open(self.ENDPOINT_JSON) as fp: + return json.loads(fp.read()) + + def resolve(self, request): + if request.is_open_api_endpoint() and request.endpoint_regional is None: + return self.fetch_endpoint_entry(request) + else: + return None + + def get_endpoint_key_from_request(self, request): + return self._make_endpoint_entry_key(request.product_code_lower, request.region_id) + + def _make_endpoint_entry_key(self, product_code, region_id): + return self._get_normalized_product_code(product_code) + "." + region_id.lower() + + def is_region_id_valid(self, request): + return self.verify_region_id(request.region_id.lower()) + + def get_valid_region_ids_by_product(self, product_code): + code = self._get_normalized_product_code(product_code) + if code in self._regional_endpoint_data: + region_ids = self._regional_endpoint_data.get(code).keys() + return sorted(region_ids) + return None + + def is_product_code_valid(self, request): + + tmp_request = ResolveEndpointRequest( + request.region_id, + self._get_normalized_product_code(request.product_code), + request.location_service_code, + request.endpoint_type, + ) + return EndpointResolverBase.is_product_code_valid(self, tmp_request) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/endpoint/location/DescribeEndpointsRequest.py b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/location/DescribeEndpointsRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..e4a4dd314a978ef5e4048be4136a480dc4a8b366 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/location/DescribeEndpointsRequest.py @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +class DescribeEndpointsRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Location', '2015-06-12', 'DescribeEndpoints') + + def get_ServiceCode(self): + return self.get_query_params().get('ServiceCode') + + def set_ServiceCode(self,ServiceCode): + self.add_query_param('ServiceCode',ServiceCode) + + def get_Id(self): + return self.get_query_params().get('Id') + + def set_Id(self,Id): + self.add_query_param('Id',Id) + + def get_Type(self): + return self.get_query_params().get('Type') + + def set_Type(self,Type): + self.add_query_param('Type',Type) \ No newline at end of file diff --git a/runtime/Lib/site-packages/aliyunsdkcore/endpoint/location/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/location/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/aliyunsdkcore/endpoint/location_service_endpoint_resolver.py b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/location_service_endpoint_resolver.py new file mode 100644 index 0000000000000000000000000000000000000000..0e5b4f9808fcffb85c332c3c924b2093897016dc --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/location_service_endpoint_resolver.py @@ -0,0 +1,144 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with self work for additional information +# regarding copyright ownership. The ASF licenses self file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use self file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +import threading +import json + +from aliyunsdkcore.acs_exception.exceptions import ServerException +from aliyunsdkcore.endpoint.endpoint_resolver_base import EndpointResolverBase +from aliyunsdkcore.endpoint.location.DescribeEndpointsRequest import DescribeEndpointsRequest + +DEFAULT_LOCATION_SERVICE_ENDPOINT = "location-readonly.aliyuncs.com" + + +class LocationServiceEndpointResolver(EndpointResolverBase): + + def __init__(self, client): + EndpointResolverBase.__init__(self) + self._location_service_endpoint = DEFAULT_LOCATION_SERVICE_ENDPOINT + self._client = client + self._invalid_product_codes = set() + self._invalid_region_ids = set() + self._valid_product_codes = set() + self._valid_region_ids = set() + + def set_location_service_endpoint(self, endpoint): + self._location_service_endpoint = endpoint + + def resolve(self, request): + if not request.location_service_code: + return None + + if request.product_code_lower in self._invalid_product_codes: + return None + + if request.region_id in self._invalid_region_ids: + return None + + key = self.get_endpoint_key_from_request(request) + if key in self.endpoints_data: + # The endpoint can be None when last fetch is failed + return self.endpoints_data[key] + + lock = threading.Lock() + with lock: + return self._get_endpoint_from_location_service(key, request) + + def _get_endpoint_from_location_service(self, key, request): + # when other thread + if key in self.endpoints_data: + return self.endpoints_data.get(key) + + self._call_location_service(key, request) + + return self.endpoints_data.get(key) + + def _call_location_service(self, key, raw_request): + request = DescribeEndpointsRequest() + request.set_protocol_type("https") + request.set_accept_format("json") + request.set_Id(raw_request.region_id) + request.set_ServiceCode(raw_request.location_service_code) + request.set_Type(raw_request.endpoint_type) + request.endpoint = self._location_service_endpoint + + try: + response = self._client.do_action_with_exception(request) + except ServerException as e: + if "InvalidRegionId" == e.get_error_code() and \ + "The specified region does not exist." == e.get_error_msg(): + # No such region` + self._invalid_region_ids.add(raw_request.region_id) + self.put_endpoint_entry(key, None) + return + elif "Illegal Parameter" == e.get_error_code() and \ + "Please check the parameters" == e.get_error_msg(): + # No such product + self._invalid_product_codes.add(raw_request.product_code_lower) + self.put_endpoint_entry(key, None) + return + else: + raise e + + # As long as code gets here + # the product code and the region id is valid + # the endpoint can be still not found + self._valid_product_codes.add(raw_request.product_code_lower) + self._valid_region_ids.add(raw_request.region_id) + + found_flag = False + body = json.loads(response.decode('utf-8')) + for item in body["Endpoints"]["Endpoint"]: + + # Location return data has a typo: SerivceCode + # We still try to expect ServiceCode in case this typo would be fixed in the future + service_code = item.get("ServiceCode") or item.get("SerivceCode") + + if service_code and item.get("Type") == raw_request.endpoint_type: + found_flag = True + self.put_endpoint_entry(key, item.get("Endpoint")) + break + + if not found_flag: + self.put_endpoint_entry(key, None) + + def is_product_code_valid(self, request): + if request.location_service_code: + return request.product_code_lower not in self._invalid_product_codes + return False + + def is_region_id_valid(self, request): + return self.verify_region_id(request.region_id.lower()) + + def get_endpoint_key_from_request(self, request): + return self._make_endpoint_entry_key( + request.product_code, request.location_service_code, + request.region_id, request.endpoint_type + ) + + def _make_endpoint_entry_key(self, + product_code, + location_service_code, + region_id, endpoint_type): + return ".".join([ + product_code.lower(), + location_service_code, + region_id.lower(), + endpoint_type + ]) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/endpoint/resolver_endpoint_request.py b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/resolver_endpoint_request.py new file mode 100644 index 0000000000000000000000000000000000000000..4ddaa123ed47a62c84abba4c846cd759f3167455 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/resolver_endpoint_request.py @@ -0,0 +1,46 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with self work for additional information +# regarding copyright ownership. The ASF licenses self file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use self file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +ENDPOINT_TYPE_INNER = "innerAPI" +ENDPOINT_TYPE_OPEN = "openAPI" + + +class ResolveEndpointRequest(object): + + def __init__(self, region_id, product_code, location_service_code, endpoint_type): + + self.region_id = region_id + self.product_code = product_code + self.product_code_lower = self.product_code.lower() + + if not endpoint_type: + self.endpoint_type = ENDPOINT_TYPE_OPEN + else: + self.endpoint_type = endpoint_type + + self.location_service_code = location_service_code + + self.request_network = "public" + self.product_suffix = "" + self.endpoint_map = None + self.endpoint_regional = None + + def is_open_api_endpoint(self): + return ENDPOINT_TYPE_OPEN == self.endpoint_type + diff --git a/runtime/Lib/site-packages/aliyunsdkcore/endpoint/user_customized_endpoint_resolver.py b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/user_customized_endpoint_resolver.py new file mode 100644 index 0000000000000000000000000000000000000000..1c362fbf208c98dbe0a37831fc57b5812ad94de3 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/endpoint/user_customized_endpoint_resolver.py @@ -0,0 +1,46 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with self work for additional information +# regarding copyright ownership. The ASF licenses self file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use self file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +from aliyunsdkcore.endpoint.endpoint_resolver_base import EndpointResolverBase + + +class UserCustomizedEndpointResolver(EndpointResolverBase): + + def __init__(self): + EndpointResolverBase.__init__(self) + self._valid_region_ids = set() + + def put_endpoint_entry(self, region_id, product_code, endpoint): + EndpointResolverBase.put_endpoint_entry( + self, self._make_endpoint_entry_key(product_code, region_id), endpoint) + self._valid_region_ids.add(region_id) + + def resolve(self, request): + return self.fetch_endpoint_entry(request) + + def get_endpoint_key_from_request(self, request): + return self._make_endpoint_entry_key(request.product_code, request.region_id) + + def _make_endpoint_entry_key(self, product_code, region_id): + return product_code.lower() + "." + region_id.lower() + + def is_region_id_valid(self, request): + return self.verify_region_id(request.region_id.lower()) + + def reset(self): + self.endpoints_data = dict() diff --git a/runtime/Lib/site-packages/aliyunsdkcore/http/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/http/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/aliyunsdkcore/http/format_type.py b/runtime/Lib/site-packages/aliyunsdkcore/http/format_type.py new file mode 100644 index 0000000000000000000000000000000000000000..c8d4136e92be7171e04ca1fc3e01e2c61cdcda0d --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/http/format_type.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 + + +XML = 'XML' +JSON = 'JSON' +RAW = 'RAW' +APPLICATION_FORM = 'application/x-www-form-urlencoded' +APPLICATION_XML = 'application/xml' +APPLICATION_JSON = 'application/json' +APPLICATION_OCTET_STREAM = 'application/octet-stream' +TEXT_XML = 'text/xml' + + +def map_format_to_accept(format): + if format == XML: + return APPLICATION_XML + if format == JSON: + return APPLICATION_JSON + return APPLICATION_OCTET_STREAM + + +def map_accept_to_format(accept): + if accept.lower() == APPLICATION_XML or accept.lower() == TEXT_XML: + return XML + if accept.lower() == APPLICATION_JSON: + return JSON + return RAW diff --git a/runtime/Lib/site-packages/aliyunsdkcore/http/http_request.py b/runtime/Lib/site-packages/aliyunsdkcore/http/http_request.py new file mode 100644 index 0000000000000000000000000000000000000000..8ff713e400e2c4e3a74bca44639cdf8fab287596 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/http/http_request.py @@ -0,0 +1,108 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 + +from aliyunsdkcore.http import format_type +from aliyunsdkcore.utils import parameter_helper as helper + + +class HttpRequest: + + content_md5 = "Content-MD5" + content_length = "Content-Length" + content_type = "Content-Type" + + def __init__(self, host="", url="/", method=None, headers=None): + self.__host = host + self.__url = url + self.__method = method + self.__content_type = None + self.__content = None + self.__encoding = None + self.__headers = headers or {} + self.__body = None + + def get_host(self): + return self.__host + + def set_host(self, host): + self.__host = host + + def get_body(self): + return self.__body + + def set_body(self, body): + self.__body = body + + def get_url(self): + return self.__url + + def set_url(self, url): + self.__url = url + + def get_encoding(self): + return self.__encoding + + def set_encoding(self, encoding): + self.__encoding = encoding + + def get_content_type(self): + return self.__content_type + + def set_content_type(self, content_type): + self.__content_type = content_type + + def get_method(self): + return self.__method + + def set_method(self, method): + self.__method = method + + def get_content(self): + return self.__content + + def get_header_value(self, name): + return self.__headers.get(name) + + def put_header_parameter(self, key, value): + if key is not None and value is not None: + self.__headers[key] = value + + def remove_header_parameter(self, key): + if key is not None: + if key in self.__headers: + self.__headers.pop(key) + + def set_content(self, content, encoding, format=format_type.RAW): + self.__content = content + if content is None: + self.remove_header_parameter(self.content_md5) + self.remove_header_parameter(self.content_type) + self.remove_header_parameter(self.content_length) + self.__content_type = None + self.__encoding = None + else: + str_md5 = helper.md5_sum(content) + content_length = len(content) + self.__headers[self.content_md5] = str_md5 + self.__headers[self.content_length] = str(content_length) + self.__headers[self.content_type] = format + self.__encoding = encoding + + def get_headers(self): + return self.__headers diff --git a/runtime/Lib/site-packages/aliyunsdkcore/http/http_response.py b/runtime/Lib/site-packages/aliyunsdkcore/http/http_response.py new file mode 100644 index 0000000000000000000000000000000000000000..daec86c4eb767efeb756794cf96ec8f27b32a10e --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/http/http_response.py @@ -0,0 +1,153 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 + +import os +import logging + +from aliyunsdkcore.vendored.requests import Session, Request +from aliyunsdkcore.http.http_request import HttpRequest +from aliyunsdkcore.http import protocol_type as PT + +from aliyunsdkcore.vendored.requests import status_codes + +logger = logging.getLogger(__name__) +logger.setLevel(logging.DEBUG) +ch = logging.StreamHandler() +logger.addHandler(ch) + +DEFAULT_CONNECT_TIMEOUT = 5 + + +class HttpResponse(HttpRequest): + def __init__( + self, + host="", + url="/", + method="GET", + headers={}, + protocol=PT.HTTP, + content=None, + port=None, + key_file=None, + cert_file=None, + read_timeout=None, + connect_timeout=None, + verify=None, + session=None, + proxy=None + ): + HttpRequest.__init__( + self, + host=host, + url=url, + method=method, + headers=headers) + self.__ssl_enable = False + if protocol is PT.HTTPS: + self.__ssl_enable = True + self.__key_file = key_file + self.__cert_file = cert_file + self.__port = port + self.__connection = None + self.__read_timeout = read_timeout + self.__connect_timeout = connect_timeout + self.__verify = verify + self.__session = session + if session is None: + self.__session = Session() + self.set_body(content) + self.proxy = proxy + + def set_ssl_enable(self, enable): + self.__ssl_enable = enable + + def get_ssl_enabled(self): + return self.__ssl_enable + + @staticmethod + def prepare_http_debug(request, symbol): + base = '' + for key, value in request.headers.items(): + base += '\n%s %s : %s' % (symbol, key, value) + return base + + def do_http_debug(self, request, response): + # logger the request + request_base = '\n> %s %s HTTP/1.1' % (self.get_method().upper(), self.get_url()) + request_base += '\n> Host : %s' % self.get_host() + logger.debug(request_base + self.prepare_http_debug(request, '>')) + + # logger the response + response_base = '\n< HTTP/1.1 %s %s' % ( + response.status_code, status_codes._codes.get(response.status_code)[0].upper()) + logger.debug(response_base + self.prepare_http_debug(response, '<')) + + def get_verify_value(self): + if self.__verify is not None: + return self.__verify + return os.environ.get('ALIBABA_CLOUD_CA_BUNDLE', True) + + def get_response_object(self): + current_protocol = 'https://' if self.get_ssl_enabled() else 'http://' + host = self.get_host() + if host.startswith('https://') or\ + not host.startswith('https://') and current_protocol == 'https://': + port = ':%s' % self.__port if self.__port != 80 and self.__port != 443 else '' + else: + port = ':%s' % self.__port if self.__port != 80 else '' + + if host.startswith('http://') or host.startswith('https://'): + url = host + port + self.get_url() + else: + url = current_protocol + host + port + self.get_url() + + self.__session.cookies.clear() + + req = Request(method=self.get_method(), url=url, + data=self.get_body(), + headers=self.get_headers(), + ) + prepped = self.__session.prepare_request(req) + if not self.proxy: + proxy_https = os.environ.get('HTTPS_PROXY') or os.environ.get( + 'https_proxy') + proxy_http = os.environ.get( + 'HTTP_PROXY') or os.environ.get('http_proxy') + + self.proxy = {} + if proxy_http: + self.proxy['http'] = proxy_http + if proxy_https: + self.proxy['https'] = proxy_https + + response = self.__session.send( + prepped, + proxies=self.proxy, + timeout=(self.__connect_timeout, self.__read_timeout), + allow_redirects=False, + verify=self.get_verify_value() + ) + + http_debug = os.environ.get('DEBUG') + + if http_debug is not None and http_debug.lower() == 'sdk': + # http debug information + self.do_http_debug(prepped, response) + + return response.status_code, response.headers, response.content diff --git a/runtime/Lib/site-packages/aliyunsdkcore/http/method_type.py b/runtime/Lib/site-packages/aliyunsdkcore/http/method_type.py new file mode 100644 index 0000000000000000000000000000000000000000..4ef08bad29d8fcb6a9b4012a2fdcad71e78ed5a2 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/http/method_type.py @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 + +GET = "GET" +PUT = "PUT" +POST = "POST" +DELETE = "DELETE" +HEAD = "HEAD" +OPTIONS = "OPTIONS" diff --git a/runtime/Lib/site-packages/aliyunsdkcore/http/protocol_type.py b/runtime/Lib/site-packages/aliyunsdkcore/http/protocol_type.py new file mode 100644 index 0000000000000000000000000000000000000000..9b87408281f6afd280bf86678fb0669030731ccb --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/http/protocol_type.py @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 + +HTTP = "http" +HTTPS = "https" diff --git a/runtime/Lib/site-packages/aliyunsdkcore/profile/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/profile/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..40348ebea42b4e087b10e65d7f1eb9298608e654 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/profile/__init__.py @@ -0,0 +1 @@ +__author__ = 'Alibaba Cloud' diff --git a/runtime/Lib/site-packages/aliyunsdkcore/profile/region_provider.py b/runtime/Lib/site-packages/aliyunsdkcore/profile/region_provider.py new file mode 100644 index 0000000000000000000000000000000000000000..6887065dc450ea837c0070313e5f38e93cc460d5 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/profile/region_provider.py @@ -0,0 +1,46 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 + +""" +Region&Endpoint provider module. + +Created on 6/12/2015 + +@author: alex + +modified by wenyang@2018-03-14: + reconstruction the smelly codes and keep compatibility +""" + +from aliyunsdkcore.endpoint.default_endpoint_resolver import DefaultEndpointResolver + + +# WARNING: Deprecated Functions! +# same as modify_point +def add_endpoint(product_name, region_id, end_point): + modify_point(product_name, region_id, end_point) + + +# WARNING: Deprecated Functions! +def modify_point(product_name, region_id, end_point): + put_endpoint_entry = DefaultEndpointResolver.predefined_endpoint_resolver.put_endpoint_entry + put_endpoint_entry(region_id, product_name, end_point) + diff --git a/runtime/Lib/site-packages/aliyunsdkcore/request.py b/runtime/Lib/site-packages/aliyunsdkcore/request.py new file mode 100644 index 0000000000000000000000000000000000000000..7b8170b52666c226eaf6e031ffcb22189d26844f --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/request.py @@ -0,0 +1,575 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 +import abc +from aliyunsdkcore.vendored.six import iterkeys +from aliyunsdkcore.vendored.six import iteritems +from aliyunsdkcore.vendored.six import add_metaclass + +from aliyunsdkcore.http import protocol_type +from aliyunsdkcore.http import method_type as mt +from aliyunsdkcore.http import format_type as ft +from aliyunsdkcore.auth.composer import rpc_signature_composer as rpc_signer +from aliyunsdkcore.auth.composer import roa_signature_composer as roa_signer +from aliyunsdkcore.utils.parameter_helper import md5_sum +from aliyunsdkcore.auth.algorithm import sha_hmac1 +from aliyunsdkcore.acs_exception import exceptions +from aliyunsdkcore.acs_exception import error_code +from aliyunsdkcore.compat import ensure_string +from aliyunsdkcore.vendored.requests.structures import CaseInsensitiveDict + +""" +Acs request model. +""" + +STYLE_RPC = 'RPC' +STYLE_ROA = 'ROA' + +_default_protocol_type = protocol_type.HTTP + + +def set_default_protocol_type(user_protocol_type): + global _default_protocol_type + + if user_protocol_type == protocol_type.HTTP or user_protocol_type == protocol_type.HTTPS: + _default_protocol_type = user_protocol_type + else: + raise exceptions.ClientException( + error_code.SDK_INVALID_PARAMS, + "Invalid 'protocol_type', should be 'http' or 'https'" + ) + + +def get_default_protocol_type(): + return _default_protocol_type + + +@add_metaclass(abc.ABCMeta) +class AcsRequest: + """ + Acs request base class. This class wraps up common parameters for a request. + """ + + def __init__(self, product, version=None, + action_name=None, + location_service_code=None, + location_endpoint_type='openAPI', + accept_format=None, + protocol_type=None, + method=None): + """ + + :param product: + :param version: + :param action_name: + :param params: + :param resource_owner_account: + :param protocol_type: + :param accept_format: + :return: + """ + self._version = version + self._product = product + self._action_name = action_name + self._protocol_type = protocol_type + if self._protocol_type is None: + self._protocol_type = _default_protocol_type + + self._accept_format = accept_format + self._params = {} + self._method = method + self._header = {} + if action_name is not None: + self.add_header('x-acs-action', action_name) + if version is not None: + self.add_header('x-acs-version', version) + self._body_params = {} + self._uri_pattern = None + self._uri_params = None + self._content = None + self._location_service_code = location_service_code + self._location_endpoint_type = location_endpoint_type + self.add_header('x-sdk-invoke-type', 'normal') + self.endpoint = None + self._extra_user_agent = {} + self.string_to_sign = '' + self._request_connect_timeout = None + self._request_read_timeout = None + self.request_network = "public" + self.product_suffix = "" + self.endpoint_map = None + self.endpoint_regional = None + + def add_query_param(self, k, v): + self._params[k] = v + + def add_body_params(self, k, v): + self._body_params[k] = v + + def get_body_params(self): + return self._body_params + + def get_uri_pattern(self): + return self._uri_pattern + + def get_uri_params(self): + return self._uri_params + + def get_product(self): + return self._product + + def get_version(self): + return self._version + + def get_action_name(self): + return self._action_name + + def get_accept_format(self): + return self._accept_format + + def get_protocol_type(self): + return self._protocol_type + + def get_query_params(self): + return self._params + + def get_method(self): + return self._method + + def set_uri_pattern(self, pattern): + self._uri_pattern = pattern + + def set_uri_params(self, params): + self._uri_params = params + + def set_method(self, method): + self._method = method + + def set_product(self, product): + self._product = product + + def set_version(self, version): + self._header['x-acs-version'] = version + self._version = version + + def set_action_name(self, action_name): + self._header['x-acs-action'] = action_name + self._action_name = action_name + + def set_accept_format(self, accept_format): + self._accept_format = accept_format + + def set_protocol_type(self, protocol_type): + self._protocol_type = protocol_type + + def set_query_params(self, params): + self._params = params + + def set_body_params(self, body_params): + self._body_params = body_params + + def set_content(self, content): + """ + + :param content: ByteArray + :return: + """ + self._content = content + + def get_content(self): + """ + + :return: ByteArray + """ + return self._content + + def get_headers(self): + """ + + :return: Dict + """ + return self._header + + def set_headers(self, headers): + """ + + :param headers: Dict + :return: + """ + self._header = headers + + def add_header(self, k, v): + self._header[k] = v + + def set_user_agent(self, agent): + self.add_header('User-Agent', agent) + + def append_user_agent(self, key, value): + self._extra_user_agent.update({key: value}) + + def request_user_agent(self): + request_user_agent = {} + if 'User-Agent' in self.get_headers(): + request_user_agent.update({ + 'request': self.get_headers().get('User-Agent') + }) + + else: + request_user_agent.update(self._extra_user_agent) + + return CaseInsensitiveDict(request_user_agent) + + def set_location_service_code(self, location_service_code): + self._location_service_code = location_service_code + + def get_location_service_code(self): + return self._location_service_code + + def get_location_endpoint_type(self): + return self._location_endpoint_type + + def set_content_type(self, content_type): + self.add_header("Content-Type", content_type) + + @abc.abstractmethod + def get_style(self): + pass + + @abc.abstractmethod + def get_url(self, region_id, ak, secret): + pass + + @abc.abstractmethod + def get_signed_header(self, region_id, ak, secret): + pass + + def set_endpoint(self, endpoint): + self.endpoint = endpoint + + def get_connect_timeout(self): + return self._request_connect_timeout + + def set_connect_timeout(self, connect_timeout): + self._request_connect_timeout = connect_timeout + + def get_read_timeout(self): + return self._request_read_timeout + + def set_read_timeout(self, read_timeout): + self._request_read_timeout = read_timeout + + +class RpcRequest(AcsRequest): + """ + Class to compose an RPC style request with. + """ + + def __init__( + self, + product, + version, + action_name, + location_service_code=None, + location_endpoint_type='openAPI', + format=None, + protocol=None, + signer=sha_hmac1): + AcsRequest.__init__( + self, + product, + version, + action_name, + location_service_code, + location_endpoint_type, + format, + protocol, + mt.GET) + self._style = STYLE_RPC + self._signer = signer + + def get_style(self): + return self._style + + def _get_sign_params(self): + req_params = self.get_query_params() + if req_params is None: + req_params = {} + req_params['Version'] = self.get_version() + req_params['Action'] = self.get_action_name() + req_params['Format'] = self.get_accept_format() + + return req_params + + def get_url(self, region_id, access_key_id, access_key_secret): + sign_params = dict(self._get_sign_params()) + if 'RegionId' not in iterkeys(sign_params): + sign_params['RegionId'] = region_id + url, string_to_sign = rpc_signer.get_signed_url( + sign_params, + access_key_id, + access_key_secret, + self.get_accept_format(), + self.get_method(), + self.get_body_params(), + self._signer) + self.string_to_sign = string_to_sign + return url + + def get_signed_header(self, region_id=None, ak=None, secret=None): + headers = {} + for headerKey, headerValue in iteritems(self.get_headers()): + if headerKey.startswith("x-acs-") or headerKey.startswith("x-sdk-"): + headers[headerKey] = headerValue + return headers + + +class RoaRequest(AcsRequest): + """ + Class to compose an ROA style request with. + """ + + def __init__( + self, + product, + version, + action_name, + location_service_code=None, + location_endpoint_type='openAPI', + method=None, + headers=None, + uri_pattern=None, + path_params=None, + protocol=None): + """ + + :param product: String, mandatory + :param version: String, mandatory + :param action_name: String, mandatory + :param method: String + :param headers: Dict + :param uri_pattern: String + :param path_params: Dict + :param protocol: String + :return: + """ + AcsRequest.__init__( + self, + product, + version, + action_name, + location_service_code, + location_endpoint_type, + ft.RAW, + protocol, + method) + self._style = STYLE_ROA + self._method = method + if headers is not None: + self._header = headers + self._uri_pattern = uri_pattern + self._path_params = path_params + + def get_style(self): + """ + + :return: String + """ + return self._style + + def get_path_params(self): + return self._path_params + + def set_path_params(self, path_params): + self._path_params = path_params + + def add_path_param(self, k, v): + if self._path_params is None: + self._path_params = {} + self._path_params[k] = v + + def _get_sign_params(self): + req_params = self.get_query_params() + if req_params is None: + req_params = {} + self.add_header("x-acs-version", self.get_version()) + # req_params['Version'] = self.get_version() + # req_params['Action'] = self.get_action_name() + # req_params['Format'] = self.get_accept_format() + return req_params + + def get_signed_header(self, region_id, ak, secret): + """ + Generate signed header + :param region_id: String + :param ak: String + :param secret: String + :return: Dict + """ + sign_params = dict(self._get_sign_params()) + if self.get_content() is not None: + self.add_header( + 'Content-MD5', md5_sum(self.get_content())) + if 'RegionId' not in sign_params.keys(): + sign_params['RegionId'] = region_id + self.add_header('x-acs-region-id', str(region_id)) + + signed_headers, sign_to_string = roa_signer.get_signature_headers( + sign_params, + ak, + secret, + self.get_accept_format(), + self.get_headers().copy(), + self.get_uri_pattern(), + self.get_path_params(), + self.get_method()) + self.string_to_sign = sign_to_string + return signed_headers + + def get_url(self, region_id, ak=None, secret=None): + """ + Compose request url without domain + :param region_id: String + :return: String + """ + sign_params = dict(self.get_query_params()) + if 'RegionId' not in sign_params.keys(): + sign_params['RegionId'] = region_id + url = roa_signer.get_url( + self.get_uri_pattern(), + sign_params, + self.get_path_params()) + return url + + +class CommonRequest(AcsRequest): + def __init__(self, domain=None, version=None, action_name=None, uri_pattern=None, product=None, + location_endpoint_type='openAPI'): + super(CommonRequest, self).__init__(product, version, action_name) + + self.request = None + self.endpoint = domain + self._version = version + self._action_name = action_name + self._uri_pattern = uri_pattern + self._product = product + self._location_endpoint_type = location_endpoint_type + self._signer = sha_hmac1 + self.add_header('x-sdk-invoke-type', 'common') + self._path_params = None + self._method = "GET" + + def get_path_params(self): + return self._path_params + + def set_path_params(self, path_params): + self._path_params = path_params + + def add_path_param(self, k, v): + if self._path_params is None: + self._path_params = {} + self._path_params[k] = v + + def set_domain(self, domain): + self.endpoint = domain + + def get_domain(self): + return self.endpoint + + def set_uri_pattern(self, uri_pattern): + self._uri_pattern = uri_pattern + + def get_uri_pattern(self): + return self._uri_pattern + + def set_product(self, product): + self._product = product + + def get_product(self): + return self._product + + def trans_to_acs_request(self): + if not self._version: + raise exceptions.ClientException( + error_code.SDK_INVALID_PARAMS, + 'common params [version] is required, cannot be empty') + if not self._action_name and not self._uri_pattern: + raise exceptions.ClientException( + error_code.SDK_INVALID_PARAMS, + 'At least one of [action] and [uri_pattern] has a value') + if not self.endpoint and not self._product: + raise exceptions.ClientException( + error_code.SDK_INVALID_PARAMS, + 'At least one of [domain] and [product_name] has a value') + + if self._uri_pattern: + self._style = STYLE_ROA + self.request = RoaRequest(product=self.get_product(), version=self.get_version(), + action_name=self.get_action_name(), + location_endpoint_type=self.get_location_endpoint_type() + ) + self.fill_params() + else: + self._style = STYLE_RPC + self.request = RpcRequest(product=self.get_product(), version=self.get_version(), + action_name=self.get_action_name(), + location_endpoint_type=self.get_location_endpoint_type(), + ) + self.fill_params() + + def get_style(self): + return self._style + + def get_url(self, region_id, ak, secret): + return self.request.get_url(region_id, ak, secret) + + def get_signed_header(self, region_id, access_key_id, access_key_secret): + return self.request.get_signed_header(region_id, access_key_id, access_key_secret) + + def fill_params(self): + + self.request.set_uri_pattern(self.get_uri_pattern()) + + self.request.set_uri_params(self.get_uri_params()) + + if self.get_style() == STYLE_ROA: + self.request.set_path_params(self.get_path_params()) + + self.request.set_method(self.get_method()) + + self.request.set_product(self.get_product()) + + self.request.set_version(self.get_version()) + + self.request.set_action_name(self.get_action_name()) + + self.request.set_accept_format(self.get_accept_format()) + + self.request.set_protocol_type(self.get_protocol_type()) + + self.request.set_query_params(self.get_query_params()) + + self.request.set_content(self.get_content()) + + self.request.set_headers(self.get_headers()) + + self.request.set_location_service_code( + self.get_location_service_code()) + + self.request.set_body_params(self.get_body_params()) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/retry/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/retry/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0f8bafbba1c11ec89ff8da19839750d1e81a5cd3 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/retry/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2019 Alibaba Cloud Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/runtime/Lib/site-packages/aliyunsdkcore/retry/backoff_strategy.py b/runtime/Lib/site-packages/aliyunsdkcore/retry/backoff_strategy.py new file mode 100644 index 0000000000000000000000000000000000000000..0dad46b68f643afcf75287794e7591f3016465cb --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/retry/backoff_strategy.py @@ -0,0 +1,87 @@ +# Copyright 2019 Alibaba Cloud Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import random +from aliyunsdkcore.retry.retry_condition import RetryCondition + + +class BackoffStrategy(object): + + def compute_delay_before_next_retry(self, retry_policy_context): + """Compute delay for request need to be retried, in milliseconds""" + pass + + +class FixedDelayStrategy(BackoffStrategy): + + def __init__(self, fixed_delay): + self.fixed_delay = fixed_delay + + def compute_delay_before_next_retry(self, retry_policy_context): + return self.fixed_delay + + +class NoDelayStrategy(FixedDelayStrategy): + + def __init__(self): + FixedDelayStrategy.__init__(self, 0) + + +class ExponentialBackoffStrategy(BackoffStrategy): + + MAX_RETRY_LIMIT = 30 # to avoid integer overflow during delay calculation + + def __init__(self, base_delay_in_milliseconds, max_delay_in_milliseconds): + self.base_delay_in_milliseconds = base_delay_in_milliseconds + self.max_delay_in_milliseconds = max_delay_in_milliseconds + + def compute_delay_before_next_retry(self, retry_policy_context): + retries = min(self.MAX_RETRY_LIMIT, retry_policy_context.retries_attempted) + delay = min(self.max_delay_in_milliseconds, self.base_delay_in_milliseconds << retries) + return delay + + +class JitteredExponentialBackoffStrategy(ExponentialBackoffStrategy): + + def compute_delay_before_next_retry(self, retry_policy_context): + delay = ExponentialBackoffStrategy.compute_delay_before_next_retry(self, + retry_policy_context) + return delay / 2 + random.randint(0, int(delay / 2)) + + +class DefaultMixedBackoffStrategy(BackoffStrategy): + + # in milliseconds + SDK_DEFAULT_BASE_DELAY = 100 + SDK_DEFAULT_TROTTLED_BASE_DELAY = 500 + SDK_DEFAULT_MAX_BACKOFF = 20 * 1000 + + def __init__(self): + self._default_backoff_strategy = ExponentialBackoffStrategy( + self.SDK_DEFAULT_BASE_DELAY, + self.SDK_DEFAULT_MAX_BACKOFF + ) + self._default_throttled_backoff_strategy = JitteredExponentialBackoffStrategy( + self.SDK_DEFAULT_TROTTLED_BASE_DELAY, + self.SDK_DEFAULT_MAX_BACKOFF + ) + + def compute_delay_before_next_retry(self, retry_policy_context): + retryable = retry_policy_context.retryable + if retryable & RetryCondition.SHOULD_RETRY_WITH_THROTTLING_BACKOFF: + return self._default_throttled_backoff_strategy.compute_delay_before_next_retry( + retry_policy_context) + else: + return self._default_backoff_strategy.compute_delay_before_next_retry( + retry_policy_context) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/retry/retry_condition.py b/runtime/Lib/site-packages/aliyunsdkcore/retry/retry_condition.py new file mode 100644 index 0000000000000000000000000000000000000000..2718bc3252350bf3841e40143458d2df1a41cb29 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/retry/retry_condition.py @@ -0,0 +1,223 @@ +# Copyright 2019 Alibaba Cloud Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import jmespath +import logging + +import aliyunsdkcore.utils +import aliyunsdkcore.utils.validation as validation +from aliyunsdkcore.acs_exception.exceptions import ClientException, ServerException +import aliyunsdkcore.acs_exception.error_code as error_code + +logger = logging.getLogger(__name__) + + +def _find_data_in_retry_config(key_name, request, retry_config): + if request.get_product() is None: + return None + path = '"{0}"."{1}"."{2}"'.format(request.get_product().lower(), + request.get_version(), + key_name) + return jmespath.search(path, retry_config) + + +class RetryCondition(object): + + BLANK_STATUS = 0 + NO_RETRY = 1 + SHOULD_RETRY = 2 + SHOULD_RETRY_WITH_CLIENT_TOKEN = 4 + SHOULD_RETRY_WITH_THROTTLING_BACKOFF = 8 + + def should_retry(self, retry_policy_context): + """Decide whether the previous request should be retried.""" + pass + + +class NoRetryCondition(RetryCondition): + + def should_retry(self, retry_policy_context): + return RetryCondition.NO_RETRY + + +class MaxRetryTimesCondition(RetryCondition): + + def __init__(self, max_retry_times): + validation.assert_integer_positive(max_retry_times, "max_retry_times") + self.max_retry_times = max_retry_times + + def should_retry(self, retry_policy_context): + + if retry_policy_context.retries_attempted < self.max_retry_times: + return RetryCondition.SHOULD_RETRY + else: + logger.debug("Reached the maximum number of retry. Attempts:%d", + retry_policy_context.retries_attempted) + return RetryCondition.NO_RETRY + + +class RetryOnExceptionCondition(RetryCondition): + + def __init__(self, retry_config): + self.retry_config = retry_config + + def should_retry(self, retry_policy_context): + request = retry_policy_context.original_request + exception = retry_policy_context.exception + + if isinstance(exception, ClientException): + if exception.get_error_code() == error_code.SDK_HTTP_ERROR: + + logger.debug("Retryable ClientException occurred. ClientException:%s", + exception) + return RetryCondition.SHOULD_RETRY + + if isinstance(exception, ServerException): + error_code_ = exception.get_error_code() + normal_errors = _find_data_in_retry_config("RetryableNormalErrors", + request, + self.retry_config) + if isinstance(normal_errors, list) and error_code_ in normal_errors: + logger.debug("Retryable ServerException occurred. ServerException:%s", + exception) + return RetryCondition.SHOULD_RETRY + + throttling_errors = _find_data_in_retry_config("RetryableThrottlingErrors", + request, + self.retry_config) + if isinstance(throttling_errors, list) and error_code_ in throttling_errors: + logger.debug("Retryable ThrottlingError occurred. ThrottlingError:%s", + exception) + return RetryCondition.SHOULD_RETRY | \ + RetryCondition.SHOULD_RETRY_WITH_THROTTLING_BACKOFF + + return RetryCondition.NO_RETRY + + +class RetryOnHttpStatusCondition(RetryCondition): + + DEFAULT_RETRYABLE_HTTP_STATUS_LIST = [ + 500, 502, 503, 504 + ] + + def __init__(self, retryable_http_status_list=None): + if retryable_http_status_list: + self.retryable_http_status_list = retryable_http_status_list + else: + self.retryable_http_status_list = self.DEFAULT_RETRYABLE_HTTP_STATUS_LIST + + def should_retry(self, retry_policy_context): + if retry_policy_context.http_status_code in self.retryable_http_status_list: + logger.debug( + "Retryable HTTP error occurred. HTTP status code: %s", + retry_policy_context.http_status_code) + return RetryCondition.SHOULD_RETRY + else: + return RetryCondition.NO_RETRY + + +class RetryOnApiCondition(RetryCondition): + + def __init__(self, retry_config): + self.retry_config = retry_config + + def should_retry(self, retry_policy_context): + request = retry_policy_context.original_request + retryable_apis = _find_data_in_retry_config("RetryableAPIs", request, self.retry_config) + if isinstance(retryable_apis, list) and request.get_action_name() in retryable_apis: + return RetryCondition.SHOULD_RETRY + else: + return RetryCondition.NO_RETRY + + +class RetryOnApiWithClientTokenCondition(RetryCondition): + + def __init__(self, retry_config): + self.retry_config = retry_config + + def should_retry(self, retry_policy_context): + request = retry_policy_context.original_request + retryable_apis = _find_data_in_retry_config( + "RetryableAPIsWithClientToken", request, self.retry_config) + if isinstance(retryable_apis, list) and request.get_action_name() in retryable_apis: + return RetryCondition.SHOULD_RETRY | RetryCondition.SHOULD_RETRY_WITH_THROTTLING_BACKOFF + else: + return RetryCondition.NO_RETRY + + +class AndRetryCondition(RetryCondition): + + def __init__(self, conditions): + self.conditions = conditions + + def should_retry(self, retry_policy_context): + retryable = RetryCondition.BLANK_STATUS + for condition in self.conditions: + retryable |= condition.should_retry(retry_policy_context) + return retryable + + +class OrRetryCondition(RetryCondition): + + def __init__(self, conditions): + self.conditions = conditions + + def should_retry(self, retry_policy_context): + retryable = RetryCondition.BLANK_STATUS + no_retry_flag = RetryCondition.NO_RETRY + mask = RetryCondition.SHOULD_RETRY + mask |= RetryCondition.SHOULD_RETRY_WITH_CLIENT_TOKEN + mask |= RetryCondition.SHOULD_RETRY_WITH_THROTTLING_BACKOFF + + for condition in self.conditions: + ret = condition.should_retry(retry_policy_context) + retryable |= ret & mask + no_retry_flag &= ret & RetryCondition.NO_RETRY + return retryable | no_retry_flag + + +class MixedRetryCondition(RetryCondition): + + def __init__(self, max_retry_times, retry_config): + RetryCondition.__init__(self) + self._inner_condition = AndRetryCondition([ + MaxRetryTimesCondition(max_retry_times), + OrRetryCondition([ + RetryOnApiCondition(retry_config), + RetryOnApiWithClientTokenCondition(retry_config), + ]), + OrRetryCondition([ + RetryOnExceptionCondition(retry_config), + RetryOnHttpStatusCondition(), + ]), + ]) + + def should_retry(self, retry_policy_context): + return self._inner_condition.should_retry(retry_policy_context) + + +class DefaultConfigRetryCondition(MixedRetryCondition): + + DEFAULT_MAX_RETRY_TIMES = 3 + RETRY_CONFIG_FILE = "retry_config.json" + _loaded_retry_config = None + + def __init__(self, max_retry_times=None): + if not self._loaded_retry_config: + self._loaded_retry_config = aliyunsdkcore.utils._load_json_from_data_dir( + self.RETRY_CONFIG_FILE) + + if max_retry_times is None: + max_retry_times = self.DEFAULT_MAX_RETRY_TIMES + MixedRetryCondition.__init__(self, max_retry_times, self._loaded_retry_config) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/retry/retry_policy.py b/runtime/Lib/site-packages/aliyunsdkcore/retry/retry_policy.py new file mode 100644 index 0000000000000000000000000000000000000000..0283fb80b775895d3d70ef762d2553d15eb5073b --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/retry/retry_policy.py @@ -0,0 +1,41 @@ +# Copyright 2019 Alibaba Cloud Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from aliyunsdkcore.retry.retry_condition import * +from aliyunsdkcore.retry.backoff_strategy import * + + +class RetryPolicy(RetryCondition, BackoffStrategy): + + def __init__(self, retry_condition, backoff_strategy): + self.retry_condition = retry_condition + self.backoff_strategy = backoff_strategy + + def should_retry(self, retry_policy_context): + return self.retry_condition.should_retry(retry_policy_context) + + def compute_delay_before_next_retry(self, retry_policy_context): + return self.backoff_strategy.compute_delay_before_next_retry( + retry_policy_context) + + +PREDEFINED_DEFAULT_RETRY_POLICY = RetryPolicy(DefaultConfigRetryCondition(), + DefaultMixedBackoffStrategy()) +NO_RETRY_POLICY = RetryPolicy(NoRetryCondition(), NoDelayStrategy()) + + +def get_default_retry_policy(max_retry_times=None): + return RetryPolicy(DefaultConfigRetryCondition(max_retry_times=max_retry_times), + DefaultMixedBackoffStrategy()) + diff --git a/runtime/Lib/site-packages/aliyunsdkcore/retry/retry_policy_context.py b/runtime/Lib/site-packages/aliyunsdkcore/retry/retry_policy_context.py new file mode 100644 index 0000000000000000000000000000000000000000..11ee9497571dcb6a0a4793f9165eb771ea86212c --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/retry/retry_policy_context.py @@ -0,0 +1,25 @@ +# Copyright 2019 Alibaba Cloud Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from aliyunsdkcore.retry.retry_condition import RetryCondition + + +class RetryPolicyContext: + + def __init__(self, original_request, exception, retries_attempted, http_status_code): + self.original_request = original_request + self.exception = exception + self.retries_attempted = retries_attempted + self.http_status_code = http_status_code + self.retryable = RetryCondition.BLANK_STATUS diff --git a/runtime/Lib/site-packages/aliyunsdkcore/utils/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..adbafd8422efdb38330016def02fa8ae159c41ef --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/utils/__init__.py @@ -0,0 +1,24 @@ +# Copyright 2019 Alibaba Cloud Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json +import os.path +import aliyunsdkcore + + +def _load_json_from_data_dir(basename): + base_dir = os.path.dirname(os.path.abspath(aliyunsdkcore.__file__)) + json_file = os.path.join(base_dir, "data", basename) + with open(json_file) as fp: + return json.loads(fp.read()) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/utils/parameter_helper.py b/runtime/Lib/site-packages/aliyunsdkcore/utils/parameter_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..a20df37b3030f7d7a817147e2b982fe272e5f152 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/utils/parameter_helper.py @@ -0,0 +1,99 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding=utf-8 + +import hashlib +import base64 +import socket +import uuid +import time +import xml.etree.cElementTree as EleTree + +from aliyunsdkcore.compat import ensure_bytes, ensure_string + +TIME_ZONE = "GMT" +FORMAT_ISO_8601 = "%Y-%m-%dT%H:%M:%SZ" +FORMAT_RFC_2616 = "%a, %d %b %Y %H:%M:%S GMT" + + +def get_uuid(): + name = socket.gethostname() + str(uuid.uuid1()) + namespace = uuid.NAMESPACE_URL + return str(uuid.uuid5(namespace, name)) + + +def get_iso_8061_date(): + return time.strftime(FORMAT_ISO_8601, time.gmtime()) + + +def get_rfc_2616_date(): + return time.strftime(FORMAT_RFC_2616, time.gmtime()) + + +def md5_sum(content): + content_bytes = ensure_bytes(content) + md5_bytes = hashlib.md5(content_bytes).digest() + return ensure_string(base64.standard_b64encode(md5_bytes)) + + +def _get_xml_by_list(elem, val, parent_element): + i = 0 + tag_name = elem.tag + if val.__len__() > 0: + _get_xml_factory(elem, val[0], parent_element) + + for item in val: + if i > 0: + sub_elem = EleTree.SubElement(parent_element, tag_name) + _get_xml_factory(sub_elem, item, parent_element) + i = i + 1 + + +def _get_xml_by_dict(elem, val): + for k in val: + sub_elem = EleTree.SubElement(elem, k) + _get_xml_factory(sub_elem, val[k], elem) + + +def _get_xml_factory(elem, val, parent_element=None): + if val is None: + return + + if isinstance(val, dict): + _get_xml_by_dict(elem, val) + elif isinstance(val, (list, tuple, set)): + if parent_element is None: + raise ValueError("parent_element") + _get_xml_by_list(elem, val, parent_element) + else: + elem.text = str(val) + + +def to_xml(dic): + if dic is None: + return + + if dic.__len__() == 0: + return "" + else: + result_xml = "" + for k in dic: + elem = EleTree.Element(k) + _get_xml_factory(elem, dic[k]) + result_xml += bytes.decode(EleTree.tostring(elem), encoding="utf-8") + return result_xml diff --git a/runtime/Lib/site-packages/aliyunsdkcore/utils/validation.py b/runtime/Lib/site-packages/aliyunsdkcore/utils/validation.py new file mode 100644 index 0000000000000000000000000000000000000000..8ceecd5b8ac4e4a37d1920d57d24e8e9bd1941f4 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/utils/validation.py @@ -0,0 +1,32 @@ +# Copyright 2019 Alibaba Cloud Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import re + +from aliyunsdkcore.acs_exception.exceptions import ClientException +import aliyunsdkcore.acs_exception.error_code as error_code + + +def assert_integer_positive(integer, name): + if isinstance(integer, int) and integer > 0: + return + raise ClientException(error_code.SDK_INVALID_PARAMETER, + "{0} should be a positive integer.".format(name)) + + +def validate_pattern(prop, prop_name, pattern): + match_obj = re.search(pattern, prop, re.M | re.I) + if not match_obj: + raise ClientException(error_code.SDK_INVALID_PARAMETER, + 'The parameter %s not match with %s' % (prop_name, pattern)) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b8a24b1a8766706c140465de646875bda684d377 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/__init__.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- + +# __ +# /__) _ _ _ _ _/ _ +# / ( (- (/ (/ (- _) / _) +# / + +""" +Requests HTTP Library +~~~~~~~~~~~~~~~~~~~~~ + +Requests is an HTTP library, written in Python, for human beings. Basic GET +usage: + + >>> import requests + >>> r = requests.get('https://www.python.org') + >>> r.status_code + 200 + >>> 'Python is a programming language' in r.content + True + +... or POST: + + >>> payload = dict(key1='value1', key2='value2') + >>> r = requests.post('http://httpbin.org/post', data=payload) + >>> print(r.text) + { + ... + "form": { + "key2": "value2", + "key1": "value1" + }, + ... + } + +The other HTTP methods are supported - see `requests.api`. Full documentation +is at . + +:copyright: (c) 2017 by Kenneth Reitz. +:license: Apache 2.0, see LICENSE for more details. +""" + +__title__ = 'requests' +__version__ = '2.18.3' + +# Attempt to enable urllib3's SNI support, if possible +try: + from .packages.urllib3.contrib import pyopenssl + pyopenssl.inject_into_urllib3() +except ImportError: + pass + + +from . import utils +from .models import Request, Response, PreparedRequest +from .api import request, get, head, post, patch, put, delete, options +from .sessions import session, Session +from .status_codes import codes +from .exceptions import ( + RequestException, Timeout, URLRequired, + TooManyRedirects, HTTPError, ConnectionError, + FileModeWarning, ConnectTimeout, ReadTimeout +) + +# Set default logging handler to avoid "No handler found" warnings. +import logging +try: # Python 2.7+ + from logging import NullHandler +except ImportError: + class NullHandler(logging.Handler): + def emit(self, record): + pass + +logging.getLogger(__name__).addHandler(NullHandler()) +logging.getLogger(__name__).setLevel(logging.CRITICAL) + + diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/__version__.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/__version__.py new file mode 100644 index 0000000000000000000000000000000000000000..2d60bcc0d02339cb4411bfffd7e929faf65554d4 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/__version__.py @@ -0,0 +1,14 @@ +# .-. .-. .-. . . .-. .-. .-. .-. +# |( |- |.| | | |- `-. | `-. +# ' ' `-' `-`.`-' `-' `-' ' `-' + +__title__ = 'requests' +__description__ = 'Python HTTP for Humans.' +__url__ = 'http://python-requests.org' +__version__ = '2.18.3' +__build__ = 0x021803 +__author__ = 'Kenneth Reitz' +__author_email__ = 'me@kennethreitz.org' +__license__ = 'Apache 2.0' +__copyright__ = 'Copyright 2017 Kenneth Reitz' +__cake__ = u'\u2728 \U0001f370 \u2728' diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/_internal_utils.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/_internal_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..759d9a56ba0102bb3b7b3abfcfae6731a2ecc243 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/_internal_utils.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- + +""" +requests._internal_utils +~~~~~~~~~~~~~~ + +Provides utility functions that are consumed internally by Requests +which depend on extremely few external helpers (such as compat) +""" + +from .compat import is_py2, builtin_str, str + + +def to_native_string(string, encoding='ascii'): + """Given a string object, regardless of type, returns a representation of + that string in the native string type, encoding and decoding where + necessary. This assumes ASCII unless told otherwise. + """ + if isinstance(string, builtin_str): + out = string + else: + if is_py2: + out = string.encode(encoding) + else: + out = string.decode(encoding) + + return out + + +def unicode_is_ascii(u_string): + """Determine if unicode string only contains ASCII characters. + + :param str u_string: unicode string to check. Must be unicode + and not Python 2 `str`. + :rtype: bool + """ + assert isinstance(u_string, str) + try: + u_string.encode('ascii') + return True + except UnicodeEncodeError: + return False diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/adapters.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/adapters.py new file mode 100644 index 0000000000000000000000000000000000000000..325207fa978b9e56d43d48e57a63d453abe0bb17 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/adapters.py @@ -0,0 +1,525 @@ +# -*- coding: utf-8 -*- + +""" +requests.adapters +~~~~~~~~~~~~~~~~~ + +This module contains the transport adapters that Requests uses to define +and maintain connections. +""" + +import os.path +import socket + +from .packages.urllib3.poolmanager import PoolManager, proxy_from_url +from .packages.urllib3.response import HTTPResponse +from .packages.urllib3.util import Timeout as TimeoutSauce +from .packages.urllib3.util.retry import Retry +from .packages.urllib3.exceptions import ClosedPoolError +from .packages.urllib3.exceptions import ConnectTimeoutError +from .packages.urllib3.exceptions import HTTPError as _HTTPError +from .packages.urllib3.exceptions import MaxRetryError +from .packages.urllib3.exceptions import NewConnectionError +from .packages.urllib3.exceptions import ProxyError as _ProxyError +from .packages.urllib3.exceptions import ProtocolError +from .packages.urllib3.exceptions import ReadTimeoutError +from .packages.urllib3.exceptions import SSLError as _SSLError +from .packages.urllib3.exceptions import ResponseError + +from .models import Response +from .compat import urlparse, basestring +from .utils import (DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers, + prepend_scheme_if_needed, get_auth_from_url, urldefragauth, + select_proxy) +from .structures import CaseInsensitiveDict +from .cookies import extract_cookies_to_jar +from .exceptions import (ConnectionError, ConnectTimeout, ReadTimeout, SSLError, + ProxyError, RetryError, InvalidSchema) +from .auth import _basic_auth_str + +try: + from .packages.urllib3.contrib.socks import SOCKSProxyManager +except ImportError: + def SOCKSProxyManager(*args, **kwargs): + raise InvalidSchema("Missing dependencies for SOCKS support.") + +DEFAULT_POOLBLOCK = False +DEFAULT_POOLSIZE = 10 +DEFAULT_RETRIES = 0 +DEFAULT_POOL_TIMEOUT = None + + +class BaseAdapter(object): + """The Base Transport Adapter""" + + def __init__(self): + super(BaseAdapter, self).__init__() + + def send(self, request, stream=False, timeout=None, verify=True, + cert=None, proxies=None): + """Sends PreparedRequest object. Returns Response object. + + :param request: The :class:`PreparedRequest ` being sent. + :param stream: (optional) Whether to stream the request content. + :param timeout: (optional) How long to wait for the server to send + data before giving up, as a float, or a :ref:`(connect timeout, + read timeout) ` tuple. + :type timeout: float or tuple + :param verify: (optional) Either a boolean, in which case it controls whether we verify + the server's TLS certificate, or a string, in which case it must be a path + to a CA bundle to use + :param cert: (optional) Any user-provided SSL certificate to be trusted. + :param proxies: (optional) The proxies dictionary to apply to the request. + """ + raise NotImplementedError + + def close(self): + """Cleans up adapter specific items.""" + raise NotImplementedError + + +class HTTPAdapter(BaseAdapter): + """The built-in HTTP Adapter for urllib3. + + Provides a general-case interface for Requests sessions to contact HTTP and + HTTPS urls by implementing the Transport Adapter interface. This class will + usually be created by the :class:`Session ` class under the + covers. + + :param pool_connections: The number of urllib3 connection pools to cache. + :param pool_maxsize: The maximum number of connections to save in the pool. + :param max_retries: The maximum number of retries each connection + should attempt. Note, this applies only to failed DNS lookups, socket + connections and connection timeouts, never to requests where data has + made it to the server. By default, Requests does not retry failed + connections. If you need granular control over the conditions under + which we retry a request, import urllib3's ``Retry`` class and pass + that instead. + :param pool_block: Whether the connection pool should block for connections. + + Usage:: + + >>> import requests + >>> s = requests.Session() + >>> a = requests.adapters.HTTPAdapter(max_retries=3) + >>> s.mount('http://', a) + """ + __attrs__ = ['max_retries', 'config', '_pool_connections', '_pool_maxsize', + '_pool_block'] + + def __init__(self, pool_connections=DEFAULT_POOLSIZE, + pool_maxsize=DEFAULT_POOLSIZE, max_retries=DEFAULT_RETRIES, + pool_block=DEFAULT_POOLBLOCK): + if max_retries == DEFAULT_RETRIES: + self.max_retries = Retry(0, read=False) + else: + self.max_retries = Retry.from_int(max_retries) + self.config = {} + self.proxy_manager = {} + + super(HTTPAdapter, self).__init__() + + self._pool_connections = pool_connections + self._pool_maxsize = pool_maxsize + self._pool_block = pool_block + + self.init_poolmanager(pool_connections, pool_maxsize, block=pool_block) + + def __getstate__(self): + return dict((attr, getattr(self, attr, None)) for attr in + self.__attrs__) + + def __setstate__(self, state): + # Can't handle by adding 'proxy_manager' to self.__attrs__ because + # self.poolmanager uses a lambda function, which isn't pickleable. + self.proxy_manager = {} + self.config = {} + + for attr, value in state.items(): + setattr(self, attr, value) + + self.init_poolmanager(self._pool_connections, self._pool_maxsize, + block=self._pool_block) + + def init_poolmanager(self, connections, maxsize, block=DEFAULT_POOLBLOCK, **pool_kwargs): + """Initializes a urllib3 PoolManager. + + This method should not be called from user code, and is only + exposed for use when subclassing the + :class:`HTTPAdapter `. + + :param connections: The number of urllib3 connection pools to cache. + :param maxsize: The maximum number of connections to save in the pool. + :param block: Block when no free connections are available. + :param pool_kwargs: Extra keyword arguments used to initialize the Pool Manager. + """ + # save these values for pickling + self._pool_connections = connections + self._pool_maxsize = maxsize + self._pool_block = block + + self.poolmanager = PoolManager(num_pools=connections, maxsize=maxsize, + block=block, strict=True, **pool_kwargs) + + def proxy_manager_for(self, proxy, **proxy_kwargs): + """Return urllib3 ProxyManager for the given proxy. + + This method should not be called from user code, and is only + exposed for use when subclassing the + :class:`HTTPAdapter `. + + :param proxy: The proxy to return a urllib3 ProxyManager for. + :param proxy_kwargs: Extra keyword arguments used to configure the Proxy Manager. + :returns: ProxyManager + :rtype: urllib3.ProxyManager + """ + if proxy in self.proxy_manager: + manager = self.proxy_manager[proxy] + elif proxy.lower().startswith('socks'): + username, password = get_auth_from_url(proxy) + manager = self.proxy_manager[proxy] = SOCKSProxyManager( + proxy, + username=username, + password=password, + num_pools=self._pool_connections, + maxsize=self._pool_maxsize, + block=self._pool_block, + **proxy_kwargs + ) + else: + proxy_headers = self.proxy_headers(proxy) + manager = self.proxy_manager[proxy] = proxy_from_url( + proxy, + proxy_headers=proxy_headers, + num_pools=self._pool_connections, + maxsize=self._pool_maxsize, + block=self._pool_block, + **proxy_kwargs) + + return manager + + def cert_verify(self, conn, url, verify, cert): + """Verify a SSL certificate. This method should not be called from user + code, and is only exposed for use when subclassing the + :class:`HTTPAdapter `. + + :param conn: The urllib3 connection object associated with the cert. + :param url: The requested URL. + :param verify: Either a boolean, in which case it controls whether we verify + the server's TLS certificate, or a string, in which case it must be a path + to a CA bundle to use + :param cert: The SSL certificate to verify. + """ + if url.lower().startswith('https') and verify: + + cert_loc = None + + # Allow self-specified cert location. + if verify is not True: + cert_loc = verify + + if not cert_loc: + cert_loc = DEFAULT_CA_BUNDLE_PATH + + if not cert_loc or not os.path.exists(cert_loc): + raise IOError("Could not find a suitable TLS CA certificate bundle, " + "invalid path: {0}".format(cert_loc)) + + conn.cert_reqs = 'CERT_REQUIRED' + + if not os.path.isdir(cert_loc): + conn.ca_certs = cert_loc + else: + conn.ca_cert_dir = cert_loc + else: + conn.cert_reqs = 'CERT_NONE' + conn.ca_certs = None + conn.ca_cert_dir = None + + if cert: + if not isinstance(cert, basestring): + conn.cert_file = cert[0] + conn.key_file = cert[1] + else: + conn.cert_file = cert + conn.key_file = None + if conn.cert_file and not os.path.exists(conn.cert_file): + raise IOError("Could not find the TLS certificate file, " + "invalid path: {0}".format(conn.cert_file)) + if conn.key_file and not os.path.exists(conn.key_file): + raise IOError("Could not find the TLS key file, " + "invalid path: {0}".format(conn.key_file)) + + def build_response(self, req, resp): + """Builds a :class:`Response ` object from a urllib3 + response. This should not be called from user code, and is only exposed + for use when subclassing the + :class:`HTTPAdapter ` + + :param req: The :class:`PreparedRequest ` used to generate the response. + :param resp: The urllib3 response object. + :rtype: requests.Response + """ + response = Response() + + # Fallback to None if there's no status_code, for whatever reason. + response.status_code = getattr(resp, 'status', None) + + # Make headers case-insensitive. + response.headers = CaseInsensitiveDict(getattr(resp, 'headers', {})) + + # Set encoding. + response.encoding = get_encoding_from_headers(response.headers) + response.raw = resp + response.reason = response.raw.reason + + if isinstance(req.url, bytes): + response.url = req.url.decode('utf-8') + else: + response.url = req.url + + # Add new cookies from the server. + extract_cookies_to_jar(response.cookies, req, resp) + + # Give the Response some context. + response.request = req + response.connection = self + + return response + + def get_connection(self, url, proxies=None): + """Returns a urllib3 connection for the given URL. This should not be + called from user code, and is only exposed for use when subclassing the + :class:`HTTPAdapter `. + + :param url: The URL to connect to. + :param proxies: (optional) A Requests-style dictionary of proxies used on this request. + :rtype: urllib3.ConnectionPool + """ + proxy = select_proxy(url, proxies) + + if proxy: + proxy = prepend_scheme_if_needed(proxy, 'http') + proxy_manager = self.proxy_manager_for(proxy) + conn = proxy_manager.connection_from_url(url) + else: + # Only scheme should be lower case + parsed = urlparse(url) + url = parsed.geturl() + conn = self.poolmanager.connection_from_url(url) + + return conn + + def close(self): + """Disposes of any internal state. + + Currently, this closes the PoolManager and any active ProxyManager, + which closes any pooled connections. + """ + self.poolmanager.clear() + for proxy in self.proxy_manager.values(): + proxy.clear() + + def request_url(self, request, proxies): + """Obtain the url to use when making the final request. + + If the message is being sent through a HTTP proxy, the full URL has to + be used. Otherwise, we should only use the path portion of the URL. + + This should not be called from user code, and is only exposed for use + when subclassing the + :class:`HTTPAdapter `. + + :param request: The :class:`PreparedRequest ` being sent. + :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs. + :rtype: str + """ + proxy = select_proxy(request.url, proxies) + scheme = urlparse(request.url).scheme + + is_proxied_http_request = (proxy and scheme != 'https') + using_socks_proxy = False + if proxy: + proxy_scheme = urlparse(proxy).scheme.lower() + using_socks_proxy = proxy_scheme.startswith('socks') + + url = request.path_url + if is_proxied_http_request and not using_socks_proxy: + url = urldefragauth(request.url) + + return url + + def add_headers(self, request, **kwargs): + """Add any headers needed by the connection. As of v2.0 this does + nothing by default, but is left for overriding by users that subclass + the :class:`HTTPAdapter `. + + This should not be called from user code, and is only exposed for use + when subclassing the + :class:`HTTPAdapter `. + + :param request: The :class:`PreparedRequest ` to add headers to. + :param kwargs: The keyword arguments from the call to send(). + """ + pass + + def proxy_headers(self, proxy): + """Returns a dictionary of the headers to add to any request sent + through a proxy. This works with urllib3 magic to ensure that they are + correctly sent to the proxy, rather than in a tunnelled request if + CONNECT is being used. + + This should not be called from user code, and is only exposed for use + when subclassing the + :class:`HTTPAdapter `. + + :param proxies: The url of the proxy being used for this request. + :rtype: dict + """ + headers = {} + username, password = get_auth_from_url(proxy) + + if username: + headers['Proxy-Authorization'] = _basic_auth_str(username, + password) + + return headers + + def send(self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None): + """Sends PreparedRequest object. Returns Response object. + + :param request: The :class:`PreparedRequest ` being sent. + :param stream: (optional) Whether to stream the request content. + :param timeout: (optional) How long to wait for the server to send + data before giving up, as a float, or a :ref:`(connect timeout, + read timeout) ` tuple. + :type timeout: float or tuple or urllib3 Timeout object + :param verify: (optional) Either a boolean, in which case it controls whether + we verify the server's TLS certificate, or a string, in which case it + must be a path to a CA bundle to use + :param cert: (optional) Any user-provided SSL certificate to be trusted. + :param proxies: (optional) The proxies dictionary to apply to the request. + :rtype: requests.Response + """ + + conn = self.get_connection(request.url, proxies) + + self.cert_verify(conn, request.url, verify, cert) + url = self.request_url(request, proxies) + self.add_headers(request) + + chunked = not (request.body is None or 'Content-Length' in request.headers) + + if isinstance(timeout, tuple): + try: + connect, read = timeout + timeout = TimeoutSauce(connect=connect, read=read) + except ValueError as e: + # this may raise a string formatting error. + err = ("Invalid timeout {0}. Pass a (connect, read) " + "timeout tuple, or a single float to set " + "both timeouts to the same value".format(timeout)) + raise ValueError(err) + elif isinstance(timeout, TimeoutSauce): + pass + else: + timeout = TimeoutSauce(connect=timeout, read=timeout) + + try: + if not chunked: + resp = conn.urlopen( + method=request.method, + url=url, + body=request.body, + headers=request.headers, + redirect=False, + assert_same_host=False, + preload_content=False, + decode_content=False, + retries=self.max_retries, + timeout=timeout + ) + + # Send the request. + else: + if hasattr(conn, 'proxy_pool'): + conn = conn.proxy_pool + + low_conn = conn._get_conn(timeout=DEFAULT_POOL_TIMEOUT) + + try: + low_conn.putrequest(request.method, + url, + skip_accept_encoding=True) + + for header, value in request.headers.items(): + low_conn.putheader(header, value) + + low_conn.endheaders() + + for i in request.body: + low_conn.send(hex(len(i))[2:].encode('utf-8')) + low_conn.send(b'\r\n') + low_conn.send(i) + low_conn.send(b'\r\n') + low_conn.send(b'0\r\n\r\n') + + # Receive the response from the server + try: + # For Python 2.7+ versions, use buffering of HTTP + # responses + r = low_conn.getresponse(buffering=True) + except TypeError: + # For compatibility with Python 2.6 versions and back + r = low_conn.getresponse() + + resp = HTTPResponse.from_httplib( + r, + pool=conn, + connection=low_conn, + preload_content=False, + decode_content=False + ) + except: + # If we hit any problems here, clean up the connection. + # Then, reraise so that we can handle the actual exception. + low_conn.close() + raise + + except (ProtocolError, socket.error) as err: + raise ConnectionError(err, request=request) + + except MaxRetryError as e: + if isinstance(e.reason, ConnectTimeoutError): + # TODO: Remove this in 3.0.0: see #2811 + if not isinstance(e.reason, NewConnectionError): + raise ConnectTimeout(e, request=request) + + if isinstance(e.reason, ResponseError): + raise RetryError(e, request=request) + + if isinstance(e.reason, _ProxyError): + raise ProxyError(e, request=request) + + if isinstance(e.reason, _SSLError): + # This branch is for urllib3 v1.22 and later. + raise SSLError(e, request=request) + + raise ConnectionError(e, request=request) + + except ClosedPoolError as e: + raise ConnectionError(e, request=request) + + except _ProxyError as e: + raise ProxyError(e) + + except (_SSLError, _HTTPError) as e: + if isinstance(e, _SSLError): + # This branch is for urllib3 versions earlier than v1.22 + raise SSLError(e, request=request) + elif isinstance(e, ReadTimeoutError): + raise ReadTimeout(e, request=request) + else: + raise + + return self.build_response(request, resp) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/api.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/api.py new file mode 100644 index 0000000000000000000000000000000000000000..bc2115c150f2d1248820b6671111e29e2b5163a7 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/api.py @@ -0,0 +1,152 @@ +# -*- coding: utf-8 -*- + +""" +requests.api +~~~~~~~~~~~~ + +This module implements the Requests API. + +:copyright: (c) 2012 by Kenneth Reitz. +:license: Apache2, see LICENSE for more details. +""" + +from . import sessions + + +def request(method, url, **kwargs): + """Constructs and sends a :class:`Request `. + + :param method: method for the new :class:`Request` object. + :param url: URL for the new :class:`Request` object. + :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. + :param data: (optional) Dictionary or list of tuples ``[(key, value)]`` (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`. + :param json: (optional) json data to send in the body of the :class:`Request`. + :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`. + :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`. + :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload. + ``file-tuple`` can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')`` + or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content-type'`` is a string + defining the content type of the given file and ``custom_headers`` a dict-like object containing additional headers + to add for the file. + :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth. + :param timeout: (optional) How many seconds to wait for the server to send data + before giving up, as a float, or a :ref:`(connect timeout, read + timeout) ` tuple. + :type timeout: float or tuple + :param allow_redirects: (optional) Boolean. Enable/disable GET/OPTIONS/POST/PUT/PATCH/DELETE/HEAD redirection. Defaults to ``True``. + :type allow_redirects: bool + :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy. + :param verify: (optional) Either a boolean, in which case it controls whether we verify + the server's TLS certificate, or a string, in which case it must be a path + to a CA bundle to use. Defaults to ``True``. + :param stream: (optional) if ``False``, the response content will be immediately downloaded. + :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair. + :return: :class:`Response ` object + :rtype: requests.Response + + Usage:: + + >>> import requests + >>> req = requests.request('GET', 'http://httpbin.org/get') + + """ + + # By using the 'with' statement we are sure the session is closed, thus we + # avoid leaving sockets open which can trigger a ResourceWarning in some + # cases, and look like a memory leak in others. + with sessions.Session() as session: + return session.request(method=method, url=url, **kwargs) + + +def get(url, params=None, **kwargs): + r"""Sends a GET request. + + :param url: URL for the new :class:`Request` object. + :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :return: :class:`Response ` object + :rtype: requests.Response + """ + + kwargs.setdefault('allow_redirects', True) + return request('get', url, params=params, **kwargs) + + +def options(url, **kwargs): + r"""Sends an OPTIONS request. + + :param url: URL for the new :class:`Request` object. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :return: :class:`Response ` object + :rtype: requests.Response + """ + + kwargs.setdefault('allow_redirects', True) + return request('options', url, **kwargs) + + +def head(url, **kwargs): + r"""Sends a HEAD request. + + :param url: URL for the new :class:`Request` object. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :return: :class:`Response ` object + :rtype: requests.Response + """ + + kwargs.setdefault('allow_redirects', False) + return request('head', url, **kwargs) + + +def post(url, data=None, json=None, **kwargs): + r"""Sends a POST request. + + :param url: URL for the new :class:`Request` object. + :param data: (optional) Dictionary (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`. + :param json: (optional) json data to send in the body of the :class:`Request`. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :return: :class:`Response ` object + :rtype: requests.Response + """ + + return request('post', url, data=data, json=json, **kwargs) + + +def put(url, data=None, **kwargs): + r"""Sends a PUT request. + + :param url: URL for the new :class:`Request` object. + :param data: (optional) Dictionary (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`. + :param json: (optional) json data to send in the body of the :class:`Request`. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :return: :class:`Response ` object + :rtype: requests.Response + """ + + return request('put', url, data=data, **kwargs) + + +def patch(url, data=None, **kwargs): + r"""Sends a PATCH request. + + :param url: URL for the new :class:`Request` object. + :param data: (optional) Dictionary (will be form-encoded), bytes, or file-like object to send in the body of the :class:`Request`. + :param json: (optional) json data to send in the body of the :class:`Request`. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :return: :class:`Response ` object + :rtype: requests.Response + """ + + return request('patch', url, data=data, **kwargs) + + +def delete(url, **kwargs): + r"""Sends a DELETE request. + + :param url: URL for the new :class:`Request` object. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :return: :class:`Response ` object + :rtype: requests.Response + """ + + return request('delete', url, **kwargs) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/auth.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/auth.py new file mode 100644 index 0000000000000000000000000000000000000000..1a182dffdd3f89a2e64e5bf6fdc288fcbbf242b0 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/auth.py @@ -0,0 +1,293 @@ +# -*- coding: utf-8 -*- + +""" +requests.auth +~~~~~~~~~~~~~ + +This module contains the authentication handlers for Requests. +""" + +import os +import re +import time +import hashlib +import threading +import warnings + +from base64 import b64encode + +from .compat import urlparse, str, basestring +from .cookies import extract_cookies_to_jar +from ._internal_utils import to_native_string +from .utils import parse_dict_header + +CONTENT_TYPE_FORM_URLENCODED = 'application/x-www-form-urlencoded' +CONTENT_TYPE_MULTI_PART = 'multipart/form-data' + + +def _basic_auth_str(username, password): + """Returns a Basic Auth string.""" + + # "I want us to put a big-ol' comment on top of it that + # says that this behaviour is dumb but we need to preserve + # it because people are relying on it." + # - Lukasa + # + # These are here solely to maintain backwards compatibility + # for things like ints. This will be removed in 3.0.0. + if not isinstance(username, basestring): + warnings.warn( + "Non-string usernames will no longer be supported in Requests " + "3.0.0. Please convert the object you've passed in ({0!r}) to " + "a string or bytes object in the near future to avoid " + "problems.".format(username), + category=DeprecationWarning, + ) + username = str(username) + + if not isinstance(password, basestring): + warnings.warn( + "Non-string passwords will no longer be supported in Requests " + "3.0.0. Please convert the object you've passed in ({0!r}) to " + "a string or bytes object in the near future to avoid " + "problems.".format(password), + category=DeprecationWarning, + ) + password = str(password) + # -- End Removal -- + + if isinstance(username, str): + username = username.encode('latin1') + + if isinstance(password, str): + password = password.encode('latin1') + + authstr = 'Basic ' + to_native_string( + b64encode(b':'.join((username, password))).strip() + ) + + return authstr + + +class AuthBase(object): + """Base class that all auth implementations derive from""" + + def __call__(self, r): + raise NotImplementedError('Auth hooks must be callable.') + + +class HTTPBasicAuth(AuthBase): + """Attaches HTTP Basic Authentication to the given Request object.""" + + def __init__(self, username, password): + self.username = username + self.password = password + + def __eq__(self, other): + return all([ + self.username == getattr(other, 'username', None), + self.password == getattr(other, 'password', None) + ]) + + def __ne__(self, other): + return not self == other + + def __call__(self, r): + r.headers['Authorization'] = _basic_auth_str(self.username, self.password) + return r + + +class HTTPProxyAuth(HTTPBasicAuth): + """Attaches HTTP Proxy Authentication to a given Request object.""" + + def __call__(self, r): + r.headers['Proxy-Authorization'] = _basic_auth_str(self.username, self.password) + return r + + +class HTTPDigestAuth(AuthBase): + """Attaches HTTP Digest Authentication to the given Request object.""" + + def __init__(self, username, password): + self.username = username + self.password = password + # Keep state in per-thread local storage + self._thread_local = threading.local() + + def init_per_thread_state(self): + # Ensure state is initialized just once per-thread + if not hasattr(self._thread_local, 'init'): + self._thread_local.init = True + self._thread_local.last_nonce = '' + self._thread_local.nonce_count = 0 + self._thread_local.chal = {} + self._thread_local.pos = None + self._thread_local.num_401_calls = None + + def build_digest_header(self, method, url): + """ + :rtype: str + """ + + realm = self._thread_local.chal['realm'] + nonce = self._thread_local.chal['nonce'] + qop = self._thread_local.chal.get('qop') + algorithm = self._thread_local.chal.get('algorithm') + opaque = self._thread_local.chal.get('opaque') + hash_utf8 = None + + if algorithm is None: + _algorithm = 'MD5' + else: + _algorithm = algorithm.upper() + # lambdas assume digest modules are imported at the top level + if _algorithm == 'MD5' or _algorithm == 'MD5-SESS': + def md5_utf8(x): + if isinstance(x, str): + x = x.encode('utf-8') + return hashlib.md5(x).hexdigest() + hash_utf8 = md5_utf8 + elif _algorithm == 'SHA': + def sha_utf8(x): + if isinstance(x, str): + x = x.encode('utf-8') + return hashlib.sha1(x).hexdigest() + hash_utf8 = sha_utf8 + + KD = lambda s, d: hash_utf8("%s:%s" % (s, d)) + + if hash_utf8 is None: + return None + + # XXX not implemented yet + entdig = None + p_parsed = urlparse(url) + #: path is request-uri defined in RFC 2616 which should not be empty + path = p_parsed.path or "/" + if p_parsed.query: + path += '?' + p_parsed.query + + A1 = '%s:%s:%s' % (self.username, realm, self.password) + A2 = '%s:%s' % (method, path) + + HA1 = hash_utf8(A1) + HA2 = hash_utf8(A2) + + if nonce == self._thread_local.last_nonce: + self._thread_local.nonce_count += 1 + else: + self._thread_local.nonce_count = 1 + ncvalue = '%08x' % self._thread_local.nonce_count + s = str(self._thread_local.nonce_count).encode('utf-8') + s += nonce.encode('utf-8') + s += time.ctime().encode('utf-8') + s += os.urandom(8) + + cnonce = (hashlib.sha1(s).hexdigest()[:16]) + if _algorithm == 'MD5-SESS': + HA1 = hash_utf8('%s:%s:%s' % (HA1, nonce, cnonce)) + + if not qop: + respdig = KD(HA1, "%s:%s" % (nonce, HA2)) + elif qop == 'auth' or 'auth' in qop.split(','): + noncebit = "%s:%s:%s:%s:%s" % ( + nonce, ncvalue, cnonce, 'auth', HA2 + ) + respdig = KD(HA1, noncebit) + else: + # XXX handle auth-int. + return None + + self._thread_local.last_nonce = nonce + + # XXX should the partial digests be encoded too? + base = 'username="%s", realm="%s", nonce="%s", uri="%s", ' \ + 'response="%s"' % (self.username, realm, nonce, path, respdig) + if opaque: + base += ', opaque="%s"' % opaque + if algorithm: + base += ', algorithm="%s"' % algorithm + if entdig: + base += ', digest="%s"' % entdig + if qop: + base += ', qop="auth", nc=%s, cnonce="%s"' % (ncvalue, cnonce) + + return 'Digest %s' % (base) + + def handle_redirect(self, r, **kwargs): + """Reset num_401_calls counter on redirects.""" + if r.is_redirect: + self._thread_local.num_401_calls = 1 + + def handle_401(self, r, **kwargs): + """ + Takes the given response and tries digest-auth, if needed. + + :rtype: requests.Response + """ + + # If response is not 4xx, do not auth + # See https://github.com/requests/requests/issues/3772 + if not 400 <= r.status_code < 500: + self._thread_local.num_401_calls = 1 + return r + + if self._thread_local.pos is not None: + # Rewind the file position indicator of the body to where + # it was to resend the request. + r.request.body.seek(self._thread_local.pos) + s_auth = r.headers.get('www-authenticate', '') + + if 'digest' in s_auth.lower() and self._thread_local.num_401_calls < 2: + + self._thread_local.num_401_calls += 1 + pat = re.compile(r'digest ', flags=re.IGNORECASE) + self._thread_local.chal = parse_dict_header(pat.sub('', s_auth, count=1)) + + # Consume content and release the original connection + # to allow our new request to reuse the same one. + r.content + r.close() + prep = r.request.copy() + extract_cookies_to_jar(prep._cookies, r.request, r.raw) + prep.prepare_cookies(prep._cookies) + + prep.headers['Authorization'] = self.build_digest_header( + prep.method, prep.url) + _r = r.connection.send(prep, **kwargs) + _r.history.append(r) + _r.request = prep + + return _r + + self._thread_local.num_401_calls = 1 + return r + + def __call__(self, r): + # Initialize per-thread state, if needed + self.init_per_thread_state() + # If we have a saved nonce, skip the 401 + if self._thread_local.last_nonce: + r.headers['Authorization'] = self.build_digest_header(r.method, r.url) + try: + self._thread_local.pos = r.body.tell() + except AttributeError: + # In the case of HTTPDigestAuth being reused and the body of + # the previous request was a file-like object, pos has the + # file position of the previous body. Ensure it's set to + # None. + self._thread_local.pos = None + r.register_hook('response', self.handle_401) + r.register_hook('response', self.handle_redirect) + self._thread_local.num_401_calls = 1 + + return r + + def __eq__(self, other): + return all([ + self.username == getattr(other, 'username', None), + self.password == getattr(other, 'password', None) + ]) + + def __ne__(self, other): + return not self == other diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/certs.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/certs.py new file mode 100644 index 0000000000000000000000000000000000000000..c67f8f41712ca697cccf7425ade510a24fe36be7 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/certs.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +requests.certs +~~~~~~~~~~~~~~ + +This module returns the preferred default CA certificate bundle. There is +only one — the one from the certifi package. + +If you are packaging Requests, e.g., for a Linux distribution or a managed +environment, you can change the definition of where() to return a separately +packaged CA bundle. +""" +import os.path + +from .packages.certifi import where + +if __name__ == '__main__': + print(where()) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/compat.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/compat.py new file mode 100644 index 0000000000000000000000000000000000000000..3663a047f5879639ae57fd37561b606903f5077f --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/compat.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- + +""" +requests.compat +~~~~~~~~~~~~~~~ + +This module handles import compatibility issues between Python 2 and +Python 3. +""" + +from .packages import chardet + +import sys + +# ------- +# Pythons +# ------- + +# Syntax sugar. +_ver = sys.version_info + +#: Python 2.x? +is_py2 = (_ver[0] == 2) + +#: Python 3.x? +is_py3 = (_ver[0] == 3) + +try: + import simplejson as json +except ImportError: + import json + +# --------- +# Specifics +# --------- + +if is_py2: + from urllib import ( + quote, unquote, quote_plus, unquote_plus, urlencode, getproxies, + proxy_bypass, proxy_bypass_environment, getproxies_environment) + from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag + from urllib2 import parse_http_list + import cookielib + from Cookie import Morsel + from StringIO import StringIO + from collections import Callable, Mapping, MutableMapping + + from .packages.urllib3.packages.ordered_dict import OrderedDict + + builtin_str = str + bytes = str + str = unicode + basestring = basestring + numeric_types = (int, long, float) + integer_types = (int, long) + +elif is_py3: + from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlencode, quote, unquote, quote_plus, unquote_plus, urldefrag + from urllib.request import parse_http_list, getproxies, proxy_bypass, proxy_bypass_environment, getproxies_environment + from http import cookiejar as cookielib + from http.cookies import Morsel + from io import StringIO + from collections import OrderedDict + from collections.abc import Callable, Mapping, MutableMapping + + builtin_str = str + str = str + bytes = bytes + basestring = (str, bytes) + numeric_types = (int, float) + integer_types = (int,) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/cookies.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/cookies.py new file mode 100644 index 0000000000000000000000000000000000000000..4c0893ff7c5f8ea10bdd6b64e615e2bada41f523 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/cookies.py @@ -0,0 +1,541 @@ +# -*- coding: utf-8 -*- + +""" +requests.cookies +~~~~~~~~~~~~~~~~ + +Compatibility code to be able to use `cookielib.CookieJar` with requests. + +requests.utils imports from here, so be careful with imports. +""" + +import copy +import time +import calendar + +from ._internal_utils import to_native_string +from .compat import cookielib, urlparse, urlunparse, Morsel, MutableMapping + +try: + import threading +except ImportError: + import dummy_threading as threading + + +class MockRequest(object): + """Wraps a `requests.Request` to mimic a `urllib2.Request`. + + The code in `cookielib.CookieJar` expects this interface in order to correctly + manage cookie policies, i.e., determine whether a cookie can be set, given the + domains of the request and the cookie. + + The original request object is read-only. The client is responsible for collecting + the new headers via `get_new_headers()` and interpreting them appropriately. You + probably want `get_cookie_header`, defined below. + """ + + def __init__(self, request): + self._r = request + self._new_headers = {} + self.type = urlparse(self._r.url).scheme + + def get_type(self): + return self.type + + def get_host(self): + return urlparse(self._r.url).netloc + + def get_origin_req_host(self): + return self.get_host() + + def get_full_url(self): + # Only return the response's URL if the user hadn't set the Host + # header + if not self._r.headers.get('Host'): + return self._r.url + # If they did set it, retrieve it and reconstruct the expected domain + host = to_native_string(self._r.headers['Host'], encoding='utf-8') + parsed = urlparse(self._r.url) + # Reconstruct the URL as we expect it + return urlunparse([ + parsed.scheme, host, parsed.path, parsed.params, parsed.query, + parsed.fragment + ]) + + def is_unverifiable(self): + return True + + def has_header(self, name): + return name in self._r.headers or name in self._new_headers + + def get_header(self, name, default=None): + return self._r.headers.get(name, self._new_headers.get(name, default)) + + def add_header(self, key, val): + """cookielib has no legitimate use for this method; add it back if you find one.""" + raise NotImplementedError("Cookie headers should be added with add_unredirected_header()") + + def add_unredirected_header(self, name, value): + self._new_headers[name] = value + + def get_new_headers(self): + return self._new_headers + + @property + def unverifiable(self): + return self.is_unverifiable() + + @property + def origin_req_host(self): + return self.get_origin_req_host() + + @property + def host(self): + return self.get_host() + + +class MockResponse(object): + """Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`. + + ...what? Basically, expose the parsed HTTP headers from the server response + the way `cookielib` expects to see them. + """ + + def __init__(self, headers): + """Make a MockResponse for `cookielib` to read. + + :param headers: a httplib.HTTPMessage or analogous carrying the headers + """ + self._headers = headers + + def info(self): + return self._headers + + def getheaders(self, name): + self._headers.getheaders(name) + + +def extract_cookies_to_jar(jar, request, response): + """Extract the cookies from the response into a CookieJar. + + :param jar: cookielib.CookieJar (not necessarily a RequestsCookieJar) + :param request: our own requests.Request object + :param response: urllib3.HTTPResponse object + """ + if not (hasattr(response, '_original_response') and + response._original_response): + return + # the _original_response field is the wrapped httplib.HTTPResponse object, + req = MockRequest(request) + # pull out the HTTPMessage with the headers and put it in the mock: + res = MockResponse(response._original_response.msg) + jar.extract_cookies(res, req) + + +def get_cookie_header(jar, request): + """ + Produce an appropriate Cookie header string to be sent with `request`, or None. + + :rtype: str + """ + r = MockRequest(request) + jar.add_cookie_header(r) + return r.get_new_headers().get('Cookie') + + +def remove_cookie_by_name(cookiejar, name, domain=None, path=None): + """Unsets a cookie by name, by default over all domains and paths. + + Wraps CookieJar.clear(), is O(n). + """ + clearables = [] + for cookie in cookiejar: + if cookie.name != name: + continue + if domain is not None and domain != cookie.domain: + continue + if path is not None and path != cookie.path: + continue + clearables.append((cookie.domain, cookie.path, cookie.name)) + + for domain, path, name in clearables: + cookiejar.clear(domain, path, name) + + +class CookieConflictError(RuntimeError): + """There are two cookies that meet the criteria specified in the cookie jar. + Use .get and .set and include domain and path args in order to be more specific. + """ + + +class RequestsCookieJar(cookielib.CookieJar, MutableMapping): + """Compatibility class; is a cookielib.CookieJar, but exposes a dict + interface. + + This is the CookieJar we create by default for requests and sessions that + don't specify one, since some clients may expect response.cookies and + session.cookies to support dict operations. + + Requests does not use the dict interface internally; it's just for + compatibility with external client code. All requests code should work + out of the box with externally provided instances of ``CookieJar``, e.g. + ``LWPCookieJar`` and ``FileCookieJar``. + + Unlike a regular CookieJar, this class is pickleable. + + .. warning:: dictionary operations that are normally O(1) may be O(n). + """ + + def get(self, name, default=None, domain=None, path=None): + """Dict-like get() that also supports optional domain and path args in + order to resolve naming collisions from using one cookie jar over + multiple domains. + + .. warning:: operation is O(n), not O(1). + """ + try: + return self._find_no_duplicates(name, domain, path) + except KeyError: + return default + + def set(self, name, value, **kwargs): + """Dict-like set() that also supports optional domain and path args in + order to resolve naming collisions from using one cookie jar over + multiple domains. + """ + # support client code that unsets cookies by assignment of a None value: + if value is None: + remove_cookie_by_name(self, name, domain=kwargs.get('domain'), path=kwargs.get('path')) + return + + if isinstance(value, Morsel): + c = morsel_to_cookie(value) + else: + c = create_cookie(name, value, **kwargs) + self.set_cookie(c) + return c + + def iterkeys(self): + """Dict-like iterkeys() that returns an iterator of names of cookies + from the jar. + + .. seealso:: itervalues() and iteritems(). + """ + for cookie in iter(self): + yield cookie.name + + def keys(self): + """Dict-like keys() that returns a list of names of cookies from the + jar. + + .. seealso:: values() and items(). + """ + return list(self.iterkeys()) + + def itervalues(self): + """Dict-like itervalues() that returns an iterator of values of cookies + from the jar. + + .. seealso:: iterkeys() and iteritems(). + """ + for cookie in iter(self): + yield cookie.value + + def values(self): + """Dict-like values() that returns a list of values of cookies from the + jar. + + .. seealso:: keys() and items(). + """ + return list(self.itervalues()) + + def iteritems(self): + """Dict-like iteritems() that returns an iterator of name-value tuples + from the jar. + + .. seealso:: iterkeys() and itervalues(). + """ + for cookie in iter(self): + yield cookie.name, cookie.value + + def items(self): + """Dict-like items() that returns a list of name-value tuples from the + jar. Allows client-code to call ``dict(RequestsCookieJar)`` and get a + vanilla python dict of key value pairs. + + .. seealso:: keys() and values(). + """ + return list(self.iteritems()) + + def list_domains(self): + """Utility method to list all the domains in the jar.""" + domains = [] + for cookie in iter(self): + if cookie.domain not in domains: + domains.append(cookie.domain) + return domains + + def list_paths(self): + """Utility method to list all the paths in the jar.""" + paths = [] + for cookie in iter(self): + if cookie.path not in paths: + paths.append(cookie.path) + return paths + + def multiple_domains(self): + """Returns True if there are multiple domains in the jar. + Returns False otherwise. + + :rtype: bool + """ + domains = [] + for cookie in iter(self): + if cookie.domain is not None and cookie.domain in domains: + return True + domains.append(cookie.domain) + return False # there is only one domain in jar + + def get_dict(self, domain=None, path=None): + """Takes as an argument an optional domain and path and returns a plain + old Python dict of name-value pairs of cookies that meet the + requirements. + + :rtype: dict + """ + dictionary = {} + for cookie in iter(self): + if ( + (domain is None or cookie.domain == domain) and + (path is None or cookie.path == path) + ): + dictionary[cookie.name] = cookie.value + return dictionary + + def __contains__(self, name): + try: + return super(RequestsCookieJar, self).__contains__(name) + except CookieConflictError: + return True + + def __getitem__(self, name): + """Dict-like __getitem__() for compatibility with client code. Throws + exception if there are more than one cookie with name. In that case, + use the more explicit get() method instead. + + .. warning:: operation is O(n), not O(1). + """ + return self._find_no_duplicates(name) + + def __setitem__(self, name, value): + """Dict-like __setitem__ for compatibility with client code. Throws + exception if there is already a cookie of that name in the jar. In that + case, use the more explicit set() method instead. + """ + self.set(name, value) + + def __delitem__(self, name): + """Deletes a cookie given a name. Wraps ``cookielib.CookieJar``'s + ``remove_cookie_by_name()``. + """ + remove_cookie_by_name(self, name) + + def set_cookie(self, cookie, *args, **kwargs): + if hasattr(cookie.value, 'startswith') and cookie.value.startswith('"') and cookie.value.endswith('"'): + cookie.value = cookie.value.replace('\\"', '') + return super(RequestsCookieJar, self).set_cookie(cookie, *args, **kwargs) + + def update(self, other): + """Updates this jar with cookies from another CookieJar or dict-like""" + if isinstance(other, cookielib.CookieJar): + for cookie in other: + self.set_cookie(copy.copy(cookie)) + else: + super(RequestsCookieJar, self).update(other) + + def _find(self, name, domain=None, path=None): + """Requests uses this method internally to get cookie values. + + If there are conflicting cookies, _find arbitrarily chooses one. + See _find_no_duplicates if you want an exception thrown if there are + conflicting cookies. + + :param name: a string containing name of cookie + :param domain: (optional) string containing domain of cookie + :param path: (optional) string containing path of cookie + :return: cookie.value + """ + for cookie in iter(self): + if cookie.name == name: + if domain is None or cookie.domain == domain: + if path is None or cookie.path == path: + return cookie.value + + raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path)) + + def _find_no_duplicates(self, name, domain=None, path=None): + """Both ``__get_item__`` and ``get`` call this function: it's never + used elsewhere in Requests. + + :param name: a string containing name of cookie + :param domain: (optional) string containing domain of cookie + :param path: (optional) string containing path of cookie + :raises KeyError: if cookie is not found + :raises CookieConflictError: if there are multiple cookies + that match name and optionally domain and path + :return: cookie.value + """ + toReturn = None + for cookie in iter(self): + if cookie.name == name: + if domain is None or cookie.domain == domain: + if path is None or cookie.path == path: + if toReturn is not None: # if there are multiple cookies that meet passed in criteria + raise CookieConflictError('There are multiple cookies with name, %r' % (name)) + toReturn = cookie.value # we will eventually return this as long as no cookie conflict + + if toReturn: + return toReturn + raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path)) + + def __getstate__(self): + """Unlike a normal CookieJar, this class is pickleable.""" + state = self.__dict__.copy() + # remove the unpickleable RLock object + state.pop('_cookies_lock') + return state + + def __setstate__(self, state): + """Unlike a normal CookieJar, this class is pickleable.""" + self.__dict__.update(state) + if '_cookies_lock' not in self.__dict__: + self._cookies_lock = threading.RLock() + + def copy(self): + """Return a copy of this RequestsCookieJar.""" + new_cj = RequestsCookieJar() + new_cj.update(self) + return new_cj + + +def _copy_cookie_jar(jar): + if jar is None: + return None + + if hasattr(jar, 'copy'): + # We're dealing with an instance of RequestsCookieJar + return jar.copy() + # We're dealing with a generic CookieJar instance + new_jar = copy.copy(jar) + new_jar.clear() + for cookie in jar: + new_jar.set_cookie(copy.copy(cookie)) + return new_jar + + +def create_cookie(name, value, **kwargs): + """Make a cookie from underspecified parameters. + + By default, the pair of `name` and `value` will be set for the domain '' + and sent on every request (this is sometimes called a "supercookie"). + """ + result = dict( + version=0, + name=name, + value=value, + port=None, + domain='', + path='/', + secure=False, + expires=None, + discard=True, + comment=None, + comment_url=None, + rest={'HttpOnly': None}, + rfc2109=False,) + + badargs = set(kwargs) - set(result) + if badargs: + err = 'create_cookie() got unexpected keyword arguments: %s' + raise TypeError(err % list(badargs)) + + result.update(kwargs) + result['port_specified'] = bool(result['port']) + result['domain_specified'] = bool(result['domain']) + result['domain_initial_dot'] = result['domain'].startswith('.') + result['path_specified'] = bool(result['path']) + + return cookielib.Cookie(**result) + + +def morsel_to_cookie(morsel): + """Convert a Morsel object into a Cookie containing the one k/v pair.""" + + expires = None + if morsel['max-age']: + try: + expires = int(time.time() + int(morsel['max-age'])) + except ValueError: + raise TypeError('max-age: %s must be integer' % morsel['max-age']) + elif morsel['expires']: + time_template = '%a, %d-%b-%Y %H:%M:%S GMT' + expires = calendar.timegm( + time.strptime(morsel['expires'], time_template) + ) + return create_cookie( + comment=morsel['comment'], + comment_url=bool(morsel['comment']), + discard=False, + domain=morsel['domain'], + expires=expires, + name=morsel.key, + path=morsel['path'], + port=None, + rest={'HttpOnly': morsel['httponly']}, + rfc2109=False, + secure=bool(morsel['secure']), + value=morsel.value, + version=morsel['version'] or 0, + ) + + +def cookiejar_from_dict(cookie_dict, cookiejar=None, overwrite=True): + """Returns a CookieJar from a key/value dictionary. + + :param cookie_dict: Dict of key/values to insert into CookieJar. + :param cookiejar: (optional) A cookiejar to add the cookies to. + :param overwrite: (optional) If False, will not replace cookies + already in the jar with new ones. + """ + if cookiejar is None: + cookiejar = RequestsCookieJar() + + if cookie_dict is not None: + names_from_jar = [cookie.name for cookie in cookiejar] + for name in cookie_dict: + if overwrite or (name not in names_from_jar): + cookiejar.set_cookie(create_cookie(name, cookie_dict[name])) + + return cookiejar + + +def merge_cookies(cookiejar, cookies): + """Add cookies to cookiejar and returns a merged CookieJar. + + :param cookiejar: CookieJar object to add the cookies to. + :param cookies: Dictionary or CookieJar object to be added. + """ + if not isinstance(cookiejar, cookielib.CookieJar): + raise ValueError('You can only merge into CookieJar') + + if isinstance(cookies, dict): + cookiejar = cookiejar_from_dict( + cookies, cookiejar=cookiejar, overwrite=False) + elif isinstance(cookies, cookielib.CookieJar): + try: + cookiejar.update(cookies) + except AttributeError: + for cookie_in_jar in cookies: + cookiejar.set_cookie(cookie_in_jar) + + return cookiejar diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/exceptions.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..8c73a1d4afa5a9984c34bb51d7f2d9ff52739357 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/exceptions.py @@ -0,0 +1,122 @@ +# -*- coding: utf-8 -*- + +""" +requests.exceptions +~~~~~~~~~~~~~~~~~~~ + +This module contains the set of Requests' exceptions. +""" +from .packages.urllib3.exceptions import HTTPError as BaseHTTPError + + +class RequestException(IOError): + """There was an ambiguous exception that occurred while handling your + request. + """ + + def __init__(self, *args, **kwargs): + """Initialize RequestException with `request` and `response` objects.""" + response = kwargs.pop('response', None) + self.response = response + self.request = kwargs.pop('request', None) + if (response is not None and not self.request and + hasattr(response, 'request')): + self.request = self.response.request + super(RequestException, self).__init__(*args, **kwargs) + + +class HTTPError(RequestException): + """An HTTP error occurred.""" + + +class ConnectionError(RequestException): + """A Connection error occurred.""" + + +class ProxyError(ConnectionError): + """A proxy error occurred.""" + + +class SSLError(ConnectionError): + """An SSL error occurred.""" + + +class Timeout(RequestException): + """The request timed out. + + Catching this error will catch both + :exc:`~requests.exceptions.ConnectTimeout` and + :exc:`~requests.exceptions.ReadTimeout` errors. + """ + + +class ConnectTimeout(ConnectionError, Timeout): + """The request timed out while trying to connect to the remote server. + + Requests that produced this error are safe to retry. + """ + + +class ReadTimeout(Timeout): + """The server did not send any data in the allotted amount of time.""" + + +class URLRequired(RequestException): + """A valid URL is required to make a request.""" + + +class TooManyRedirects(RequestException): + """Too many redirects.""" + + +class MissingSchema(RequestException, ValueError): + """The URL schema (e.g. http or https) is missing.""" + + +class InvalidSchema(RequestException, ValueError): + """See defaults.py for valid schemas.""" + + +class InvalidURL(RequestException, ValueError): + """The URL provided was somehow invalid.""" + + +class InvalidHeader(RequestException, ValueError): + """The header value provided was somehow invalid.""" + + +class ChunkedEncodingError(RequestException): + """The server declared chunked encoding but sent an invalid chunk.""" + + +class ContentDecodingError(RequestException, BaseHTTPError): + """Failed to decode response content""" + + +class StreamConsumedError(RequestException, TypeError): + """The content for this response was already consumed""" + + +class RetryError(RequestException): + """Custom retries logic failed""" + + +class UnrewindableBodyError(RequestException): + """Requests encountered an error when trying to rewind a body""" + +# Warnings + + +class RequestsWarning(Warning): + """Base warning for Requests.""" + pass + + +class FileModeWarning(RequestsWarning, DeprecationWarning): + """A file was opened in text mode, but Requests determined its binary length.""" + pass + + +class RequestsDependencyWarning(RequestsWarning): + """An imported dependency doesn't match the expected version range.""" + pass diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/help.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/help.py new file mode 100644 index 0000000000000000000000000000000000000000..5440ee614efb6008bae5c9512fd9d333156f181a --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/help.py @@ -0,0 +1,120 @@ +"""Module containing bug report helper(s).""" +from __future__ import print_function + +import json +import platform +import sys +import ssl + +import idna +import urllib3 +import chardet + +from . import __version__ as requests_version + +try: + from .packages.urllib3.contrib import pyopenssl +except ImportError: + pyopenssl = None + OpenSSL = None + cryptography = None +else: + import OpenSSL + import cryptography + + +def _implementation(): + """Return a dict with the Python implementation and version. + + Provide both the name and the version of the Python implementation + currently running. For example, on CPython 2.7.5 it will return + {'name': 'CPython', 'version': '2.7.5'}. + + This function works best on CPython and PyPy: in particular, it probably + doesn't work for Jython or IronPython. Future investigation should be done + to work out the correct shape of the code for those platforms. + """ + implementation = platform.python_implementation() + + if implementation == 'CPython': + implementation_version = platform.python_version() + elif implementation == 'PyPy': + implementation_version = '%s.%s.%s' % (sys.pypy_version_info.major, + sys.pypy_version_info.minor, + sys.pypy_version_info.micro) + if sys.pypy_version_info.releaselevel != 'final': + implementation_version = ''.join([ + implementation_version, sys.pypy_version_info.releaselevel + ]) + elif implementation == 'Jython': + implementation_version = platform.python_version() # Complete Guess + elif implementation == 'IronPython': + implementation_version = platform.python_version() # Complete Guess + else: + implementation_version = 'Unknown' + + return {'name': implementation, 'version': implementation_version} + + +def info(): + """Generate information for a bug report.""" + try: + platform_info = { + 'system': platform.system(), + 'release': platform.release(), + } + except IOError: + platform_info = { + 'system': 'Unknown', + 'release': 'Unknown', + } + + implementation_info = _implementation() + urllib3_info = {'version': urllib3.__version__} + chardet_info = {'version': chardet.__version__} + + pyopenssl_info = { + 'version': None, + 'openssl_version': '', + } + if OpenSSL: + pyopenssl_info = { + 'version': OpenSSL.__version__, + 'openssl_version': '%x' % OpenSSL.SSL.OPENSSL_VERSION_NUMBER, + } + cryptography_info = { + 'version': getattr(cryptography, '__version__', ''), + } + idna_info = { + 'version': getattr(idna, '__version__', ''), + } + + # OPENSSL_VERSION_NUMBER doesn't exist in the Python 2.6 ssl module. + system_ssl = getattr(ssl, 'OPENSSL_VERSION_NUMBER', None) + system_ssl_info = { + 'version': '%x' % system_ssl if system_ssl is not None else '' + } + + return { + 'platform': platform_info, + 'implementation': implementation_info, + 'system_ssl': system_ssl_info, + 'using_pyopenssl': pyopenssl is not None, + 'pyOpenSSL': pyopenssl_info, + 'urllib3': urllib3_info, + 'chardet': chardet_info, + 'cryptography': cryptography_info, + 'idna': idna_info, + 'requests': { + 'version': requests_version, + }, + } + + +def main(): + """Pretty-print the bug information as JSON.""" + print(json.dumps(info(), sort_keys=True, indent=2)) + + +if __name__ == '__main__': + main() diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/hooks.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/hooks.py new file mode 100644 index 0000000000000000000000000000000000000000..32b32de75047dbc94bc7757801fe3ec4733bad43 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/hooks.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- + +""" +requests.hooks +~~~~~~~~~~~~~~ + +This module provides the capabilities for the Requests hooks system. + +Available hooks: + +``response``: + The response generated from a Request. +""" +HOOKS = ['response'] + + +def default_hooks(): + return dict((event, []) for event in HOOKS) + +# TODO: response is the only one + + +def dispatch_hook(key, hooks, hook_data, **kwargs): + """Dispatches a hook dictionary on a given piece of data.""" + hooks = hooks or dict() + hooks = hooks.get(key) + if hooks: + if hasattr(hooks, '__call__'): + hooks = [hooks] + for hook in hooks: + _hook_data = hook(hook_data, **kwargs) + if _hook_data is not None: + hook_data = _hook_data + return hook_data diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/models.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/models.py new file mode 100644 index 0000000000000000000000000000000000000000..fd677517809bc9915f6c92632c004725798b28be --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/models.py @@ -0,0 +1,948 @@ +# -*- coding: utf-8 -*- + +""" +requests.models +~~~~~~~~~~~~~~~ + +This module contains the primary objects that power Requests. +""" + +import datetime +import sys + +# Import encoding now, to avoid implicit import later. +# Implicit import within threads may cause LookupError when standard library is in a ZIP, +# such as in Embedded Python. See https://github.com/requests/requests/issues/3578. +import encodings.idna + +from .packages.urllib3.fields import RequestField +from .packages.urllib3.filepost import encode_multipart_formdata +from .packages.urllib3.util import parse_url +from .packages.urllib3.exceptions import ( + DecodeError, ReadTimeoutError, ProtocolError, LocationParseError) + +from io import UnsupportedOperation +from .hooks import default_hooks +from .structures import CaseInsensitiveDict + +from .auth import HTTPBasicAuth +from .cookies import cookiejar_from_dict, get_cookie_header, _copy_cookie_jar +from .exceptions import ( + HTTPError, MissingSchema, InvalidURL, ChunkedEncodingError, + ContentDecodingError, ConnectionError, StreamConsumedError) +from ._internal_utils import to_native_string, unicode_is_ascii +from .utils import ( + guess_filename, get_auth_from_url, requote_uri, + stream_decode_response_unicode, to_key_val_list, parse_header_links, + iter_slices, guess_json_utf, super_len, check_header_validity) +from .compat import ( + Callable, Mapping, + cookielib, urlunparse, urlsplit, urlencode, str, bytes, + is_py2, chardet, builtin_str, basestring) +from .compat import json as complexjson +from .status_codes import codes + +#: The set of HTTP status codes that indicate an automatically +#: processable redirect. +REDIRECT_STATI = ( + codes.moved, # 301 + codes.found, # 302 + codes.other, # 303 + codes.temporary_redirect, # 307 + codes.permanent_redirect, # 308 +) + +DEFAULT_REDIRECT_LIMIT = 30 +CONTENT_CHUNK_SIZE = 10 * 1024 +ITER_CHUNK_SIZE = 512 + + +class RequestEncodingMixin(object): + @property + def path_url(self): + """Build the path URL to use.""" + + url = [] + + p = urlsplit(self.url) + + path = p.path + if not path: + path = '/' + + url.append(path) + + query = p.query + if query: + url.append('?') + url.append(query) + + return ''.join(url) + + @staticmethod + def _encode_params(data): + """Encode parameters in a piece of data. + + Will successfully encode parameters when passed as a dict or a list of + 2-tuples. Order is retained if data is a list of 2-tuples but arbitrary + if parameters are supplied as a dict. + """ + + if isinstance(data, (str, bytes)): + return data + elif hasattr(data, 'read'): + return data + elif hasattr(data, '__iter__'): + result = [] + for k, vs in to_key_val_list(data): + if isinstance(vs, basestring) or not hasattr(vs, '__iter__'): + vs = [vs] + for v in vs: + if v is not None: + result.append( + (k.encode('utf-8') if isinstance(k, str) else k, + v.encode('utf-8') if isinstance(v, str) else v)) + return urlencode(result, doseq=True) + else: + return data + + @staticmethod + def _encode_files(files, data): + """Build the body for a multipart/form-data request. + + Will successfully encode files when passed as a dict or a list of + tuples. Order is retained if data is a list of tuples but arbitrary + if parameters are supplied as a dict. + The tuples may be 2-tuples (filename, fileobj), 3-tuples (filename, fileobj, contentype) + or 4-tuples (filename, fileobj, contentype, custom_headers). + """ + if (not files): + raise ValueError("Files must be provided.") + elif isinstance(data, basestring): + raise ValueError("Data must not be a string.") + + new_fields = [] + fields = to_key_val_list(data or {}) + files = to_key_val_list(files or {}) + + for field, val in fields: + if isinstance(val, basestring) or not hasattr(val, '__iter__'): + val = [val] + for v in val: + if v is not None: + # Don't call str() on bytestrings: in Py3 it all goes wrong. + if not isinstance(v, bytes): + v = str(v) + + new_fields.append( + (field.decode('utf-8') if isinstance(field, bytes) else field, + v.encode('utf-8') if isinstance(v, str) else v)) + + for (k, v) in files: + # support for explicit filename + ft = None + fh = None + if isinstance(v, (tuple, list)): + if len(v) == 2: + fn, fp = v + elif len(v) == 3: + fn, fp, ft = v + else: + fn, fp, ft, fh = v + else: + fn = guess_filename(v) or k + fp = v + + if isinstance(fp, (str, bytes, bytearray)): + fdata = fp + else: + fdata = fp.read() + + rf = RequestField(name=k, data=fdata, filename=fn, headers=fh) + rf.make_multipart(content_type=ft) + new_fields.append(rf) + + body, content_type = encode_multipart_formdata(new_fields) + + return body, content_type + + +class RequestHooksMixin(object): + def register_hook(self, event, hook): + """Properly register a hook.""" + + if event not in self.hooks: + raise ValueError('Unsupported event specified, with event name "%s"' % (event)) + + if isinstance(hook, Callable): + self.hooks[event].append(hook) + elif hasattr(hook, '__iter__'): + self.hooks[event].extend(h for h in hook if isinstance(h, Callable)) + + def deregister_hook(self, event, hook): + """Deregister a previously registered hook. + Returns True if the hook existed, False if not. + """ + + try: + self.hooks[event].remove(hook) + return True + except ValueError: + return False + + +class Request(RequestHooksMixin): + """A user-created :class:`Request ` object. + + Used to prepare a :class:`PreparedRequest `, which is sent to the server. + + :param method: HTTP method to use. + :param url: URL to send. + :param headers: dictionary of headers to send. + :param files: dictionary of {filename: fileobject} files to multipart upload. + :param data: the body to attach to the request. If a dictionary is provided, form-encoding will take place. + :param json: json for the body to attach to the request (if files or data is not specified). + :param params: dictionary of URL parameters to append to the URL. + :param auth: Auth handler or (user, pass) tuple. + :param cookies: dictionary or CookieJar of cookies to attach to this request. + :param hooks: dictionary of callback hooks, for internal usage. + + Usage:: + + >>> import requests + >>> req = requests.Request('GET', 'http://httpbin.org/get') + >>> req.prepare() + + """ + + def __init__(self, + method=None, url=None, headers=None, files=None, data=None, + params=None, auth=None, cookies=None, hooks=None, json=None): + + # Default empty dicts for dict params. + data = [] if data is None else data + files = [] if files is None else files + headers = {} if headers is None else headers + params = {} if params is None else params + hooks = {} if hooks is None else hooks + + self.hooks = default_hooks() + for (k, v) in list(hooks.items()): + self.register_hook(event=k, hook=v) + + self.method = method + self.url = url + self.headers = headers + self.files = files + self.data = data + self.json = json + self.params = params + self.auth = auth + self.cookies = cookies + + def __repr__(self): + return '' % (self.method) + + def prepare(self): + """Constructs a :class:`PreparedRequest ` for transmission and returns it.""" + p = PreparedRequest() + p.prepare( + method=self.method, + url=self.url, + headers=self.headers, + files=self.files, + data=self.data, + json=self.json, + params=self.params, + auth=self.auth, + cookies=self.cookies, + hooks=self.hooks, + ) + return p + + +class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): + """The fully mutable :class:`PreparedRequest ` object, + containing the exact bytes that will be sent to the server. + + Generated from either a :class:`Request ` object or manually. + + Usage:: + + >>> import requests + >>> req = requests.Request('GET', 'http://httpbin.org/get') + >>> r = req.prepare() + + + >>> s = requests.Session() + >>> s.send(r) + + """ + + def __init__(self): + #: HTTP verb to send to the server. + self.method = None + #: HTTP URL to send the request to. + self.url = None + #: dictionary of HTTP headers. + self.headers = None + # The `CookieJar` used to create the Cookie header will be stored here + # after prepare_cookies is called + self._cookies = None + #: request body to send to the server. + self.body = None + #: dictionary of callback hooks, for internal usage. + self.hooks = default_hooks() + #: integer denoting starting position of a readable file-like body. + self._body_position = None + + def prepare(self, + method=None, url=None, headers=None, files=None, data=None, + params=None, auth=None, cookies=None, hooks=None, json=None): + """Prepares the entire request with the given parameters.""" + + self.prepare_method(method) + self.prepare_url(url, params) + self.prepare_headers(headers) + self.prepare_cookies(cookies) + self.prepare_body(data, files, json) + self.prepare_auth(auth, url) + + # Note that prepare_auth must be last to enable authentication schemes + # such as OAuth to work on a fully prepared request. + + # This MUST go after prepare_auth. Authenticators could add a hook + self.prepare_hooks(hooks) + + def __repr__(self): + return '' % (self.method) + + def copy(self): + p = PreparedRequest() + p.method = self.method + p.url = self.url + p.headers = self.headers.copy() if self.headers is not None else None + p._cookies = _copy_cookie_jar(self._cookies) + p.body = self.body + p.hooks = self.hooks + p._body_position = self._body_position + return p + + def prepare_method(self, method): + """Prepares the given HTTP method.""" + self.method = method + if self.method is not None: + self.method = to_native_string(self.method.upper()) + + @staticmethod + def _get_idna_encoded_host(host): + import idna + + try: + host = idna.encode(host, uts46=True).decode('utf-8') + except idna.IDNAError: + raise UnicodeError + return host + + def prepare_url(self, url, params): + """Prepares the given HTTP URL.""" + #: Accept objects that have string representations. + #: We're unable to blindly call unicode/str functions + #: as this will include the bytestring indicator (b'') + #: on python 3.x. + #: https://github.com/requests/requests/pull/2238 + if isinstance(url, bytes): + url = url.decode('utf8') + else: + url = unicode(url) if is_py2 else str(url) + + # Remove leading whitespaces from url + url = url.lstrip() + + # Don't do any URL preparation for non-HTTP schemes like `mailto`, + # `data` etc to work around exceptions from `url_parse`, which + # handles RFC 3986 only. + if ':' in url and not url.lower().startswith('http'): + self.url = url + return + + # Support for unicode domain names and paths. + try: + scheme, auth, host, port, path, query, fragment = parse_url(url) + except LocationParseError as e: + raise InvalidURL(*e.args) + + if not scheme: + error = ("Invalid URL {0!r}: No schema supplied. Perhaps you meant http://{0}?") + error = error.format(to_native_string(url, 'utf8')) + + raise MissingSchema(error) + + if not host: + raise InvalidURL("Invalid URL %r: No host supplied" % url) + + # In general, we want to try IDNA encoding the hostname if the string contains + # non-ASCII characters. This allows users to automatically get the correct IDNA + # behaviour. For strings containing only ASCII characters, we need to also verify + # it doesn't start with a wildcard (*), before allowing the unencoded hostname. + if not unicode_is_ascii(host): + try: + host = self._get_idna_encoded_host(host) + except UnicodeError: + raise InvalidURL('URL has an invalid label.') + elif host.startswith(u'*'): + raise InvalidURL('URL has an invalid label.') + + # Carefully reconstruct the network location + netloc = auth or '' + if netloc: + netloc += '@' + netloc += host + if port: + netloc += ':' + str(port) + + # Bare domains aren't valid URLs. + if not path: + path = '/' + + if is_py2: + if isinstance(scheme, str): + scheme = scheme.encode('utf-8') + if isinstance(netloc, str): + netloc = netloc.encode('utf-8') + if isinstance(path, str): + path = path.encode('utf-8') + if isinstance(query, str): + query = query.encode('utf-8') + if isinstance(fragment, str): + fragment = fragment.encode('utf-8') + + if isinstance(params, (str, bytes)): + params = to_native_string(params) + + enc_params = self._encode_params(params) + if enc_params: + if query: + query = '%s&%s' % (query, enc_params) + else: + query = enc_params + + url = requote_uri(urlunparse([scheme, netloc, path, None, query, fragment])) + self.url = url + + def prepare_headers(self, headers): + """Prepares the given HTTP headers.""" + + self.headers = CaseInsensitiveDict() + if headers: + for header in headers.items(): + # Raise exception on invalid header value. + check_header_validity(header) + name, value = header + self.headers[to_native_string(name)] = value + + def prepare_body(self, data, files, json=None): + """Prepares the given HTTP body data.""" + + # Check if file, fo, generator, iterator. + # If not, run through normal process. + + # Nottin' on you. + body = None + content_type = None + + if not data and json is not None: + # urllib3 requires a bytes-like body. Python 2's json.dumps + # provides this natively, but Python 3 gives a Unicode string. + content_type = 'application/json' + body = complexjson.dumps(json) + if not isinstance(body, bytes): + body = body.encode('utf-8') + + is_stream = all([ + hasattr(data, '__iter__'), + not isinstance(data, (basestring, list, tuple, Mapping)) + ]) + + try: + length = super_len(data) + except (TypeError, AttributeError, UnsupportedOperation): + length = None + + if is_stream: + body = data + + if getattr(body, 'tell', None) is not None: + # Record the current file position before reading. + # This will allow us to rewind a file in the event + # of a redirect. + try: + self._body_position = body.tell() + except (IOError, OSError): + # This differentiates from None, allowing us to catch + # a failed `tell()` later when trying to rewind the body + self._body_position = object() + + if files: + raise NotImplementedError('Streamed bodies and files are mutually exclusive.') + + if length: + self.headers['Content-Length'] = builtin_str(length) + else: + self.headers['Transfer-Encoding'] = 'chunked' + else: + # Multi-part file uploads. + if files: + (body, content_type) = self._encode_files(files, data) + else: + if data: + body = self._encode_params(data) + if isinstance(data, basestring) or hasattr(data, 'read'): + content_type = None + else: + content_type = 'application/x-www-form-urlencoded' + + self.prepare_content_length(body) + + # Add content-type if it wasn't explicitly provided. + if content_type and ('content-type' not in self.headers): + self.headers['Content-Type'] = content_type + + self.body = body + + def prepare_content_length(self, body): + """Prepare Content-Length header based on request method and body""" + if body is not None: + length = super_len(body) + if length: + # If length exists, set it. Otherwise, we fallback + # to Transfer-Encoding: chunked. + self.headers['Content-Length'] = builtin_str(length) + elif self.method not in ('GET', 'HEAD') and self.headers.get('Content-Length') is None: + # Set Content-Length to 0 for methods that can have a body + # but don't provide one. (i.e. not GET or HEAD) + self.headers['Content-Length'] = '0' + + def prepare_auth(self, auth, url=''): + """Prepares the given HTTP auth data.""" + + # If no Auth is explicitly provided, extract it from the URL first. + if auth is None: + url_auth = get_auth_from_url(self.url) + auth = url_auth if any(url_auth) else None + + if auth: + if isinstance(auth, tuple) and len(auth) == 2: + # special-case basic HTTP auth + auth = HTTPBasicAuth(*auth) + + # Allow auth to make its changes. + r = auth(self) + + # Update self to reflect the auth changes. + self.__dict__.update(r.__dict__) + + # Recompute Content-Length + self.prepare_content_length(self.body) + + def prepare_cookies(self, cookies): + """Prepares the given HTTP cookie data. + + This function eventually generates a ``Cookie`` header from the + given cookies using cookielib. Due to cookielib's design, the header + will not be regenerated if it already exists, meaning this function + can only be called once for the life of the + :class:`PreparedRequest ` object. Any subsequent calls + to ``prepare_cookies`` will have no actual effect, unless the "Cookie" + header is removed beforehand. + """ + if isinstance(cookies, cookielib.CookieJar): + self._cookies = cookies + else: + self._cookies = cookiejar_from_dict(cookies) + + cookie_header = get_cookie_header(self._cookies, self) + if cookie_header is not None: + self.headers['Cookie'] = cookie_header + + def prepare_hooks(self, hooks): + """Prepares the given hooks.""" + # hooks can be passed as None to the prepare method and to this + # method. To prevent iterating over None, simply use an empty list + # if hooks is False-y + hooks = hooks or [] + for event in hooks: + self.register_hook(event, hooks[event]) + + +class Response(object): + """The :class:`Response ` object, which contains a + server's response to an HTTP request. + """ + + __attrs__ = [ + '_content', 'status_code', 'headers', 'url', 'history', + 'encoding', 'reason', 'cookies', 'elapsed', 'request' + ] + + def __init__(self): + self._content = False + self._content_consumed = False + self._next = None + + #: Integer Code of responded HTTP Status, e.g. 404 or 200. + self.status_code = None + + #: Case-insensitive Dictionary of Response Headers. + #: For example, ``headers['content-encoding']`` will return the + #: value of a ``'Content-Encoding'`` response header. + self.headers = CaseInsensitiveDict() + + #: File-like object representation of response (for advanced usage). + #: Use of ``raw`` requires that ``stream=True`` be set on the request. + # This requirement does not apply for use internally to Requests. + self.raw = None + + #: Final URL location of Response. + self.url = None + + #: Encoding to decode with when accessing r.text. + self.encoding = None + + #: A list of :class:`Response ` objects from + #: the history of the Request. Any redirect responses will end + #: up here. The list is sorted from the oldest to the most recent request. + self.history = [] + + #: Textual reason of responded HTTP Status, e.g. "Not Found" or "OK". + self.reason = None + + #: A CookieJar of Cookies the server sent back. + self.cookies = cookiejar_from_dict({}) + + #: The amount of time elapsed between sending the request + #: and the arrival of the response (as a timedelta). + #: This property specifically measures the time taken between sending + #: the first byte of the request and finishing parsing the headers. It + #: is therefore unaffected by consuming the response content or the + #: value of the ``stream`` keyword argument. + self.elapsed = datetime.timedelta(0) + + #: The :class:`PreparedRequest ` object to which this + #: is a response. + self.request = None + + def __enter__(self): + return self + + def __exit__(self, *args): + self.close() + + def __getstate__(self): + # Consume everything; accessing the content attribute makes + # sure the content has been fully read. + if not self._content_consumed: + self.content + + return dict( + (attr, getattr(self, attr, None)) + for attr in self.__attrs__ + ) + + def __setstate__(self, state): + for name, value in state.items(): + setattr(self, name, value) + + # pickled objects do not have .raw + setattr(self, '_content_consumed', True) + setattr(self, 'raw', None) + + def __repr__(self): + return '' % (self.status_code) + + def __bool__(self): + """Returns True if :attr:`status_code` is less than 400. + + This attribute checks if the status code of the response is between + 400 and 600 to see if there was a client error or a server error. If + the status code, is between 200 and 400, this will return True. This + is **not** a check to see if the response code is ``200 OK``. + """ + return self.ok + + def __nonzero__(self): + """Returns True if :attr:`status_code` is less than 400. + + This attribute checks if the status code of the response is between + 400 and 600 to see if there was a client error or a server error. If + the status code, is between 200 and 400, this will return True. This + is **not** a check to see if the response code is ``200 OK``. + """ + return self.ok + + def __iter__(self): + """Allows you to use a response as an iterator.""" + return self.iter_content(128) + + @property + def ok(self): + """Returns True if :attr:`status_code` is less than 400. + + This attribute checks if the status code of the response is between + 400 and 600 to see if there was a client error or a server error. If + the status code, is between 200 and 400, this will return True. This + is **not** a check to see if the response code is ``200 OK``. + """ + try: + self.raise_for_status() + except HTTPError: + return False + return True + + @property + def is_redirect(self): + """True if this Response is a well-formed HTTP redirect that could have + been processed automatically (by :meth:`Session.resolve_redirects`). + """ + return ('location' in self.headers and self.status_code in REDIRECT_STATI) + + @property + def is_permanent_redirect(self): + """True if this Response one of the permanent versions of redirect.""" + return ('location' in self.headers and self.status_code in (codes.moved_permanently, codes.permanent_redirect)) + + @property + def next(self): + """Returns a PreparedRequest for the next request in a redirect chain, if there is one.""" + return self._next + + @property + def apparent_encoding(self): + """The apparent encoding, provided by the chardet library.""" + return chardet.detect(self.content)['encoding'] + + def iter_content(self, chunk_size=1, decode_unicode=False): + """Iterates over the response data. When stream=True is set on the + request, this avoids reading the content at once into memory for + large responses. The chunk size is the number of bytes it should + read into memory. This is not necessarily the length of each item + returned as decoding can take place. + + chunk_size must be of type int or None. A value of None will + function differently depending on the value of `stream`. + stream=True will read data as it arrives in whatever size the + chunks are received. If stream=False, data is returned as + a single chunk. + + If decode_unicode is True, content will be decoded using the best + available encoding based on the response. + """ + + def generate(): + # Special case for urllib3. + if hasattr(self.raw, 'stream'): + try: + for chunk in self.raw.stream(chunk_size, decode_content=True): + yield chunk + except ProtocolError as e: + raise ChunkedEncodingError(e) + except DecodeError as e: + raise ContentDecodingError(e) + except ReadTimeoutError as e: + raise ConnectionError(e) + else: + # Standard file-like object. + while True: + chunk = self.raw.read(chunk_size) + if not chunk: + break + yield chunk + + self._content_consumed = True + + if self._content_consumed and isinstance(self._content, bool): + raise StreamConsumedError() + elif chunk_size is not None and not isinstance(chunk_size, int): + raise TypeError("chunk_size must be an int, it is instead a %s." % type(chunk_size)) + # simulate reading small chunks of the content + reused_chunks = iter_slices(self._content, chunk_size) + + stream_chunks = generate() + + chunks = reused_chunks if self._content_consumed else stream_chunks + + if decode_unicode: + chunks = stream_decode_response_unicode(chunks, self) + + return chunks + + def iter_lines(self, chunk_size=ITER_CHUNK_SIZE, decode_unicode=None, delimiter=None): + """Iterates over the response data, one line at a time. When + stream=True is set on the request, this avoids reading the + content at once into memory for large responses. + + .. note:: This method is not reentrant safe. + """ + + pending = None + + for chunk in self.iter_content(chunk_size=chunk_size, decode_unicode=decode_unicode): + + if pending is not None: + chunk = pending + chunk + + if delimiter: + lines = chunk.split(delimiter) + else: + lines = chunk.splitlines() + + if lines and lines[-1] and chunk and lines[-1][-1] == chunk[-1]: + pending = lines.pop() + else: + pending = None + + for line in lines: + yield line + + if pending is not None: + yield pending + + @property + def content(self): + """Content of the response, in bytes.""" + + if self._content is False: + # Read the contents. + if self._content_consumed: + raise RuntimeError( + 'The content for this response was already consumed') + + if self.status_code == 0 or self.raw is None: + self._content = None + else: + self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes() + + self._content_consumed = True + # don't need to release the connection; that's been handled by urllib3 + # since we exhausted the data. + return self._content + + @property + def text(self): + """Content of the response, in unicode. + + If Response.encoding is None, encoding will be guessed using + ``chardet``. + + The encoding of the response content is determined based solely on HTTP + headers, following RFC 2616 to the letter. If you can take advantage of + non-HTTP knowledge to make a better guess at the encoding, you should + set ``r.encoding`` appropriately before accessing this property. + """ + + # Try charset from content-type + content = None + encoding = self.encoding + + if not self.content: + return str('') + + # Fallback to auto-detected encoding. + if self.encoding is None: + encoding = self.apparent_encoding + + # Decode unicode from given encoding. + try: + content = str(self.content, encoding, errors='replace') + except (LookupError, TypeError): + # A LookupError is raised if the encoding was not found which could + # indicate a misspelling or similar mistake. + # + # A TypeError can be raised if encoding is None + # + # So we try blindly encoding. + content = str(self.content, errors='replace') + + return content + + def json(self, **kwargs): + r"""Returns the json-encoded content of a response, if any. + + :param \*\*kwargs: Optional arguments that ``json.loads`` takes. + :raises ValueError: If the response body does not contain valid json. + """ + + if not self.encoding and self.content and len(self.content) > 3: + # No encoding set. JSON RFC 4627 section 3 states we should expect + # UTF-8, -16 or -32. Detect which one to use; If the detection or + # decoding fails, fall back to `self.text` (using chardet to make + # a best guess). + encoding = guess_json_utf(self.content) + if encoding is not None: + try: + return complexjson.loads( + self.content.decode(encoding), **kwargs + ) + except UnicodeDecodeError: + # Wrong UTF codec detected; usually because it's not UTF-8 + # but some other 8-bit codec. This is an RFC violation, + # and the server didn't bother to tell us what codec *was* + # used. + pass + return complexjson.loads(self.text, **kwargs) + + @property + def links(self): + """Returns the parsed header links of the response, if any.""" + + header = self.headers.get('link') + + # l = MultiDict() + l = {} + + if header: + links = parse_header_links(header) + + for link in links: + key = link.get('rel') or link.get('url') + l[key] = link + + return l + + def raise_for_status(self): + """Raises stored :class:`HTTPError`, if one occurred.""" + + http_error_msg = '' + if isinstance(self.reason, bytes): + # We attempt to decode utf-8 first because some servers + # choose to localize their reason strings. If the string + # isn't utf-8, we fall back to iso-8859-1 for all other + # encodings. (See PR #3538) + try: + reason = self.reason.decode('utf-8') + except UnicodeDecodeError: + reason = self.reason.decode('iso-8859-1') + else: + reason = self.reason + + if 400 <= self.status_code < 500: + http_error_msg = u'%s Client Error: %s for url: %s' % (self.status_code, reason, self.url) + + elif 500 <= self.status_code < 600: + http_error_msg = u'%s Server Error: %s for url: %s' % (self.status_code, reason, self.url) + + if http_error_msg: + raise HTTPError(http_error_msg, response=self) + + def close(self): + """Releases the connection back to the pool. Once this method has been + called the underlying ``raw`` object must not be accessed again. + + *Note: Should not normally need to be called explicitly.* + """ + if not self._content_consumed: + self.raw.close() + + release_conn = getattr(self.raw, 'release_conn', None) + if release_conn is not None: + release_conn() diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages.py new file mode 100644 index 0000000000000000000000000000000000000000..7232fe0ff7e85083d47d624532f29badd7c854d0 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages.py @@ -0,0 +1,14 @@ +import sys + +# This code exists for backwards compatibility reasons. +# I don't like it either. Just look the other way. :) + +for package in ('urllib3', 'idna', 'chardet'): + locals()[package] = __import__(package) + # This traversal is apparently necessary such that the identities are + # preserved (requests.packages.urllib3.* is urllib3.*) + for mod in list(sys.modules): + if mod == package or mod.startswith(package + '.'): + sys.modules['requests.packages.' + mod] = sys.modules[mod] + +# Kinda cool, though, right? diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..5a336894f6fd1e388df72ebfedbd09f93e38f9ea --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/__init__.py @@ -0,0 +1,3 @@ +from __future__ import absolute_import + +from . import urllib3 \ No newline at end of file diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/certifi/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/certifi/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..556193cefbf1f8b9b65cab70f394e28481af1fea --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/certifi/__init__.py @@ -0,0 +1,3 @@ +from .core import where, old_where + +__version__ = "2018.01.18" diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/certifi/__main__.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/certifi/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..5f1da0dd0c201e8aedc1552ef82a1780eb37276d --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/certifi/__main__.py @@ -0,0 +1,2 @@ +from certifi import where +print(where()) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/certifi/cacert.pem b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/certifi/cacert.pem new file mode 100644 index 0000000000000000000000000000000000000000..101ac98fa42d9eb4b27836e122cc81d495e33c21 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/certifi/cacert.pem @@ -0,0 +1,4433 @@ + +# Issuer: CN=GlobalSign Root CA O=GlobalSign nv-sa OU=Root CA +# Subject: CN=GlobalSign Root CA O=GlobalSign nv-sa OU=Root CA +# Label: "GlobalSign Root CA" +# Serial: 4835703278459707669005204 +# MD5 Fingerprint: 3e:45:52:15:09:51:92:e1:b7:5d:37:9f:b1:87:29:8a +# SHA1 Fingerprint: b1:bc:96:8b:d4:f4:9d:62:2a:a8:9a:81:f2:15:01:52:a4:1d:82:9c +# SHA256 Fingerprint: eb:d4:10:40:e4:bb:3e:c7:42:c9:e3:81:d3:1e:f2:a4:1a:48:b6:68:5c:96:e7:ce:f3:c1:df:6c:d4:33:1c:99 +-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG +A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv +b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw +MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i +YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT +aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ +jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp +xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp +1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG +snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ +U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8 +9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E +BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B +AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz +yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE +38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP +AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad +DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME +HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== +-----END CERTIFICATE----- + +# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R2 +# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R2 +# Label: "GlobalSign Root CA - R2" +# Serial: 4835703278459682885658125 +# MD5 Fingerprint: 94:14:77:7e:3e:5e:fd:8f:30:bd:41:b0:cf:e7:d0:30 +# SHA1 Fingerprint: 75:e0:ab:b6:13:85:12:27:1c:04:f8:5f:dd:de:38:e4:b7:24:2e:fe +# SHA256 Fingerprint: ca:42:dd:41:74:5f:d0:b8:1e:b9:02:36:2c:f9:d8:bf:71:9d:a1:bd:1b:1e:fc:94:6f:5b:4c:99:f4:2c:1b:9e +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G +A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp +Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1 +MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG +A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL +v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8 +eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq +tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd +C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa +zq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB +mTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH +V2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n +bG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG +3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs +J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO +291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS +ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd +AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 +TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== +-----END CERTIFICATE----- + +# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only +# Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only +# Label: "Verisign Class 3 Public Primary Certification Authority - G3" +# Serial: 206684696279472310254277870180966723415 +# MD5 Fingerprint: cd:68:b6:a7:c7:c4:ce:75:e0:1d:4f:57:44:61:92:09 +# SHA1 Fingerprint: 13:2d:0d:45:53:4b:69:97:cd:b2:d5:c3:39:e2:55:76:60:9b:5c:c6 +# SHA256 Fingerprint: eb:04:cf:5e:b1:f3:9a:fa:76:2f:2b:b1:20:f2:96:cb:a5:20:c1:b9:7d:b1:58:95:65:b8:1c:b9:a1:7b:72:44 +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl +cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu +LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT +aWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp +dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD +VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT +aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ +bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu +IENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg +LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMu6nFL8eB8aHm8b +N3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1EUGO+i2t +KmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGu +kxUccLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBm +CC+Vk7+qRy+oRpfwEuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJ +Xwzw3sJ2zq/3avL6QaaiMxTJ5Xpj055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWu +imi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAERSWwauSCPc/L8my/uRan2Te +2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5fj267Cz3qWhMe +DGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC +/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565p +F4ErWjfJXir0xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGt +TxzhT5yvDwyd93gN2PQ1VoDat20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== +-----END CERTIFICATE----- + +# Issuer: CN=Entrust.net Certification Authority (2048) O=Entrust.net OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited +# Subject: CN=Entrust.net Certification Authority (2048) O=Entrust.net OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited +# Label: "Entrust.net Premium 2048 Secure Server CA" +# Serial: 946069240 +# MD5 Fingerprint: ee:29:31:bc:32:7e:9a:e6:e8:b5:f7:51:b4:34:71:90 +# SHA1 Fingerprint: 50:30:06:09:1d:97:d4:f5:ae:39:f7:cb:e7:92:7d:7d:65:2d:34:31 +# SHA256 Fingerprint: 6d:c4:71:72:e0:1c:bc:b0:bf:62:58:0d:89:5f:e2:b8:ac:9a:d4:f8:73:80:1e:0c:10:b9:c8:37:d2:1e:b1:77 +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML +RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp +bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5 +IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQxNzUwNTFaFw0yOTA3 +MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3d3d3 +LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxp +YWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEG +A1UEAxMqRW50cnVzdC5uZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgp +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArU1LqRKGsuqjIAcVFmQq +K0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOLGp18EzoOH1u3Hs/lJBQe +sYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSrhRSGlVuX +MlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVT +XTzWnLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/ +HoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH +4QIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV +HQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJKoZIhvcNAQEFBQADggEBADub +j1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPyT/4xmf3IDExo +U8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf +zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5b +u/8j72gZyxKTJ1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+ +bYQLCIt+jerXmCHG8+c8eS9enNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/Er +fF6adulZkMV8gzURZVE= +-----END CERTIFICATE----- + +# Issuer: CN=Baltimore CyberTrust Root O=Baltimore OU=CyberTrust +# Subject: CN=Baltimore CyberTrust Root O=Baltimore OU=CyberTrust +# Label: "Baltimore CyberTrust Root" +# Serial: 33554617 +# MD5 Fingerprint: ac:b6:94:a5:9c:17:e0:d7:91:52:9b:b1:97:06:a6:e4 +# SHA1 Fingerprint: d4:de:20:d0:5e:66:fc:53:fe:1a:50:88:2c:78:db:28:52:ca:e4:74 +# SHA256 Fingerprint: 16:af:57:a9:f6:76:b0:ab:12:60:95:aa:5e:ba:de:f2:2a:b3:11:19:d6:44:ac:95:cd:4b:93:db:f3:f2:6a:eb +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ +RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD +VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX +DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y +ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy +VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr +mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr +IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK +mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu +XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy +dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye +jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1 +BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3 +DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92 +9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx +jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0 +Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz +ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS +R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp +-----END CERTIFICATE----- + +# Issuer: CN=AddTrust External CA Root O=AddTrust AB OU=AddTrust External TTP Network +# Subject: CN=AddTrust External CA Root O=AddTrust AB OU=AddTrust External TTP Network +# Label: "AddTrust External Root" +# Serial: 1 +# MD5 Fingerprint: 1d:35:54:04:85:78:b0:3f:42:42:4d:bf:20:73:0a:3f +# SHA1 Fingerprint: 02:fa:f3:e2:91:43:54:68:60:78:57:69:4d:f5:e4:5b:68:85:18:68 +# SHA256 Fingerprint: 68:7f:a4:51:38:22:78:ff:f0:c8:b1:1f:8d:43:d5:76:67:1c:6e:b2:bc:ea:b4:13:fb:83:d9:65:d0:6d:2f:f2 +-----BEGIN CERTIFICATE----- +MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs +IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290 +MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux +FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h +bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v +dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt +H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9 +uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX +mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX +a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN +E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0 +WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD +VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0 +Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU +cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx +IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN +AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH +YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 +6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC +Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX +c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a +mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= +-----END CERTIFICATE----- + +# Issuer: CN=Entrust Root Certification Authority O=Entrust, Inc. OU=www.entrust.net/CPS is incorporated by reference/(c) 2006 Entrust, Inc. +# Subject: CN=Entrust Root Certification Authority O=Entrust, Inc. OU=www.entrust.net/CPS is incorporated by reference/(c) 2006 Entrust, Inc. +# Label: "Entrust Root Certification Authority" +# Serial: 1164660820 +# MD5 Fingerprint: d6:a5:c3:ed:5d:dd:3e:00:c1:3d:87:92:1f:1d:3f:e4 +# SHA1 Fingerprint: b3:1e:b1:b7:40:e3:6c:84:02:da:dc:37:d4:4d:f5:d4:67:49:52:f9 +# SHA256 Fingerprint: 73:c1:76:43:4f:1b:c6:d5:ad:f4:5b:0e:76:e7:27:28:7c:8d:e5:76:16:c1:e6:e6:14:1a:2b:2c:bc:7d:8e:4c +-----BEGIN CERTIFICATE----- +MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMC +VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0 +Lm5ldC9DUFMgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMW +KGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsGA1UEAxMkRW50cnVzdCBSb290IENl +cnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0MloXDTI2MTEyNzIw +NTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMTkw +NwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSBy +ZWZlcmVuY2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNV +BAMTJEVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBALaVtkNC+sZtKm9I35RMOVcF7sN5EUFo +Nu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYszA9u3g3s+IIRe7bJWKKf4 +4LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOwwCj0Yzfv9 +KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGI +rb68j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi +94DkZfs0Nw4pgHBNrziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOB +sDCBrTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAi +gA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1MzQyWjAfBgNVHSMEGDAWgBRo +kORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DHhmak8fdLQ/uE +vW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA +A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9t +O1KzKtvn1ISMY/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6Zua +AGAT/3B+XxFNSRuzFVJ7yVTav52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP +9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTSW3iDVuycNsMm4hH2Z0kdkquM++v/ +eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0tHuu2guQOHXvgR1m +0vdXcDazv/wor3ElhVsT/h5/WrQ8 +-----END CERTIFICATE----- + +# Issuer: CN=GeoTrust Global CA O=GeoTrust Inc. +# Subject: CN=GeoTrust Global CA O=GeoTrust Inc. +# Label: "GeoTrust Global CA" +# Serial: 144470 +# MD5 Fingerprint: f7:75:ab:29:fb:51:4e:b7:77:5e:ff:05:3c:99:8e:f5 +# SHA1 Fingerprint: de:28:f4:a4:ff:e5:b9:2f:a3:c5:03:d1:a3:49:a7:f9:96:2a:82:12 +# SHA256 Fingerprint: ff:85:6a:2d:25:1d:cd:88:d3:66:56:f4:50:12:67:98:cf:ab:aa:de:40:79:9c:72:2d:e4:d2:b5:db:36:a7:3a +-----BEGIN CERTIFICATE----- +MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT +MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i +YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg +R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9 +9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq +fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv +iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU +1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ +bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW +MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA +ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l +uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn +Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS +tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF +PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un +hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV +5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== +-----END CERTIFICATE----- + +# Issuer: CN=GeoTrust Universal CA O=GeoTrust Inc. +# Subject: CN=GeoTrust Universal CA O=GeoTrust Inc. +# Label: "GeoTrust Universal CA" +# Serial: 1 +# MD5 Fingerprint: 92:65:58:8b:a2:1a:31:72:73:68:5c:b4:a5:7a:07:48 +# SHA1 Fingerprint: e6:21:f3:35:43:79:05:9a:4b:68:30:9d:8a:2f:74:22:15:87:ec:79 +# SHA256 Fingerprint: a0:45:9b:9f:63:b2:25:59:f5:fa:5d:4c:6d:b3:f9:f7:2f:f1:93:42:03:35:78:f0:73:bf:1d:1b:46:cb:b9:12 +-----BEGIN CERTIFICATE----- +MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEW +MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVy +c2FsIENBMB4XDTA0MDMwNDA1MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UE +BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xHjAcBgNVBAMTFUdlb1RydXN0 +IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKYV +VaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9tJPi8 +cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTT +QjOgNB0eRXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFh +F7em6fgemdtzbvQKoiFs7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2v +c7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d8Lsrlh/eezJS/R27tQahsiFepdaVaH/w +mZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7VqnJNk22CDtucvc+081xd +VHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3CgaRr0BHdCX +teGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZ +f9hBZ3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfRe +Bi9Fi1jUIxaS5BZuKGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+ +nhutxx9z3SxPGWX9f5NAEC7S8O08ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB +/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0XG0D08DYj3rWMB8GA1UdIwQY +MBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG +9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc +aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fX +IwjhmF7DWgh2qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzyn +ANXH/KttgCJwpQzgXQQpAvvLoJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0z +uzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsKxr2EoyNB3tZ3b4XUhRxQ4K5RirqN +Pnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxFKyDuSN/n3QmOGKja +QI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2DFKW +koRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9 +ER/frslKxfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQt +DF4JbAiXfKM9fJP/P6EUp8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/Sfuvm +bJxPgWp6ZKy7PtXny3YuxadIwVyQD8vIP/rmMuGNG2+k5o7Y+SlIis5z/iw= +-----END CERTIFICATE----- + +# Issuer: CN=GeoTrust Universal CA 2 O=GeoTrust Inc. +# Subject: CN=GeoTrust Universal CA 2 O=GeoTrust Inc. +# Label: "GeoTrust Universal CA 2" +# Serial: 1 +# MD5 Fingerprint: 34:fc:b8:d0:36:db:9e:14:b3:c2:f2:db:8f:e4:94:c7 +# SHA1 Fingerprint: 37:9a:19:7b:41:85:45:35:0c:a6:03:69:f3:3c:2e:af:47:4f:20:79 +# SHA256 Fingerprint: a0:23:4f:3b:c8:52:7c:a5:62:8e:ec:81:ad:5d:69:89:5d:a5:68:0d:c9:1d:1c:b8:47:7f:33:f8:78:b9:5b:0b +-----BEGIN CERTIFICATE----- +MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEW +MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVy +c2FsIENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYD +VQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1 +c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0DE81 +WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUG +FF+3Qs17j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdq +XbboW0W63MOhBW9Wjo8QJqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxL +se4YuU6W3Nx2/zu+z18DwPw76L5GG//aQMJS9/7jOvdqdzXQ2o3rXhhqMcceujwb +KNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2WP0+GfPtDCapkzj4T8Fd +IgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP20gaXT73 +y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRt +hAAnZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgoc +QIgfksILAAX/8sgCSqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4 +Lt1ZrtmhN79UNdxzMk+MBB4zsslG8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAfBgNV +HSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8EBAMCAYYwDQYJ +KoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z +dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQ +L1EuxBRa3ugZ4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgr +Fg5fNuH8KrUwJM/gYwx7WBr+mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSo +ag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpqA1Ihn0CoZ1Dy81of398j9tx4TuaY +T1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpgY+RdM4kX2TGq2tbz +GDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiPpm8m +1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJV +OCiNUW7dFGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH +6aLcr34YEoP9VhdBLtUpgn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwX +QMAJKOSLakhT2+zNVVXxxvjpoixMptEmX36vWkzaH6byHCx+rgIW0lbQL1dTR+iS +-----END CERTIFICATE----- + +# Issuer: CN=Visa eCommerce Root O=VISA OU=Visa International Service Association +# Subject: CN=Visa eCommerce Root O=VISA OU=Visa International Service Association +# Label: "Visa eCommerce Root" +# Serial: 25952180776285836048024890241505565794 +# MD5 Fingerprint: fc:11:b8:d8:08:93:30:00:6d:23:f9:7e:eb:52:1e:02 +# SHA1 Fingerprint: 70:17:9b:86:8c:00:a4:fa:60:91:52:22:3f:9f:3e:32:bd:e0:05:62 +# SHA256 Fingerprint: 69:fa:c9:bd:55:fb:0a:c7:8d:53:bb:ee:5c:f1:d5:97:98:9f:d0:aa:ab:20:a2:51:51:bd:f1:73:3e:e7:d1:22 +-----BEGIN CERTIFICATE----- +MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBr +MQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRl +cm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv +bW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2WhcNMjIwNjI0MDAxNjEyWjBrMQsw +CQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5h +dGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1l +cmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h +2mCxlCfLF9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4E +lpF7sDPwsRROEW+1QK8bRaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdV +ZqW1LS7YgFmypw23RuwhY/81q6UCzyr0TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq +299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI/k4+oKsGGelT84ATB+0t +vz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzsGHxBvfaL +dXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD +AgEGMB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUF +AAOCAQEAX/FBfXxcCLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcR +zCSs00Rsca4BIGsDoo8Ytyk6feUWYFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3 +LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pzzkWKsKZJ/0x9nXGIxHYdkFsd +7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBuYQa7FkKMcPcw +++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt +398znM/jra6O1I7mT1GvFpLgXPYHDw== +-----END CERTIFICATE----- + +# Issuer: CN=AAA Certificate Services O=Comodo CA Limited +# Subject: CN=AAA Certificate Services O=Comodo CA Limited +# Label: "Comodo AAA Services root" +# Serial: 1 +# MD5 Fingerprint: 49:79:04:b0:eb:87:19:ac:47:b0:bc:11:51:9b:74:d0 +# SHA1 Fingerprint: d1:eb:23:a4:6d:17:d6:8f:d9:25:64:c2:f1:f1:60:17:64:d8:e3:49 +# SHA256 Fingerprint: d7:a7:a0:fb:5d:7e:27:31:d7:71:e9:48:4e:bc:de:f7:1d:5f:0c:3e:0a:29:48:78:2b:c8:3e:e0:ea:69:9e:f4 +-----BEGIN CERTIFICATE----- +MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb +MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow +GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj +YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL +MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE +BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM +GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua +BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe +3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4 +YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR +rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm +ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU +oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF +MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v +QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t +b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF +AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q +GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz +Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2 +G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi +l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3 +smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== +-----END CERTIFICATE----- + +# Issuer: CN=QuoVadis Root Certification Authority O=QuoVadis Limited OU=Root Certification Authority +# Subject: CN=QuoVadis Root Certification Authority O=QuoVadis Limited OU=Root Certification Authority +# Label: "QuoVadis Root CA" +# Serial: 985026699 +# MD5 Fingerprint: 27:de:36:fe:72:b7:00:03:00:9d:f4:f0:1e:6c:04:24 +# SHA1 Fingerprint: de:3f:40:bd:50:93:d3:9b:6c:60:f6:da:bc:07:62:01:00:89:76:c9 +# SHA256 Fingerprint: a4:5e:de:3b:bb:f0:9c:8a:e1:5c:72:ef:c0:72:68:d6:93:a2:1c:99:6f:d5:1e:67:ca:07:94:60:fd:6d:88:73 +-----BEGIN CERTIFICATE----- +MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJC +TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAzMTkxODMzMzNaFw0yMTAzMTcxODMz +MzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUw +IwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVR +dW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Yp +li4kVEAkOPcahdxYTMukJ0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2D +rOpm2RgbaIr1VxqYuvXtdj182d6UajtLF8HVj71lODqV0D1VNk7feVcxKh7YWWVJ +WCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeLYzcS19Dsw3sgQUSj7cug +F+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWenAScOospU +xbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCC +Ak4wPQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVv +dmFkaXNvZmZzaG9yZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREw +ggENMIIBCQYJKwYBBAG+WAABMIH7MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNl +IG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBh +c3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFy +ZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh +Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYI +KwYBBQUHAgEWFmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3T +KbkGGew5Oanwl4Rqy+/fMIGuBgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rq +y+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1p +dGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYD +VQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6tlCL +MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSk +fnIYj9lofFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf8 +7C9TqnN7Az10buYWnuulLsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1R +cHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2xgI4JVrmcGmD+XcHXetwReNDWXcG31a0y +mQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi5upZIof4l/UO/erMkqQW +xFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi5nrQNiOK +SnQ2+Q== +-----END CERTIFICATE----- + +# Issuer: CN=QuoVadis Root CA 2 O=QuoVadis Limited +# Subject: CN=QuoVadis Root CA 2 O=QuoVadis Limited +# Label: "QuoVadis Root CA 2" +# Serial: 1289 +# MD5 Fingerprint: 5e:39:7b:dd:f8:ba:ec:82:e9:ac:62:ba:0c:54:00:2b +# SHA1 Fingerprint: ca:3a:fb:cf:12:40:36:4b:44:b2:16:20:88:80:48:39:19:93:7c:f7 +# SHA256 Fingerprint: 85:a0:dd:7d:d7:20:ad:b7:ff:05:f8:3d:54:2b:20:9d:c7:ff:45:28:f7:d6:77:b1:83:89:fe:a5:e5:c4:9e:86 +-----BEGIN CERTIFICATE----- +MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x +GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv +b3QgQ0EgMjAeFw0wNjExMjQxODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNV +BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W +YWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCa +GMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6XJxg +Fyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55J +WpzmM+Yklvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bB +rrcCaoF6qUWD4gXmuVbBlDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp ++ARz8un+XJiM9XOva7R+zdRcAitMOeGylZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1 +ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt66/3FsvbzSUr5R/7mp/i +Ucw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1JdxnwQ5hYIiz +PtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og +/zOhD7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UH +oycR7hYQe7xFSkyyBNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuI +yV77zGHcizN300QyNQliBJIWENieJ0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1Ud +EwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBQahGK8SEwzJQTU7tD2 +A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGUa6FJpEcwRTEL +MAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT +ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2f +BluornFdLwUvZ+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzn +g/iN/Ae42l9NLmeyhP3ZRPx3UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2Bl +fF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodmVjB3pjd4M1IQWK4/YY7yarHvGH5K +WWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK+JDSV6IZUaUtl0Ha +B0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrWIozc +hLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPR +TUIZ3Ph1WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWD +mbA4CD/pXvk1B+TJYm5Xf6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0Z +ohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y +4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8VCLAAVBpQ570su9t+Oza +8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u +-----END CERTIFICATE----- + +# Issuer: CN=QuoVadis Root CA 3 O=QuoVadis Limited +# Subject: CN=QuoVadis Root CA 3 O=QuoVadis Limited +# Label: "QuoVadis Root CA 3" +# Serial: 1478 +# MD5 Fingerprint: 31:85:3c:62:94:97:63:b9:aa:fd:89:4e:af:6f:e0:cf +# SHA1 Fingerprint: 1f:49:14:f7:d8:74:95:1d:dd:ae:02:c0:be:fd:3a:2d:82:75:51:85 +# SHA256 Fingerprint: 18:f1:fc:7f:20:5d:f8:ad:dd:eb:7f:e0:07:dd:57:e3:af:37:5a:9c:4d:8d:73:54:6b:f4:f1:fe:d1:e1:8d:35 +-----BEGIN CERTIFICATE----- +MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x +GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv +b3QgQ0EgMzAeFw0wNjExMjQxOTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNV +BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W +YWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDM +V0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNggDhoB +4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUr +H556VOijKTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd +8lyyBTNvijbO0BNO/79KDDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9Cabwv +vWhDFlaJKjdhkf2mrk7AyxRllDdLkgbvBNDInIjbC3uBr7E9KsRlOni27tyAsdLT +mZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwpp5ijJUMv7/FfJuGITfhe +btfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8nT8KKdjc +T5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDt +WAEXMJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZ +c6tsgLjoC2SToJyMGf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A +4iLItLRkT9a6fUg+qGkM17uGcclzuD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYD +VR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHTBgkrBgEEAb5YAAMwgcUwgZMG +CCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmljYXRlIGNvbnN0 +aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 +aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVu +dC4wLQYIKwYBBQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2Nw +czALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4G +A1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4ywLQoUmkRzBFMQswCQYDVQQGEwJC +TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UEAxMSUXVvVmFkaXMg +Um9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZVqyM0 +7ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSem +d1o417+shvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd ++LJ2w/w4E6oM3kJpK27zPOuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B +4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadN +t54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp8kokUvd0/bpO5qgdAm6x +DYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBCbjPsMZ57 +k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6s +zHXug/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0j +Wy10QJLZYxkNc91pvGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeT +mJlglFwjz1onl14LBQaTNx47aTbrqZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK +4SVhM7JZG+Ju1zdXtg2pEto= +-----END CERTIFICATE----- + +# Issuer: O=SECOM Trust.net OU=Security Communication RootCA1 +# Subject: O=SECOM Trust.net OU=Security Communication RootCA1 +# Label: "Security Communication Root CA" +# Serial: 0 +# MD5 Fingerprint: f1:bc:63:6a:54:e0:b5:27:f5:cd:e7:1a:e3:4d:6e:4a +# SHA1 Fingerprint: 36:b1:2b:49:f9:81:9e:d7:4c:9e:bc:38:0f:c6:56:8f:5d:ac:b2:f7 +# SHA256 Fingerprint: e7:5e:72:ed:9f:56:0e:ec:6e:b4:80:00:73:a4:3f:c3:ad:19:19:5a:39:22:82:01:78:95:97:4a:99:02:6b:6c +-----BEGIN CERTIFICATE----- +MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEY +MBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21t +dW5pY2F0aW9uIFJvb3RDQTEwHhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5 +WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYD +VQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw8yl8 +9f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJ +DKaVv0uMDPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9 +Ms+k2Y7CI9eNqPPYJayX5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/N +QV3Is00qVUarH9oe4kA92819uZKAnDfdDJZkndwi92SL32HeFZRSFaB9UslLqCHJ +xrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2JChzAgMBAAGjPzA9MB0G +A1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYwDwYDVR0T +AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vG +kl3g0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfr +Uj94nK9NrvjVT8+amCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5 +Bw+SUEmK3TGXX8npN6o7WWWXlDLJs58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJU +JRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ6rBK+1YWc26sTfcioU+tHXot +RSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAiFL39vmwLAw== +-----END CERTIFICATE----- + +# Issuer: CN=Sonera Class2 CA O=Sonera +# Subject: CN=Sonera Class2 CA O=Sonera +# Label: "Sonera Class 2 Root CA" +# Serial: 29 +# MD5 Fingerprint: a3:ec:75:0f:2e:88:df:fa:48:01:4e:0b:5c:48:6f:fb +# SHA1 Fingerprint: 37:f7:6d:e6:07:7c:90:c5:b1:3e:93:1a:b7:41:10:b4:f2:e4:9a:27 +# SHA256 Fingerprint: 79:08:b4:03:14:c1:38:10:0b:51:8d:07:35:80:7f:fb:fc:f8:51:8a:00:95:33:71:05:ba:38:6b:15:3d:d9:27 +-----BEGIN CERTIFICATE----- +MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP +MA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAx +MDQwNjA3Mjk0MFoXDTIxMDQwNjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNV +BAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMiBDQTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3/Ei9vX+ALTU74W+o +Z6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybTdXnt +5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s +3TmVToMGf+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2Ej +vOr7nQKV0ba5cTppCD8PtOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu +8nYybieDwnPz3BjotJPqdURrBGAgcVeHnfO+oJAjPYok4doh28MCAwEAAaMzMDEw +DwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITTXjwwCwYDVR0PBAQDAgEG +MA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt0jSv9zil +zqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/ +3DEIcbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvD +FNr450kkkdAdavphOe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6 +Tk6ezAyNlNzZRZxe7EJQY670XcSxEtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2 +ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLHllpwrN9M +-----END CERTIFICATE----- + +# Issuer: CN=XRamp Global Certification Authority O=XRamp Security Services Inc OU=www.xrampsecurity.com +# Subject: CN=XRamp Global Certification Authority O=XRamp Security Services Inc OU=www.xrampsecurity.com +# Label: "XRamp Global CA Root" +# Serial: 107108908803651509692980124233745014957 +# MD5 Fingerprint: a1:0b:44:b3:ca:10:d8:00:6e:9d:0f:d8:0f:92:0a:d1 +# SHA1 Fingerprint: b8:01:86:d1:eb:9c:86:a5:41:04:cf:30:54:f3:4c:52:b7:e5:58:c6 +# SHA256 Fingerprint: ce:cd:dc:90:50:99:d8:da:df:c5:b1:d2:09:b7:37:cb:e2:c1:8c:fb:2c:10:c0:ff:0b:cf:0d:32:86:fc:1a:a2 +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCB +gjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEk +MCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRY +UmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQxMTAxMTcx +NDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3 +dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2Vy +dmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS6 +38eMpSe2OAtp87ZOqCwuIR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCP +KZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMxfoArtYzAQDsRhtDLooY2YKTVMIJt2W7Q +DxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FEzG+gSqmUsE3a56k0enI4 +qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqsAxcZZPRa +JSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNVi +PvryxS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0P +BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASs +jVy16bYbMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0 +eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQEwDQYJKoZIhvcNAQEFBQAD +ggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc/Kh4ZzXxHfAR +vbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt +qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLa +IR9NmXmd4c8nnxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSy +i6mx5O+aGtA9aZnuqCij4Tyz8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQ +O+7ETPTsJ3xCwnR8gooJybQDJbw= +-----END CERTIFICATE----- + +# Issuer: O=The Go Daddy Group, Inc. OU=Go Daddy Class 2 Certification Authority +# Subject: O=The Go Daddy Group, Inc. OU=Go Daddy Class 2 Certification Authority +# Label: "Go Daddy Class 2 CA" +# Serial: 0 +# MD5 Fingerprint: 91:de:06:25:ab:da:fd:32:17:0c:bb:25:17:2a:84:67 +# SHA1 Fingerprint: 27:96:ba:e6:3f:18:01:e2:77:26:1b:a0:d7:77:70:02:8f:20:ee:e4 +# SHA256 Fingerprint: c3:84:6b:f2:4b:9e:93:ca:64:27:4c:0e:c6:7c:1e:cc:5e:02:4f:fc:ac:d2:d7:40:19:35:0e:81:fe:54:6a:e4 +-----BEGIN CERTIFICATE----- +MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEh +MB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBE +YWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3 +MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRo +ZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3Mg +MiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggEN +ADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCA +PVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6w +wdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXi +EqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMY +avx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+ +YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0OBBYEFNLE +sNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h +/t2oatTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5 +IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD +ggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy +OO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P +TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ +HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER +dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf +ReYNnyicsbkqWletNw+vHX/bvZ8= +-----END CERTIFICATE----- + +# Issuer: O=Starfield Technologies, Inc. OU=Starfield Class 2 Certification Authority +# Subject: O=Starfield Technologies, Inc. OU=Starfield Class 2 Certification Authority +# Label: "Starfield Class 2 CA" +# Serial: 0 +# MD5 Fingerprint: 32:4a:4b:bb:c8:63:69:9b:be:74:9a:c6:dd:1d:46:24 +# SHA1 Fingerprint: ad:7e:1c:28:b0:64:ef:8f:60:03:40:20:14:c3:d0:e3:37:0e:b5:8a +# SHA256 Fingerprint: 14:65:fa:20:53:97:b8:76:fa:a6:f0:a9:95:8e:55:90:e4:0f:cc:7f:aa:4f:b7:c2:c8:67:75:21:fb:5f:b6:58 +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl +MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp +U3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQw +NjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UE +ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZp +ZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqGSIb3 +DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf +8MOh2tTYbitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN ++lq2cwQlZut3f+dZxkqZJRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0 +X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVmepsZGD3/cVE8MC5fvj13c7JdBmzDI1aa +K4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSNF4Azbl5KXZnJHoe0nRrA +1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HFMIHCMB0G +A1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fR +zt0fhvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0 +YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBD +bGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8w +DQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGsafPzWdqbAYcaT1epoXkJKtv3 +L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLMPUxA2IGvd56D +eruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl +xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynp +VSJYACPq4xJDKVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEY +WQPJIrSPnNVeKtelttQKbfi3QBFGmh95DmK/D5fs4C8fF5Q= +-----END CERTIFICATE----- + +# Issuer: O=Government Root Certification Authority +# Subject: O=Government Root Certification Authority +# Label: "Taiwan GRCA" +# Serial: 42023070807708724159991140556527066870 +# MD5 Fingerprint: 37:85:44:53:32:45:1f:20:f0:f3:95:e1:25:c4:43:4e +# SHA1 Fingerprint: f4:8b:11:bf:de:ab:be:94:54:20:71:e6:41:de:6b:be:88:2b:40:b9 +# SHA256 Fingerprint: 76:00:29:5e:ef:e8:5b:9e:1f:d6:24:db:76:06:2a:aa:ae:59:81:8a:54:d2:77:4c:d4:c0:b2:c0:11:31:e1:b3 +-----BEGIN CERTIFICATE----- +MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/ +MQswCQYDVQQGEwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5MB4XDTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1ow +PzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dvdmVybm1lbnQgUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB +AJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qNw8XR +IePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1q +gQdW8or5BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKy +yhwOeYHWtXBiCAEuTk8O1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAts +F/tnyMKtsc2AtJfcdgEWFelq16TheEfOhtX7MfP6Mb40qij7cEwdScevLJ1tZqa2 +jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wovJ5pGfaENda1UhhXcSTvx +ls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7Q3hub/FC +VGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHK +YS1tB6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoH +EgKXTiCQ8P8NHuJBO9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThN +Xo+EHWbNxWCWtFJaBYmOlXqYwZE8lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1Ud +DgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNVHRMEBTADAQH/MDkGBGcqBwAE +MTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg209yewDL7MTqK +UWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ +TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyf +qzvS/3WXy6TjZwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaK +ZEk9GhiHkASfQlK3T8v+R0F2Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFE +JPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlUD7gsL0u8qV1bYH+Mh6XgUmMqvtg7 +hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6QzDxARvBMB1uUO07+1 +EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+HbkZ6Mm +nD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WX +udpVBrkk7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44Vbnz +ssQwmSNOXfJIoRIM3BKQCZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDe +LMDDav7v3Aun+kbfYNucpllQdSNpc5Oy+fwC00fmcc4QAu4njIT/rEUNE1yDMuAl +pYYsfPQS +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert Assured ID Root CA O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert Assured ID Root CA O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert Assured ID Root CA" +# Serial: 17154717934120587862167794914071425081 +# MD5 Fingerprint: 87:ce:0b:7b:2a:0e:49:00:e1:58:71:9b:37:a8:93:72 +# SHA1 Fingerprint: 05:63:b8:63:0d:62:d7:5a:bb:c8:ab:1e:4b:df:b5:a8:99:b2:4d:43 +# SHA256 Fingerprint: 3e:90:99:b5:01:5e:8f:48:6c:00:bc:ea:9d:11:1e:e7:21:fa:ba:35:5a:89:bc:f1:df:69:56:1e:3d:c6:32:5c +-----BEGIN CERTIFICATE----- +MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBl +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv +b3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzExMTEwMDAwMDAwWjBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl +cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwggEi +MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7c +JpSIqvTO9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYP +mDI2dsze3Tyoou9q+yHyUmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+ +wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4 +VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpyoeb6pNnVFzF1roV9Iq4/ +AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whfGHdPAgMB +AAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW +BBRF66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYun +pyGd823IDzANBgkqhkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRC +dWKuh+vy1dneVrOfzM4UKLkNl2BcEkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTf +fwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38FnSbNd67IJKusm7Xi+fT8r87cm +NW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i8b5QZ7dsvfPx +H2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe ++o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert Global Root CA O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert Global Root CA O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert Global Root CA" +# Serial: 10944719598952040374951832963794454346 +# MD5 Fingerprint: 79:e4:a9:84:0d:7d:3a:96:d7:c0:4f:e2:43:4c:89:2e +# SHA1 Fingerprint: a8:98:5d:3a:65:e5:e5:c4:b2:d7:d6:6d:40:c6:dd:2f:b1:9c:54:36 +# SHA256 Fingerprint: 43:48:a0:e9:44:4c:78:cb:26:5e:05:8d:5e:89:44:b4:d8:4f:96:62:bd:26:db:25:7f:89:34:a4:43:c7:01:61 +-----BEGIN CERTIFICATE----- +MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD +QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT +MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j +b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB +CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97 +nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt +43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P +T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4 +gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO +BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR +TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw +DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr +hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg +06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF +PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls +YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk +CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert High Assurance EV Root CA O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert High Assurance EV Root CA O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert High Assurance EV Root CA" +# Serial: 3553400076410547919724730734378100087 +# MD5 Fingerprint: d4:74:de:57:5c:39:b2:d3:9c:85:83:c5:c0:65:49:8a +# SHA1 Fingerprint: 5f:b7:ee:06:33:e2:59:db:ad:0c:4c:9a:e6:d3:8f:1a:61:c7:dc:25 +# SHA256 Fingerprint: 74:31:e5:f4:c3:c1:ce:46:90:77:4f:0b:61:e0:54:40:88:3b:a9:a0:1e:d0:0b:a6:ab:d7:80:6e:d3:b1:18:cf +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j +ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL +MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3 +LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug +RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm ++9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW +PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM +xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB +Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3 +hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg +EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA +FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec +nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z +eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF +hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2 +Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe +vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep ++OkuE6N36B9K +-----END CERTIFICATE----- + +# Issuer: CN=Class 2 Primary CA O=Certplus +# Subject: CN=Class 2 Primary CA O=Certplus +# Label: "Certplus Class 2 Primary CA" +# Serial: 177770208045934040241468760488327595043 +# MD5 Fingerprint: 88:2c:8c:52:b8:a2:3c:f3:f7:bb:03:ea:ae:ac:42:0b +# SHA1 Fingerprint: 74:20:74:41:72:9c:dd:92:ec:79:31:d8:23:10:8d:c2:81:92:e2:bb +# SHA256 Fingerprint: 0f:99:3c:8a:ef:97:ba:af:56:87:14:0e:d5:9a:d1:82:1b:b4:af:ac:f0:aa:9a:58:b5:d5:7a:33:8a:3a:fb:cb +-----BEGIN CERTIFICATE----- +MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAw +PTELMAkGA1UEBhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFz +cyAyIFByaW1hcnkgQ0EwHhcNOTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9 +MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2VydHBsdXMxGzAZBgNVBAMTEkNsYXNz +IDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANxQ +ltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR5aiR +VhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyL +kcAbmXuZVg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCd +EgETjdyAYveVqUSISnFOYFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yas +H7WLO7dDWWuwJKZtkIvEcupdM5i3y95ee++U8Rs+yskhwcWYAqqi9lt3m/V+llU0 +HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRMECDAGAQH/AgEKMAsGA1Ud +DwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJYIZIAYb4 +QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMu +Y29tL0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/ +AN9WM2K191EBkOvDP9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8 +yfFC82x/xXp8HVGIutIKPidd3i1RTtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMR +FcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+7UCmnYR0ObncHoUW2ikbhiMA +ybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW//1IMwrh3KWB +kJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7 +l7+ijrRU +-----END CERTIFICATE----- + +# Issuer: CN=DST Root CA X3 O=Digital Signature Trust Co. +# Subject: CN=DST Root CA X3 O=Digital Signature Trust Co. +# Label: "DST Root CA X3" +# Serial: 91299735575339953335919266965803778155 +# MD5 Fingerprint: 41:03:52:dc:0f:f7:50:1b:16:f0:02:8e:ba:6f:45:c5 +# SHA1 Fingerprint: da:c9:02:4f:54:d8:f6:df:94:93:5f:b1:73:26:38:ca:6a:d7:7c:13 +# SHA256 Fingerprint: 06:87:26:03:31:a7:24:03:d9:09:f1:05:e6:9b:cf:0d:32:e1:bd:24:93:ff:c6:d9:20:6d:11:bc:d6:77:07:39 +-----BEGIN CERTIFICATE----- +MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/ +MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT +DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow +PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD +Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O +rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq +OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b +xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw +7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD +aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV +HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG +SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69 +ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr +AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz +R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5 +JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo +Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ +-----END CERTIFICATE----- + +# Issuer: CN=SwissSign Gold CA - G2 O=SwissSign AG +# Subject: CN=SwissSign Gold CA - G2 O=SwissSign AG +# Label: "SwissSign Gold CA - G2" +# Serial: 13492815561806991280 +# MD5 Fingerprint: 24:77:d9:a8:91:d1:3b:fa:88:2d:c2:ff:f8:cd:33:93 +# SHA1 Fingerprint: d8:c5:38:8a:b7:30:1b:1b:6e:d4:7a:e6:45:25:3a:6f:9f:1a:27:61 +# SHA256 Fingerprint: 62:dd:0b:e9:b9:f5:0a:16:3e:a0:f8:e7:5c:05:3b:1e:ca:57:ea:55:c8:68:8f:64:7c:68:81:f2:c8:35:7b:95 +-----BEGIN CERTIFICATE----- +MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV +BAYTAkNIMRUwEwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2ln +biBHb2xkIENBIC0gRzIwHhcNMDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBF +MQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMR8wHQYDVQQDExZT +d2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +CgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUqt2/8 +76LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+ +bbqBHH5CjCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c +6bM8K8vzARO/Ws/BtQpgvd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqE +emA8atufK+ze3gE/bk3lUIbLtK/tREDFylqM2tIrfKjuvqblCqoOpd8FUrdVxyJd +MmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvRAiTysybUa9oEVeXBCsdt +MDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuendjIj3o02y +MszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69y +FGkOpeUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPi +aG59je883WX0XaxR7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxM +gI93e2CaHt+28kgeDrpOVG2Y4OGiGqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCB +qTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUWyV7 +lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64OfPAeGZe6Drn +8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov +L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe6 +45R88a7A3hfm5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczO +UYrHUDFu4Up+GC9pWbY9ZIEr44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5 +O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOfMke6UiI0HTJ6CVanfCU2qT1L2sCC +bwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6mGu6uLftIdxf+u+yv +GPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxpmo/a +77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCC +hdiDyyJkvC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid3 +92qgQmwLOM7XdVAyksLfKzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEpp +Ld6leNcG2mqeSz53OiATIgHQv2ieY2BrNU0LbbqhPcCT4H8js1WtciVORvnSFu+w +ZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6LqjviOvrv1vA+ACOzB2+htt +Qc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ +-----END CERTIFICATE----- + +# Issuer: CN=SwissSign Silver CA - G2 O=SwissSign AG +# Subject: CN=SwissSign Silver CA - G2 O=SwissSign AG +# Label: "SwissSign Silver CA - G2" +# Serial: 5700383053117599563 +# MD5 Fingerprint: e0:06:a1:c9:7d:cf:c9:fc:0d:c0:56:75:96:d8:62:13 +# SHA1 Fingerprint: 9b:aa:e5:9f:56:ee:21:cb:43:5a:be:25:93:df:a7:f0:40:d1:1d:cb +# SHA256 Fingerprint: be:6c:4d:a2:bb:b9:ba:59:b6:f3:93:97:68:37:42:46:c3:c0:05:99:3f:a9:8f:02:0d:1d:ed:be:d4:8a:81:d5 +-----BEGIN CERTIFICATE----- +MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UE +BhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWdu +IFNpbHZlciBDQSAtIEcyMB4XDTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0Nlow +RzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMY +U3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644N0Mv +Fz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7br +YT7QbNHm+/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieF +nbAVlDLaYQ1HTWBCrpJH6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH +6ATK72oxh9TAtvmUcXtnZLi2kUpCe2UuMGoM9ZDulebyzYLs2aFK7PayS+VFheZt +eJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5hqAaEuSh6XzjZG6k4sIN/ +c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5FZGkECwJ +MoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRH +HTBsROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTf +jNFusB3hB48IHpmccelM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb6 +5i/4z3GcRm25xBWNOHkDRUjvxF3XCO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOB +rDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU +F6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRBtjpbO8tFnb0c +wpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 +cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIB +AHPGgeAn0i0P4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShp +WJHckRE1qTodvBqlYJ7YH39FkWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9 +xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L3XWgwF15kIwb4FDm3jH+mHtwX6WQ +2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx/uNncqCxv1yL5PqZ +IseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFaDGi8 +aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2X +em1ZqSqPe97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQR +dAtq/gsD/KNVV4n+SsuuWxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/ +OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJDIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+ +hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ubDgEj8Z+7fNzcbBGXJbLy +tGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u +-----END CERTIFICATE----- + +# Issuer: CN=GeoTrust Primary Certification Authority O=GeoTrust Inc. +# Subject: CN=GeoTrust Primary Certification Authority O=GeoTrust Inc. +# Label: "GeoTrust Primary Certification Authority" +# Serial: 32798226551256963324313806436981982369 +# MD5 Fingerprint: 02:26:c3:01:5e:08:30:37:43:a9:d0:7d:cf:37:e6:bf +# SHA1 Fingerprint: 32:3c:11:8e:1b:f7:b8:b6:52:54:e2:e2:10:0d:d6:02:90:37:f0:96 +# SHA256 Fingerprint: 37:d5:10:06:c5:12:ea:ab:62:64:21:f1:ec:8c:92:01:3f:c5:f8:2a:e9:8e:e5:33:eb:46:19:b8:de:b4:d0:6c +-----BEGIN CERTIFICATE----- +MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBY +MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMo +R2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEx +MjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgxCzAJBgNVBAYTAlVTMRYwFAYDVQQK +Ew1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQcmltYXJ5IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9 +AWbK7hWNb6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjA +ZIVcFU2Ix7e64HXprQU9nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE0 +7e9GceBrAqg1cmuXm2bgyxx5X9gaBGgeRwLmnWDiNpcB3841kt++Z8dtd1k7j53W +kBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGttm/81w7a4DSwDRp35+MI +mO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4G +A1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJ +KoZIhvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ1 +6CePbJC/kRYkRj5KTs4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl +4b7UVXGYNTq+k+qurUKykG/g/CFNNWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6K +oKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHaFloxt/m0cYASSJlyc1pZU8Fj +UjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG1riR/aYNKxoU +AT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= +-----END CERTIFICATE----- + +# Issuer: CN=thawte Primary Root CA O=thawte, Inc. OU=Certification Services Division/(c) 2006 thawte, Inc. - For authorized use only +# Subject: CN=thawte Primary Root CA O=thawte, Inc. OU=Certification Services Division/(c) 2006 thawte, Inc. - For authorized use only +# Label: "thawte Primary Root CA" +# Serial: 69529181992039203566298953787712940909 +# MD5 Fingerprint: 8c:ca:dc:0b:22:ce:f5:be:72:ac:41:1a:11:a8:d8:12 +# SHA1 Fingerprint: 91:c6:d6:ee:3e:8a:c8:63:84:e5:48:c2:99:29:5c:75:6c:81:7b:81 +# SHA256 Fingerprint: 8d:72:2f:81:a9:c1:13:c0:79:1d:f1:36:a2:96:6d:b2:6c:95:0a:97:1d:b4:6b:41:99:f4:ea:54:b7:8b:fb:9f +-----BEGIN CERTIFICATE----- +MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCB +qTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf +Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw +MDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNV +BAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3MDAwMDAwWhcNMzYw +NzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5j +LjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYG +A1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsoPD7gFnUnMekz52hWXMJEEUMDSxuaPFs +W0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ1CRfBsDMRJSUjQJib+ta +3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGcq/gcfomk +6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6 +Sk/KaAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94J +NqR32HuHUETVPm4pafs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBA +MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XP +r87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUFAAOCAQEAeRHAS7ORtvzw6WfU +DW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeEuzLlQRHAd9mz +YJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX +xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2 +/qxAeeWsEG89jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/ +LHbTY5xZ3Y+m4Q6gLkH3LpVHz7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7 +jVaMaA== +-----END CERTIFICATE----- + +# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G5 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2006 VeriSign, Inc. - For authorized use only +# Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G5 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2006 VeriSign, Inc. - For authorized use only +# Label: "VeriSign Class 3 Public Primary Certification Authority - G5" +# Serial: 33037644167568058970164719475676101450 +# MD5 Fingerprint: cb:17:e4:31:67:3e:e2:09:fe:45:57:93:f3:0a:fa:1c +# SHA1 Fingerprint: 4e:b6:d5:78:49:9b:1c:cf:5f:58:1e:ad:56:be:3d:9b:67:44:a5:e5 +# SHA256 Fingerprint: 9a:cf:ab:7e:43:c8:d8:80:d0:6b:26:2a:94:de:ee:e4:b4:65:99:89:c3:d0:ca:f1:9b:af:64:05:e4:1a:b7:df +-----BEGIN CERTIFICATE----- +MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW +ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW +ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp +U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y +aXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1 +nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex +t0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz +SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG +BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+ +rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/ +NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E +BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH +BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy +aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv +MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE +p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y +5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK +WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ +4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N +hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq +-----END CERTIFICATE----- + +# Issuer: CN=SecureTrust CA O=SecureTrust Corporation +# Subject: CN=SecureTrust CA O=SecureTrust Corporation +# Label: "SecureTrust CA" +# Serial: 17199774589125277788362757014266862032 +# MD5 Fingerprint: dc:32:c3:a7:6d:25:57:c7:68:09:9d:ea:2d:a9:a2:d1 +# SHA1 Fingerprint: 87:82:c6:c3:04:35:3b:cf:d2:96:92:d2:59:3e:7d:44:d9:34:ff:11 +# SHA256 Fingerprint: f1:c1:b5:0a:e5:a2:0d:d8:03:0e:c9:f6:bc:24:82:3d:d3:67:b5:25:57:59:b4:e7:1b:61:fc:e9:f7:37:5d:73 +-----BEGIN CERTIFICATE----- +MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBI +MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x +FzAVBgNVBAMTDlNlY3VyZVRydXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIz +MTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAeBgNVBAoTF1NlY3VyZVRydXN0IENv +cnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQXOZEz +Zum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO +0gMdA+9tDWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIao +wW8xQmxSPmjL8xk037uHGFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj +7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b01k/unK8RCSc43Oz969XL0Imnal0ugBS +8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmHursCAwEAAaOBnTCBmjAT +BgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB +/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCeg +JYYjaHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGC +NxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt3 +6Z3q059c4EVlew3KW+JwULKUBRSuSceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/ +3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHfmbx8IVQr5Fiiu1cprp6poxkm +D5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZnMUFdAvnZyPS +CPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR +3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= +-----END CERTIFICATE----- + +# Issuer: CN=Secure Global CA O=SecureTrust Corporation +# Subject: CN=Secure Global CA O=SecureTrust Corporation +# Label: "Secure Global CA" +# Serial: 9751836167731051554232119481456978597 +# MD5 Fingerprint: cf:f4:27:0d:d4:ed:dc:65:16:49:6d:3d:da:bf:6e:de +# SHA1 Fingerprint: 3a:44:73:5a:e5:81:90:1f:24:86:61:46:1e:3b:9c:c4:5f:f5:3a:1b +# SHA256 Fingerprint: 42:00:f5:04:3a:c8:59:0e:bb:52:7d:20:9e:d1:50:30:29:fb:cb:d4:1c:a1:b5:06:ec:27:f1:5a:de:7d:ac:69 +-----BEGIN CERTIFICATE----- +MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBK +MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x +GTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkx +MjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3Qg +Q29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jxYDiJ +iQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa +/FHtaMbQbqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJ +jnIFHovdRIWCQtBJwB1g8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnI +HmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYVHDGA76oYa8J719rO+TMg1fW9ajMtgQT7 +sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi0XPnj3pDAgMBAAGjgZ0w +gZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCsw +KaAnoCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsG +AQQBgjcVAQQDAgEAMA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0L +URYD7xh8yOOvaliTFGCRsoTciE6+OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXO +H0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cnCDpOGR86p1hcF895P4vkp9Mm +I50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/53CYNv6ZHdAbY +iNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc +f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW +-----END CERTIFICATE----- + +# Issuer: CN=COMODO Certification Authority O=COMODO CA Limited +# Subject: CN=COMODO Certification Authority O=COMODO CA Limited +# Label: "COMODO Certification Authority" +# Serial: 104350513648249232941998508985834464573 +# MD5 Fingerprint: 5c:48:dc:f7:42:72:ec:56:94:6d:1c:cc:71:35:80:75 +# SHA1 Fingerprint: 66:31:bf:9e:f7:4f:9e:b6:c9:d5:a6:0c:ba:6a:be:d1:f7:bd:ef:7b +# SHA256 Fingerprint: 0c:2c:d6:3d:f7:80:6f:a3:99:ed:e8:09:11:6b:57:5b:f8:79:89:f0:65:18:f9:80:8c:86:05:03:17:8b:af:66 +-----BEGIN CERTIFICATE----- +MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCB +gTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G +A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNV +BAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEyMDEwMDAw +MDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3Jl +YXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01P +RE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3 +UcEbVASY06m/weaKXTuH+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI +2GqGd0S7WWaXUF601CxwRM/aN5VCaTwwxHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8 +Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV4EajcNxo2f8ESIl33rXp ++2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA1KGzqSX+ +DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5O +nKVIrLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW +/zAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6g +PKA6hjhodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9u +QXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOCAQEAPpiem/Yb6dc5t3iuHXIY +SdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CPOGEIqB6BCsAv +IC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ +RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4 +zJVSk/BwJVmcIGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5dd +BA6+C4OmF4O5MBKgxTMVBbkN+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IB +ZQ== +-----END CERTIFICATE----- + +# Issuer: CN=Network Solutions Certificate Authority O=Network Solutions L.L.C. +# Subject: CN=Network Solutions Certificate Authority O=Network Solutions L.L.C. +# Label: "Network Solutions Certificate Authority" +# Serial: 116697915152937497490437556386812487904 +# MD5 Fingerprint: d3:f3:a6:16:c0:fa:6b:1d:59:b1:2d:96:4d:0e:11:2e +# SHA1 Fingerprint: 74:f8:a3:c3:ef:e7:b3:90:06:4b:83:90:3c:21:64:60:20:e5:df:ce +# SHA256 Fingerprint: 15:f0:ba:00:a3:ac:7a:f3:ac:88:4c:07:2b:10:11:a0:77:bd:77:c0:97:f4:01:64:b2:f8:59:8a:bd:83:86:0c +-----BEGIN CERTIFICATE----- +MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBi +MQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu +MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3Jp +dHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMxMjM1OTU5WjBiMQswCQYDVQQGEwJV +UzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydO +ZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwz +c7MEL7xxjOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPP +OCwGJgl6cvf6UDL4wpPTaaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rl +mGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXTcrA/vGp97Eh/jcOrqnErU2lBUzS1sLnF +BgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc/Qzpf14Dl847ABSHJ3A4 +qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMBAAGjgZcw +gZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIB +BjAPBgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwu +bmV0c29sc3NsLmNvbS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3Jp +dHkuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc8 +6fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q4LqILPxFzBiwmZVRDuwduIj/ +h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/GGUsyfJj4akH +/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv +wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHN +pGxlaKFJdlxDydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey +-----END CERTIFICATE----- + +# Issuer: CN=COMODO ECC Certification Authority O=COMODO CA Limited +# Subject: CN=COMODO ECC Certification Authority O=COMODO CA Limited +# Label: "COMODO ECC Certification Authority" +# Serial: 41578283867086692638256921589707938090 +# MD5 Fingerprint: 7c:62:ff:74:9d:31:53:5e:68:4a:d5:78:aa:1e:bf:23 +# SHA1 Fingerprint: 9f:74:4e:9f:2b:4d:ba:ec:0f:31:2c:50:b6:56:3b:8e:2d:93:c3:11 +# SHA256 Fingerprint: 17:93:92:7a:06:14:54:97:89:ad:ce:2f:8f:34:f7:f0:b6:6d:0f:3a:e3:a3:b8:4d:21:ec:15:db:ba:4f:ad:c7 +-----BEGIN CERTIFICATE----- +MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTEL +MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE +BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMT +IkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwMzA2MDAw +MDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdy +ZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09N +T0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSR +FtSrYpn1PlILBs5BAH+X4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0J +cfRK9ChQtP6IHG4/bC8vCVlbpVsLM5niwz2J+Wos77LTBumjQjBAMB0GA1UdDgQW +BBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VGFAkK+qDm +fQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdv +GDeAU/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= +-----END CERTIFICATE----- + +# Issuer: CN=OISTE WISeKey Global Root GA CA O=WISeKey OU=Copyright (c) 2005/OISTE Foundation Endorsed +# Subject: CN=OISTE WISeKey Global Root GA CA O=WISeKey OU=Copyright (c) 2005/OISTE Foundation Endorsed +# Label: "OISTE WISeKey Global Root GA CA" +# Serial: 86718877871133159090080555911823548314 +# MD5 Fingerprint: bc:6c:51:33:a7:e9:d3:66:63:54:15:72:1b:21:92:93 +# SHA1 Fingerprint: 59:22:a1:e1:5a:ea:16:35:21:f8:98:39:6a:46:46:b0:44:1b:0f:a9 +# SHA256 Fingerprint: 41:c9:23:86:6a:b4:ca:d6:b7:ad:57:80:81:58:2e:02:07:97:a6:cb:df:4f:ff:78:ce:83:96:b3:89:37:d7:f5 +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCB +ijELMAkGA1UEBhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHly +aWdodCAoYykgMjAwNTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNl +ZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQSBDQTAeFw0w +NTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYDVQQGEwJDSDEQMA4G +A1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIwIAYD +VQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBX +SVNlS2V5IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAy0+zAJs9Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxR +VVuuk+g3/ytr6dTqvirdqFEr12bDYVxgAsj1znJ7O7jyTmUIms2kahnBAbtzptf2 +w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbDd50kc3vkDIzh2TbhmYsF +mQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ/yxViJGg +4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t9 +4B3RLoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYw +DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQw +EAYJKwYBBAGCNxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOx +SPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vImMMkQyh2I+3QZH4VFvbBsUfk2 +ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4+vg1YFkCExh8 +vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa +hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZi +Fj4A4xylNoEYokxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ +/L7fCg0= +-----END CERTIFICATE----- + +# Issuer: CN=Certigna O=Dhimyotis +# Subject: CN=Certigna O=Dhimyotis +# Label: "Certigna" +# Serial: 18364802974209362175 +# MD5 Fingerprint: ab:57:a6:5b:7d:42:82:19:b5:d8:58:26:28:5e:fd:ff +# SHA1 Fingerprint: b1:2e:13:63:45:86:a4:6f:1a:b2:60:68:37:58:2d:c4:ac:fd:94:97 +# SHA256 Fingerprint: e3:b6:a2:db:2e:d7:ce:48:84:2f:7a:c5:32:41:c7:b7:1d:54:14:4b:fb:40:c1:1f:3f:1d:0b:42:f5:ee:a1:2d +-----BEGIN CERTIFICATE----- +MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNV +BAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4X +DTA3MDYyOTE1MTMwNVoXDTI3MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQ +BgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwIQ2VydGlnbmEwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7qXOEm7RFHYeGifBZ4 +QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyHGxny +gQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbw +zBfsV1/pogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q +130yGLMLLGq/jj8UEYkgDncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2 +JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKfIrjxwo1p3Po6WAbfAgMBAAGjgbwwgbkw +DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQtCRZvgHyUtVF9lo53BEw +ZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJBgNVBAYT +AkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzj +AQ/JSP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG +9w0BAQUFAAOCAQEAhQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8h +bV6lUmPOEvjvKtpv6zf+EwLHyzs+ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFnc +fca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1kluPBS1xp81HlDQwY9qcEQCYsuu +HWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY1gkIl2PlwS6w +t0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw +WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== +-----END CERTIFICATE----- + +# Issuer: CN=Deutsche Telekom Root CA 2 O=Deutsche Telekom AG OU=T-TeleSec Trust Center +# Subject: CN=Deutsche Telekom Root CA 2 O=Deutsche Telekom AG OU=T-TeleSec Trust Center +# Label: "Deutsche Telekom Root CA 2" +# Serial: 38 +# MD5 Fingerprint: 74:01:4a:91:b1:08:c4:58:ce:47:cd:f0:dd:11:53:08 +# SHA1 Fingerprint: 85:a4:08:c0:9c:19:3e:5d:51:58:7d:cd:d6:13:30:fd:8c:de:37:bf +# SHA256 Fingerprint: b6:19:1a:50:d0:c3:97:7f:7d:a9:9b:cd:aa:c8:6a:22:7d:ae:b9:67:9e:c7:0b:a3:b0:c9:d9:22:71:c1:70:d3 +-----BEGIN CERTIFICATE----- +MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEc +MBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2Vj +IFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENB +IDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5MjM1OTAwWjBxMQswCQYDVQQGEwJE +RTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxl +U2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290 +IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEU +ha88EOQ5bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhC +QN/Po7qCWWqSG6wcmtoIKyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1Mjwr +rFDa1sPeg5TKqAyZMg4ISFZbavva4VhYAUlfckE8FQYBjl2tqriTtM2e66foai1S +NNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aKSe5TBY8ZTNXeWHmb0moc +QqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTVjlsB9WoH +txa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAP +BgNVHRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC +AQEAlGRZrTlk5ynrE/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756Abrsp +tJh6sTtU6zkXR34ajgv8HzFZMQSyzhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpa +IzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8rZ7/gFnkm0W09juwzTkZmDLl +6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4Gdyd1Lx+4ivn+ +xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU +Cm26OWMohpLzGITY+9HPBVZkVw== +-----END CERTIFICATE----- + +# Issuer: CN=Cybertrust Global Root O=Cybertrust, Inc +# Subject: CN=Cybertrust Global Root O=Cybertrust, Inc +# Label: "Cybertrust Global Root" +# Serial: 4835703278459682877484360 +# MD5 Fingerprint: 72:e4:4a:87:e3:69:40:80:77:ea:bc:e3:f4:ff:f0:e1 +# SHA1 Fingerprint: 5f:43:e5:b1:bf:f8:78:8c:ac:1c:c7:ca:4a:9a:c6:22:2b:cc:34:c6 +# SHA256 Fingerprint: 96:0a:df:00:63:e9:63:56:75:0c:29:65:dd:0a:08:67:da:0b:9c:bd:6e:77:71:4a:ea:fb:23:49:ab:39:3d:a3 +-----BEGIN CERTIFICATE----- +MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYG +A1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2Jh +bCBSb290MB4XDTA2MTIxNTA4MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UE +ChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBS +b290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Mi8vRRQZhP/8NN5 +7CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW0ozS +J8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2y +HLtgwEZLAfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iP +t3sMpTjr3kfb1V05/Iin89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNz +FtApD0mpSPCzqrdsxacwOUBdrsTiXSZT8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAY +XSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/ +MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2MDSgMqAw +hi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3Js +MB8GA1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUA +A4IBAQBW7wojoFROlZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMj +Wqd8BfP9IjsO0QbE2zZMcwSO5bAi5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUx +XOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2hO0j9n0Hq0V+09+zv+mKts2o +omcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+TX3EJIrduPuoc +A06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW +WL1WMRJOEcgh4LMRkWXbtKaIOM5V +-----END CERTIFICATE----- + +# Issuer: O=Chunghwa Telecom Co., Ltd. OU=ePKI Root Certification Authority +# Subject: O=Chunghwa Telecom Co., Ltd. OU=ePKI Root Certification Authority +# Label: "ePKI Root Certification Authority" +# Serial: 28956088682735189655030529057352760477 +# MD5 Fingerprint: 1b:2e:00:ca:26:06:90:3d:ad:fe:6f:15:68:d3:6b:b3 +# SHA1 Fingerprint: 67:65:0d:f1:7e:8e:7e:5b:82:40:a4:f4:56:4b:cf:e2:3d:69:c6:f0 +# SHA256 Fingerprint: c0:a6:f4:dc:63:a2:4b:fd:cf:54:ef:2a:6a:08:2a:0a:72:de:35:80:3e:2f:f5:ff:52:7a:e5:d8:72:06:df:d5 +-----BEGIN CERTIFICATE----- +MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBe +MQswCQYDVQQGEwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0 +ZC4xKjAoBgNVBAsMIWVQS0kgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe +Fw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMxMjdaMF4xCzAJBgNVBAYTAlRXMSMw +IQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEqMCgGA1UECwwhZVBL +SSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAH +SyZbCUNsIZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAh +ijHyl3SJCRImHJ7K2RKilTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3X +DZoTM1PRYfl61dd4s5oz9wCGzh1NlDivqOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1 +TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX12ruOzjjK9SXDrkb5wdJ +fzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0OWQqraffA +sgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uU +WH1+ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLS +nT0IFaUQAS2zMnaolQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pH +dmX2Os+PYhcZewoozRrSgx4hxyy/vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJip +NiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXiZo1jDiVN1Rmy5nk3pyKdVDEC +AwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/QkqiMAwGA1UdEwQF +MAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH +ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGB +uvl2ICO1J2B01GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6Yl +PwZpVnPDimZI+ymBV3QGypzqKOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkP +JXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdVxrsStZf0X4OFunHB2WyBEXYKCrC/ +gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEPNXubrjlpC2JgQCA2 +j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+rGNm6 +5ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUB +o2M3IUxExJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS +/jQ6fbjpKdx2qcgw+BRxgMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2z +Gp1iro2C6pSe3VkQw63d4k3jMdXH7OjysP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTE +W9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmODBCEIZ43ygknQW/2xzQ+D +hNQ+IIX3Sj0rnP0qCglN6oH4EZw= +-----END CERTIFICATE----- + +# Issuer: O=certSIGN OU=certSIGN ROOT CA +# Subject: O=certSIGN OU=certSIGN ROOT CA +# Label: "certSIGN ROOT CA" +# Serial: 35210227249154 +# MD5 Fingerprint: 18:98:c0:d6:e9:3a:fc:f9:b0:f5:0c:f7:4b:01:44:17 +# SHA1 Fingerprint: fa:b7:ee:36:97:26:62:fb:2d:b0:2a:f6:bf:03:fd:e8:7c:4b:2f:9b +# SHA256 Fingerprint: ea:a9:62:c4:fa:4a:6b:af:eb:e4:15:19:6d:35:1c:cd:88:8d:4f:53:f3:fa:8a:e6:d7:c4:66:a9:4e:60:42:bb +-----BEGIN CERTIFICATE----- +MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYT +AlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBD +QTAeFw0wNjA3MDQxNzIwMDRaFw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJP +MREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7IJUqOtdu0KBuqV5Do +0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHHrfAQ +UySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5d +RdY4zTW2ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQ +OA7+j0xbm0bqQfWwCHTD0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwv +JoIQ4uNllAoEwF73XVv4EOLQunpL+943AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08C +AwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAcYwHQYDVR0O +BBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IBAQA+0hyJ +LjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecY +MnQ8SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ +44gx+FkagQnIl6Z0x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6I +Jd1hJyMctTEHBDa0GpC9oHRxUIltvBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNw +i/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7NzTogVZ96edhBiIL5VaZVDADlN +9u6wWk5JRFRYX0KD +-----END CERTIFICATE----- + +# Issuer: CN=GeoTrust Primary Certification Authority - G3 O=GeoTrust Inc. OU=(c) 2008 GeoTrust Inc. - For authorized use only +# Subject: CN=GeoTrust Primary Certification Authority - G3 O=GeoTrust Inc. OU=(c) 2008 GeoTrust Inc. - For authorized use only +# Label: "GeoTrust Primary Certification Authority - G3" +# Serial: 28809105769928564313984085209975885599 +# MD5 Fingerprint: b5:e8:34:36:c9:10:44:58:48:70:6d:2e:83:d4:b8:05 +# SHA1 Fingerprint: 03:9e:ed:b8:0b:e7:a0:3c:69:53:89:3b:20:d2:d9:32:3a:4c:2a:fd +# SHA256 Fingerprint: b4:78:b8:12:25:0d:f8:78:63:5c:2a:a7:ec:7d:15:5e:aa:62:5e:e8:29:16:e2:cd:29:43:61:88:6c:d1:fb:d4 +-----BEGIN CERTIFICATE----- +MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCB +mDELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsT +MChjKSAyMDA4IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s +eTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhv +cml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIzNTk1OVowgZgxCzAJ +BgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg +MjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0 +BgNVBAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg +LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz ++uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5jK/BGvESyiaHAKAxJcCGVn2TAppMSAmUm +hsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdEc5IiaacDiGydY8hS2pgn +5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3CIShwiP/W +JmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exAL +DmKudlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZC +huOl1UcCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw +HQYDVR0OBBYEFMR5yo6hTgMdHNxr2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IB +AQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9cr5HqQ6XErhK8WTTOd8lNNTB +zU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbEAp7aDHdlDkQN +kv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD +AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUH +SJsMC8tJP33st/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2G +spki4cErx5z481+oghLrGREt +-----END CERTIFICATE----- + +# Issuer: CN=thawte Primary Root CA - G2 O=thawte, Inc. OU=(c) 2007 thawte, Inc. - For authorized use only +# Subject: CN=thawte Primary Root CA - G2 O=thawte, Inc. OU=(c) 2007 thawte, Inc. - For authorized use only +# Label: "thawte Primary Root CA - G2" +# Serial: 71758320672825410020661621085256472406 +# MD5 Fingerprint: 74:9d:ea:60:24:c4:fd:22:53:3e:cc:3a:72:d9:29:4f +# SHA1 Fingerprint: aa:db:bc:22:23:8f:c4:01:a1:27:bb:38:dd:f4:1d:db:08:9e:f0:12 +# SHA256 Fingerprint: a4:31:0d:50:af:18:a6:44:71:90:37:2a:86:af:af:8b:95:1f:fb:43:1d:83:7f:1e:56:88:b4:59:71:ed:15:57 +-----BEGIN CERTIFICATE----- +MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDEL +MAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMp +IDIwMDcgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAi +BgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMjAeFw0wNzExMDUwMDAw +MDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh +d3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBGb3Ig +YXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9v +dCBDQSAtIEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/ +BebfowJPDQfGAFG6DAJSLSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6 +papu+7qzcMBniKI11KOasf2twu8x+qi58/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUmtgAMADna3+FGO6Lts6K +DPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUNG4k8VIZ3 +KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41ox +XZ3Krr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== +-----END CERTIFICATE----- + +# Issuer: CN=thawte Primary Root CA - G3 O=thawte, Inc. OU=Certification Services Division/(c) 2008 thawte, Inc. - For authorized use only +# Subject: CN=thawte Primary Root CA - G3 O=thawte, Inc. OU=Certification Services Division/(c) 2008 thawte, Inc. - For authorized use only +# Label: "thawte Primary Root CA - G3" +# Serial: 127614157056681299805556476275995414779 +# MD5 Fingerprint: fb:1b:5d:43:8a:94:cd:44:c6:76:f2:43:4b:47:e7:31 +# SHA1 Fingerprint: f1:8b:53:8d:1b:e9:03:b6:a6:f0:56:43:5b:17:15:89:ca:f3:6b:f2 +# SHA256 Fingerprint: 4b:03:f4:58:07:ad:70:f2:1b:fc:2c:ae:71:c9:fd:e4:60:4c:06:4c:f5:ff:b6:86:ba:e5:db:aa:d7:fd:d3:4c +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCB +rjELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf +Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw +MDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNV +BAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0wODA0MDIwMDAwMDBa +Fw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3Rl +LCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9u +MTgwNgYDVQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXpl +ZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEcz +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsr8nLPvb2FvdeHsbnndm +gcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2AtP0LMqmsywCPLLEHd5N/8 +YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC+BsUa0Lf +b1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS9 +9irY7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2S +zhkGcuYMXDhpxwTWvGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUk +OQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV +HQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJKoZIhvcNAQELBQADggEBABpA +2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweKA3rD6z8KLFIW +oCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu +t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7c +KUGRIjxpp7sC8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fM +m7v/OeZWYdMKp8RcTGB7BXcmer/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZu +MdRAGmI0Nj81Aa6sY6A= +-----END CERTIFICATE----- + +# Issuer: CN=GeoTrust Primary Certification Authority - G2 O=GeoTrust Inc. OU=(c) 2007 GeoTrust Inc. - For authorized use only +# Subject: CN=GeoTrust Primary Certification Authority - G2 O=GeoTrust Inc. OU=(c) 2007 GeoTrust Inc. - For authorized use only +# Label: "GeoTrust Primary Certification Authority - G2" +# Serial: 80682863203381065782177908751794619243 +# MD5 Fingerprint: 01:5e:d8:6b:bd:6f:3d:8e:a1:31:f8:12:e0:98:73:6a +# SHA1 Fingerprint: 8d:17:84:d5:37:f3:03:7d:ec:70:fe:57:8b:51:9a:99:e6:10:d7:b0 +# SHA256 Fingerprint: 5e:db:7a:c4:3b:82:a0:6a:87:61:e8:d7:be:49:79:eb:f2:61:1f:7d:d7:9b:f9:1c:1c:6b:56:6a:21:9e:d7:66 +-----BEGIN CERTIFICATE----- +MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDEL +MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj +KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2 +MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 +eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1OVowgZgxCzAJBgNV +BAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykgMjAw +NyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNV +BAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH +MjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL +So17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLal +tJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO +BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoG +CCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGT +qQ7mndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBucz +rD6ogRLQy7rQkgu2npaqBA+K +-----END CERTIFICATE----- + +# Issuer: CN=VeriSign Universal Root Certification Authority O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2008 VeriSign, Inc. - For authorized use only +# Subject: CN=VeriSign Universal Root Certification Authority O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2008 VeriSign, Inc. - For authorized use only +# Label: "VeriSign Universal Root Certification Authority" +# Serial: 85209574734084581917763752644031726877 +# MD5 Fingerprint: 8e:ad:b5:01:aa:4d:81:e4:8c:1d:d1:e1:14:00:95:19 +# SHA1 Fingerprint: 36:79:ca:35:66:87:72:30:4d:30:a5:fb:87:3b:0f:a7:7b:b7:0d:54 +# SHA256 Fingerprint: 23:99:56:11:27:a5:71:25:de:8c:ef:ea:61:0d:df:2f:a0:78:b5:c8:06:7f:4e:82:82:90:bf:b8:60:e8:4b:3c +-----BEGIN CERTIFICATE----- +MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCB +vTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9W +ZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe +Fw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJVUzEX +MBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0 +IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9y +IGF1dGhvcml6ZWQgdXNlIG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNh +bCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj1mCOkdeQmIN65lgZOIzF +9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGPMiJhgsWH +H26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+H +LL729fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN +/BMReYTtXlT2NJ8IAfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPT +rJ9VAMf2CGqUuV/c4DPxhGD5WycRtPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0GCCsGAQUFBwEMBGEwX6FdoFsw +WTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2Oa8PPgGrUSBgs +exkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud +DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4 +sAPmLGd75JR3Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+ +seQxIcaBlVZaDrHC1LGmWazxY8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz +4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTxP/jgdFcrGJ2BtMQo2pSXpXDrrB2+ +BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+PwGZsY6rp2aQW9IHR +lRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4mJO3 +7M2CYfE45k+XmCpajQ== +-----END CERTIFICATE----- + +# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G4 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2007 VeriSign, Inc. - For authorized use only +# Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G4 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2007 VeriSign, Inc. - For authorized use only +# Label: "VeriSign Class 3 Public Primary Certification Authority - G4" +# Serial: 63143484348153506665311985501458640051 +# MD5 Fingerprint: 3a:52:e1:e7:fd:6f:3a:e3:6f:f3:6f:99:1b:f9:22:41 +# SHA1 Fingerprint: 22:d5:d8:df:8f:02:31:d1:8d:f7:9d:b7:cf:8a:2d:64:c9:3f:6c:3a +# SHA256 Fingerprint: 69:dd:d7:ea:90:bb:57:c9:3e:13:5d:c8:5e:a6:fc:d5:48:0b:60:32:39:bd:c4:54:fc:75:8b:2a:26:cf:7f:79 +-----BEGIN CERTIFICATE----- +MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW +ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp +U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y +aXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjELMAkG +A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJp +U2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwg +SW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2ln +biBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8Utpkmw4tXNherJI9/gHm +GUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGzrl0Bp3ve +fLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJ +aW1hZ2UvZ2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYj +aHR0cDovL2xvZ28udmVyaXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMW +kf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMDA2gAMGUCMGYhDBgmYFo4e1ZC +4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIxAJw9SDkjOVga +FRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== +-----END CERTIFICATE----- + +# Issuer: CN=NetLock Arany (Class Gold) F\u0151tan\xfas\xedtv\xe1ny O=NetLock Kft. OU=Tan\xfas\xedtv\xe1nykiad\xf3k (Certification Services) +# Subject: CN=NetLock Arany (Class Gold) F\u0151tan\xfas\xedtv\xe1ny O=NetLock Kft. OU=Tan\xfas\xedtv\xe1nykiad\xf3k (Certification Services) +# Label: "NetLock Arany (Class Gold) F\u0151tan\xfas\xedtv\xe1ny" +# Serial: 80544274841616 +# MD5 Fingerprint: c5:a1:b7:ff:73:dd:d6:d7:34:32:18:df:fc:3c:ad:88 +# SHA1 Fingerprint: 06:08:3f:59:3f:15:a1:04:a0:69:a4:6b:a9:03:d0:06:b7:97:09:91 +# SHA256 Fingerprint: 6c:61:da:c3:a2:de:f0:31:50:6b:e0:36:d2:a6:fe:40:19:94:fb:d1:3d:f9:c8:d4:66:59:92:74:c4:46:ec:98 +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQG +EwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3 +MDUGA1UECwwuVGFuw7pzw610dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNl +cnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBBcmFueSAoQ2xhc3MgR29sZCkgRsWR +dGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgxMjA2MTUwODIxWjCB +pzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxOZXRM +b2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlm +aWNhdGlvbiBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNz +IEdvbGQpIEbFkXRhbsO6c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAxCRec75LbRTDofTjl5Bu0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrT +lF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw/HpYzY6b7cNGbIRwXdrz +AZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAkH3B5r9s5 +VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRG +ILdwfzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2 +BJtr+UBdADTHLpl1neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAG +AQH/AgEEMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2M +U9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwWqZw8UQCgwBEIBaeZ5m8BiFRh +bvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTtaYtOUZcTh5m2C ++C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC +bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2F +uLjbvrW5KfnaNwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2 +XjG4Kvte9nHfRCaexOYNkbQudZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= +-----END CERTIFICATE----- + +# Issuer: CN=Staat der Nederlanden Root CA - G2 O=Staat der Nederlanden +# Subject: CN=Staat der Nederlanden Root CA - G2 O=Staat der Nederlanden +# Label: "Staat der Nederlanden Root CA - G2" +# Serial: 10000012 +# MD5 Fingerprint: 7c:a5:0f:f8:5b:9a:7d:6d:30:ae:54:5a:e3:42:a2:8a +# SHA1 Fingerprint: 59:af:82:79:91:86:c7:b4:75:07:cb:cf:03:57:46:eb:04:dd:b7:16 +# SHA256 Fingerprint: 66:8c:83:94:7d:a6:3b:72:4b:ec:e1:74:3c:31:a0:e6:ae:d0:db:8e:c5:b3:1b:e3:77:bb:78:4f:91:b6:71:6f +-----BEGIN CERTIFICATE----- +MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJO +TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFh +dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oX +DTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMCTkwxHjAcBgNVBAoMFVN0YWF0IGRl +ciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5lZGVybGFuZGVuIFJv +b3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ5291 +qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8Sp +uOUfiUtnvWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPU +Z5uW6M7XxgpT0GtJlvOjCwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvE +pMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiile7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp +5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCROME4HYYEhLoaJXhena/M +UGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpICT0ugpTN +GmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy +5V6548r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv +6q012iDTiIJh8BIitrzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEK +eN5KzlW/HdXZt1bv8Hb/C3m1r737qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6 +B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMBAAGjgZcwgZQwDwYDVR0TAQH/ +BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcCARYxaHR0cDov +L3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV +HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqG +SIb3DQEBCwUAA4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLyS +CZa59sCrI2AGeYwRTlHSeYAz+51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen +5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwjf/ST7ZwaUb7dRUG/kSS0H4zpX897 +IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaNkqbG9AclVMwWVxJK +gnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfkCpYL ++63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxL +vJxxcypFURmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkm +bEgeqmiSBeGCc1qb3AdbCG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvk +N1trSt8sV4pAWja63XVECDdCcAz+3F4hoKOKwJCcaNpQ5kUQR3i2TtJlycM33+FC +Y7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoVIPVVYpbtbZNQvOSqeK3Z +ywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm66+KAQ== +-----END CERTIFICATE----- + +# Issuer: CN=Hongkong Post Root CA 1 O=Hongkong Post +# Subject: CN=Hongkong Post Root CA 1 O=Hongkong Post +# Label: "Hongkong Post Root CA 1" +# Serial: 1000 +# MD5 Fingerprint: a8:0d:6f:39:78:b9:43:6d:77:42:6d:98:5a:cc:23:ca +# SHA1 Fingerprint: d6:da:a8:20:8d:09:d2:15:4d:24:b5:2f:cb:34:6e:b2:58:b2:8a:58 +# SHA256 Fingerprint: f9:e6:7d:33:6c:51:00:2a:c0:54:c6:32:02:2d:66:dd:a2:e7:e3:ff:f1:0a:d0:61:ed:31:d8:bb:b4:10:cf:b2 +-----BEGIN CERTIFICATE----- +MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsx +FjAUBgNVBAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3Qg +Um9vdCBDQSAxMB4XDTAzMDUxNTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkG +A1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdr +b25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1ApzQ +jVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEn +PzlTCeqrauh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjh +ZY4bXSNmO7ilMlHIhqqhqZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9 +nnV0ttgCXjqQesBCNnLsak3c78QA3xMYV18meMjWCnl3v/evt3a5pQuEF10Q6m/h +q5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNVHRMBAf8ECDAGAQH/AgED +MA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7ih9legYsC +mEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI3 +7piol7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clB +oiMBdDhViw+5LmeiIAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJs +EhTkYY2sEJCehFC78JZvRZ+K88psT/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpO +fMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilTc4afU9hDDl3WY4JxHYB0yvbi +AmvZWg== +-----END CERTIFICATE----- + +# Issuer: CN=SecureSign RootCA11 O=Japan Certification Services, Inc. +# Subject: CN=SecureSign RootCA11 O=Japan Certification Services, Inc. +# Label: "SecureSign RootCA11" +# Serial: 1 +# MD5 Fingerprint: b7:52:74:e2:92:b4:80:93:f2:75:e4:cc:d7:f2:ea:26 +# SHA1 Fingerprint: 3b:c4:9f:48:f8:f3:73:a0:9c:1e:bd:f8:5b:b1:c3:65:c7:d8:11:b3 +# SHA256 Fingerprint: bf:0f:ee:fb:9e:3a:58:1a:d5:f9:e9:db:75:89:98:57:43:d2:61:08:5c:4d:31:4f:6f:5d:72:59:aa:42:16:12 +-----BEGIN CERTIFICATE----- +MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDEr +MCkGA1UEChMiSmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoG +A1UEAxMTU2VjdXJlU2lnbiBSb290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0 +MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSswKQYDVQQKEyJKYXBhbiBDZXJ0aWZp +Y2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1cmVTaWduIFJvb3RD +QTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvLTJsz +i1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8 +h9uuywGOwvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOV +MdrAG/LuYpmGYz+/3ZMqg6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9 +UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rPO7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni +8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitAbpSACW22s293bzUIUPsC +h8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZXt94wDgYD +VR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB +AKChOBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xm +KbabfSVSSUOrTC4rbnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQ +X5Ucv+2rIrVls4W6ng+4reV6G4pQOh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWr +QbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01y8hSyn+B/tlr0/cR7SXf+Of5 +pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061lgeLKBObjBmN +QSdJQO7e5iNEOdyhIta6A/I= +-----END CERTIFICATE----- + +# Issuer: CN=Microsec e-Szigno Root CA 2009 O=Microsec Ltd. +# Subject: CN=Microsec e-Szigno Root CA 2009 O=Microsec Ltd. +# Label: "Microsec e-Szigno Root CA 2009" +# Serial: 14014712776195784473 +# MD5 Fingerprint: f8:49:f4:03:bc:44:2d:83:be:48:69:7d:29:64:fc:b1 +# SHA1 Fingerprint: 89:df:74:fe:5c:f4:0f:4a:80:f9:e3:37:7d:54:da:91:e1:01:31:8e +# SHA256 Fingerprint: 3c:5f:81:fe:a5:fa:b8:2c:64:bf:a2:ea:ec:af:cd:e8:e0:77:fc:86:20:a7:ca:e5:37:16:3d:f3:6e:db:f3:78 +-----BEGIN CERTIFICATE----- +MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYD +VQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0 +ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0G +CSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTAeFw0wOTA2MTYxMTMwMThaFw0y +OTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3Qx +FjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3pp +Z25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o +dTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvP +kd6mJviZpWNwrZuuyjNAfW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tc +cbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG0IMZfcChEhyVbUr02MelTTMuhTlAdX4U +fIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKApxn1ntxVUwOXewdI/5n7 +N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm1HxdrtbC +xkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1 ++rUCAwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G +A1UdDgQWBBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPM +Pcu1SCOhGnqmKrs0aDAbBgNVHREEFDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqG +SIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0olZMEyL/azXm4Q5DwpL7v8u8h +mLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfXI/OMn74dseGk +ddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 +tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c +2Pm2G2JwCz02yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5t +HMN1Rq41Bab2XD0h7lbwyYIiLXpUq3DDfSJlgnCW +-----END CERTIFICATE----- + +# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3 +# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3 +# Label: "GlobalSign Root CA - R3" +# Serial: 4835703278459759426209954 +# MD5 Fingerprint: c5:df:b8:49:ca:05:13:55:ee:2d:ba:1a:c3:3e:b0:28 +# SHA1 Fingerprint: d6:9b:56:11:48:f0:1c:77:c5:45:78:c1:09:26:df:5b:85:69:76:ad +# SHA256 Fingerprint: cb:b5:22:d7:b7:f1:27:ad:6a:01:13:86:5b:df:1c:d4:10:2e:7d:07:59:af:63:5a:7c:f4:72:0d:c9:63:c5:3b +-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G +A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp +Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4 +MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG +A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8 +RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT +gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm +KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd +QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ +XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw +DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o +LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU +RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp +jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK +6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX +mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs +Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH +WD9f +-----END CERTIFICATE----- + +# Issuer: CN=Autoridad de Certificacion Firmaprofesional CIF A62634068 +# Subject: CN=Autoridad de Certificacion Firmaprofesional CIF A62634068 +# Label: "Autoridad de Certificacion Firmaprofesional CIF A62634068" +# Serial: 6047274297262753887 +# MD5 Fingerprint: 73:3a:74:7a:ec:bb:a3:96:a6:c2:e4:e2:c8:9b:c0:c3 +# SHA1 Fingerprint: ae:c5:fb:3f:c8:e1:bf:c4:e5:4f:03:07:5a:9a:e8:00:b7:f7:b6:fa +# SHA256 Fingerprint: 04:04:80:28:bf:1f:28:64:d4:8f:9a:d4:d8:32:94:36:6a:82:88:56:55:3f:3b:14:30:3f:90:14:7f:5d:40:ef +-----BEGIN CERTIFICATE----- +MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UE +BhMCRVMxQjBABgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1h +cHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEy +MzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIwQAYDVQQDDDlBdXRvcmlkYWQgZGUg +Q2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBBNjI2MzQwNjgwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDDUtd9 +thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQM +cas9UX4PB99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefG +L9ItWY16Ck6WaVICqjaY7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15i +NA9wBj4gGFrO93IbJWyTdBSTo3OxDqqHECNZXyAFGUftaI6SEspd/NYrspI8IM/h +X68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyIplD9amML9ZMWGxmPsu2b +m8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctXMbScyJCy +Z/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirja +EbsXLZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/T +KI8xWVvTyQKmtFLKbpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF +6NkBiDkal4ZkQdU7hwxu+g/GvUgUvzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVh +OSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYD +VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNHDhpkLzCBpgYD +VR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp +cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBv +ACAAZABlACAAbABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBl +AGwAbwBuAGEAIAAwADgAMAAxADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF +661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx51tkljYyGOylMnfX40S2wBEqgLk9 +am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qkR71kMrv2JYSiJ0L1 +ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaPT481 +PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS +3a/DTg4fJl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5k +SeTy36LssUzAKh3ntLFlosS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF +3dvd6qJ2gHN99ZwExEWN57kci57q13XRcrHedUTnQn3iV2t93Jm8PYMo6oCTjcVM +ZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoRsaS8I8nkvof/uZS2+F0g +StRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTDKCOM/icz +Q0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQB +jLMi6Et8Vcad+qMUu2WFbm5PEn4KPJ2V +-----END CERTIFICATE----- + +# Issuer: CN=Izenpe.com O=IZENPE S.A. +# Subject: CN=Izenpe.com O=IZENPE S.A. +# Label: "Izenpe.com" +# Serial: 917563065490389241595536686991402621 +# MD5 Fingerprint: a6:b0:cd:85:80:da:5c:50:34:a3:39:90:2f:55:67:73 +# SHA1 Fingerprint: 2f:78:3d:25:52:18:a7:4a:65:39:71:b5:2c:a2:9c:45:15:6f:e9:19 +# SHA256 Fingerprint: 25:30:cc:8e:98:32:15:02:ba:d9:6f:9b:1f:ba:1b:09:9e:2d:29:9e:0f:45:48:bb:91:4f:36:3b:c0:d4:53:1f +-----BEGIN CERTIFICATE----- +MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4 +MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6 +ZW5wZS5jb20wHhcNMDcxMjEzMTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYD +VQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5j +b20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ03rKDx6sp4boFmVq +scIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAKClaO +xdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6H +LmYRY2xU+zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFX +uaOKmMPsOzTFlUFpfnXCPCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQD +yCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxTOTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+ +JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbKF7jJeodWLBoBHmy+E60Q +rLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK0GqfvEyN +BjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8L +hij+0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIB +QFqNeb+Lz0vPqhbBleStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+ +HMh3/1uaD7euBUbl8agW7EekFwIDAQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2lu +Zm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+SVpFTlBFIFMuQS4gLSBDSUYg +QTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBGNjIgUzgxQzBB +BgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx +MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUA +A4ICAQB4pgwWSp9MiDrAyw6lFn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWb +laQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbgakEyrkgPH7UIBzg/YsfqikuFgba56 +awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8qhT/AQKM6WfxZSzwo +JNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Csg1lw +LDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCT +VyvehQP5aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGk +LhObNA5me0mrZJfQRsN5nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJb +UjWumDqtujWTI6cfSN01RpiyEGjkpTHCClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/ +QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZoQ0iy2+tzJOeRf1SktoA+ +naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1ZWrOZyGls +QyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== +-----END CERTIFICATE----- + +# Issuer: CN=Chambers of Commerce Root - 2008 O=AC Camerfirma S.A. +# Subject: CN=Chambers of Commerce Root - 2008 O=AC Camerfirma S.A. +# Label: "Chambers of Commerce Root - 2008" +# Serial: 11806822484801597146 +# MD5 Fingerprint: 5e:80:9e:84:5a:0e:65:0b:17:02:f3:55:18:2a:3e:d7 +# SHA1 Fingerprint: 78:6a:74:ac:76:ab:14:7f:9c:6a:30:50:ba:9e:a8:7e:fe:9a:ce:3c +# SHA256 Fingerprint: 06:3e:4a:fa:c4:91:df:d3:32:f3:08:9b:85:42:e9:46:17:d8:93:d7:fe:94:4e:10:a7:93:7e:e2:9d:96:93:c0 +-----BEGIN CERTIFICATE----- +MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYD +VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0 +IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3 +MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xKTAnBgNVBAMTIENoYW1iZXJz +IG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEyMjk1MFoXDTM4MDcz +MTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBj +dXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIw +EAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEp +MCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0G +CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW9 +28sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKAXuFixrYp4YFs8r/lfTJq +VKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorjh40G072Q +DuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR +5gN/ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfL +ZEFHcpOrUMPrCXZkNNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05a +Sd+pZgvMPMZ4fKecHePOjlO+Bd5gD2vlGts/4+EhySnB8esHnFIbAURRPHsl18Tl +UlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331lubKgdaX8ZSD6e2wsWsSaR6s ++12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ0wlf2eOKNcx5 +Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj +ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAx +hduub+84Mxh2EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNV +HQ4EFgQU+SSsD7K1+HnA+mCIG8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1 ++HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpN +YWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29t +L2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVy +ZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAt +IDIwMDiCCQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRV +HSAAMCowKAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20w +DQYJKoZIhvcNAQEFBQADggIBAJASryI1wqM58C7e6bXpeHxIvj99RZJe6dqxGfwW +PJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH3qLPaYRgM+gQDROpI9CF +5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbURWpGqOt1 +glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaH +FoI6M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2 +pSB7+R5KBWIBpih1YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MD +xvbxrN8y8NmBGuScvfaAFPDRLLmF9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QG +tjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcKzBIKinmwPQN/aUv0NCB9szTq +jktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvGnrDQWzilm1De +fhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg +OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZ +d0jQ +-----END CERTIFICATE----- + +# Issuer: CN=Global Chambersign Root - 2008 O=AC Camerfirma S.A. +# Subject: CN=Global Chambersign Root - 2008 O=AC Camerfirma S.A. +# Label: "Global Chambersign Root - 2008" +# Serial: 14541511773111788494 +# MD5 Fingerprint: 9e:80:ff:78:01:0c:2e:c1:36:bd:fe:96:90:6e:08:f3 +# SHA1 Fingerprint: 4a:bd:ee:ec:95:0d:35:9c:89:ae:c7:52:a1:2c:5b:29:f6:d6:aa:0c +# SHA256 Fingerprint: 13:63:35:43:93:34:a7:69:80:16:a0:d3:24:de:72:28:4e:07:9d:7b:52:20:bb:8f:bd:74:78:16:ee:be:ba:ca +-----BEGIN CERTIFICATE----- +MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYD +VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0 +IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3 +MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD +aGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMxNDBaFw0zODA3MzEx +MjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3Vy +cmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAG +A1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAl +BgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZI +hvcNAQEBBQADggIPADCCAgoCggIBAMDfVtPkOpt2RbQT2//BthmLN0EYlVJH6xed +KYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXfXjaOcNFccUMd2drvXNL7 +G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0ZJJ0YPP2 +zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4 +ddPB/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyG +HoiMvvKRhI9lNNgATH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2 +Id3UwD2ln58fQ1DJu7xsepeY7s2MH/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3V +yJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfeOx2YItaswTXbo6Al/3K1dh3e +beksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSFHTynyQbehP9r +6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh +wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsog +zCtLkykPAgMBAAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQW +BBS5CcqcHtvTbDprru1U8VuTBjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDpr +ru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UEBhMCRVUxQzBBBgNVBAcTOk1hZHJp +ZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJmaXJtYS5jb20vYWRk +cmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJmaXJt +YSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiC +CQDJzdPp1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCow +KAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZI +hvcNAQEFBQADggIBAICIf3DekijZBZRG/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZ +UohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6ReAJ3spED8IXDneRRXoz +X1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/sdZ7LoR/x +fxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVz +a2Mg9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yyd +Yhz2rXzdpjEetrHHfoUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMd +SqlapskD7+3056huirRXhOukP9DuqqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9O +AP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETrP3iZ8ntxPjzxmKfFGBI/5rso +M0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVqc5iJWzouE4ge +v8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z +09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B +-----END CERTIFICATE----- + +# Issuer: CN=Go Daddy Root Certificate Authority - G2 O=GoDaddy.com, Inc. +# Subject: CN=Go Daddy Root Certificate Authority - G2 O=GoDaddy.com, Inc. +# Label: "Go Daddy Root Certificate Authority - G2" +# Serial: 0 +# MD5 Fingerprint: 80:3a:bc:22:c1:e6:fb:8d:9b:3b:27:4a:32:1b:9a:01 +# SHA1 Fingerprint: 47:be:ab:c9:22:ea:e8:0e:78:78:34:62:a7:9f:45:c2:54:fd:e6:8b +# SHA256 Fingerprint: 45:14:0b:32:47:eb:9c:c8:c5:b4:f0:d7:b5:30:91:f7:32:92:08:9e:6e:5a:63:e2:74:9d:d3:ac:a9:19:8e:da +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx +EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoT +EUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRp +ZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIz +NTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQH +EwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8GA1UE +AxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKD +E6bFIEMBO4Tx5oVJnyfq9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH +/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD+qK+ihVqf94Lw7YZFAXK6sOoBJQ7Rnwy +DfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutdfMh8+7ArU6SSYmlRJQVh +GkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMlNAJWJwGR +tDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEA +AaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE +FDqahQcQZyi27/a9BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmX +WWcDYfF+OwYxdS2hII5PZYe096acvNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu +9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r5N9ss4UXnT3ZJE95kTXWXwTr +gIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYVN8Gb5DKj7Tjo +2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO +LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI +4uJEvlz36hz1 +-----END CERTIFICATE----- + +# Issuer: CN=Starfield Root Certificate Authority - G2 O=Starfield Technologies, Inc. +# Subject: CN=Starfield Root Certificate Authority - G2 O=Starfield Technologies, Inc. +# Label: "Starfield Root Certificate Authority - G2" +# Serial: 0 +# MD5 Fingerprint: d6:39:81:c6:52:7e:96:69:fc:fc:ca:66:ed:05:f2:96 +# SHA1 Fingerprint: b5:1c:06:7c:ee:2b:0c:3d:f8:55:ab:2d:92:f4:fe:39:d4:e7:0f:0e +# SHA256 Fingerprint: 2c:e1:cb:0b:f9:d2:f9:e1:02:99:3f:be:21:51:52:c3:b2:dd:0c:ab:de:1c:68:e5:31:9b:83:91:54:db:b7:f5 +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMx +EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT +HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVs +ZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAw +MFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 +b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQgVGVj +aG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZp +Y2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAL3twQP89o/8ArFvW59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMg +nLRJdzIpVv257IzdIvpy3Cdhl+72WoTsbhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1 +HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNkN3mSwOxGXn/hbVNMYq/N +Hwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7NfZTD4p7dN +dloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0 +HZbUJtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO +BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0G +CSqGSIb3DQEBCwUAA4IBAQARWfolTwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjU +sHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx4mcujJUDJi5DnUox9g61DLu3 +4jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUwF5okxBDgBPfg +8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K +pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1 +mMpYjn0q7pBZc2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 +-----END CERTIFICATE----- + +# Issuer: CN=Starfield Services Root Certificate Authority - G2 O=Starfield Technologies, Inc. +# Subject: CN=Starfield Services Root Certificate Authority - G2 O=Starfield Technologies, Inc. +# Label: "Starfield Services Root Certificate Authority - G2" +# Serial: 0 +# MD5 Fingerprint: 17:35:74:af:7b:61:1c:eb:f4:f9:3c:e2:ee:40:f9:a2 +# SHA1 Fingerprint: 92:5a:8f:8d:2c:6d:04:e0:66:5f:59:6a:ff:22:d8:63:e8:25:6f:3f +# SHA256 Fingerprint: 56:8d:69:05:a2:c8:87:08:a4:b3:02:51:90:ed:cf:ed:b1:97:4a:60:6a:13:c6:e5:29:0f:cb:2a:e6:3e:da:b5 +-----BEGIN CERTIFICATE----- +MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx +EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT +HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVs +ZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 +MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNVBAYTAlVTMRAwDgYD +VQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFy +ZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2Vy +dmljZXMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20p +OsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm2 +8xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4PahHQUw2eeBGg6345AWh1K +Ts9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLPLJGmpufe +hRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk +6mFBrMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAw +DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+q +AdcwKziIorhtSpzyEZGDMA0GCSqGSIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMI +bw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPPE95Dz+I0swSdHynVv/heyNXB +ve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTyxQGjhdByPq1z +qwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd +iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn +0q23KXB56jzaYyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCN +sSi6 +-----END CERTIFICATE----- + +# Issuer: CN=AffirmTrust Commercial O=AffirmTrust +# Subject: CN=AffirmTrust Commercial O=AffirmTrust +# Label: "AffirmTrust Commercial" +# Serial: 8608355977964138876 +# MD5 Fingerprint: 82:92:ba:5b:ef:cd:8a:6f:a6:3d:55:f9:84:f6:d6:b7 +# SHA1 Fingerprint: f9:b5:b6:32:45:5f:9c:be:ec:57:5f:80:dc:e9:6e:2c:c7:b2:78:b7 +# SHA256 Fingerprint: 03:76:ab:1d:54:c5:f9:80:3c:e4:b2:e2:01:a0:ee:7e:ef:7b:57:b6:36:e8:a9:3c:9b:8d:48:60:c9:6f:5f:a7 +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz +dCBDb21tZXJjaWFsMB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDEL +MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp +cm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6EqdbDuKP +Hx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yr +ba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPAL +MeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1 +yHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqr +VwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/ +nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ +KoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYG +XUPGhi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNj +vbz4YYCanrHOQnDiqX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivt +Z8SOyUOyXGsViQK8YvxO8rUzqrJv0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9g +N53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0khsUlHRUe072o0EclNmsxZt9YC +nlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= +-----END CERTIFICATE----- + +# Issuer: CN=AffirmTrust Networking O=AffirmTrust +# Subject: CN=AffirmTrust Networking O=AffirmTrust +# Label: "AffirmTrust Networking" +# Serial: 8957382827206547757 +# MD5 Fingerprint: 42:65:ca:be:01:9a:9a:4c:a9:8c:41:49:cd:c0:d5:7f +# SHA1 Fingerprint: 29:36:21:02:8b:20:ed:02:f5:66:c5:32:d1:d6:ed:90:9f:45:00:2f +# SHA256 Fingerprint: 0a:81:ec:5a:92:97:77:f1:45:90:4a:f3:8d:5d:50:9f:66:b5:e2:c5:8f:cd:b5:31:05:8b:0e:17:f3:f0:b4:1b +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz +dCBOZXR3b3JraW5nMB4XDTEwMDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDEL +MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp +cm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SEHi3y +YJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbua +kCNrmreIdIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRL +QESxG9fhwoXA3hA/Pe24/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp +6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gbh+0t+nvujArjqWaJGctB+d1ENmHP4ndG +yH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNVHQ4EFgQUBx/S55zawm6i +QLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ +KoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfO +tDIuUFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzu +QY0x2+c06lkh1QF612S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZ +Lgo/bNjR9eUJtGxUAArgFU2HdW23WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4u +olu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9/ZFvgrG+CJPbFEfxojfHRZ48 +x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= +-----END CERTIFICATE----- + +# Issuer: CN=AffirmTrust Premium O=AffirmTrust +# Subject: CN=AffirmTrust Premium O=AffirmTrust +# Label: "AffirmTrust Premium" +# Serial: 7893706540734352110 +# MD5 Fingerprint: c4:5d:0e:48:b6:ac:28:30:4e:0a:bc:f9:38:16:87:57 +# SHA1 Fingerprint: d8:a6:33:2c:e0:03:6f:b1:85:f6:63:4f:7d:6a:06:65:26:32:28:27 +# SHA256 Fingerprint: 70:a7:3f:7f:37:6b:60:07:42:48:90:45:34:b1:14:82:d5:bf:0e:69:8e:cc:49:8d:f5:25:77:eb:f2:e9:3b:9a +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVz +dCBQcmVtaXVtMB4XDTEwMDEyOTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkG +A1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1U +cnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxBLf +qV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtnBKAQ +JG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ ++jjeRFcV5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrS +s8PhaJyJ+HoAVt70VZVs+7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5 +HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmdGPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d7 +70O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5Rp9EixAqnOEhss/n/fauG +V+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NIS+LI+H+S +qHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S +5u046uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4Ia +C1nEWTJ3s7xgaVY5/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TX +OwF0lkLgAOIua+rF7nKsu7/+6qqo+Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYE +FJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ +BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByvMiPIs0laUZx2 +KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg +Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B +8OWycvpEgjNC6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQ +MKSOyARiqcTtNd56l+0OOF6SL5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc +0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK+4w1IX2COPKpVJEZNZOUbWo6xbLQ +u4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmVBtWVyuEklut89pMF +u+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFgIxpH +YoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8 +GKa1qF60g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaO +RtGdFNrHF+QFlozEJLUbzxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6e +KeC2uAloGRwYQw== +-----END CERTIFICATE----- + +# Issuer: CN=AffirmTrust Premium ECC O=AffirmTrust +# Subject: CN=AffirmTrust Premium ECC O=AffirmTrust +# Label: "AffirmTrust Premium ECC" +# Serial: 8401224907861490260 +# MD5 Fingerprint: 64:b0:09:55:cf:b1:d5:99:e2:be:13:ab:a6:5d:ea:4d +# SHA1 Fingerprint: b8:23:6b:00:2f:1d:16:86:53:01:55:6c:11:a4:37:ca:eb:ff:c3:bb +# SHA256 Fingerprint: bd:71:fd:f6:da:97:e4:cf:62:d1:64:7a:dd:25:81:b0:7d:79:ad:f8:39:7e:b4:ec:ba:9c:5e:84:88:82:14:23 +-----BEGIN CERTIFICATE----- +MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMC +VVMxFDASBgNVBAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQ +cmVtaXVtIEVDQzAeFw0xMDAxMjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJ +BgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1UcnVzdDEgMB4GA1UEAwwXQWZmaXJt +VHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQNMF4bFZ0D +0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQN8O9 +ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0G +A1UdDgQWBBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4G +A1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs +aobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6I +flc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ== +-----END CERTIFICATE----- + +# Issuer: CN=Certum Trusted Network CA O=Unizeto Technologies S.A. OU=Certum Certification Authority +# Subject: CN=Certum Trusted Network CA O=Unizeto Technologies S.A. OU=Certum Certification Authority +# Label: "Certum Trusted Network CA" +# Serial: 279744 +# MD5 Fingerprint: d5:e9:81:40:c5:18:69:fc:46:2c:89:75:62:0f:aa:78 +# SHA1 Fingerprint: 07:e0:32:e0:20:b7:2c:3f:19:2f:06:28:a2:59:3a:19:a7:0f:06:9e +# SHA256 Fingerprint: 5c:58:46:8d:55:f5:8e:49:7e:74:39:82:d2:b5:00:10:b6:d1:65:37:4a:cf:83:a7:d4:a3:2d:b7:68:c4:40:8e +-----BEGIN CERTIFICATE----- +MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBM +MSIwIAYDVQQKExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5D +ZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBU +cnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIyMTIwNzM3WhcNMjkxMjMxMTIwNzM3 +WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2dpZXMg +Uy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSIw +IAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rH +UV+rpDKmYYe2bg+G0jACl/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LM +TXPb865Px1bVWqeWifrzq2jUI4ZZJ88JJ7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVU +BBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4fOQtf/WsX+sWn7Et0brM +kUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0cvW0QM8x +AcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNV +HQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15y +sHhE49wcrwn9I0j6vSrEuVUEtRCjjSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfL +I9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1mS1FhIrlQgnXdAIv94nYmem8 +J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5ajZt3hrvJBW8qY +VoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI +03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= +-----END CERTIFICATE----- + +# Issuer: CN=TWCA Root Certification Authority O=TAIWAN-CA OU=Root CA +# Subject: CN=TWCA Root Certification Authority O=TAIWAN-CA OU=Root CA +# Label: "TWCA Root Certification Authority" +# Serial: 1 +# MD5 Fingerprint: aa:08:8f:f6:f9:7b:b7:f2:b1:a7:1e:9b:ea:ea:bd:79 +# SHA1 Fingerprint: cf:9e:87:6d:d3:eb:fc:42:26:97:a3:b5:a3:7a:a0:76:a9:06:23:48 +# SHA256 Fingerprint: bf:d8:8f:e1:10:1c:41:ae:3e:80:1b:f8:be:56:35:0e:e9:ba:d1:a6:b9:bd:51:5e:dc:5c:6d:5b:87:11:ac:44 +-----BEGIN CERTIFICATE----- +MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzES +MBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFU +V0NBIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMz +WhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJVEFJV0FO +LUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlm +aWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFE +AcK0HMMxQhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HH +K3XLfJ+utdGdIzdjp9xCoi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeX +RfwZVzsrb+RH9JlF/h3x+JejiB03HFyP4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/z +rX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1ry+UPizgN7gr8/g+YnzAx +3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkq +hkiG9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeC +MErJk/9q56YAf4lCmtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdls +XebQ79NqZp4VKIV66IIArB6nCWlWQtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62D +lhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVYT0bf+215WfKEIlKuD8z7fDvn +aspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocnyYh0igzyXxfkZ +YiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== +-----END CERTIFICATE----- + +# Issuer: O=SECOM Trust Systems CO.,LTD. OU=Security Communication RootCA2 +# Subject: O=SECOM Trust Systems CO.,LTD. OU=Security Communication RootCA2 +# Label: "Security Communication RootCA2" +# Serial: 0 +# MD5 Fingerprint: 6c:39:7d:a4:0e:55:59:b2:3f:d6:41:b1:12:50:de:43 +# SHA1 Fingerprint: 5f:3b:8c:f2:f8:10:b3:7d:78:b4:ce:ec:19:19:c3:73:34:b9:c7:74 +# SHA256 Fingerprint: 51:3b:2c:ec:b8:10:d4:cd:e5:dd:85:39:1a:df:c6:c2:dd:60:d8:7b:b7:36:d2:b5:21:48:4a:a4:7a:0e:be:f6 +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDEl +MCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMe +U2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoX +DTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRy +dXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3VyaXR5IENvbW11bmlj +YXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANAV +OVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGr +zbl+dp+++T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVM +VAX3NuRFg3sUZdbcDE3R3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQ +hNBqyjoGADdH5H5XTz+L62e4iKrFvlNVspHEfbmwhRkGeC7bYRr6hfVKkaHnFtWO +ojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1KEOtOghY6rCcMU/Gt1SSw +awNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8QIH4D5cs +OPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3 +DQEBCwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpF +coJxDjrSzG+ntKEju/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXc +okgfGT+Ok+vx+hfuzU7jBBJV1uXk3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8 +t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6qtnRGEmyR7jTV7JqR50S+kDFy +1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29mvVXIwAHIRc/ +SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03 +-----END CERTIFICATE----- + +# Issuer: CN=Hellenic Academic and Research Institutions RootCA 2011 O=Hellenic Academic and Research Institutions Cert. Authority +# Subject: CN=Hellenic Academic and Research Institutions RootCA 2011 O=Hellenic Academic and Research Institutions Cert. Authority +# Label: "Hellenic Academic and Research Institutions RootCA 2011" +# Serial: 0 +# MD5 Fingerprint: 73:9f:4c:4b:73:5b:79:e9:fa:ba:1c:ef:6e:cb:d5:c9 +# SHA1 Fingerprint: fe:45:65:9b:79:03:5b:98:a1:61:b5:51:2e:ac:da:58:09:48:22:4d +# SHA256 Fingerprint: bc:10:4f:15:a4:8b:e7:09:dc:a5:42:a7:e1:d4:b9:df:6f:05:45:27:e8:02:ea:a9:2d:59:54:44:25:8a:fe:71 +-----BEGIN CERTIFICATE----- +MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1Ix +RDBCBgNVBAoTO0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1 +dGlvbnMgQ2VydC4gQXV0aG9yaXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1p +YyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIFJvb3RDQSAyMDExMB4XDTExMTIw +NjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYTAkdSMUQwQgYDVQQK +EztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIENl +cnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJl +c2VhcmNoIEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPz +dYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJ +fel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa71HFK9+WXesyHgLacEns +bgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u8yBRQlqD +75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSP +FEDH3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNV +HRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp +5dgTBCPuQSUwRwYDVR0eBEAwPqA8MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQu +b3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQub3JnMA0GCSqGSIb3DQEBBQUA +A4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVtXdMiKahsog2p +6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 +TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7 +dIsXRSZMFpGD/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8Acys +Nnq/onN694/BtZqhFLKPM58N7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXI +l7WdmplNsDz4SgCbZN2fOUvRJ9e4 +-----END CERTIFICATE----- + +# Issuer: CN=Actalis Authentication Root CA O=Actalis S.p.A./03358520967 +# Subject: CN=Actalis Authentication Root CA O=Actalis S.p.A./03358520967 +# Label: "Actalis Authentication Root CA" +# Serial: 6271844772424770508 +# MD5 Fingerprint: 69:c1:0d:4f:07:a3:1b:c3:fe:56:3d:04:bc:11:f6:a6 +# SHA1 Fingerprint: f3:73:b3:87:06:5a:28:84:8a:f2:f3:4a:ce:19:2b:dd:c7:8e:9c:ac +# SHA256 Fingerprint: 55:92:60:84:ec:96:3a:64:b9:6e:2a:be:01:ce:0b:a8:6a:64:fb:fe:bc:c7:aa:b5:af:c1:55:b3:7f:d7:60:66 +-----BEGIN CERTIFICATE----- +MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UE +BhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8w +MzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 +IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDkyMjExMjIwMlowazELMAkGA1UEBhMC +SVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1 +ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENB +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNv +UTufClrJwkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX +4ay8IMKx4INRimlNAJZaby/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9 +KK3giq0itFZljoZUj5NDKd45RnijMCO6zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/ +gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1fYVEiVRvjRuPjPdA1Yprb +rxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2oxgkg4YQ +51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2F +be8lEfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxe +KF+w6D9Fz8+vm2/7hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4F +v6MGn8i1zeQf1xcGDXqVdFUNaBr8EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbn +fpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5jF66CyCU3nuDuP/jVo23Eek7 +jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLYiDrIn3hm7Ynz +ezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt +ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAL +e3KHwGCmSUyIWOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70 +jsNjLiNmsGe+b7bAEzlgqqI0JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDz +WochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKxK3JCaKygvU5a2hi/a5iB0P2avl4V +SM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+Xlff1ANATIGk0k9j +pwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC4yyX +X04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+Ok +fcvHlXHo2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7R +K4X9p2jIugErsWx0Hbhzlefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btU +ZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXemOR/qnuOf0GZvBeyqdn6/axag67XH/JJU +LysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9vwGYT7JZVEc+NHt4bVaT +LnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== +-----END CERTIFICATE----- + +# Issuer: O=Trustis Limited OU=Trustis FPS Root CA +# Subject: O=Trustis Limited OU=Trustis FPS Root CA +# Label: "Trustis FPS Root CA" +# Serial: 36053640375399034304724988975563710553 +# MD5 Fingerprint: 30:c9:e7:1e:6b:e6:14:eb:65:b2:16:69:20:31:67:4d +# SHA1 Fingerprint: 3b:c0:38:0b:33:c3:f6:a6:0c:86:15:22:93:d9:df:f5:4b:81:c0:04 +# SHA256 Fingerprint: c1:b4:82:99:ab:a5:20:8f:e9:63:0a:ce:55:ca:68:a0:3e:da:5a:51:9c:88:02:a0:d3:a6:73:be:8f:8e:55:7d +-----BEGIN CERTIFICATE----- +MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBF +MQswCQYDVQQGEwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQL +ExNUcnVzdGlzIEZQUyBSb290IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTEx +MzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNVBAoTD1RydXN0aXMgTGltaXRlZDEc +MBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQRUN+ +AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihH +iTHcDnlkH5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjj +vSkCqPoc4Vu5g6hBSLwacY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA +0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zto3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlB +OrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEAAaNTMFEwDwYDVR0TAQH/ +BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAdBgNVHQ4E +FgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01 +GX2cGE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmW +zaD+vkAMXBJV+JOCyinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP4 +1BIy+Q7DsdwyhEQsb8tGD+pmQQ9P8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZE +f1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHVl/9D7S3B2l0pKoU/rGXuhg8F +jZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYliB6XzCGcKQEN +ZetX2fNXlrtIzYE= +-----END CERTIFICATE----- + +# Issuer: CN=Buypass Class 2 Root CA O=Buypass AS-983163327 +# Subject: CN=Buypass Class 2 Root CA O=Buypass AS-983163327 +# Label: "Buypass Class 2 Root CA" +# Serial: 2 +# MD5 Fingerprint: 46:a7:d2:fe:45:fb:64:5a:a8:59:90:9b:78:44:9b:29 +# SHA1 Fingerprint: 49:0a:75:74:de:87:0a:47:fe:58:ee:f6:c7:6b:eb:c6:0b:12:40:99 +# SHA256 Fingerprint: 9a:11:40:25:19:7c:5b:b9:5d:94:e6:3d:55:cd:43:79:08:47:b6:46:b2:3c:df:11:ad:a4:a0:0e:ff:15:fb:48 +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd +MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg +Q2xhc3MgMiBSb290IENBMB4XDTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1ow +TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw +HgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB +BQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1g1Lr +6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPV +L4O2fuPn9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC91 +1K2GScuVr1QGbNgGE41b/+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHx +MlAQTn/0hpPshNOOvEu/XAFOBz3cFIqUCqTqc/sLUegTBxj6DvEr0VQVfTzh97QZ +QmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeffawrbD02TTqigzXsu8lkB +arcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgIzRFo1clr +Us3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLi +FRhnBkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRS +P/TizPJhk9H9Z2vXUq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN +9SG9dKpN6nIDSdvHXx1iY8f93ZHsM+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxP +AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMmAd+BikoL1Rpzz +uvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAU18h +9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s +A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3t +OluwlN5E40EIosHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo ++fsicdl9sz1Gv7SEr5AcD48Saq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7 +KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYdDnkM/crqJIByw5c/8nerQyIKx+u2 +DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWDLfJ6v9r9jv6ly0Us +H8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0oyLQ +I+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK7 +5t98biGCwWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h +3PFaTWwyI0PurKju7koSCTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPz +Y11aWOIv4x3kqdbQCtCev9eBCfHJxyYNrJgWVqA= +-----END CERTIFICATE----- + +# Issuer: CN=Buypass Class 3 Root CA O=Buypass AS-983163327 +# Subject: CN=Buypass Class 3 Root CA O=Buypass AS-983163327 +# Label: "Buypass Class 3 Root CA" +# Serial: 2 +# MD5 Fingerprint: 3d:3b:18:9e:2c:64:5a:e8:d5:88:ce:0e:f9:37:c2:ec +# SHA1 Fingerprint: da:fa:f7:fa:66:84:ec:06:8f:14:50:bd:c7:c2:81:a5:bc:a9:64:57 +# SHA256 Fingerprint: ed:f7:eb:bc:a2:7a:2a:38:4d:38:7b:7d:40:10:c6:66:e2:ed:b4:84:3e:4c:29:b4:ae:1d:5b:93:32:e6:b2:4d +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd +MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg +Q2xhc3MgMyBSb290IENBMB4XDTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFow +TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw +HgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB +BQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRHsJ8Y +ZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3E +N3coTRiR5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9 +tznDDgFHmV0ST9tD+leh7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX +0DJq1l1sDPGzbjniazEuOQAnFN44wOwZZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c +/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH2xc519woe2v1n/MuwU8X +KhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV/afmiSTY +zIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvS +O1UQRwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D +34xFMFbG02SrZvPAXpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgP +K9Dx2hzLabjKSWJtyNBjYt1gD1iqj6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3 +AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFEe4zf/lb+74suwv +Tg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAACAj +QTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV +cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXS +IGrs/CIBKM+GuIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2 +HJLw5QY33KbmkJs4j1xrG0aGQ0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsa +O5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8ZORK15FTAaggiG6cX0S5y2CBNOxv +033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2KSb12tjE8nVhz36u +dmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz6MkE +kbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg41 +3OEMXbugUZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvD +u79leNKGef9JOxqDDPDeeOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq +4/g7u9xN12TyUb7mqqta6THuBrxzvxNiCp/HuZc= +-----END CERTIFICATE----- + +# Issuer: CN=T-TeleSec GlobalRoot Class 3 O=T-Systems Enterprise Services GmbH OU=T-Systems Trust Center +# Subject: CN=T-TeleSec GlobalRoot Class 3 O=T-Systems Enterprise Services GmbH OU=T-Systems Trust Center +# Label: "T-TeleSec GlobalRoot Class 3" +# Serial: 1 +# MD5 Fingerprint: ca:fb:40:a8:4e:39:92:8a:1d:fe:8e:2f:c4:27:ea:ef +# SHA1 Fingerprint: 55:a6:72:3e:cb:f2:ec:cd:c3:23:74:70:19:9d:2a:be:11:e3:81:d1 +# SHA256 Fingerprint: fd:73:da:d3:1c:64:4f:f1:b4:3b:ef:0c:cd:da:96:71:0b:9c:d9:87:5e:ca:7e:31:70:7a:f3:e9:6d:52:2b:bd +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx +KzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd +BgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNl +YyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgxMDAxMTAyOTU2WhcNMzMxMDAxMjM1 +OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnBy +aXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50 +ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN +8ELg63iIVl6bmlQdTQyK9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/ +RLyTPWGrTs0NvvAgJ1gORH8EGoel15YUNpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4 +hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZFiP0Zf3WHHx+xGwpzJFu5 +ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W0eDrXltM +EnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGj +QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1 +A/d2O2GCahKqGFPrAyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOy +WL6ukK2YJ5f+AbGwUgC4TeQbIXQbfsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ +1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzTucpH9sry9uetuUg/vBa3wW30 +6gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7hP0HHRwA11fXT +91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml +e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4p +TpPDpFQUWw== +-----END CERTIFICATE----- + +# Issuer: CN=EE Certification Centre Root CA O=AS Sertifitseerimiskeskus +# Subject: CN=EE Certification Centre Root CA O=AS Sertifitseerimiskeskus +# Label: "EE Certification Centre Root CA" +# Serial: 112324828676200291871926431888494945866 +# MD5 Fingerprint: 43:5e:88:d4:7d:1a:4a:7e:fd:84:2e:52:eb:01:d4:6f +# SHA1 Fingerprint: c9:a8:b9:e7:55:80:5e:58:e3:53:77:a7:25:eb:af:c3:7b:27:cc:d7 +# SHA256 Fingerprint: 3e:84:ba:43:42:90:85:16:e7:75:73:c0:99:2f:09:79:ca:08:4e:46:85:68:1f:f1:95:cc:ba:8a:22:9b:8a:76 +-----BEGIN CERTIFICATE----- +MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1 +MQswCQYDVQQGEwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1 +czEoMCYGA1UEAwwfRUUgQ2VydGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYG +CSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIwMTAxMDMwMTAxMDMwWhgPMjAzMDEy +MTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlBUyBTZXJ0aWZpdHNl +ZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRyZSBS +b290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUy +euuOF0+W2Ap7kaJjbMeMTC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvO +bntl8jixwKIy72KyaOBhU8E2lf/slLo2rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIw +WFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw93X2PaRka9ZP585ArQ/d +MtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtNP2MbRMNE +1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYD +VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/ +zQas8fElyalL1BSZMEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYB +BQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEF +BQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+RjxY6hUFaTlrg4wCQiZrxTFGGV +v9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqMlIpPnTX/dqQG +E5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u +uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIW +iAYLtqZLICjU3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/v +GVCJYMzpJJUPwssd8m92kMfMdcGWxZ0= +-----END CERTIFICATE----- + +# Issuer: CN=D-TRUST Root Class 3 CA 2 2009 O=D-Trust GmbH +# Subject: CN=D-TRUST Root Class 3 CA 2 2009 O=D-Trust GmbH +# Label: "D-TRUST Root Class 3 CA 2 2009" +# Serial: 623603 +# MD5 Fingerprint: cd:e0:25:69:8d:47:ac:9c:89:35:90:f7:fd:51:3d:2f +# SHA1 Fingerprint: 58:e8:ab:b0:36:15:33:fb:80:f7:9b:1b:6d:29:d3:ff:8d:5f:00:f0 +# SHA256 Fingerprint: 49:e7:a4:42:ac:f0:ea:62:87:05:00:54:b5:25:64:b6:50:e4:f4:9e:42:e3:48:d6:aa:38:e0:39:e9:57:b1:c1 +-----BEGIN CERTIFICATE----- +MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRF +MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBD +bGFzcyAzIENBIDIgMjAwOTAeFw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NTha +ME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMM +HkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOADER03 +UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42 +tSHKXzlABF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9R +ySPocq60vFYJfxLLHLGvKZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsM +lFqVlNpQmvH/pStmMaTJOKDfHR+4CS7zp+hnUquVH+BGPtikw8paxTGA6Eian5Rp +/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUCAwEAAaOCARowggEWMA8G +A1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ4PGEMA4G +A1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVj +dG9yeS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUy +MENBJTIwMiUyMDIwMDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRl +cmV2b2NhdGlvbmxpc3QwQ6BBoD+GPWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3Js +L2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAwOS5jcmwwDQYJKoZIhvcNAQEL +BQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm2H6NMLVwMeni +acfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0 +o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4K +zCUqNQT4YJEVdT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8 +PIWmawomDeCTmGCufsYkl4phX5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3Y +Johw1+qRzT65ysCQblrGXnRl11z+o+I= +-----END CERTIFICATE----- + +# Issuer: CN=D-TRUST Root Class 3 CA 2 EV 2009 O=D-Trust GmbH +# Subject: CN=D-TRUST Root Class 3 CA 2 EV 2009 O=D-Trust GmbH +# Label: "D-TRUST Root Class 3 CA 2 EV 2009" +# Serial: 623604 +# MD5 Fingerprint: aa:c6:43:2c:5e:2d:cd:c4:34:c0:50:4f:11:02:4f:b6 +# SHA1 Fingerprint: 96:c9:1b:0b:95:b4:10:98:42:fa:d0:d8:22:79:fe:60:fa:b9:16:83 +# SHA256 Fingerprint: ee:c5:49:6b:98:8c:e9:86:25:b9:34:09:2e:ec:29:08:be:d0:b0:f3:16:c2:d4:73:0c:84:ea:f1:f3:d3:48:81 +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRF +MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBD +bGFzcyAzIENBIDIgRVYgMjAwOTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUw +NDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNV +BAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAwOTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfSegpn +ljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM0 +3TP1YtHhzRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6Z +qQTMFexgaDbtCHu39b+T7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lR +p75mpoo6Kr3HGrHhFPC+Oh25z1uxav60sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8 +HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure3511H3a6UCAwEAAaOCASQw +ggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyvcop9Ntea +HNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFw +Oi8vZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xh +c3MlMjAzJTIwQ0ElMjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1E +RT9jZXJ0aWZpY2F0ZXJldm9jYXRpb25saXN0MEagRKBChkBodHRwOi8vd3d3LmQt +dHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xhc3NfM19jYV8yX2V2XzIwMDku +Y3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+PPoeUSbrh/Yp +3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05 +nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNF +CSuGdXzfX2lXANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7na +xpeG0ILD5EJt/rDiZE4OJudANCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqX +KVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVvw9y4AyHqnxbxLFS1 +-----END CERTIFICATE----- + +# Issuer: CN=CA Disig Root R2 O=Disig a.s. +# Subject: CN=CA Disig Root R2 O=Disig a.s. +# Label: "CA Disig Root R2" +# Serial: 10572350602393338211 +# MD5 Fingerprint: 26:01:fb:d8:27:a7:17:9a:45:54:38:1a:43:01:3b:03 +# SHA1 Fingerprint: b5:61:eb:ea:a4:de:e4:25:4b:69:1a:98:a5:57:47:c2:34:c7:d9:71 +# SHA256 Fingerprint: e2:3d:4a:03:6d:7b:70:e9:f5:95:b1:42:20:79:d2:b9:1e:df:bb:1f:b6:51:a0:63:3e:aa:8a:9d:c5:f8:07:03 +-----BEGIN CERTIFICATE----- +MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV +BAYTAlNLMRMwEQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMu +MRkwFwYDVQQDExBDQSBEaXNpZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQy +MDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sxEzARBgNVBAcTCkJyYXRpc2xhdmEx +EzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERpc2lnIFJvb3QgUjIw +ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbCw3Oe +NcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNH +PWSb6WiaxswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3I +x2ymrdMxp7zo5eFm1tL7A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbe +QTg06ov80egEFGEtQX6sx3dOy1FU+16SGBsEWmjGycT6txOgmLcRK7fWV8x8nhfR +yyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqVg8NTEQxzHQuyRpDRQjrO +QG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa5Beny912 +H9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJ +QfYEkoopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUD +i/ZnWejBBhG93c+AAk9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORs +nLMOPReisjQS1n6yqEm70XooQL6iFh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1 +rqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud +DwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5uQu0wDQYJKoZI +hvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM +tCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqf +GopTpti72TVVsRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkb +lvdhuDvEK7Z4bLQjb/D907JedR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka ++elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W81k/BfDxujRNt+3vrMNDcTa/F1bal +TFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjxmHHEt38OFdAlab0i +nSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01utI3 +gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18Dr +G5gPcFw0sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3Os +zMOl6W8KjptlwlCFtaOgUxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8x +L4ysEr3vQCj8KWefshNPZiTEUxnpHikV7+ZtsH8tZ/3zbBt1RqPlShfppNcL +-----END CERTIFICATE----- + +# Issuer: CN=ACCVRAIZ1 O=ACCV OU=PKIACCV +# Subject: CN=ACCVRAIZ1 O=ACCV OU=PKIACCV +# Label: "ACCVRAIZ1" +# Serial: 6828503384748696800 +# MD5 Fingerprint: d0:a0:5a:ee:05:b6:09:94:21:a1:7d:f1:b2:29:82:02 +# SHA1 Fingerprint: 93:05:7a:88:15:c6:4f:ce:88:2f:fa:91:16:52:28:78:bc:53:64:17 +# SHA256 Fingerprint: 9a:6e:c0:12:e1:a7:da:9d:be:34:19:4d:47:8a:d7:c0:db:18:22:fb:07:1d:f1:29:81:49:6e:d1:04:38:41:13 +-----BEGIN CERTIFICATE----- +MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UE +AwwJQUNDVlJBSVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQsw +CQYDVQQGEwJFUzAeFw0xMTA1MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQ +BgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwHUEtJQUNDVjENMAsGA1UECgwEQUND +VjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCb +qau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gMjmoY +HtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWo +G2ioPej0RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpA +lHPrzg5XPAOBOp0KoVdDaaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhr +IA8wKFSVf+DuzgpmndFALW4ir50awQUZ0m/A8p/4e7MCQvtQqR0tkw8jq8bBD5L/ +0KIV9VMJcRz/RROE5iZe+OCIHAr8Fraocwa48GOEAqDGWuzndN9wrqODJerWx5eH +k6fGioozl2A3ED6XPm4pFdahD9GILBKfb6qkxkLrQaLjlUPTAYVtjrs78yM2x/47 +4KElB0iryYl0/wiPgL/AlmXz7uxLaL2diMMxs0Dx6M/2OLuc5NF/1OVYm3z61PMO +m3WR5LpSLhl+0fXNWhn8ugb2+1KoS5kE3fj5tItQo05iifCHJPqDQsGH+tUtKSpa +cXpkatcnYGMN285J9Y0fkIkyF/hzQ7jSWpOGYdbhdQrqeWZ2iE9x6wQl1gpaepPl +uUsXQA+xtrn13k/c4LOsOxFwYIRKQ26ZIMApcQrAZQIDAQABo4ICyzCCAscwfQYI +KwYBBQUHAQEEcTBvMEwGCCsGAQUFBzAChkBodHRwOi8vd3d3LmFjY3YuZXMvZmls +ZWFkbWluL0FyY2hpdm9zL2NlcnRpZmljYWRvcy9yYWl6YWNjdjEuY3J0MB8GCCsG +AQUFBzABhhNodHRwOi8vb2NzcC5hY2N2LmVzMB0GA1UdDgQWBBTSh7Tj3zcnk1X2 +VuqB5TbMjB4/vTAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNKHtOPfNyeT +VfZW6oHlNsyMHj+9MIIBcwYDVR0gBIIBajCCAWYwggFiBgRVHSAAMIIBWDCCASIG +CCsGAQUFBwICMIIBFB6CARAAQQB1AHQAbwByAGkAZABhAGQAIABkAGUAIABDAGUA +cgB0AGkAZgBpAGMAYQBjAGkA8wBuACAAUgBhAO0AegAgAGQAZQAgAGwAYQAgAEEA +QwBDAFYAIAAoAEEAZwBlAG4AYwBpAGEAIABkAGUAIABUAGUAYwBuAG8AbABvAGcA +7QBhACAAeQAgAEMAZQByAHQAaQBmAGkAYwBhAGMAaQDzAG4AIABFAGwAZQBjAHQA +cgDzAG4AaQBjAGEALAAgAEMASQBGACAAUQA0ADYAMAAxADEANQA2AEUAKQAuACAA +QwBQAFMAIABlAG4AIABoAHQAdABwADoALwAvAHcAdwB3AC4AYQBjAGMAdgAuAGUA +czAwBggrBgEFBQcCARYkaHR0cDovL3d3dy5hY2N2LmVzL2xlZ2lzbGFjaW9uX2Mu +aHRtMFUGA1UdHwROMEwwSqBIoEaGRGh0dHA6Ly93d3cuYWNjdi5lcy9maWxlYWRt +aW4vQXJjaGl2b3MvY2VydGlmaWNhZG9zL3JhaXphY2N2MV9kZXIuY3JsMA4GA1Ud +DwEB/wQEAwIBBjAXBgNVHREEEDAOgQxhY2N2QGFjY3YuZXMwDQYJKoZIhvcNAQEF +BQADggIBAJcxAp/n/UNnSEQU5CmH7UwoZtCPNdpNYbdKl02125DgBS4OxnnQ8pdp +D70ER9m+27Up2pvZrqmZ1dM8MJP1jaGo/AaNRPTKFpV8M9xii6g3+CfYCS0b78gU +JyCpZET/LtZ1qmxNYEAZSUNUY9rizLpm5U9EelvZaoErQNV/+QEnWCzI7UiRfD+m +AM/EKXMRNt6GGT6d7hmKG9Ww7Y49nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepD +vV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJTS+xJlsndQAJxGJ3KQhfnlms +tn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3sCPdK6jT2iWH +7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h +I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szA +h1xA2syVP1XgNce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xF +d3+YJ5oyXSrjhO7FmGYvliAd3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2H +pPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3pEfbRD0tVNEYqi4Y7 +-----END CERTIFICATE----- + +# Issuer: CN=TWCA Global Root CA O=TAIWAN-CA OU=Root CA +# Subject: CN=TWCA Global Root CA O=TAIWAN-CA OU=Root CA +# Label: "TWCA Global Root CA" +# Serial: 3262 +# MD5 Fingerprint: f9:03:7e:cf:e6:9e:3c:73:7a:2a:90:07:69:ff:2b:96 +# SHA1 Fingerprint: 9c:bb:48:53:f6:a4:f6:d3:52:a4:e8:32:52:55:60:13:f5:ad:af:65 +# SHA256 Fingerprint: 59:76:90:07:f7:68:5d:0f:cd:50:87:2f:9f:95:d5:75:5a:5b:2b:45:7d:81:f3:69:2b:61:0a:98:67:2f:0e:1b +-----BEGIN CERTIFICATE----- +MIIFQTCCAymgAwIBAgICDL4wDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVFcx +EjAQBgNVBAoTCVRBSVdBTi1DQTEQMA4GA1UECxMHUm9vdCBDQTEcMBoGA1UEAxMT +VFdDQSBHbG9iYWwgUm9vdCBDQTAeFw0xMjA2MjcwNjI4MzNaFw0zMDEyMzExNTU5 +NTlaMFExCzAJBgNVBAYTAlRXMRIwEAYDVQQKEwlUQUlXQU4tQ0ExEDAOBgNVBAsT +B1Jvb3QgQ0ExHDAaBgNVBAMTE1RXQ0EgR2xvYmFsIFJvb3QgQ0EwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQCwBdvI64zEbooh745NnHEKH1Jw7W2CnJfF +10xORUnLQEK1EjRsGcJ0pDFfhQKX7EMzClPSnIyOt7h52yvVavKOZsTuKwEHktSz +0ALfUPZVr2YOy+BHYC8rMjk1Ujoog/h7FsYYuGLWRyWRzvAZEk2tY/XTP3VfKfCh +MBwqoJimFb3u/Rk28OKRQ4/6ytYQJ0lM793B8YVwm8rqqFpD/G2Gb3PpN0Wp8DbH +zIh1HrtsBv+baz4X7GGqcXzGHaL3SekVtTzWoWH1EfcFbx39Eb7QMAfCKbAJTibc +46KokWofwpFFiFzlmLhxpRUZyXx1EcxwdE8tmx2RRP1WKKD+u4ZqyPpcC1jcxkt2 +yKsi2XMPpfRaAok/T54igu6idFMqPVMnaR1sjjIsZAAmY2E2TqNGtz99sy2sbZCi +laLOz9qC5wc0GZbpuCGqKX6mOL6OKUohZnkfs8O1CWfe1tQHRvMq2uYiN2DLgbYP +oA/pyJV/v1WRBXrPPRXAb94JlAGD1zQbzECl8LibZ9WYkTunhHiVJqRaCPgrdLQA +BDzfuBSO6N+pjWxnkjMdwLfS7JLIvgm/LCkFbwJrnu+8vyq8W8BQj0FwcYeyTbcE +qYSjMq+u7msXi7Kx/mzhkIyIqJdIzshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm +4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB +/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6gcFGn90xHNcgL +1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn +LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WF +H6vPNOw/KP4M8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNo +RI2T9GRwoD2dKAXDOXC4Ynsg/eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+ +nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlglPx4mI88k1HtQJAH32RjJMtOcQWh +15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryPA9gK8kxkRr05YuWW +6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3mi4TW +nsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5j +wa19hAM8EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWz +aGHQRiapIVJpLesux+t3zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmy +KwbQBM0= +-----END CERTIFICATE----- + +# Issuer: CN=TeliaSonera Root CA v1 O=TeliaSonera +# Subject: CN=TeliaSonera Root CA v1 O=TeliaSonera +# Label: "TeliaSonera Root CA v1" +# Serial: 199041966741090107964904287217786801558 +# MD5 Fingerprint: 37:41:49:1b:18:56:9a:26:f5:ad:c2:66:fb:40:a5:4c +# SHA1 Fingerprint: 43:13:bb:96:f1:d5:86:9b:c1:4e:6a:92:f6:cf:f6:34:69:87:82:37 +# SHA256 Fingerprint: dd:69:36:fe:21:f8:f0:77:c1:23:a1:a5:21:c1:22:24:f7:22:55:b7:3e:03:a7:26:06:93:e8:a2:4b:0f:a3:89 +-----BEGIN CERTIFICATE----- +MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAw +NzEUMBIGA1UECgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJv +b3QgQ0EgdjEwHhcNMDcxMDE4MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYD +VQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwWVGVsaWFTb25lcmEgUm9vdCBDQSB2 +MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMK+6yfwIaPzaSZVfp3F +VRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3t+XmfHnqjLWCi65ItqwA3GV1 +7CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq/t75rH2D+1665I+X +Z75Ljo1kB1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1jF3oI7x+ +/jXh7VB7qTCNGdMJjmhnXb88lxhTuylixcpecsHHltTbLaC0H2kD7OriUPEMPPCs +81Mt8Bz17Ww5OXOAFshSsCPN4D7c3TxHoLs1iuKYaIu+5b9y7tL6pe0S7fyYGKkm +dtwoSxAgHNN/Fnct7W+A90m7UwW7XWjH1Mh1Fj+JWov3F0fUTPHSiXk+TT2YqGHe +Oh7S+F4D4MHJHIzTjU3TlTazN19jY5szFPAtJmtTfImMMsJu7D0hADnJoWjiUIMu +sDor8zagrC/kb2HCUQk5PotTubtn2txTuXZZNp1D5SDgPTJghSJRt8czu90VL6R4 +pgd7gUY2BIbdeTXHlSw7sKMXNeVzH7RcWe/a6hBle3rQf5+ztCo3O3CLm1u5K7fs +slESl1MpWtTwEhDcTwK7EpIvYtQ/aUN8Ddb8WHUBiJ1YFkveupD/RwGJBmr2X7KQ +arMCpgKIv7NHfirZ1fpoeDVNAgMBAAGjPzA9MA8GA1UdEwEB/wQFMAMBAf8wCwYD +VR0PBAQDAgEGMB0GA1UdDgQWBBTwj1k4ALP1j5qWDNXr+nuqF+gTEjANBgkqhkiG +9w0BAQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNmzqjMDfz1mgbl +dxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx +0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1Tj +TQpgcmLNkQfWpb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBed +Y2gea+zDTYa4EzAvXUYNR0PVG6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7 +Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpcc41teyWRyu5FrgZLAMzTsVlQ2jqI +OylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOTJsjrDNYmiLbAJM+7 +vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2qReW +t88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcn +HL/EVlP6Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVx +SK236thZiNSQvxaz2emsWWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= +-----END CERTIFICATE----- + +# Issuer: CN=E-Tugra Certification Authority O=E-Tu\u011fra EBG Bili\u015fim Teknolojileri ve Hizmetleri A.\u015e. OU=E-Tugra Sertifikasyon Merkezi +# Subject: CN=E-Tugra Certification Authority O=E-Tu\u011fra EBG Bili\u015fim Teknolojileri ve Hizmetleri A.\u015e. OU=E-Tugra Sertifikasyon Merkezi +# Label: "E-Tugra Certification Authority" +# Serial: 7667447206703254355 +# MD5 Fingerprint: b8:a1:03:63:b0:bd:21:71:70:8a:6f:13:3a:bb:79:49 +# SHA1 Fingerprint: 51:c6:e7:08:49:06:6e:f3:92:d4:5c:a0:0d:6d:a3:62:8f:c3:52:39 +# SHA256 Fingerprint: b0:bf:d5:2b:b0:d7:d9:bd:92:bf:5d:4d:c1:3d:a2:55:c0:2c:54:2f:37:83:65:ea:89:39:11:f5:5e:55:f2:3c +-----BEGIN CERTIFICATE----- +MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNV +BAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBC +aWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNV +BAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQDDB9FLVR1 +Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMwNTEyMDk0OFoXDTIz +MDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExQDA+ +BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhp +em1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN +ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA4vU/kwVRHoViVF56C/UY +B4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vdhQd2h8y/L5VMzH2nPbxH +D5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+XawGb1Q5KCKpbknSF +Q9OArqGIW66z6l7LFpp3RMih9lRozt6Plyu6W0ACDGQXwLWTzeHxE2bODHnv0ZEo +q1+gElIwcxmOj+GMB6LDu0rw6h8VqO4lzKRG+Bsi77MOQ7osJLjFLFzUHPhdZL3D +k14opz8n8Y4e0ypQBaNV2cvnOVPAmJ6MVGKLJrD3fY185MaeZkJVgkfnsliNZvcH +fC425lAcP9tDJMW/hkd5s3kc91r0E+xs+D/iWR+V7kI+ua2oMoVJl0b+SzGPWsut +dEcf6ZG33ygEIqDUD13ieU/qbIWGvaimzuT6w+Gzrt48Ue7LE3wBf4QOXVGUnhMM +ti6lTPk5cDZvlsouDERVxcr6XQKj39ZkjFqzAQqptQpHF//vkUAqjqFGOjGY5RH8 +zLtJVor8udBhmm9lbObDyz51Sf6Pp+KJxWfXnUYTTjF2OySznhFlhqt/7x3U+Lzn +rFpct1pHXFXOVbQicVtbC/DP3KBhZOqp12gKY6fgDT+gr9Oq0n7vUaDmUStVkhUX +U8u3Zg5mTPj5dUyQ5xJwx0UCAwEAAaNjMGEwHQYDVR0OBBYEFC7j27JJ0JxUeVz6 +Jyr+zE7S6E5UMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5 +XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAF +Nzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAKkEh47U6YA5n+KGCR +HTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jOXKqY +GwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c +77NCR807VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3 ++GbHeJAAFS6LrVE1Uweoa2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WK +vJUawSg5TB9D0pH0clmKuVb8P7Sd2nCcdlqMQ1DujjByTd//SffGqWfZbawCEeI6 +FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEVKV0jq9BgoRJP3vQXzTLl +yb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gTDx4JnW2P +AJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpD +y4Q08ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8d +NL/+I5c30jn6PQ0GC7TbO6Orb1wdtn7os4I07QZcJA== +-----END CERTIFICATE----- + +# Issuer: CN=T-TeleSec GlobalRoot Class 2 O=T-Systems Enterprise Services GmbH OU=T-Systems Trust Center +# Subject: CN=T-TeleSec GlobalRoot Class 2 O=T-Systems Enterprise Services GmbH OU=T-Systems Trust Center +# Label: "T-TeleSec GlobalRoot Class 2" +# Serial: 1 +# MD5 Fingerprint: 2b:9b:9e:e4:7b:6c:1f:00:72:1a:cc:c1:77:79:df:6a +# SHA1 Fingerprint: 59:0d:2d:7d:88:4f:40:2e:61:7e:a5:62:32:17:65:cf:17:d8:94:e9 +# SHA256 Fingerprint: 91:e2:f5:78:8d:58:10:eb:a7:ba:58:73:7d:e1:54:8a:8e:ca:cd:01:45:98:bc:0b:14:3e:04:1b:17:05:25:52 +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx +KzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd +BgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNl +YyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgxMDAxMTA0MDE0WhcNMzMxMDAxMjM1 +OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnBy +aXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50 +ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUd +AqSzm1nzHoqvNK38DcLZSBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiC +FoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/FvudocP05l03Sx5iRUKrERLMjfTlH6VJi +1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx9702cu+fjOlbpSD8DT6Iavq +jnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGVWOHAD3bZ +wI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGj +QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/ +WSA2AHmgoCJrjNXyYdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhy +NsZt+U2e+iKo4YFWz827n+qrkRk4r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPAC +uvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNfvNoBYimipidx5joifsFvHZVw +IEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR3p1m0IvVVGb6 +g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN +9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlP +BSeOE6Fuwg== +-----END CERTIFICATE----- + +# Issuer: CN=Atos TrustedRoot 2011 O=Atos +# Subject: CN=Atos TrustedRoot 2011 O=Atos +# Label: "Atos TrustedRoot 2011" +# Serial: 6643877497813316402 +# MD5 Fingerprint: ae:b9:c4:32:4b:ac:7f:5d:66:cc:77:94:bb:2a:77:56 +# SHA1 Fingerprint: 2b:b1:f5:3e:55:0c:1d:c5:f1:d4:e6:b7:6a:46:4b:55:06:02:ac:21 +# SHA256 Fingerprint: f3:56:be:a2:44:b7:a9:1e:b3:5d:53:ca:9a:d7:86:4a:ce:01:8e:2d:35:d5:f8:f9:6d:df:68:a6:f4:1a:a4:74 +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UE +AwwVQXRvcyBUcnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQG +EwJERTAeFw0xMTA3MDcxNDU4MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMM +FUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsGA1UECgwEQXRvczELMAkGA1UEBhMC +REUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCVhTuXbyo7LjvPpvMp +Nb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr54rM +VD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+ +SZFhyBH+DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ +4J7sVaE3IqKHBAUsR320HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0L +cp2AMBYHlT8oDv3FdU9T1nSatCQujgKRz3bFmx5VdJx4IbHwLfELn8LVlhgf8FQi +eowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7Rl+lwrrw7GWzbITAPBgNV +HRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZbNshMBgG +A1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3 +DQEBCwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8j +vZfza1zv7v1Apt+hk6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kP +DpFrdRbhIfzYJsdHt6bPWHJxfrrhTZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pc +maHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a961qn8FYiqTxlVMYVqL2Gns2D +lmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G3mB/ufNPRJLv +KrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed +-----END CERTIFICATE----- + +# Issuer: CN=QuoVadis Root CA 1 G3 O=QuoVadis Limited +# Subject: CN=QuoVadis Root CA 1 G3 O=QuoVadis Limited +# Label: "QuoVadis Root CA 1 G3" +# Serial: 687049649626669250736271037606554624078720034195 +# MD5 Fingerprint: a4:bc:5b:3f:fe:37:9a:fa:64:f0:e2:fa:05:3d:0b:ab +# SHA1 Fingerprint: 1b:8e:ea:57:96:29:1a:c9:39:ea:b8:0a:81:1a:73:73:c0:93:79:67 +# SHA256 Fingerprint: 8a:86:6f:d1:b2:76:b5:7e:57:8e:92:1c:65:82:8a:2b:ed:58:e9:f2:f2:88:05:41:34:b7:f1:f4:bf:c9:cc:74 +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIUeFhfLq0sGUvjNwc1NBMotZbUZZMwDQYJKoZIhvcNAQEL +BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc +BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMSBHMzAeFw0xMjAxMTIxNzI3NDRaFw00 +MjAxMTIxNzI3NDRaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDEgRzMwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQCgvlAQjunybEC0BJyFuTHK3C3kEakEPBtV +wedYMB0ktMPvhd6MLOHBPd+C5k+tR4ds7FtJwUrVu4/sh6x/gpqG7D0DmVIB0jWe +rNrwU8lmPNSsAgHaJNM7qAJGr6Qc4/hzWHa39g6QDbXwz8z6+cZM5cOGMAqNF341 +68Xfuw6cwI2H44g4hWf6Pser4BOcBRiYz5P1sZK0/CPTz9XEJ0ngnjybCKOLXSoh +4Pw5qlPafX7PGglTvF0FBM+hSo+LdoINofjSxxR3W5A2B4GbPgb6Ul5jxaYA/qXp +UhtStZI5cgMJYr2wYBZupt0lwgNm3fME0UDiTouG9G/lg6AnhF4EwfWQvTA9xO+o +abw4m6SkltFi2mnAAZauy8RRNOoMqv8hjlmPSlzkYZqn0ukqeI1RPToV7qJZjqlc +3sX5kCLliEVx3ZGZbHqfPT2YfF72vhZooF6uCyP8Wg+qInYtyaEQHeTTRCOQiJ/G +KubX9ZqzWB4vMIkIG1SitZgj7Ah3HJVdYdHLiZxfokqRmu8hqkkWCKi9YSgxyXSt +hfbZxbGL0eUQMk1fiyA6PEkfM4VZDdvLCXVDaXP7a3F98N/ETH3Goy7IlXnLc6KO +Tk0k+17kBL5yG6YnLUlamXrXXAkgt3+UuU/xDRxeiEIbEbfnkduebPRq34wGmAOt +zCjvpUfzUwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB +BjAdBgNVHQ4EFgQUo5fW816iEOGrRZ88F2Q87gFwnMwwDQYJKoZIhvcNAQELBQAD +ggIBABj6W3X8PnrHX3fHyt/PX8MSxEBd1DKquGrX1RUVRpgjpeaQWxiZTOOtQqOC +MTaIzen7xASWSIsBx40Bz1szBpZGZnQdT+3Btrm0DWHMY37XLneMlhwqI2hrhVd2 +cDMT/uFPpiN3GPoajOi9ZcnPP/TJF9zrx7zABC4tRi9pZsMbj/7sPtPKlL92CiUN +qXsCHKnQO18LwIE6PWThv6ctTr1NxNgpxiIY0MWscgKCP6o6ojoilzHdCGPDdRS5 +YCgtW2jgFqlmgiNR9etT2DGbe+m3nUvriBbP+V04ikkwj+3x6xn0dxoxGE1nVGwv +b2X52z3sIexe9PSLymBlVNFxZPT5pqOBMzYzcfCkeF9OrYMh3jRJjehZrJ3ydlo2 +8hP0r+AJx2EqbPfgna67hkooby7utHnNkDPDs3b69fBsnQGQ+p6Q9pxyz0fawx/k +NSBT8lTR32GDpgLiJTjehTItXnOQUl1CxM49S+H5GYQd1aJQzEH7QRTDvdbJWqNj +ZgKAvQU6O0ec7AAmTPWIUb+oI38YB7AL7YsmoWTTYUrrXJ/es69nA7Mf3W1daWhp +q1467HxpvMc7hU6eFbm0FU/DlXpY18ls6Wy58yljXrQs8C097Vpl4KlbQMJImYFt +nh8GKjwStIsPm6Ik8KaN1nrgS7ZklmOVhMJKzRwuJIczYOXD +-----END CERTIFICATE----- + +# Issuer: CN=QuoVadis Root CA 2 G3 O=QuoVadis Limited +# Subject: CN=QuoVadis Root CA 2 G3 O=QuoVadis Limited +# Label: "QuoVadis Root CA 2 G3" +# Serial: 390156079458959257446133169266079962026824725800 +# MD5 Fingerprint: af:0c:86:6e:bf:40:2d:7f:0b:3e:12:50:ba:12:3d:06 +# SHA1 Fingerprint: 09:3c:61:f3:8b:8b:dc:7d:55:df:75:38:02:05:00:e1:25:f5:c8:36 +# SHA256 Fingerprint: 8f:e4:fb:0a:f9:3a:4d:0d:67:db:0b:eb:b2:3e:37:c7:1b:f3:25:dc:bc:dd:24:0e:a0:4d:af:58:b4:7e:18:40 +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQEL +BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc +BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00 +MjAxMTIxODU5MzJaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDIgRzMwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQChriWyARjcV4g/Ruv5r+LrI3HimtFhZiFf +qq8nUeVuGxbULX1QsFN3vXg6YOJkApt8hpvWGo6t/x8Vf9WVHhLL5hSEBMHfNrMW +n4rjyduYNM7YMxcoRvynyfDStNVNCXJJ+fKH46nafaF9a7I6JaltUkSs+L5u+9ym +c5GQYaYDFCDy54ejiK2toIz/pgslUiXnFgHVy7g1gQyjO/Dh4fxaXc6AcW34Sas+ +O7q414AB+6XrW7PFXmAqMaCvN+ggOp+oMiwMzAkd056OXbxMmO7FGmh77FOm6RQ1 +o9/NgJ8MSPsc9PG/Srj61YxxSscfrf5BmrODXfKEVu+lV0POKa2Mq1W/xPtbAd0j +IaFYAI7D0GoT7RPjEiuA3GfmlbLNHiJuKvhB1PLKFAeNilUSxmn1uIZoL1NesNKq +IcGY5jDjZ1XHm26sGahVpkUG0CM62+tlXSoREfA7T8pt9DTEceT/AFr2XK4jYIVz +8eQQsSWu1ZK7E8EM4DnatDlXtas1qnIhO4M15zHfeiFuuDIIfR0ykRVKYnLP43eh +vNURG3YBZwjgQQvD6xVu+KQZ2aKrr+InUlYrAoosFCT5v0ICvybIxo/gbjh9Uy3l +7ZizlWNof/k19N+IxWA1ksB8aRxhlRbQ694Lrz4EEEVlWFA4r0jyWbYW8jwNkALG +cC4BrTwV1wIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB +BjAdBgNVHQ4EFgQU7edvdlq/YOxJW8ald7tyFnGbxD0wDQYJKoZIhvcNAQELBQAD +ggIBAJHfgD9DCX5xwvfrs4iP4VGyvD11+ShdyLyZm3tdquXK4Qr36LLTn91nMX66 +AarHakE7kNQIXLJgapDwyM4DYvmL7ftuKtwGTTwpD4kWilhMSA/ohGHqPHKmd+RC +roijQ1h5fq7KpVMNqT1wvSAZYaRsOPxDMuHBR//47PERIjKWnML2W2mWeyAMQ0Ga +W/ZZGYjeVYg3UQt4XAoeo0L9x52ID8DyeAIkVJOviYeIyUqAHerQbj5hLja7NQ4n +lv1mNDthcnPxFlxHBlRJAHpYErAK74X9sbgzdWqTHBLmYF5vHX/JHyPLhGGfHoJE ++V+tYlUkmlKY7VHnoX6XOuYvHxHaU4AshZ6rNRDbIl9qxV6XU/IyAgkwo1jwDQHV +csaxfGl7w/U2Rcxhbl5MlMVerugOXou/983g7aEOGzPuVBj+D77vfoRrQ+NwmNtd +dbINWQeFFSM51vHfqSYP1kjHs6Yi9TM3WpVHn3u6GBVv/9YUZINJ0gpnIdsPNWNg +KCLjsZWDzYWm3S8P52dSbrsvhXz1SnPnxT7AvSESBT/8twNJAlvIJebiVDj1eYeM +HVOyToV7BjjHLPj4sHKNJeV3UvQDHEimUF+IIDBu8oJDqz2XhOdT+yHBTw8imoa4 +WSr2Rz0ZiC3oheGe7IUIarFsNMkd7EgrO3jtZsSOeWmD3n+M +-----END CERTIFICATE----- + +# Issuer: CN=QuoVadis Root CA 3 G3 O=QuoVadis Limited +# Subject: CN=QuoVadis Root CA 3 G3 O=QuoVadis Limited +# Label: "QuoVadis Root CA 3 G3" +# Serial: 268090761170461462463995952157327242137089239581 +# MD5 Fingerprint: df:7d:b9:ad:54:6f:68:a1:df:89:57:03:97:43:b0:d7 +# SHA1 Fingerprint: 48:12:bd:92:3c:a8:c4:39:06:e7:30:6d:27:96:e6:a4:cf:22:2e:7d +# SHA256 Fingerprint: 88:ef:81:de:20:2e:b0:18:45:2e:43:f8:64:72:5c:ea:5f:bd:1f:c2:d9:d2:05:73:07:09:c5:d8:b8:69:0f:46 +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIULvWbAiin23r/1aOp7r0DoM8Sah0wDQYJKoZIhvcNAQEL +BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc +BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMyBHMzAeFw0xMjAxMTIyMDI2MzJaFw00 +MjAxMTIyMDI2MzJaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDMgRzMwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQCzyw4QZ47qFJenMioKVjZ/aEzHs286IxSR +/xl/pcqs7rN2nXrpixurazHb+gtTTK/FpRp5PIpM/6zfJd5O2YIyC0TeytuMrKNu +FoM7pmRLMon7FhY4futD4tN0SsJiCnMK3UmzV9KwCoWdcTzeo8vAMvMBOSBDGzXR +U7Ox7sWTaYI+FrUoRqHe6okJ7UO4BUaKhvVZR74bbwEhELn9qdIoyhA5CcoTNs+c +ra1AdHkrAj80//ogaX3T7mH1urPnMNA3I4ZyYUUpSFlob3emLoG+B01vr87ERROR +FHAGjx+f+IdpsQ7vw4kZ6+ocYfx6bIrc1gMLnia6Et3UVDmrJqMz6nWB2i3ND0/k +A9HvFZcba5DFApCTZgIhsUfei5pKgLlVj7WiL8DWM2fafsSntARE60f75li59wzw +eyuxwHApw0BiLTtIadwjPEjrewl5qW3aqDCYz4ByA4imW0aucnl8CAMhZa634Ryl +sSqiMd5mBPfAdOhx3v89WcyWJhKLhZVXGqtrdQtEPREoPHtht+KPZ0/l7DxMYIBp +VzgeAVuNVejH38DMdyM0SXV89pgR6y3e7UEuFAUCf+D+IOs15xGsIs5XPd7JMG0Q +A4XN8f+MFrXBsj6IbGB/kE+V9/YtrQE5BwT6dYB9v0lQ7e/JxHwc64B+27bQ3RP+ +ydOc17KXqQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB +BjAdBgNVHQ4EFgQUxhfQvKjqAkPyGwaZXSuQILnXnOQwDQYJKoZIhvcNAQELBQAD +ggIBADRh2Va1EodVTd2jNTFGu6QHcrxfYWLopfsLN7E8trP6KZ1/AvWkyaiTt3px +KGmPc+FSkNrVvjrlt3ZqVoAh313m6Tqe5T72omnHKgqwGEfcIHB9UqM+WXzBusnI +FUBhynLWcKzSt/Ac5IYp8M7vaGPQtSCKFWGafoaYtMnCdvvMujAWzKNhxnQT5Wvv +oxXqA/4Ti2Tk08HS6IT7SdEQTXlm66r99I0xHnAUrdzeZxNMgRVhvLfZkXdxGYFg +u/BYpbWcC/ePIlUnwEsBbTuZDdQdm2NnL9DuDcpmvJRPpq3t/O5jrFc/ZSXPsoaP +0Aj/uHYUbt7lJ+yreLVTubY/6CD50qi+YUbKh4yE8/nxoGibIh6BJpsQBJFxwAYf +3KDTuVan45gtf4Od34wrnDKOMpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmDhPbl +8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+ +DhcI00iX0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HN +PlopNLk9hM6xZdRZkZFWdSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/ +ywaZWWDYWGWVjUTR939+J399roD1B0y2PpxxVJkES/1Y+Zj0 +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert Assured ID Root G2 O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert Assured ID Root G2 O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert Assured ID Root G2" +# Serial: 15385348160840213938643033620894905419 +# MD5 Fingerprint: 92:38:b9:f8:63:24:82:65:2c:57:33:e6:fe:81:8f:9d +# SHA1 Fingerprint: a1:4b:48:d9:43:ee:0a:0e:40:90:4f:3c:e0:a4:c0:91:93:51:5d:3f +# SHA256 Fingerprint: 7d:05:eb:b6:82:33:9f:8c:94:51:ee:09:4e:eb:fe:fa:79:53:a1:14:ed:b2:f4:49:49:45:2f:ab:7d:2f:c1:85 +-----BEGIN CERTIFICATE----- +MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBl +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv +b3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl +cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwggEi +MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSA +n61UQbVH35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4Htecc +biJVMWWXvdMX0h5i89vqbFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9Hp +EgjAALAcKxHad3A2m67OeYfcgnDmCXRwVWmvo2ifv922ebPynXApVfSr/5Vh88lA +bx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OPYLfykqGxvYmJHzDNw6Yu +YjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+RnlTGNAgMB +AAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQW +BBTOw0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPI +QW5pJ6d1Ee88hjZv0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I +0jJmwYrA8y8678Dj1JGG0VDjA9tzd29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4Gni +lmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAWhsI6yLETcDbYz+70CjTVW0z9 +B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0MjomZmWzwPDCv +ON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo +IhNzbM8m9Yop5w== +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert Assured ID Root G3 O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert Assured ID Root G3 O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert Assured ID Root G3" +# Serial: 15459312981008553731928384953135426796 +# MD5 Fingerprint: 7c:7f:65:31:0c:81:df:8d:ba:3e:99:e2:5c:ad:6e:fb +# SHA1 Fingerprint: f5:17:a2:4f:9a:48:c6:c9:f8:a2:00:26:9f:dc:0f:48:2c:ab:30:89 +# SHA256 Fingerprint: 7e:37:cb:8b:4c:47:09:0c:ab:36:55:1b:a6:f4:5d:b8:40:68:0f:ba:16:6a:95:2d:b1:00:71:7f:43:05:3f:c2 +-----BEGIN CERTIFICATE----- +MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQsw +CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cu +ZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3Qg +RzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBlMQswCQYDVQQGEwJV +UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQu +Y29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQBgcq +hkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJf +Zn4f5dwbRXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17Q +RSAPWXYQ1qAk8C3eNvJsKTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ +BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgFUaFNN6KDec6NHSrkhDAKBggqhkjOPQQD +AwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5FyYZ5eEJJZVrmDxxDnOOlY +JjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy1vUhZscv +6pZjamVFkpUBtA== +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert Global Root G2 O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert Global Root G2 O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert Global Root G2" +# Serial: 4293743540046975378534879503202253541 +# MD5 Fingerprint: e4:a6:8a:c8:54:ac:52:42:46:0a:fd:72:48:1b:2a:44 +# SHA1 Fingerprint: df:3c:24:f9:bf:d6:66:76:1b:26:80:73:fe:06:d1:cc:8d:4f:82:a4 +# SHA256 Fingerprint: cb:3c:cb:b7:60:31:e5:e0:13:8f:8d:d3:9a:23:f9:de:47:ff:c3:5e:43:c1:14:4c:ea:27:d4:6a:5a:b1:cb:5f +-----BEGIN CERTIFICATE----- +MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH +MjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVT +MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j +b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI +2/Ou8jqJkTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx +1x7e/dfgy5SDN67sH0NO3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQ +q2EGnI/yuum06ZIya7XzV+hdG82MHauVBJVJ8zUtluNJbd134/tJS7SsVQepj5Wz +tCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyMUNGPHgm+F6HmIcr9g+UQ +vIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQABo0IwQDAP +BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV +5uNu5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY +1Yl9PMWLSn/pvtsrF9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4 +NeF22d+mQrvHRAiGfzZ0JFrabA0UWTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NG +Fdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBHQRFXGU7Aj64GxJUTFy8bJZ91 +8rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/iyK5S9kJRaTe +pLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl +MrY= +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert Global Root G3 O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert Global Root G3 O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert Global Root G3" +# Serial: 7089244469030293291760083333884364146 +# MD5 Fingerprint: f5:5d:a4:50:a5:fb:28:7e:1e:0f:0d:cc:96:57:56:ca +# SHA1 Fingerprint: 7e:04:de:89:6a:3e:66:6d:00:e6:87:d3:3f:fa:d9:3b:e8:3d:34:9e +# SHA256 Fingerprint: 31:ad:66:48:f8:10:41:38:c7:38:f3:9e:a4:32:01:33:39:3e:3a:18:cc:02:29:6e:f9:7c:2a:c9:ef:67:31:d0 +-----BEGIN CERTIFICATE----- +MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQsw +CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cu +ZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAe +Fw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVTMRUw +EwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20x +IDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEczMHYwEAYHKoZIzj0CAQYF +K4EEACIDYgAE3afZu4q4C/sLfyHS8L6+c/MzXRq8NOrexpu80JX28MzQC7phW1FG +fp4tn+6OYwwX7Adw9c+ELkCDnOg/QW07rdOkFFk2eJ0DQ+4QE2xy3q6Ip6FrtUPO +Z9wj/wMco+I+o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAd +BgNVHQ4EFgQUs9tIpPmhxdiuNkHMEWNpYim8S8YwCgYIKoZIzj0EAwMDaAAwZQIx +AK288mw/EkrRLTnDCgmXc/SINoyIJ7vmiI1Qhadj+Z4y3maTD/HMsQmP3Wyr+mt/ +oAIwOWZbwmSNuJ5Q3KjVSaLtx9zRSX8XAbjIho9OjIgrqJqpisXRAL34VOKa5Vt8 +sycX +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert Trusted Root G4 O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert Trusted Root G4 O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert Trusted Root G4" +# Serial: 7451500558977370777930084869016614236 +# MD5 Fingerprint: 78:f2:fc:aa:60:1f:2f:b4:eb:c9:37:ba:53:2e:75:49 +# SHA1 Fingerprint: dd:fb:16:cd:49:31:c9:73:a2:03:7d:3f:c8:3a:4d:7d:77:5d:05:e4 +# SHA256 Fingerprint: 55:2f:7b:dc:f1:a7:af:9e:6c:e6:72:01:7f:4f:12:ab:f7:72:40:c7:8e:76:1a:c2:03:d1:d9:d2:0a:c8:99:88 +-----BEGIN CERTIFICATE----- +MIIFkDCCA3igAwIBAgIQBZsbV56OITLiOQe9p3d1XDANBgkqhkiG9w0BAQwFADBi +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3Qg +RzQwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBiMQswCQYDVQQGEwJV +UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQu +Y29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQC/5pBzaN675F1KPDAiMGkz7MKnJS7JIT3y +ithZwuEppz1Yq3aaza57G4QNxDAf8xukOBbrVsaXbR2rsnnyyhHS5F/WBTxSD1If +xp4VpX6+n6lXFllVcq9ok3DCsrp1mWpzMpTREEQQLt+C8weE5nQ7bXHiLQwb7iDV +ySAdYyktzuxeTsiT+CFhmzTrBcZe7FsavOvJz82sNEBfsXpm7nfISKhmV1efVFiO +DCu3T6cw2Vbuyntd463JT17lNecxy9qTXtyOj4DatpGYQJB5w3jHtrHEtWoYOAMQ +jdjUN6QuBX2I9YI+EJFwq1WCQTLX2wRzKm6RAXwhTNS8rhsDdV14Ztk6MUSaM0C/ +CNdaSaTC5qmgZ92kJ7yhTzm1EVgX9yRcRo9k98FpiHaYdj1ZXUJ2h4mXaXpI8OCi +EhtmmnTK3kse5w5jrubU75KSOp493ADkRSWJtppEGSt+wJS00mFt6zPZxd9LBADM +fRyVw4/3IbKyEbe7f/LVjHAsQWCqsWMYRJUadmJ+9oCw++hkpjPRiQfhvbfmQ6QY +uKZ3AeEPlAwhHbJUKSWJbOUOUlFHdL4mrLZBdd56rF+NP8m800ERElvlEFDrMcXK +chYiCd98THU/Y+whX8QgUWtvsauGi0/C1kVfnSD8oR7FwI+isX4KJpn15GkvmB0t +9dmpsh3lGwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB +hjAdBgNVHQ4EFgQU7NfjgtJxXWRM3y5nP+e6mK4cD08wDQYJKoZIhvcNAQEMBQAD +ggIBALth2X2pbL4XxJEbw6GiAI3jZGgPVs93rnD5/ZpKmbnJeFwMDF/k5hQpVgs2 +SV1EY+CtnJYYZhsjDT156W1r1lT40jzBQ0CuHVD1UvyQO7uYmWlrx8GnqGikJ9yd ++SeuMIW59mdNOj6PWTkiU0TryF0Dyu1Qen1iIQqAyHNm0aAFYF/opbSnr6j3bTWc +fFqK1qI4mfN4i/RN0iAL3gTujJtHgXINwBQy7zBZLq7gcfJW5GqXb5JQbZaNaHqa +sjYUegbyJLkJEVDXCLG4iXqEI2FCKeWjzaIgQdfRnGTZ6iahixTXTBmyUEFxPT9N +cCOGDErcgdLMMpSEDQgJlxxPwO5rIHQw0uA5NBCFIRUBCOhVMt5xSdkoF1BN5r5N +0XWs0Mr7QbhDparTwwVETyw2m+L64kW4I1NsBm9nVX9GtUw/bihaeSbSpKhil9Ie +4u1Ki7wb/UdKDd9nZn6yW0HQO+T0O/QEY+nvwlQAUaCKKsnOeMzV6ocEGLPOr0mI +r/OSmbaz5mEP0oUA51Aa5BuVnRmhuZyxm7EAHu/QD09CbMkKvO5D+jpxpchNJqU1 +/YldvIViHTLSoCtU7ZpXwdv6EM8Zt4tKG48BtieVU+i2iW1bvGjUI+iLUaJW+fCm +gKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP82Z+ +-----END CERTIFICATE----- + +# Issuer: CN=COMODO RSA Certification Authority O=COMODO CA Limited +# Subject: CN=COMODO RSA Certification Authority O=COMODO CA Limited +# Label: "COMODO RSA Certification Authority" +# Serial: 101909084537582093308941363524873193117 +# MD5 Fingerprint: 1b:31:b0:71:40:36:cc:14:36:91:ad:c4:3e:fd:ec:18 +# SHA1 Fingerprint: af:e5:d2:44:a8:d1:19:42:30:ff:47:9f:e2:f8:97:bb:cd:7a:8c:b4 +# SHA256 Fingerprint: 52:f0:e1:c4:e5:8e:c6:29:29:1b:60:31:7f:07:46:71:b8:5d:7e:a8:0d:5b:07:27:34:63:53:4b:32:b4:02:34 +-----BEGIN CERTIFICATE----- +MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCB +hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G +A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV +BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMTE5 +MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgT +EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR +Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR +6FSS0gpWsawNJN3Fz0RndJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8X +pz3jsARh7v8Rl8f0hj4K+j5c+ZPmNHrZFGvnnLOFoIJ6dq9xkNfs/Q36nGz637CC +9BR++b7Epi9Pf5l/tfxnQ3K9DADWietrLNPtj5gcFKt+5eNu/Nio5JIk2kNrYrhV +/erBvGy2i/MOjZrkm2xpmfh4SDBF1a3hDTxFYPwyllEnvGfDyi62a+pGx8cgoLEf +Zd5ICLqkTqnyg0Y3hOvozIFIQ2dOciqbXL1MGyiKXCJ7tKuY2e7gUYPDCUZObT6Z ++pUX2nwzV0E8jVHtC7ZcryxjGt9XyD+86V3Em69FmeKjWiS0uqlWPc9vqv9JWL7w +qP/0uK3pN/u6uPQLOvnoQ0IeidiEyxPx2bvhiWC4jChWrBQdnArncevPDt09qZah +SL0896+1DSJMwBGB7FY79tOi4lu3sgQiUpWAk2nojkxl8ZEDLXB0AuqLZxUpaVIC +u9ffUGpVRr+goyhhf3DQw6KqLCGqR84onAZFdr+CGCe01a60y1Dma/RMhnEw6abf +Fobg2P9A3fvQQoh/ozM6LlweQRGBY84YcWsr7KaKtzFcOmpH4MN5WdYgGq/yapiq +crxXStJLnbsQ/LBMQeXtHT1eKJ2czL+zUdqnR+WEUwIDAQABo0IwQDAdBgNVHQ4E +FgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB +/wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvl +wFTPoCWOAvn9sKIN9SCYPBMtrFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM +4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+nq6PK7o9mfjYcwlYRm6mnPTXJ9OV +2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSgtZx8jb8uk2Intzna +FxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwWsRqZ +CuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiK +boHGhfKppC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmcke +jkk9u+UJueBPSZI9FoJAzMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yL +S0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHqZJx64SIDqZxubw5lT2yHh17zbqD5daWb +QOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk527RH89elWsn2/x20Kk4yl +0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7ILaZRfyHB +NVOFBkpdn627G190 +-----END CERTIFICATE----- + +# Issuer: CN=USERTrust RSA Certification Authority O=The USERTRUST Network +# Subject: CN=USERTrust RSA Certification Authority O=The USERTRUST Network +# Label: "USERTrust RSA Certification Authority" +# Serial: 2645093764781058787591871645665788717 +# MD5 Fingerprint: 1b:fe:69:d1:91:b7:19:33:a3:72:a8:0f:e1:55:e5:b5 +# SHA1 Fingerprint: 2b:8f:1b:57:33:0d:bb:a2:d0:7a:6c:51:f7:0e:e9:0d:da:b9:ad:8e +# SHA256 Fingerprint: e7:93:c9:b0:2f:d8:aa:13:e2:1c:31:22:8a:cc:b0:81:19:64:3b:74:9c:89:89:64:b1:74:6d:46:c3:d4:cb:d2 +-----BEGIN CERTIFICATE----- +MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCB +iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl +cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV +BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAw +MjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNV +BAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU +aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2Vy +dGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK +AoICAQCAEmUXNg7D2wiz0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B +3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2jY0K2dvKpOyuR+OJv0OwWIJAJPuLodMkY +tJHUYmTbf6MG8YgYapAiPLz+E/CHFHv25B+O1ORRxhFnRghRy4YUVD+8M/5+bJz/ +Fp0YvVGONaanZshyZ9shZrHUm3gDwFA66Mzw3LyeTP6vBZY1H1dat//O+T23LLb2 +VN3I5xI6Ta5MirdcmrS3ID3KfyI0rn47aGYBROcBTkZTmzNg95S+UzeQc0PzMsNT +79uq/nROacdrjGCT3sTHDN/hMq7MkztReJVni+49Vv4M0GkPGw/zJSZrM233bkf6 +c0Plfg6lZrEpfDKEY1WJxA3Bk1QwGROs0303p+tdOmw1XNtB1xLaqUkL39iAigmT +Yo61Zs8liM2EuLE/pDkP2QKe6xJMlXzzawWpXhaDzLhn4ugTncxbgtNMs+1b/97l +c6wjOy0AvzVVdAlJ2ElYGn+SNuZRkg7zJn0cTRe8yexDJtC/QV9AqURE9JnnV4ee +UB9XVKg+/XRjL7FQZQnmWEIuQxpMtPAlR1n6BB6T1CZGSlCBst6+eLf8ZxXhyVeE +Hg9j1uliutZfVS7qXMYoCAQlObgOK6nyTJccBz8NUvXt7y+CDwIDAQABo0IwQDAd +BgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/BAQDAgEGMA8G +A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAFzUfA3P9wF9QZllDHPF +Up/L+M+ZBn8b2kMVn54CVVeWFPFSPCeHlCjtHzoBN6J2/FNQwISbxmtOuowhT6KO +VWKR82kV2LyI48SqC/3vqOlLVSoGIG1VeCkZ7l8wXEskEVX/JJpuXior7gtNn3/3 +ATiUFJVDBwn7YKnuHKsSjKCaXqeYalltiz8I+8jRRa8YFWSQEg9zKC7F4iRO/Fjs +8PRF/iKz6y+O0tlFYQXBl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM8WcR +iQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYze +Sf7dNXGiFSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZ +XHlKYC6SQK5MNyosycdiyA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/ +qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9cJ2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRB +VXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGwsAvgnEzDHNb842m1R0aB +L6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gxQ+6IHdfG +jjxDah2nGN59PRbxYvnKkKj9 +-----END CERTIFICATE----- + +# Issuer: CN=USERTrust ECC Certification Authority O=The USERTRUST Network +# Subject: CN=USERTrust ECC Certification Authority O=The USERTRUST Network +# Label: "USERTrust ECC Certification Authority" +# Serial: 123013823720199481456569720443997572134 +# MD5 Fingerprint: fa:68:bc:d9:b5:7f:ad:fd:c9:1d:06:83:28:cc:24:c1 +# SHA1 Fingerprint: d1:cb:ca:5d:b2:d5:2a:7f:69:3b:67:4d:e5:f0:5a:1d:0c:95:7d:f0 +# SHA256 Fingerprint: 4f:f4:60:d5:4b:9c:86:da:bf:bc:fc:57:12:e0:40:0d:2b:ed:3f:bc:4d:4f:bd:aa:86:e0:6a:dc:d2:a9:ad:7a +-----BEGIN CERTIFICATE----- +MIICjzCCAhWgAwIBAgIQXIuZxVqUxdJxVt7NiYDMJjAKBggqhkjOPQQDAzCBiDEL +MAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNl +eSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMT +JVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMjAx +MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgT +Ck5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVUaGUg +VVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlm +aWNhdGlvbiBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQarFRaqflo +I+d61SRvU8Za2EurxtW20eZzca7dnNYMYf3boIkDuAUU7FfO7l0/4iGzzvfUinng +o4N+LZfQYcTxmdwlkWOrfzCjtHDix6EznPO/LlxTsV+zfTJ/ijTjeXmjQjBAMB0G +A1UdDgQWBBQ64QmG1M8ZwpZ2dEl23OA1xmNjmjAOBgNVHQ8BAf8EBAMCAQYwDwYD +VR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjA2Z6EWCNzklwBBHU6+4WMB +zzuqQhFkoJ2UOQIReVx7Hfpkue4WQrO/isIJxOzksU0CMQDpKmFHjFJKS04YcPbW +RNZu9YO6bVi9JNlWSOrvxKJGgYhqOkbRqZtNyWHa0V1Xahg= +-----END CERTIFICATE----- + +# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign ECC Root CA - R4 +# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign ECC Root CA - R4 +# Label: "GlobalSign ECC Root CA - R4" +# Serial: 14367148294922964480859022125800977897474 +# MD5 Fingerprint: 20:f0:27:68:d1:7e:a0:9d:0e:e6:2a:ca:df:5c:89:8e +# SHA1 Fingerprint: 69:69:56:2e:40:80:f4:24:a1:e7:19:9f:14:ba:f3:ee:58:ab:6a:bb +# SHA256 Fingerprint: be:c9:49:11:c2:95:56:76:db:6c:0a:55:09:86:d7:6e:3b:a0:05:66:7c:44:2c:97:62:b4:fb:b7:73:de:22:8c +-----BEGIN CERTIFICATE----- +MIIB4TCCAYegAwIBAgIRKjikHJYKBN5CsiilC+g0mAIwCgYIKoZIzj0EAwIwUDEk +MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpH +bG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoX +DTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBD +QSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWdu +MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuMZ5049sJQ6fLjkZHAOkrprlOQcJ +FspjsbmG+IpXwVfOQvpzofdlQv8ewQCybnMO/8ch5RikqtlxP6jUuc6MHaNCMEAw +DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFFSwe61F +uOJAf/sKbvu+M8k8o4TVMAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGX +kPoUVy0D7O48027KqGx2vKLeuwIgJ6iFJzWbVsaj8kfSt24bAgAXqmemFZHe+pTs +ewv4n4Q= +-----END CERTIFICATE----- + +# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign ECC Root CA - R5 +# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign ECC Root CA - R5 +# Label: "GlobalSign ECC Root CA - R5" +# Serial: 32785792099990507226680698011560947931244 +# MD5 Fingerprint: 9f:ad:3b:1c:02:1e:8a:ba:17:74:38:81:0c:a2:bc:08 +# SHA1 Fingerprint: 1f:24:c6:30:cd:a4:18:ef:20:69:ff:ad:4f:dd:5f:46:3a:1b:69:aa +# SHA256 Fingerprint: 17:9f:bc:14:8a:3d:d0:0f:d2:4e:a1:34:58:cc:43:bf:a7:f5:9c:81:82:d7:83:a5:13:f6:eb:ec:10:0c:89:24 +-----BEGIN CERTIFICATE----- +MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEk +MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpH +bG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoX +DTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBD +QSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWdu +MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6SFkc +8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8ke +hOvRnkmSh5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYD +VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYI +KoZIzj0EAwMDaAAwZQIxAOVpEslu28YxuglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg +515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7yFz9SO8NdCKoCOJuxUnO +xwy8p2Fp8fc74SrL+SvzZpA3 +-----END CERTIFICATE----- + +# Issuer: CN=Staat der Nederlanden Root CA - G3 O=Staat der Nederlanden +# Subject: CN=Staat der Nederlanden Root CA - G3 O=Staat der Nederlanden +# Label: "Staat der Nederlanden Root CA - G3" +# Serial: 10003001 +# MD5 Fingerprint: 0b:46:67:07:db:10:2f:19:8c:35:50:60:d1:0b:f4:37 +# SHA1 Fingerprint: d8:eb:6b:41:51:92:59:e0:f3:e7:85:00:c0:3d:b6:88:97:c9:ee:fc +# SHA256 Fingerprint: 3c:4f:b0:b9:5a:b8:b3:00:32:f4:32:b8:6f:53:5f:e1:72:c1:85:d0:fd:39:86:58:37:cf:36:18:7f:a6:f4:28 +-----BEGIN CERTIFICATE----- +MIIFdDCCA1ygAwIBAgIEAJiiOTANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJO +TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFh +dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQSAtIEczMB4XDTEzMTExNDExMjg0MloX +DTI4MTExMzIzMDAwMFowWjELMAkGA1UEBhMCTkwxHjAcBgNVBAoMFVN0YWF0IGRl +ciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5lZGVybGFuZGVuIFJv +b3QgQ0EgLSBHMzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAL4yolQP +cPssXFnrbMSkUeiFKrPMSjTysF/zDsccPVMeiAho2G89rcKezIJnByeHaHE6n3WW +IkYFsO2tx1ueKt6c/DrGlaf1F2cY5y9JCAxcz+bMNO14+1Cx3Gsy8KL+tjzk7FqX +xz8ecAgwoNzFs21v0IJyEavSgWhZghe3eJJg+szeP4TrjTgzkApyI/o1zCZxMdFy +KJLZWyNtZrVtB0LrpjPOktvA9mxjeM3KTj215VKb8b475lRgsGYeCasH/lSJEULR +9yS6YHgamPfJEf0WwTUaVHXvQ9Plrk7O53vDxk5hUUurmkVLoR9BvUhTFXFkC4az +5S6+zqQbwSmEorXLCCN2QyIkHxcE1G6cxvx/K2Ya7Irl1s9N9WMJtxU51nus6+N8 +6U78dULI7ViVDAZCopz35HCz33JvWjdAidiFpNfxC95DGdRKWCyMijmev4SH8RY7 +Ngzp07TKbBlBUgmhHbBqv4LvcFEhMtwFdozL92TkA1CvjJFnq8Xy7ljY3r735zHP +bMk7ccHViLVlvMDoFxcHErVc0qsgk7TmgoNwNsXNo42ti+yjwUOH5kPiNL6VizXt +BznaqB16nzaeErAMZRKQFWDZJkBE41ZgpRDUajz9QdwOWke275dhdU/Z/seyHdTt +XUmzqWrLZoQT1Vyg3N9udwbRcXXIV2+vD3dbAgMBAAGjQjBAMA8GA1UdEwEB/wQF +MAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRUrfrHkleuyjWcLhL75Lpd +INyUVzANBgkqhkiG9w0BAQsFAAOCAgEAMJmdBTLIXg47mAE6iqTnB/d6+Oea31BD +U5cqPco8R5gu4RV78ZLzYdqQJRZlwJ9UXQ4DO1t3ApyEtg2YXzTdO2PCwyiBwpwp +LiniyMMB8jPqKqrMCQj3ZWfGzd/TtiunvczRDnBfuCPRy5FOCvTIeuXZYzbB1N/8 +Ipf3YF3qKS9Ysr1YvY2WTxB1v0h7PVGHoTx0IsL8B3+A3MSs/mrBcDCw6Y5p4ixp +gZQJut3+TcCDjJRYwEYgr5wfAvg1VUkvRtTA8KCWAg8zxXHzniN9lLf9OtMJgwYh +/WA9rjLA0u6NpvDntIJ8CsxwyXmA+P5M9zWEGYox+wrZ13+b8KKaa8MFSu1BYBQw +0aoRQm7TIwIEC8Zl3d1Sd9qBa7Ko+gE4uZbqKmxnl4mUnrzhVNXkanjvSr0rmj1A +fsbAddJu+2gw7OyLnflJNZoaLNmzlTnVHpL3prllL+U9bTpITAjc5CgSKL59NVzq +4BZ+Extq1z7XnvwtdbLBFNUjA9tbbws+eC8N3jONFrdI54OagQ97wUNNVQQXOEpR +1VmiiXTTn74eS9fGbbeIJG9gkaSChVtWQbzQRKtqE77RLFi3EjNYsjdj3BP1lB0/ +QFH1T/U67cjF68IeHRaVesd+QnGTbksVtzDfqu1XhUisHWrdOWnk4Xl4vs4Fv6EM +94B7IWcnMFk= +-----END CERTIFICATE----- + +# Issuer: CN=Staat der Nederlanden EV Root CA O=Staat der Nederlanden +# Subject: CN=Staat der Nederlanden EV Root CA O=Staat der Nederlanden +# Label: "Staat der Nederlanden EV Root CA" +# Serial: 10000013 +# MD5 Fingerprint: fc:06:af:7b:e8:1a:f1:9a:b4:e8:d2:70:1f:c0:f5:ba +# SHA1 Fingerprint: 76:e2:7e:c1:4f:db:82:c1:c0:a6:75:b5:05:be:3d:29:b4:ed:db:bb +# SHA256 Fingerprint: 4d:24:91:41:4c:fe:95:67:46:ec:4c:ef:a6:cf:6f:72:e2:8a:13:29:43:2f:9d:8a:90:7a:c4:cb:5d:ad:c1:5a +-----BEGIN CERTIFICATE----- +MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJO +TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFh +dCBkZXIgTmVkZXJsYW5kZW4gRVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0y +MjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5MMR4wHAYDVQQKDBVTdGFhdCBkZXIg +TmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRlcmxhbmRlbiBFViBS +b290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkkSzrS +M4M1LGns3Amk41GoJSt5uAg94JG6hIXGhaTK5skuU6TJJB79VWZxXSzFYGgEt9nC +UiY4iKTWO0Cmws0/zZiTs1QUWJZV1VD+hq2kY39ch/aO5ieSZxeSAgMs3NZmdO3d +Z//BYY1jTw+bbRcwJu+r0h8QoPnFfxZpgQNH7R5ojXKhTbImxrpsX23Wr9GxE46p +rfNeaXUmGD5BKyF/7otdBwadQ8QpCiv8Kj6GyzyDOvnJDdrFmeK8eEEzduG/L13l +pJhQDBXd4Pqcfzho0LKmeqfRMb1+ilgnQ7O6M5HTp5gVXJrm0w912fxBmJc+qiXb +j5IusHsMX/FjqTf5m3VpTCgmJdrV8hJwRVXj33NeN/UhbJCONVrJ0yPr08C+eKxC +KFhmpUZtcALXEPlLVPxdhkqHz3/KRawRWrUgUY0viEeXOcDPusBCAUCZSCELa6fS +/ZbV0b5GnUngC6agIk440ME8MLxwjyx1zNDFjFE7PZQIZCZhfbnDZY8UnCHQqv0X +cgOPvZuM5l5Tnrmd74K74bzickFbIZTTRTeU0d8JOV3nI6qaHcptqAqGhYqCvkIH +1vI4gnPah1vlPNOePqc7nvQDs/nxfRN0Av+7oeX6AHkcpmZBiFxgV6YuCcS6/ZrP +px9Aw7vMWgpVSzs4dlG4Y4uElBbmVvMCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB +/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFP6rAJCYniT8qcwaivsnuL8wbqg7 +MA0GCSqGSIb3DQEBCwUAA4ICAQDPdyxuVr5Os7aEAJSrR8kN0nbHhp8dB9O2tLsI +eK9p0gtJ3jPFrK3CiAJ9Brc1AsFgyb/E6JTe1NOpEyVa/m6irn0F3H3zbPB+po3u +2dfOWBfoqSmuc0iH55vKbimhZF8ZE/euBhD/UcabTVUlT5OZEAFTdfETzsemQUHS +v4ilf0X8rLiltTMMgsT7B/Zq5SWEXwbKwYY5EdtYzXc7LMJMD16a4/CrPmEbUCTC +wPTxGfARKbalGAKb12NMcIxHowNDXLldRqANb/9Zjr7dn3LDWyvfjFvO5QxGbJKy +CqNMVEIYFRIYvdr8unRu/8G2oGTYqV9Vrp9canaW2HNnh/tNf1zuacpzEPuKqf2e +vTY4SUmH9A4U8OmHuD+nT3pajnnUk+S7aFKErGzp85hwVXIy+TSrK0m1zSBi5Dp6 +Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCjuTaPPoIa +Gl6I6lD4WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeL +eG9QgkRQP2YGiqtDhFZKDyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8 +FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGyeUN51q1veieQA6TqJIc/2b3Z6fJfUEkc +7uzXLg== +-----END CERTIFICATE----- + +# Issuer: CN=IdenTrust Commercial Root CA 1 O=IdenTrust +# Subject: CN=IdenTrust Commercial Root CA 1 O=IdenTrust +# Label: "IdenTrust Commercial Root CA 1" +# Serial: 13298821034946342390520003877796839426 +# MD5 Fingerprint: b3:3e:77:73:75:ee:a0:d3:e3:7e:49:63:49:59:bb:c7 +# SHA1 Fingerprint: df:71:7e:aa:4a:d9:4e:c9:55:84:99:60:2d:48:de:5f:bc:f0:3a:25 +# SHA256 Fingerprint: 5d:56:49:9b:e4:d2:e0:8b:cf:ca:d0:8a:3e:38:72:3d:50:50:3b:de:70:69:48:e4:2f:55:60:30:19:e5:28:ae +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBK +MQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVu +VHJ1c3QgQ29tbWVyY2lhbCBSb290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQw +MTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MScw +JQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBSb290IENBIDEwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQCnUBneP5k91DNG8W9RYYKyqU+PZ4ldhNlT +3Qwo2dfw/66VQ3KZ+bVdfIrBQuExUHTRgQ18zZshq0PirK1ehm7zCYofWjK9ouuU ++ehcCuz/mNKvcbO0U59Oh++SvL3sTzIwiEsXXlfEU8L2ApeN2WIrvyQfYo3fw7gp +S0l4PJNgiCL8mdo2yMKi1CxUAGc1bnO/AljwpN3lsKImesrgNqUZFvX9t++uP0D1 +bVoE/c40yiTcdCMbXTMTEl3EASX2MN0CXZ/g1Ue9tOsbobtJSdifWwLziuQkkORi +T0/Br4sOdBeo0XKIanoBScy0RnnGF7HamB4HWfp1IYVl3ZBWzvurpWCdxJ35UrCL +vYf5jysjCiN2O/cz4ckA82n5S6LgTrx+kzmEB/dEcH7+B1rlsazRGMzyNeVJSQjK +Vsk9+w8YfYs7wRPCTY/JTw436R+hDmrfYi7LNQZReSzIJTj0+kuniVyc0uMNOYZK +dHzVWYfCP04MXFL0PfdSgvHqo6z9STQaKPNBiDoT7uje/5kdX7rL6B7yuVBgwDHT +c+XvvqDtMwt0viAgxGds8AgDelWAf0ZOlqf0Hj7h9tgJ4TNkK2PXMl6f+cB7D3hv +l7yTmvmcEpB4eoCHFddydJxVdHixuuFucAS6T6C6aMN7/zHwcz09lCqxC0EOoP5N +iGVreTO01wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB +/zAdBgNVHQ4EFgQU7UQZwNPwBovupHu+QucmVMiONnYwDQYJKoZIhvcNAQELBQAD +ggIBAA2ukDL2pkt8RHYZYR4nKM1eVO8lvOMIkPkp165oCOGUAFjvLi5+U1KMtlwH +6oi6mYtQlNeCgN9hCQCTrQ0U5s7B8jeUeLBfnLOic7iPBZM4zY0+sLj7wM+x8uwt +LRvM7Kqas6pgghstO8OEPVeKlh6cdbjTMM1gCIOQ045U8U1mwF10A0Cj7oV+wh93 +nAbowacYXVKV7cndJZ5t+qntozo00Fl72u1Q8zW/7esUTTHHYPTa8Yec4kjixsU3 ++wYQ+nVZZjFHKdp2mhzpgq7vmrlR94gjmmmVYjzlVYA211QC//G5Xc7UI2/YRYRK +W2XviQzdFKcgyxilJbQN+QHwotL0AMh0jqEqSI5l2xPE4iUXfeu+h1sXIFRRk0pT +AwvsXcoz7WL9RccvW9xYoIA55vrX/hMUpu09lEpCdNTDd1lzzY9GvlU47/rokTLq +l1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2gXjtw+hG +4iZZRHUe2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZ +mUlO+KWA2yUPHGNiiskzZ2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A +7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7RcGzM7vRX+Bi6hG6H +-----END CERTIFICATE----- + +# Issuer: CN=IdenTrust Public Sector Root CA 1 O=IdenTrust +# Subject: CN=IdenTrust Public Sector Root CA 1 O=IdenTrust +# Label: "IdenTrust Public Sector Root CA 1" +# Serial: 13298821034946342390521976156843933698 +# MD5 Fingerprint: 37:06:a5:b0:fc:89:9d:ba:f4:6b:8c:1a:64:cd:d5:ba +# SHA1 Fingerprint: ba:29:41:60:77:98:3f:f4:f3:ef:f2:31:05:3b:2e:ea:6d:4d:45:fd +# SHA256 Fingerprint: 30:d0:89:5a:9a:44:8a:26:20:91:63:55:22:d1:f5:20:10:b5:86:7a:ca:e1:2c:78:ef:95:8f:d4:f4:38:9f:2f +-----BEGIN CERTIFICATE----- +MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBN +MQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVu +VHJ1c3QgUHVibGljIFNlY3RvciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcN +MzQwMTE2MTc1MzMyWjBNMQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0 +MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3RvciBSb290IENBIDEwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2IpT8pEiv6EdrCvsnduTyP4o7 +ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG2LqEfpYnYeEe4IFNGy +RBb06tD6Hi9e28tzQa68ALBKK0CyrOE7S8ItneShm+waOh7wCLPQ5CQ1B5+ctMlS +bdsHyo+1W/CD80/HLaXIrcuVIKQxKFdYWuSNG5qrng0M8gozOSI5Cpcu81N3uURF +/YTLNiCBWS2ab21ISGHKTN9T0a9SvESfqy9rg3LvdYDaBjMbXcjaY8ZNzaxmMc3R +3j6HEDbhuaR672BQssvKplbgN6+rNBM5Jeg5ZuSYeqoSmJxZZoY+rfGwyj4GD3vw +EUs3oERte8uojHH01bWRNszwFcYr3lEXsZdMUD2xlVl8BX0tIdUAvwFnol57plzy +9yLxkA2T26pEUWbMfXYD62qoKjgZl3YNa4ph+bz27nb9cCvdKTz4Ch5bQhyLVi9V +GxyhLrXHFub4qjySjmm2AcG1hp2JDws4lFTo6tyePSW8Uybt1as5qsVATFSrsrTZ +2fjXctscvG29ZV/viDUqZi/u9rNl8DONfJhBaUYPQxxp+pu10GFqzcpL2UyQRqsV +WaFHVCkugyhfHMKiq3IXAAaOReyL4jM9f9oZRORicsPfIsbyVtTdX5Vy7W1f90gD +W/3FKqD2cyOEEBsB5wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQU43HgntinQtnbcZFrlJPrw6PRFKMwDQYJKoZIhvcN +AQELBQADggIBAEf63QqwEZE4rU1d9+UOl1QZgkiHVIyqZJnYWv6IAcVYpZmxI1Qj +t2odIFflAWJBF9MJ23XLblSQdf4an4EKwt3X9wnQW3IV5B4Jaj0z8yGa5hV+rVHV +DRDtfULAj+7AmgjVQdZcDiFpboBhDhXAuM/FSRJSzL46zNQuOAXeNf0fb7iAaJg9 +TaDKQGXSc3z1i9kKlT/YPyNtGtEqJBnZhbMX73huqVjRI9PHE+1yJX9dsXNw0H8G +lwmEKYBhHfpe/3OsoOOJuBxxFcbeMX8S3OFtm6/n6J91eEyrRjuazr8FGF1NFTwW +mhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHWchezxQMxNRF4eKLg6TCMf4Df +WN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF5PgLZxYWxoK4Mhn5 ++bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57IcXR5f1GJ +tshquDDIajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhA +GaQdp/lLQzfcaFpPz+vCZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv +8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ3Wl9af0AVqW3rLatt8o+Ae+c +-----END CERTIFICATE----- + +# Issuer: CN=Entrust Root Certification Authority - G2 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2009 Entrust, Inc. - for authorized use only +# Subject: CN=Entrust Root Certification Authority - G2 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2009 Entrust, Inc. - for authorized use only +# Label: "Entrust Root Certification Authority - G2" +# Serial: 1246989352 +# MD5 Fingerprint: 4b:e2:c9:91:96:65:0c:f4:0e:5a:93:92:a0:0a:fe:b2 +# SHA1 Fingerprint: 8c:f4:27:fd:79:0c:3a:d1:66:06:8d:e8:1e:57:ef:bb:93:22:72:d4 +# SHA256 Fingerprint: 43:df:57:74:b0:3e:7f:ef:5f:e4:0d:93:1a:7b:ed:f1:bb:2e:6b:42:73:8c:4e:6d:38:41:10:3d:3a:a7:f3:39 +-----BEGIN CERTIFICATE----- +MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMC +VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50 +cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3Qs +IEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVz +dCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwHhcNMDkwNzA3MTcy +NTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVu +dHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwt +dGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0 +aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5IC0gRzIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQC6hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP/vaCeb9zYQYKpSfYs1/T +RU4cctZOMvJyig/3gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXzHHfV1IWN +cCG0szLni6LVhjkCsbjSR87kyUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hW +wcKUs/Ja5CeanyTXxuzQmyWC48zCxEXFjJd6BmsqEZ+pCm5IO2/b1BEZQvePB7/1 +U1+cPvQXLOZprE4yTGJ36rfo5bs0vBmLrpxR57d+tVOxMyLlbc9wPBr64ptntoP0 +jaWvYkxN4FisZDQSA/i2jZRjJKRxAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ60B7vfec7aVHUbI2fkBJmqzAN +BgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5ZiXMRrEPR9RP/ +jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ +Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v +1fN2D807iDginWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4R +nAuknZoh8/CbCzB428Hch0P+vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmH +VHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xOe4pIb4tF9g== +-----END CERTIFICATE----- + +# Issuer: CN=Entrust Root Certification Authority - EC1 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2012 Entrust, Inc. - for authorized use only +# Subject: CN=Entrust Root Certification Authority - EC1 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2012 Entrust, Inc. - for authorized use only +# Label: "Entrust Root Certification Authority - EC1" +# Serial: 51543124481930649114116133369 +# MD5 Fingerprint: b6:7e:1d:f0:58:c5:49:6c:24:3b:3d:ed:98:18:ed:bc +# SHA1 Fingerprint: 20:d8:06:40:df:9b:25:f5:12:25:3a:11:ea:f7:59:8a:eb:14:b5:47 +# SHA256 Fingerprint: 02:ed:0e:b2:8c:14:da:45:16:5c:56:67:91:70:0d:64:51:d7:fb:56:f0:b2:ab:1d:3b:8e:b0:70:e5:6e:df:f5 +-----BEGIN CERTIFICATE----- +MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkG +A1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3 +d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVu +dHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEzMDEGA1UEAxMq +RW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRUMxMB4XDTEy +MTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8xCzAJBgNVBAYTAlVTMRYwFAYD +VQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0 +L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxMiBFbnRydXN0LCBJbmMuIC0g +Zm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMzAxBgNVBAMTKkVudHJ1c3QgUm9vdCBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEVDMTB2MBAGByqGSM49AgEGBSuBBAAi +A2IABIQTydC6bUF74mzQ61VfZgIaJPRbiWlH47jCffHyAsWfoPZb1YsGGYZPUxBt +ByQnoaD41UcZYUx9ypMn6nQM72+WCf5j7HBdNq1nd67JnXxVRDqiY1Ef9eNi1KlH +Bz7MIKNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O +BBYEFLdj5xrdjekIplWDpOBqUEFlEUJJMAoGCCqGSM49BAMDA2cAMGQCMGF52OVC +R98crlOZF7ZvHH3hvxGU0QOIdeSNiaSKd0bebWHvAvX7td/M/k7//qnmpwIwW5nX +hTcGtXsI/esni0qU+eH6p44mCOh8kmhtc9hvJqwhAriZtyZBWyVgrtBIGu4G +-----END CERTIFICATE----- + +# Issuer: CN=CFCA EV ROOT O=China Financial Certification Authority +# Subject: CN=CFCA EV ROOT O=China Financial Certification Authority +# Label: "CFCA EV ROOT" +# Serial: 407555286 +# MD5 Fingerprint: 74:e1:b6:ed:26:7a:7a:44:30:33:94:ab:7b:27:81:30 +# SHA1 Fingerprint: e2:b8:29:4b:55:84:ab:6b:58:c2:90:46:6c:ac:3f:b8:39:8f:84:83 +# SHA256 Fingerprint: 5c:c3:d7:8e:4e:1d:5e:45:54:7a:04:e6:87:3e:64:f9:0c:f9:53:6d:1c:cc:2e:f8:00:f3:55:c4:c5:fd:70:fd +-----BEGIN CERTIFICATE----- +MIIFjTCCA3WgAwIBAgIEGErM1jANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJD +TjEwMC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9y +aXR5MRUwEwYDVQQDDAxDRkNBIEVWIFJPT1QwHhcNMTIwODA4MDMwNzAxWhcNMjkx +MjMxMDMwNzAxWjBWMQswCQYDVQQGEwJDTjEwMC4GA1UECgwnQ2hpbmEgRmluYW5j +aWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQDDAxDRkNBIEVWIFJP +T1QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDXXWvNED8fBVnVBU03 +sQ7smCuOFR36k0sXgiFxEFLXUWRwFsJVaU2OFW2fvwwbwuCjZ9YMrM8irq93VCpL +TIpTUnrD7i7es3ElweldPe6hL6P3KjzJIx1qqx2hp/Hz7KDVRM8Vz3IvHWOX6Jn5 +/ZOkVIBMUtRSqy5J35DNuF++P96hyk0g1CXohClTt7GIH//62pCfCqktQT+x8Rgp +7hZZLDRJGqgG16iI0gNyejLi6mhNbiyWZXvKWfry4t3uMCz7zEasxGPrb382KzRz +EpR/38wmnvFyXVBlWY9ps4deMm/DGIq1lY+wejfeWkU7xzbh72fROdOXW3NiGUgt +hxwG+3SYIElz8AXSG7Ggo7cbcNOIabla1jj0Ytwli3i/+Oh+uFzJlU9fpy25IGvP +a931DfSCt/SyZi4QKPaXWnuWFo8BGS1sbn85WAZkgwGDg8NNkt0yxoekN+kWzqot +aK8KgWU6cMGbrU1tVMoqLUuFG7OA5nBFDWteNfB/O7ic5ARwiRIlk9oKmSJgamNg +TnYGmE69g60dWIolhdLHZR4tjsbftsbhf4oEIRUpdPA+nJCdDC7xij5aqgwJHsfV +PKPtl8MeNPo4+QgO48BdK4PRVmrJtqhUUy54Mmc9gn900PvhtgVguXDbjgv5E1hv +cWAQUhC5wUEJ73IfZzF4/5YFjQIDAQABo2MwYTAfBgNVHSMEGDAWgBTj/i39KNAL +tbq2osS/BqoFjJP7LzAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAd +BgNVHQ4EFgQU4/4t/SjQC7W6tqLEvwaqBYyT+y8wDQYJKoZIhvcNAQELBQADggIB +ACXGumvrh8vegjmWPfBEp2uEcwPenStPuiB/vHiyz5ewG5zz13ku9Ui20vsXiObT +ej/tUxPQ4i9qecsAIyjmHjdXNYmEwnZPNDatZ8POQQaIxffu2Bq41gt/UP+TqhdL +jOztUmCypAbqTuv0axn96/Ua4CUqmtzHQTb3yHQFhDmVOdYLO6Qn+gjYXB74BGBS +ESgoA//vU2YApUo0FmZ8/Qmkrp5nGm9BC2sGE5uPhnEFtC+NiWYzKXZUmhH4J/qy +P5Hgzg0b8zAarb8iXRvTvyUFTeGSGn+ZnzxEk8rUQElsgIfXBDrDMlI1Dlb4pd19 +xIsNER9Tyx6yF7Zod1rg1MvIB671Oi6ON7fQAUtDKXeMOZePglr4UeWJoBjnaH9d +Ci77o0cOPaYjesYBx4/IXr9tgFa+iiS6M+qf4TIRnvHST4D2G0CvOJ4RUHlzEhLN +5mydLIhyPDCBBpEi6lmt2hkuIsKNuYyH4Ga8cyNfIWRjgEj1oDwYPZTISEEdQLpe +/v5WOaHIz16eGWRGENoXkbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+Z +AAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3CekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ +5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su +-----END CERTIFICATE----- + +# Issuer: CN=T\xdcRKTRUST Elektronik Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 H5 O=T\xdcRKTRUST Bilgi \u0130leti\u015fim ve Bili\u015fim G\xfcvenli\u011fi Hizmetleri A.\u015e. +# Subject: CN=T\xdcRKTRUST Elektronik Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 H5 O=T\xdcRKTRUST Bilgi \u0130leti\u015fim ve Bili\u015fim G\xfcvenli\u011fi Hizmetleri A.\u015e. +# Label: "T\xdcRKTRUST Elektronik Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 H5" +# Serial: 156233699172481 +# MD5 Fingerprint: da:70:8e:f0:22:df:93:26:f6:5f:9f:d3:15:06:52:4e +# SHA1 Fingerprint: c4:18:f6:4d:46:d1:df:00:3d:27:30:13:72:43:a9:12:11:c6:75:fb +# SHA256 Fingerprint: 49:35:1b:90:34:44:c1:85:cc:dc:5c:69:3d:24:d8:55:5c:b2:08:d6:a8:14:13:07:69:9f:4a:f0:63:19:9d:78 +-----BEGIN CERTIFICATE----- +MIIEJzCCAw+gAwIBAgIHAI4X/iQggTANBgkqhkiG9w0BAQsFADCBsTELMAkGA1UE +BhMCVFIxDzANBgNVBAcMBkFua2FyYTFNMEsGA1UECgxEVMOcUktUUlVTVCBCaWxn +aSDEsGxldGnFn2ltIHZlIEJpbGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkg +QS7Fni4xQjBABgNVBAMMOVTDnFJLVFJVU1QgRWxla3Ryb25payBTZXJ0aWZpa2Eg +SGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSBINTAeFw0xMzA0MzAwODA3MDFaFw0yMzA0 +MjgwODA3MDFaMIGxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMU0wSwYD +VQQKDERUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8 +dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjFCMEAGA1UEAww5VMOcUktUUlVTVCBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIEg1MIIB +IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApCUZ4WWe60ghUEoI5RHwWrom +/4NZzkQqL/7hzmAD/I0Dpe3/a6i6zDQGn1k19uwsu537jVJp45wnEFPzpALFp/kR +Gml1bsMdi9GYjZOHp3GXDSHHmflS0yxjXVW86B8BSLlg/kJK9siArs1mep5Fimh3 +4khon6La8eHBEJ/rPCmBp+EyCNSgBbGM+42WAA4+Jd9ThiI7/PS98wl+d+yG6w8z +5UNP9FR1bSmZLmZaQ9/LXMrI5Tjxfjs1nQ/0xVqhzPMggCTTV+wVunUlm+hkS7M0 +hO8EuPbJbKoCPrZV4jI3X/xml1/N1p7HIL9Nxqw/dV8c7TKcfGkAaZHjIxhT6QID +AQABo0IwQDAdBgNVHQ4EFgQUVpkHHtOsDGlktAxQR95DLL4gwPswDgYDVR0PAQH/ +BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAJ5FdnsX +SDLyOIspve6WSk6BGLFRRyDN0GSxDsnZAdkJzsiZ3GglE9Rc8qPoBP5yCccLqh0l +VX6Wmle3usURehnmp349hQ71+S4pL+f5bFgWV1Al9j4uPqrtd3GqqpmWRgqujuwq +URawXs3qZwQcWDD1YIq9pr1N5Za0/EKJAWv2cMhQOQwt1WbZyNKzMrcbGW3LM/nf +peYVhDfwwvJllpKQd/Ct9JDpEXjXk4nAPQu6KfTomZ1yju2dL+6SfaHx/126M2CF +Yv4HAqGEVka+lgqaE9chTLd8B59OTj+RdPsnnRHM3eaxynFNExc5JsUpISuTKWqW ++qtB4Uu2NQvAmxU= +-----END CERTIFICATE----- + +# Issuer: CN=Certinomis - Root CA O=Certinomis OU=0002 433998903 +# Subject: CN=Certinomis - Root CA O=Certinomis OU=0002 433998903 +# Label: "Certinomis - Root CA" +# Serial: 1 +# MD5 Fingerprint: 14:0a:fd:8d:a8:28:b5:38:69:db:56:7e:61:22:03:3f +# SHA1 Fingerprint: 9d:70:bb:01:a5:a4:a0:18:11:2e:f7:1c:01:b9:32:c5:34:e7:88:a8 +# SHA256 Fingerprint: 2a:99:f5:bc:11:74:b7:3c:bb:1d:62:08:84:e0:1c:34:e5:1c:cb:39:78:da:12:5f:0e:33:26:88:83:bf:41:58 +-----BEGIN CERTIFICATE----- +MIIFkjCCA3qgAwIBAgIBATANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJGUjET +MBEGA1UEChMKQ2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxHTAb +BgNVBAMTFENlcnRpbm9taXMgLSBSb290IENBMB4XDTEzMTAyMTA5MTcxOFoXDTMz +MTAyMTA5MTcxOFowWjELMAkGA1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMx +FzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMR0wGwYDVQQDExRDZXJ0aW5vbWlzIC0g +Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANTMCQosP5L2 +fxSeC5yaah1AMGT9qt8OHgZbn1CF6s2Nq0Nn3rD6foCWnoR4kkjW4znuzuRZWJfl +LieY6pOod5tK8O90gC3rMB+12ceAnGInkYjwSond3IjmFPnVAy//ldu9n+ws+hQV +WZUKxkd8aRi5pwP5ynapz8dvtF4F/u7BUrJ1Mofs7SlmO/NKFoL21prbcpjp3vDF +TKWrteoB4owuZH9kb/2jJZOLyKIOSY008B/sWEUuNKqEUL3nskoTuLAPrjhdsKkb +5nPJWqHZZkCqqU2mNAKthH6yI8H7KsZn9DS2sJVqM09xRLWtwHkziOC/7aOgFLSc +CbAK42C++PhmiM1b8XcF4LVzbsF9Ri6OSyemzTUK/eVNfaoqoynHWmgE6OXWk6Ri +wsXm9E/G+Z8ajYJJGYrKWUM66A0ywfRMEwNvbqY/kXPLynNvEiCL7sCCeN5LLsJJ +wx3tFvYk9CcbXFcx3FXuqB5vbKziRcxXV4p1VxngtViZSTYxPDMBbRZKzbgqg4SG +m/lg0h9tkQPTYKbVPZrdd5A9NaSfD171UkRpucC63M9933zZxKyGIjK8e2uR73r4 +F2iw4lNVYC2vPsKD2NkJK/DAZNuHi5HMkesE/Xa0lZrmFAYb1TQdvtj/dBxThZng +WVJKYe2InmtJiUZ+IFrZ50rlau7SZRFDAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIB +BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTvkUz1pcMw6C8I6tNxIqSSaHh0 +2TAfBgNVHSMEGDAWgBTvkUz1pcMw6C8I6tNxIqSSaHh02TANBgkqhkiG9w0BAQsF +AAOCAgEAfj1U2iJdGlg+O1QnurrMyOMaauo++RLrVl89UM7g6kgmJs95Vn6RHJk/ +0KGRHCwPT5iVWVO90CLYiF2cN/z7ZMF4jIuaYAnq1fohX9B0ZedQxb8uuQsLrbWw +F6YSjNRieOpWauwK0kDDPAUwPk2Ut59KA9N9J0u2/kTO+hkzGm2kQtHdzMjI1xZS +g081lLMSVX3l4kLr5JyTCcBMWwerx20RoFAXlCOotQqSD7J6wWAsOMwaplv/8gzj +qh8c3LigkyfeY+N/IZ865Z764BNqdeuWXGKRlI5nU7aJ+BIJy29SWwNyhlCVCNSN +h4YVH5Uk2KRvms6knZtt0rJ2BobGVgjF6wnaNsIbW0G+YSrjcOa4pvi2WsS9Iff/ +ql+hbHY5ZtbqTFXhADObE5hjyW/QASAJN1LnDE8+zbz1X5YnpyACleAu6AdBBR8V +btaw5BngDwKTACdyxYvRVB9dSsNAl35VpnzBMwQUAR1JIGkLGZOdblgi90AMRgwj +Y/M50n92Uaf0yKHxDHYiI0ZSKS3io0EHVmmY0gUJvGnHWmHNj4FgFU2A3ZDifcRQ +8ow7bkrHxuaAKzyBvBGAFhAn1/DNP3nMcyrDflOR1m749fPH0FFNjkulW+YZFzvW +gQncItzujrnEj1PhZ7szuIgVRs/taTX/dQ1G885x4cVrhkIGuUE= +-----END CERTIFICATE----- + +# Issuer: CN=OISTE WISeKey Global Root GB CA O=WISeKey OU=OISTE Foundation Endorsed +# Subject: CN=OISTE WISeKey Global Root GB CA O=WISeKey OU=OISTE Foundation Endorsed +# Label: "OISTE WISeKey Global Root GB CA" +# Serial: 157768595616588414422159278966750757568 +# MD5 Fingerprint: a4:eb:b9:61:28:2e:b7:2f:98:b0:35:26:90:99:51:1d +# SHA1 Fingerprint: 0f:f9:40:76:18:d3:d7:6a:4b:98:f0:a8:35:9e:0c:fd:27:ac:cc:ed +# SHA256 Fingerprint: 6b:9c:08:e8:6e:b0:f7:67:cf:ad:65:cd:98:b6:21:49:e5:49:4a:67:f5:84:5e:7b:d1:ed:01:9f:27:b8:6b:d6 +-----BEGIN CERTIFICATE----- +MIIDtTCCAp2gAwIBAgIQdrEgUnTwhYdGs/gjGvbCwDANBgkqhkiG9w0BAQsFADBt +MQswCQYDVQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUg +Rm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9i +YWwgUm9vdCBHQiBDQTAeFw0xNDEyMDExNTAwMzJaFw0zOTEyMDExNTEwMzFaMG0x +CzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYDVQQLExlPSVNURSBG +b3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEdsb2Jh +bCBSb290IEdCIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2Be3 +HEokKtaXscriHvt9OO+Y9bI5mE4nuBFde9IllIiCFSZqGzG7qFshISvYD06fWvGx +WuR51jIjK+FTzJlFXHtPrby/h0oLS5daqPZI7H17Dc0hBt+eFf1Biki3IPShehtX +1F1Q/7pn2COZH8g/497/b1t3sWtuuMlk9+HKQUYOKXHQuSP8yYFfTvdv37+ErXNk +u7dCjmn21HYdfp2nuFeKUWdy19SouJVUQHMD9ur06/4oQnc/nSMbsrY9gBQHTC5P +99UKFg29ZkM3fiNDecNAhvVMKdqOmq0NpQSHiB6F4+lT1ZvIiwNjeOvgGUpuuy9r +M2RYk61pv48b74JIxwIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUNQ/INmNe4qPs+TtmFc5RUuORmj0wEAYJKwYBBAGCNxUB +BAMCAQAwDQYJKoZIhvcNAQELBQADggEBAEBM+4eymYGQfp3FsLAmzYh7KzKNbrgh +cViXfa43FK8+5/ea4n32cZiZBKpDdHij40lhPnOMTZTg+XHEthYOU3gf1qKHLwI5 +gSk8rxWYITD+KJAAjNHhy/peyP34EEY7onhCkRd0VQreUGdNZtGn//3ZwLWoo4rO +ZvUPQ82nK1d7Y0Zqqi5S2PTt4W2tKZB4SLrhI6qjiey1q5bAtEuiHZeeevJuQHHf +aPFlTc58Bd9TZaml8LGXBHAVRgOY1NK/VLSgWH1Sb9pWJmLU2NuJMW8c8CLC02Ic +Nc1MaRVUGpCY3useX8p3x8uOPUNpnJpY0CQ73xtAln41rYHHTnG6iBM= +-----END CERTIFICATE----- + +# Issuer: CN=SZAFIR ROOT CA2 O=Krajowa Izba Rozliczeniowa S.A. +# Subject: CN=SZAFIR ROOT CA2 O=Krajowa Izba Rozliczeniowa S.A. +# Label: "SZAFIR ROOT CA2" +# Serial: 357043034767186914217277344587386743377558296292 +# MD5 Fingerprint: 11:64:c1:89:b0:24:b1:8c:b1:07:7e:89:9e:51:9e:99 +# SHA1 Fingerprint: e2:52:fa:95:3f:ed:db:24:60:bd:6e:28:f3:9c:cc:cf:5e:b3:3f:de +# SHA256 Fingerprint: a1:33:9d:33:28:1a:0b:56:e5:57:d3:d3:2b:1c:e7:f9:36:7e:b0:94:bd:5f:a7:2a:7e:50:04:c8:de:d7:ca:fe +-----BEGIN CERTIFICATE----- +MIIDcjCCAlqgAwIBAgIUPopdB+xV0jLVt+O2XwHrLdzk1uQwDQYJKoZIhvcNAQEL +BQAwUTELMAkGA1UEBhMCUEwxKDAmBgNVBAoMH0tyYWpvd2EgSXpiYSBSb3psaWN6 +ZW5pb3dhIFMuQS4xGDAWBgNVBAMMD1NaQUZJUiBST09UIENBMjAeFw0xNTEwMTkw +NzQzMzBaFw0zNTEwMTkwNzQzMzBaMFExCzAJBgNVBAYTAlBMMSgwJgYDVQQKDB9L +cmFqb3dhIEl6YmEgUm96bGljemVuaW93YSBTLkEuMRgwFgYDVQQDDA9TWkFGSVIg +Uk9PVCBDQTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC3vD5QqEvN +QLXOYeeWyrSh2gwisPq1e3YAd4wLz32ohswmUeQgPYUM1ljj5/QqGJ3a0a4m7utT +3PSQ1hNKDJA8w/Ta0o4NkjrcsbH/ON7Dui1fgLkCvUqdGw+0w8LBZwPd3BucPbOw +3gAeqDRHu5rr/gsUvTaE2g0gv/pby6kWIK05YO4vdbbnl5z5Pv1+TW9NL++IDWr6 +3fE9biCloBK0TXC5ztdyO4mTp4CEHCdJckm1/zuVnsHMyAHs6A6KCpbns6aH5db5 +BSsNl0BwPLqsdVqc1U2dAgrSS5tmS0YHF2Wtn2yIANwiieDhZNRnvDF5YTy7ykHN +XGoAyDw4jlivAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD +AgEGMB0GA1UdDgQWBBQuFqlKGLXLzPVvUPMjX/hd56zwyDANBgkqhkiG9w0BAQsF +AAOCAQEAtXP4A9xZWx126aMqe5Aosk3AM0+qmrHUuOQn/6mWmc5G4G18TKI4pAZw +8PRBEew/R40/cof5O/2kbytTAOD/OblqBw7rHRz2onKQy4I9EYKL0rufKq8h5mOG +nXkZ7/e7DDWQw4rtTw/1zBLZpD67oPwglV9PJi8RI4NOdQcPv5vRtB3pEAT+ymCP +oky4rc/hkA/NrgrHXXu3UNLUYfrVFdvXn4dRVOul4+vJhaAlIDf7js4MNIThPIGy +d05DpYhfhmehPea0XGG2Ptv+tyjFogeutcrKjSoS75ftwjCkySp6+/NNIxuZMzSg +LvWpCz/UXeHPhJ/iGcJfitYgHuNztw== +-----END CERTIFICATE----- + +# Issuer: CN=Certum Trusted Network CA 2 O=Unizeto Technologies S.A. OU=Certum Certification Authority +# Subject: CN=Certum Trusted Network CA 2 O=Unizeto Technologies S.A. OU=Certum Certification Authority +# Label: "Certum Trusted Network CA 2" +# Serial: 44979900017204383099463764357512596969 +# MD5 Fingerprint: 6d:46:9e:d9:25:6d:08:23:5b:5e:74:7d:1e:27:db:f2 +# SHA1 Fingerprint: d3:dd:48:3e:2b:bf:4c:05:e8:af:10:f5:fa:76:26:cf:d3:dc:30:92 +# SHA256 Fingerprint: b6:76:f2:ed:da:e8:77:5c:d3:6c:b0:f6:3c:d1:d4:60:39:61:f4:9e:62:65:ba:01:3a:2f:03:07:b6:d0:b8:04 +-----BEGIN CERTIFICATE----- +MIIF0jCCA7qgAwIBAgIQIdbQSk8lD8kyN/yqXhKN6TANBgkqhkiG9w0BAQ0FADCB +gDELMAkGA1UEBhMCUEwxIjAgBgNVBAoTGVVuaXpldG8gVGVjaG5vbG9naWVzIFMu +QS4xJzAlBgNVBAsTHkNlcnR1bSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEkMCIG +A1UEAxMbQ2VydHVtIFRydXN0ZWQgTmV0d29yayBDQSAyMCIYDzIwMTExMDA2MDgz +OTU2WhgPMjA0NjEwMDYwODM5NTZaMIGAMQswCQYDVQQGEwJQTDEiMCAGA1UEChMZ +VW5pemV0byBUZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5MSQwIgYDVQQDExtDZXJ0dW0gVHJ1c3RlZCBOZXR3 +b3JrIENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC9+Xj45tWA +DGSdhhuWZGc/IjoedQF97/tcZ4zJzFxrqZHmuULlIEub2pt7uZld2ZuAS9eEQCsn +0+i6MLs+CRqnSZXvK0AkwpfHp+6bJe+oCgCXhVqqndwpyeI1B+twTUrWwbNWuKFB +OJvR+zF/j+Bf4bE/D44WSWDXBo0Y+aomEKsq09DRZ40bRr5HMNUuctHFY9rnY3lE +fktjJImGLjQ/KUxSiyqnwOKRKIm5wFv5HdnnJ63/mgKXwcZQkpsCLL2puTRZCr+E +Sv/f/rOf69me4Jgj7KZrdxYq28ytOxykh9xGc14ZYmhFV+SQgkK7QtbwYeDBoz1m +o130GO6IyY0XRSmZMnUCMe4pJshrAua1YkV/NxVaI2iJ1D7eTiew8EAMvE0Xy02i +sx7QBlrd9pPPV3WZ9fqGGmd4s7+W/jTcvedSVuWz5XV710GRBdxdaeOVDUO5/IOW +OZV7bIBaTxNyxtd9KXpEulKkKtVBRgkg/iKgtlswjbyJDNXXcPiHUv3a76xRLgez +Tv7QCdpw75j6VuZt27VXS9zlLCUVyJ4ueE742pyehizKV/Ma5ciSixqClnrDvFAS +adgOWkaLOusm+iPJtrCBvkIApPjW/jAux9JG9uWOdf3yzLnQh1vMBhBgu4M1t15n +3kfsmUjxpKEV/q2MYo45VU85FrmxY53/twIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MB0GA1UdDgQWBBS2oVQ5AsOgP46KvPrU+Bym0ToO/TAOBgNVHQ8BAf8EBAMC +AQYwDQYJKoZIhvcNAQENBQADggIBAHGlDs7k6b8/ONWJWsQCYftMxRQXLYtPU2sQ +F/xlhMcQSZDe28cmk4gmb3DWAl45oPePq5a1pRNcgRRtDoGCERuKTsZPpd1iHkTf +CVn0W3cLN+mLIMb4Ck4uWBzrM9DPhmDJ2vuAL55MYIR4PSFk1vtBHxgP58l1cb29 +XN40hz5BsA72udY/CROWFC/emh1auVbONTqwX3BNXuMp8SMoclm2q8KMZiYcdywm +djWLKKdpoPk79SPdhRB0yZADVpHnr7pH1BKXESLjokmUbOe3lEu6LaTaM4tMpkT/ +WjzGHWTYtTHkpjx6qFcL2+1hGsvxznN3Y6SHb0xRONbkX8eftoEq5IVIeVheO/jb +AoJnwTnbw3RLPTYe+SmTiGhbqEQZIfCn6IENLOiTNrQ3ssqwGyZ6miUfmpqAnksq +P/ujmv5zMnHCnsZy4YpoJ/HkD7TETKVhk/iXEAcqMCWpuchxuO9ozC1+9eB+D4Ko +b7a6bINDd82Kkhehnlt4Fj1F4jNy3eFmypnTycUm/Q1oBEauttmbjL4ZvrHG8hnj +XALKLNhvSgfZyTXaQHXyxKcZb55CEJh15pWLYLztxRLXis7VmFxWlgPF7ncGNf/P +5O4/E2Hu29othfDNrp2yGAlFw5Khchf8R7agCyzxxN5DaAhqXzvwdmP7zAYspsbi +DrW5viSP +-----END CERTIFICATE----- + +# Issuer: CN=Hellenic Academic and Research Institutions RootCA 2015 O=Hellenic Academic and Research Institutions Cert. Authority +# Subject: CN=Hellenic Academic and Research Institutions RootCA 2015 O=Hellenic Academic and Research Institutions Cert. Authority +# Label: "Hellenic Academic and Research Institutions RootCA 2015" +# Serial: 0 +# MD5 Fingerprint: ca:ff:e2:db:03:d9:cb:4b:e9:0f:ad:84:fd:7b:18:ce +# SHA1 Fingerprint: 01:0c:06:95:a6:98:19:14:ff:bf:5f:c6:b0:b6:95:ea:29:e9:12:a6 +# SHA256 Fingerprint: a0:40:92:9a:02:ce:53:b4:ac:f4:f2:ff:c6:98:1c:e4:49:6f:75:5e:6d:45:fe:0b:2a:69:2b:cd:52:52:3f:36 +-----BEGIN CERTIFICATE----- +MIIGCzCCA/OgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBpjELMAkGA1UEBhMCR1Ix +DzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5k +IFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNVBAMT +N0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgUm9v +dENBIDIwMTUwHhcNMTUwNzA3MTAxMTIxWhcNNDAwNjMwMTAxMTIxWjCBpjELMAkG +A1UEBhMCR1IxDzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNh +ZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkx +QDA+BgNVBAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1 +dGlvbnMgUm9vdENBIDIwMTUwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQDC+Kk/G4n8PDwEXT2QNrCROnk8ZlrvbTkBSRq0t89/TSNTt5AA4xMqKKYx8ZEA +4yjsriFBzh/a/X0SWwGDD7mwX5nh8hKDgE0GPt+sr+ehiGsxr/CL0BgzuNtFajT0 +AoAkKAoCFZVedioNmToUW/bLy1O8E00BiDeUJRtCvCLYjqOWXjrZMts+6PAQZe10 +4S+nfK8nNLspfZu2zwnI5dMK/IhlZXQK3HMcXM1AsRzUtoSMTFDPaI6oWa7CJ06C +ojXdFPQf/7J31Ycvqm59JCfnxssm5uX+Zwdj2EUN3TpZZTlYepKZcj2chF6IIbjV +9Cz82XBST3i4vTwri5WY9bPRaM8gFH5MXF/ni+X1NYEZN9cRCLdmvtNKzoNXADrD +gfgXy5I2XdGj2HUb4Ysn6npIQf1FGQatJ5lOwXBH3bWfgVMS5bGMSF0xQxfjjMZ6 +Y5ZLKTBOhE5iGV48zpeQpX8B653g+IuJ3SWYPZK2fu/Z8VFRfS0myGlZYeCsargq +NhEEelC9MoS+L9xy1dcdFkfkR2YgP/SWxa+OAXqlD3pk9Q0Yh9muiNX6hME6wGko +LfINaFGq46V3xqSQDqE3izEjR8EJCOtu93ib14L8hCCZSRm2Ekax+0VVFqmjZayc +Bw/qa9wfLgZy7IaIEuQt218FL+TwA9MmM+eAws1CoRc0CwIDAQABo0IwQDAPBgNV +HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUcRVnyMjJvXVd +ctA4GGqd83EkVAswDQYJKoZIhvcNAQELBQADggIBAHW7bVRLqhBYRjTyYtcWNl0I +XtVsyIe9tC5G8jH4fOpCtZMWVdyhDBKg2mF+D1hYc2Ryx+hFjtyp8iY/xnmMsVMI +M4GwVhO+5lFc2JsKT0ucVlMC6U/2DWDqTUJV6HwbISHTGzrMd/K4kPFox/la/vot +9L/J9UUbzjgQKjeKeaO04wlshYaT/4mWJ3iBj2fjRnRUjtkNaeJK9E10A/+yd+2V +Z5fkscWrv2oj6NSU4kQoYsRL4vDY4ilrGnB+JGGTe08DMiUNRSQrlrRGar9KC/ea +j8GsGsVn82800vpzY4zvFrCopEYq+OsS7HK07/grfoxSwIuEVPkvPuNVqNxmsdnh +X9izjFk0WaSrT2y7HxjbdavYy5LNlDhhDgcGH0tGEPEVvo2FXDtKK4F5D7Rpn0lQ +l033DlZdwJVqwjbDG2jJ9SrcR5q+ss7FJej6A7na+RZukYT1HCjI/CbM1xyQVqdf +bzoEvM14iQuODy+jqk+iGxI9FghAD/FGTNeqewjBCvVtJ94Cj8rDtSvK6evIIVM4 +pcw72Hc3MKJP2W/R8kCtQXoXxdZKNYm3QdV8hn9VTYNKpXMgwDqvkPGaJI7ZjnHK +e7iG2rKPmT4dEw0SEe7Uq/DpFXYC5ODfqiAeW2GFZECpkJcNrVPSWh2HagCXZWK0 +vm9qp/UsQu0yrbYhnr68 +-----END CERTIFICATE----- + +# Issuer: CN=Hellenic Academic and Research Institutions ECC RootCA 2015 O=Hellenic Academic and Research Institutions Cert. Authority +# Subject: CN=Hellenic Academic and Research Institutions ECC RootCA 2015 O=Hellenic Academic and Research Institutions Cert. Authority +# Label: "Hellenic Academic and Research Institutions ECC RootCA 2015" +# Serial: 0 +# MD5 Fingerprint: 81:e5:b4:17:eb:c2:f5:e1:4b:0d:41:7b:49:92:fe:ef +# SHA1 Fingerprint: 9f:f1:71:8d:92:d5:9a:f3:7d:74:97:b4:bc:6f:84:68:0b:ba:b6:66 +# SHA256 Fingerprint: 44:b5:45:aa:8a:25:e6:5a:73:ca:15:dc:27:fc:36:d2:4c:1c:b9:95:3a:06:65:39:b1:15:82:dc:48:7b:48:33 +-----BEGIN CERTIFICATE----- +MIICwzCCAkqgAwIBAgIBADAKBggqhkjOPQQDAjCBqjELMAkGA1UEBhMCR1IxDzAN +BgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJl +c2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxRDBCBgNVBAMTO0hl +bGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgRUNDIFJv +b3RDQSAyMDE1MB4XDTE1MDcwNzEwMzcxMloXDTQwMDYzMDEwMzcxMlowgaoxCzAJ +BgNVBAYTAkdSMQ8wDQYDVQQHEwZBdGhlbnMxRDBCBgNVBAoTO0hlbGxlbmljIEFj +YWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9yaXR5 +MUQwQgYDVQQDEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0 +dXRpb25zIEVDQyBSb290Q0EgMjAxNTB2MBAGByqGSM49AgEGBSuBBAAiA2IABJKg +QehLgoRc4vgxEZmGZE4JJS+dQS8KrjVPdJWyUWRrjWvmP3CV8AVER6ZyOFB2lQJa +jq4onvktTpnvLEhvTCUp6NFxW98dwXU3tNf6e3pCnGoKVlp8aQuqgAkkbH7BRqNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFLQi +C4KZJAEOnLvkDv2/+5cgk5kqMAoGCCqGSM49BAMCA2cAMGQCMGfOFmI4oqxiRaep +lSTAGiecMjvAwNW6qef4BENThe5SId6d9SWDPp5YSy/XZxMOIQIwBeF1Ad5o7Sof +TUwJCA3sS61kFyjndc5FZXIhF8siQQ6ME5g4mlRtm8rifOoCWCKR +-----END CERTIFICATE----- + +# Issuer: CN=Certplus Root CA G1 O=Certplus +# Subject: CN=Certplus Root CA G1 O=Certplus +# Label: "Certplus Root CA G1" +# Serial: 1491911565779898356709731176965615564637713 +# MD5 Fingerprint: 7f:09:9c:f7:d9:b9:5c:69:69:56:d5:37:3e:14:0d:42 +# SHA1 Fingerprint: 22:fd:d0:b7:fd:a2:4e:0d:ac:49:2c:a0:ac:a6:7b:6a:1f:e3:f7:66 +# SHA256 Fingerprint: 15:2a:40:2b:fc:df:2c:d5:48:05:4d:22:75:b3:9c:7f:ca:3e:c0:97:80:78:b0:f0:ea:76:e5:61:a6:c7:43:3e +-----BEGIN CERTIFICATE----- +MIIFazCCA1OgAwIBAgISESBVg+QtPlRWhS2DN7cs3EYRMA0GCSqGSIb3DQEBDQUA +MD4xCzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2Vy +dHBsdXMgUm9vdCBDQSBHMTAeFw0xNDA1MjYwMDAwMDBaFw0zODAxMTUwMDAwMDBa +MD4xCzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2Vy +dHBsdXMgUm9vdCBDQSBHMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB +ANpQh7bauKk+nWT6VjOaVj0W5QOVsjQcmm1iBdTYj+eJZJ+622SLZOZ5KmHNr49a +iZFluVj8tANfkT8tEBXgfs+8/H9DZ6itXjYj2JizTfNDnjl8KvzsiNWI7nC9hRYt +6kuJPKNxQv4c/dMcLRC4hlTqQ7jbxofaqK6AJc96Jh2qkbBIb6613p7Y1/oA/caP +0FG7Yn2ksYyy/yARujVjBYZHYEMzkPZHogNPlk2dT8Hq6pyi/jQu3rfKG3akt62f +6ajUeD94/vI4CTYd0hYCyOwqaK/1jpTvLRN6HkJKHRUxrgwEV/xhc/MxVoYxgKDE +EW4wduOU8F8ExKyHcomYxZ3MVwia9Az8fXoFOvpHgDm2z4QTd28n6v+WZxcIbekN +1iNQMLAVdBM+5S//Ds3EC0pd8NgAM0lm66EYfFkuPSi5YXHLtaW6uOrc4nBvCGrc +h2c0798wct3zyT8j/zXhviEpIDCB5BmlIOklynMxdCm+4kLV87ImZsdo/Rmz5yCT +mehd4F6H50boJZwKKSTUzViGUkAksnsPmBIgJPaQbEfIDbsYIC7Z/fyL8inqh3SV +4EJQeIQEQWGw9CEjjy3LKCHyamz0GqbFFLQ3ZU+V/YDI+HLlJWvEYLF7bY5KinPO +WftwenMGE9nTdDckQQoRb5fc5+R+ob0V8rqHDz1oihYHAgMBAAGjYzBhMA4GA1Ud +DwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSowcCbkahDFXxd +Bie0KlHYlwuBsTAfBgNVHSMEGDAWgBSowcCbkahDFXxdBie0KlHYlwuBsTANBgkq +hkiG9w0BAQ0FAAOCAgEAnFZvAX7RvUz1isbwJh/k4DgYzDLDKTudQSk0YcbX8ACh +66Ryj5QXvBMsdbRX7gp8CXrc1cqh0DQT+Hern+X+2B50ioUHj3/MeXrKls3N/U/7 +/SMNkPX0XtPGYX2eEeAC7gkE2Qfdpoq3DIMku4NQkv5gdRE+2J2winq14J2by5BS +S7CTKtQ+FjPlnsZlFT5kOwQ/2wyPX1wdaR+v8+khjPPvl/aatxm2hHSco1S1cE5j +2FddUyGbQJJD+tZ3VTNPZNX70Cxqjm0lpu+F6ALEUz65noe8zDUa3qHpimOHZR4R +Kttjd5cUvpoUmRGywO6wT/gUITJDT5+rosuoD6o7BlXGEilXCNQ314cnrUlZp5Gr +RHpejXDbl85IULFzk/bwg2D5zfHhMf1bfHEhYxQUqq/F3pN+aLHsIqKqkHWetUNy +6mSjhEv9DKgma3GX7lZjZuhCVPnHHd/Qj1vfyDBviP4NxDMcU6ij/UgQ8uQKTuEV +V/xuZDDCVRHc6qnNSlSsKWNEz0pAoNZoWRsz+e86i9sgktxChL8Bq4fA1SCC28a5 +g4VCXA9DO2pJNdWY9BW/+mGBDAkgGNLQFwzLSABQ6XaCjGTXOqAHVcweMcDvOrRl +++O/QmueD6i9a5jc2NvLi6Td11n0bt3+qsOR0C5CB8AMTVPNJLFMWx5R9N/pkvo= +-----END CERTIFICATE----- + +# Issuer: CN=Certplus Root CA G2 O=Certplus +# Subject: CN=Certplus Root CA G2 O=Certplus +# Label: "Certplus Root CA G2" +# Serial: 1492087096131536844209563509228951875861589 +# MD5 Fingerprint: a7:ee:c4:78:2d:1b:ee:2d:b9:29:ce:d6:a7:96:32:31 +# SHA1 Fingerprint: 4f:65:8e:1f:e9:06:d8:28:02:e9:54:47:41:c9:54:25:5d:69:cc:1a +# SHA256 Fingerprint: 6c:c0:50:41:e6:44:5e:74:69:6c:4c:fb:c9:f8:0f:54:3b:7e:ab:bb:44:b4:ce:6f:78:7c:6a:99:71:c4:2f:17 +-----BEGIN CERTIFICATE----- +MIICHDCCAaKgAwIBAgISESDZkc6uo+jF5//pAq/Pc7xVMAoGCCqGSM49BAMDMD4x +CzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBs +dXMgUm9vdCBDQSBHMjAeFw0xNDA1MjYwMDAwMDBaFw0zODAxMTUwMDAwMDBaMD4x +CzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBs +dXMgUm9vdCBDQSBHMjB2MBAGByqGSM49AgEGBSuBBAAiA2IABM0PW1aC3/BFGtat +93nwHcmsltaeTpwftEIRyoa/bfuFo8XlGVzX7qY/aWfYeOKmycTbLXku54uNAm8x +Ik0G42ByRZ0OQneezs/lf4WbGOT8zC5y0xaTTsqZY1yhBSpsBqNjMGEwDgYDVR0P +AQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNqDYwJ5jtpMxjwj +FNiPwyCrKGBZMB8GA1UdIwQYMBaAFNqDYwJ5jtpMxjwjFNiPwyCrKGBZMAoGCCqG +SM49BAMDA2gAMGUCMHD+sAvZ94OX7PNVHdTcswYO/jOYnYs5kGuUIe22113WTNch +p+e/IQ8rzfcq3IUHnQIxAIYUFuXcsGXCwI4Un78kFmjlvPl5adytRSv3tjFzzAal +U5ORGpOucGpnutee5WEaXw== +-----END CERTIFICATE----- + +# Issuer: CN=OpenTrust Root CA G1 O=OpenTrust +# Subject: CN=OpenTrust Root CA G1 O=OpenTrust +# Label: "OpenTrust Root CA G1" +# Serial: 1492036577811947013770400127034825178844775 +# MD5 Fingerprint: 76:00:cc:81:29:cd:55:5e:88:6a:7a:2e:f7:4d:39:da +# SHA1 Fingerprint: 79:91:e8:34:f7:e2:ee:dd:08:95:01:52:e9:55:2d:14:e9:58:d5:7e +# SHA256 Fingerprint: 56:c7:71:28:d9:8c:18:d9:1b:4c:fd:ff:bc:25:ee:91:03:d4:75:8e:a2:ab:ad:82:6a:90:f3:45:7d:46:0e:b4 +-----BEGIN CERTIFICATE----- +MIIFbzCCA1egAwIBAgISESCzkFU5fX82bWTCp59rY45nMA0GCSqGSIb3DQEBCwUA +MEAxCzAJBgNVBAYTAkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9w +ZW5UcnVzdCBSb290IENBIEcxMB4XDTE0MDUyNjA4NDU1MFoXDTM4MDExNTAwMDAw +MFowQDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCU9wZW5UcnVzdDEdMBsGA1UEAwwU +T3BlblRydXN0IFJvb3QgQ0EgRzEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK +AoICAQD4eUbalsUwXopxAy1wpLuwxQjczeY1wICkES3d5oeuXT2R0odsN7faYp6b +wiTXj/HbpqbfRm9RpnHLPhsxZ2L3EVs0J9V5ToybWL0iEA1cJwzdMOWo010hOHQX +/uMftk87ay3bfWAfjH1MBcLrARYVmBSO0ZB3Ij/swjm4eTrwSSTilZHcYTSSjFR0 +77F9jAHiOH3BX2pfJLKOYheteSCtqx234LSWSE9mQxAGFiQD4eCcjsZGT44ameGP +uY4zbGneWK2gDqdkVBFpRGZPTBKnjix9xNRbxQA0MMHZmf4yzgeEtE7NCv82TWLx +p2NX5Ntqp66/K7nJ5rInieV+mhxNaMbBGN4zK1FGSxyO9z0M+Yo0FMT7MzUj8czx +Kselu7Cizv5Ta01BG2Yospb6p64KTrk5M0ScdMGTHPjgniQlQ/GbI4Kq3ywgsNw2 +TgOzfALU5nsaqocTvz6hdLubDuHAk5/XpGbKuxs74zD0M1mKB3IDVedzagMxbm+W +G+Oin6+Sx+31QrclTDsTBM8clq8cIqPQqwWyTBIjUtz9GVsnnB47ev1CI9sjgBPw +vFEVVJSmdz7QdFG9URQIOTfLHzSpMJ1ShC5VkLG631UAC9hWLbFJSXKAqWLXwPYY +EQRVzXR7z2FwefR7LFxckvzluFqrTJOVoSfupb7PcSNCupt2LQIDAQABo2MwYTAO +BgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUl0YhVyE1 +2jZVx/PxN3DlCPaTKbYwHwYDVR0jBBgwFoAUl0YhVyE12jZVx/PxN3DlCPaTKbYw +DQYJKoZIhvcNAQELBQADggIBAB3dAmB84DWn5ph76kTOZ0BP8pNuZtQ5iSas000E +PLuHIT839HEl2ku6q5aCgZG27dmxpGWX4m9kWaSW7mDKHyP7Rbr/jyTwyqkxf3kf +gLMtMrpkZ2CvuVnN35pJ06iCsfmYlIrM4LvgBBuZYLFGZdwIorJGnkSI6pN+VxbS +FXJfLkur1J1juONI5f6ELlgKn0Md/rcYkoZDSw6cMoYsYPXpSOqV7XAp8dUv/TW0 +V8/bhUiZucJvbI/NeJWsZCj9VrDDb8O+WVLhX4SPgPL0DTatdrOjteFkdjpY3H1P +XlZs5VVZV6Xf8YpmMIzUUmI4d7S+KNfKNsSbBfD4Fdvb8e80nR14SohWZ25g/4/I +i+GOvUKpMwpZQhISKvqxnUOOBZuZ2mKtVzazHbYNeS2WuOvyDEsMpZTGMKcmGS3t +TAZQMPH9WD25SxdfGbRqhFS0OE85og2WaMMolP3tLR9Ka0OWLpABEPs4poEL0L91 +09S5zvE/bw4cHjdx5RiHdRk/ULlepEU0rbDK5uUTdg8xFKmOLZTW1YVNcxVPS/Ky +Pu1svf0OnWZzsD2097+o4BGkxK51CUpjAEggpsadCwmKtODmzj7HPiY46SvepghJ +AwSQiumPv+i2tCqjI40cHLI5kqiPAlxAOXXUc0ECd97N4EOH1uS6SsNsEn/+KuYj +1oxx +-----END CERTIFICATE----- + +# Issuer: CN=OpenTrust Root CA G2 O=OpenTrust +# Subject: CN=OpenTrust Root CA G2 O=OpenTrust +# Label: "OpenTrust Root CA G2" +# Serial: 1492012448042702096986875987676935573415441 +# MD5 Fingerprint: 57:24:b6:59:24:6b:ae:c8:fe:1c:0c:20:f2:c0:4e:eb +# SHA1 Fingerprint: 79:5f:88:60:c5:ab:7c:3d:92:e6:cb:f4:8d:e1:45:cd:11:ef:60:0b +# SHA256 Fingerprint: 27:99:58:29:fe:6a:75:15:c1:bf:e8:48:f9:c4:76:1d:b1:6c:22:59:29:25:7b:f4:0d:08:94:f2:9e:a8:ba:f2 +-----BEGIN CERTIFICATE----- +MIIFbzCCA1egAwIBAgISESChaRu/vbm9UpaPI+hIvyYRMA0GCSqGSIb3DQEBDQUA +MEAxCzAJBgNVBAYTAkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9w +ZW5UcnVzdCBSb290IENBIEcyMB4XDTE0MDUyNjAwMDAwMFoXDTM4MDExNTAwMDAw +MFowQDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCU9wZW5UcnVzdDEdMBsGA1UEAwwU +T3BlblRydXN0IFJvb3QgQ0EgRzIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK +AoICAQDMtlelM5QQgTJT32F+D3Y5z1zCU3UdSXqWON2ic2rxb95eolq5cSG+Ntmh +/LzubKh8NBpxGuga2F8ORAbtp+Dz0mEL4DKiltE48MLaARf85KxP6O6JHnSrT78e +CbY2albz4e6WiWYkBuTNQjpK3eCasMSCRbP+yatcfD7J6xcvDH1urqWPyKwlCm/6 +1UWY0jUJ9gNDlP7ZvyCVeYCYitmJNbtRG6Q3ffyZO6v/v6wNj0OxmXsWEH4db0fE +FY8ElggGQgT4hNYdvJGmQr5J1WqIP7wtUdGejeBSzFfdNTVY27SPJIjki9/ca1TS +gSuyzpJLHB9G+h3Ykst2Z7UJmQnlrBcUVXDGPKBWCgOz3GIZ38i1MH/1PCZ1Eb3X +G7OHngevZXHloM8apwkQHZOJZlvoPGIytbU6bumFAYueQ4xncyhZW+vj3CzMpSZy +YhK05pyDRPZRpOLAeiRXyg6lPzq1O4vldu5w5pLeFlwoW5cZJ5L+epJUzpM5ChaH +vGOz9bGTXOBut9Dq+WIyiET7vycotjCVXRIouZW+j1MY5aIYFuJWpLIsEPUdN6b4 +t/bQWVyJ98LVtZR00dX+G7bw5tYee9I8y6jj9RjzIR9u701oBnstXW5DiabA+aC/ +gh7PU3+06yzbXfZqfUAkBXKJOAGTy3HCOV0GEfZvePg3DTmEJwIDAQABo2MwYTAO +BgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUajn6QiL3 +5okATV59M4PLuG53hq8wHwYDVR0jBBgwFoAUajn6QiL35okATV59M4PLuG53hq8w +DQYJKoZIhvcNAQENBQADggIBAJjLq0A85TMCl38th6aP1F5Kr7ge57tx+4BkJamz +Gj5oXScmp7oq4fBXgwpkTx4idBvpkF/wrM//T2h6OKQQbA2xx6R3gBi2oihEdqc0 +nXGEL8pZ0keImUEiyTCYYW49qKgFbdEfwFFEVn8nNQLdXpgKQuswv42hm1GqO+qT +RmTFAHneIWv2V6CG1wZy7HBGS4tz3aAhdT7cHcCP009zHIXZ/n9iyJVvttN7jLpT +wm+bREx50B1ws9efAvSyB7DH5fitIw6mVskpEndI2S9G/Tvw/HRwkqWOOAgfZDC2 +t0v7NqwQjqBSM2OdAzVWxWm9xiNaJ5T2pBL4LTM8oValX9YZ6e18CL13zSdkzJTa +TkZQh+D5wVOAHrut+0dSixv9ovneDiK3PTNZbNTe9ZUGMg1RGUFcPk8G97krgCf2 +o6p6fAbhQ8MTOWIaNr3gKC6UAuQpLmBVrkA9sHSSXvAgZJY/X0VdiLWK2gKgW0VU +3jg9CcCoSmVGFvyqv1ROTVu+OEO3KMqLM6oaJbolXCkvW0pujOotnCr2BXbgd5eA +iN1nE28daCSLT7d0geX0YJ96Vdc+N9oWaz53rK4YcJUIeSkDiv7BO7M/Gg+kO14f +WKGVyasvc0rQLW6aWQ9VGHgtPFGml4vmu7JwqkwR3v98KzfUetF3NI/n+UL3PIEM +S1IK +-----END CERTIFICATE----- + +# Issuer: CN=OpenTrust Root CA G3 O=OpenTrust +# Subject: CN=OpenTrust Root CA G3 O=OpenTrust +# Label: "OpenTrust Root CA G3" +# Serial: 1492104908271485653071219941864171170455615 +# MD5 Fingerprint: 21:37:b4:17:16:92:7b:67:46:70:a9:96:d7:a8:13:24 +# SHA1 Fingerprint: 6e:26:64:f3:56:bf:34:55:bf:d1:93:3f:7c:01:de:d8:13:da:8a:a6 +# SHA256 Fingerprint: b7:c3:62:31:70:6e:81:07:8c:36:7c:b8:96:19:8f:1e:32:08:dd:92:69:49:dd:8f:57:09:a4:10:f7:5b:62:92 +-----BEGIN CERTIFICATE----- +MIICITCCAaagAwIBAgISESDm+Ez8JLC+BUCs2oMbNGA/MAoGCCqGSM49BAMDMEAx +CzAJBgNVBAYTAkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9wZW5U +cnVzdCBSb290IENBIEczMB4XDTE0MDUyNjAwMDAwMFoXDTM4MDExNTAwMDAwMFow +QDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCU9wZW5UcnVzdDEdMBsGA1UEAwwUT3Bl +blRydXN0IFJvb3QgQ0EgRzMwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARK7liuTcpm +3gY6oxH84Bjwbhy6LTAMidnW7ptzg6kjFYwvWYpa3RTqnVkrQ7cG7DK2uu5Bta1d +oYXM6h0UZqNnfkbilPPntlahFVmhTzeXuSIevRHr9LIfXsMUmuXZl5mjYzBhMA4G +A1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRHd8MUi2I5 +DMlv4VBN0BBY3JWIbTAfBgNVHSMEGDAWgBRHd8MUi2I5DMlv4VBN0BBY3JWIbTAK +BggqhkjOPQQDAwNpADBmAjEAj6jcnboMBBf6Fek9LykBl7+BFjNAk2z8+e2AcG+q +j9uEwov1NcoG3GRvaBbhj5G5AjEA2Euly8LQCGzpGPta3U1fJAuwACEl74+nBCZx +4nxp5V2a+EEfOzmTk51V6s2N8fvB +-----END CERTIFICATE----- + +# Issuer: CN=ISRG Root X1 O=Internet Security Research Group +# Subject: CN=ISRG Root X1 O=Internet Security Research Group +# Label: "ISRG Root X1" +# Serial: 172886928669790476064670243504169061120 +# MD5 Fingerprint: 0c:d2:f9:e0:da:17:73:e9:ed:86:4d:a5:e3:70:e7:4e +# SHA1 Fingerprint: ca:bd:2a:79:a1:07:6a:31:f2:1d:25:36:35:cb:03:9d:43:29:a5:e8 +# SHA256 Fingerprint: 96:bc:ec:06:26:49:76:f3:74:60:77:9a:cf:28:c5:a7:cf:e8:a3:c0:aa:e1:1a:8f:fc:ee:05:c0:bd:df:08:c6 +-----BEGIN CERTIFICATE----- +MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw +TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh +cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4 +WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu +ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY +MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc +h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+ +0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U +A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW +T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH +B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC +B5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf1b0SHzUv +KBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWn +OlFuhjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTn +jh8BCNAw1FtxNrQHusEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbw +qHyGO0aoSCqI3Haadr8faqU9GY/rOPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CI +rU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY9umbbjANBgkq +hkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL +ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ +3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK +NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5 +ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur +TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC +jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc +oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq +4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA +mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d +emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc= +-----END CERTIFICATE----- + +# Issuer: O=FNMT-RCM OU=AC RAIZ FNMT-RCM +# Subject: O=FNMT-RCM OU=AC RAIZ FNMT-RCM +# Label: "AC RAIZ FNMT-RCM" +# Serial: 485876308206448804701554682760554759 +# MD5 Fingerprint: e2:09:04:b4:d3:bd:d1:a0:14:fd:1a:d2:47:c4:57:1d +# SHA1 Fingerprint: ec:50:35:07:b2:15:c4:95:62:19:e2:a8:9a:5b:42:99:2c:4c:2c:20 +# SHA256 Fingerprint: eb:c5:57:0c:29:01:8c:4d:67:b1:aa:12:7b:af:12:f7:03:b4:61:1e:bc:17:b7:da:b5:57:38:94:17:9b:93:fa +-----BEGIN CERTIFICATE----- +MIIFgzCCA2ugAwIBAgIPXZONMGc2yAYdGsdUhGkHMA0GCSqGSIb3DQEBCwUAMDsx +CzAJBgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJ +WiBGTk1ULVJDTTAeFw0wODEwMjkxNTU5NTZaFw0zMDAxMDEwMDAwMDBaMDsxCzAJ +BgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJWiBG +Tk1ULVJDTTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALpxgHpMhm5/ +yBNtwMZ9HACXjywMI7sQmkCpGreHiPibVmr75nuOi5KOpyVdWRHbNi63URcfqQgf +BBckWKo3Shjf5TnUV/3XwSyRAZHiItQDwFj8d0fsjz50Q7qsNI1NOHZnjrDIbzAz +WHFctPVrbtQBULgTfmxKo0nRIBnuvMApGGWn3v7v3QqQIecaZ5JCEJhfTzC8PhxF +tBDXaEAUwED653cXeuYLj2VbPNmaUtu1vZ5Gzz3rkQUCwJaydkxNEJY7kvqcfw+Z +374jNUUeAlz+taibmSXaXvMiwzn15Cou08YfxGyqxRxqAQVKL9LFwag0Jl1mpdIC +IfkYtwb1TplvqKtMUejPUBjFd8g5CSxJkjKZqLsXF3mwWsXmo8RZZUc1g16p6DUL +mbvkzSDGm0oGObVo/CK67lWMK07q87Hj/LaZmtVC+nFNCM+HHmpxffnTtOmlcYF7 +wk5HlqX2doWjKI/pgG6BU6VtX7hI+cL5NqYuSf+4lsKMB7ObiFj86xsc3i1w4peS +MKGJ47xVqCfWS+2QrYv6YyVZLag13cqXM7zlzced0ezvXg5KkAYmY6252TUtB7p2 +ZSysV4999AeU14ECll2jB0nVetBX+RvnU0Z1qrB5QstocQjpYL05ac70r8NWQMet +UqIJ5G+GR4of6ygnXYMgrwTJbFaai0b1AgMBAAGjgYMwgYAwDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFPd9xf3E6Jobd2Sn9R2gzL+H +YJptMD4GA1UdIAQ3MDUwMwYEVR0gADArMCkGCCsGAQUFBwIBFh1odHRwOi8vd3d3 +LmNlcnQuZm5tdC5lcy9kcGNzLzANBgkqhkiG9w0BAQsFAAOCAgEAB5BK3/MjTvDD +nFFlm5wioooMhfNzKWtN/gHiqQxjAb8EZ6WdmF/9ARP67Jpi6Yb+tmLSbkyU+8B1 +RXxlDPiyN8+sD8+Nb/kZ94/sHvJwnvDKuO+3/3Y3dlv2bojzr2IyIpMNOmqOFGYM +LVN0V2Ue1bLdI4E7pWYjJ2cJj+F3qkPNZVEI7VFY/uY5+ctHhKQV8Xa7pO6kO8Rf +77IzlhEYt8llvhjho6Tc+hj507wTmzl6NLrTQfv6MooqtyuGC2mDOL7Nii4LcK2N +JpLuHvUBKwrZ1pebbuCoGRw6IYsMHkCtA+fdZn71uSANA+iW+YJF1DngoABd15jm +fZ5nc8OaKveri6E6FO80vFIOiZiaBECEHX5FaZNXzuvO+FB8TxxuBEOb+dY7Ixjp +6o7RTUaN8Tvkasq6+yO3m/qZASlaWFot4/nUbQ4mrcFuNLwy+AwF+mWj2zs3gyLp +1txyM/1d8iC9djwj2ij3+RvrWWTV3F9yfiD8zYm1kGdNYno/Tq0dwzn+evQoFt9B +9kiABdcPUXmsEKvU7ANm5mqwujGSQkBqvjrTcuFqN1W8rB2Vt2lh8kORdOag0wok +RqEIr9baRRmW1FMdW4R58MD3R++Lj8UGrp1MYp3/RgT408m2ECVAdf4WqslKYIYv +uu8wd+RU4riEmViAqhOLUTpPSPaLtrM= +-----END CERTIFICATE----- + +# Issuer: CN=Amazon Root CA 1 O=Amazon +# Subject: CN=Amazon Root CA 1 O=Amazon +# Label: "Amazon Root CA 1" +# Serial: 143266978916655856878034712317230054538369994 +# MD5 Fingerprint: 43:c6:bf:ae:ec:fe:ad:2f:18:c6:88:68:30:fc:c8:e6 +# SHA1 Fingerprint: 8d:a7:f9:65:ec:5e:fc:37:91:0f:1c:6e:59:fd:c1:cc:6a:6e:de:16 +# SHA256 Fingerprint: 8e:cd:e6:88:4f:3d:87:b1:12:5b:a3:1a:c3:fc:b1:3d:70:16:de:7f:57:cc:90:4f:e1:cb:97:c6:ae:98:19:6e +-----BEGIN CERTIFICATE----- +MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF +ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6 +b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL +MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv +b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj +ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM +9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw +IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6 +VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L +93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm +jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA +A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI +U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs +N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv +o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU +5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy +rqXRfboQnoZsG4q5WTP468SQvvG5 +-----END CERTIFICATE----- + +# Issuer: CN=Amazon Root CA 2 O=Amazon +# Subject: CN=Amazon Root CA 2 O=Amazon +# Label: "Amazon Root CA 2" +# Serial: 143266982885963551818349160658925006970653239 +# MD5 Fingerprint: c8:e5:8d:ce:a8:42:e2:7a:c0:2a:5c:7c:9e:26:bf:66 +# SHA1 Fingerprint: 5a:8c:ef:45:d7:a6:98:59:76:7a:8c:8b:44:96:b5:78:cf:47:4b:1a +# SHA256 Fingerprint: 1b:a5:b2:aa:8c:65:40:1a:82:96:01:18:f8:0b:ec:4f:62:30:4d:83:ce:c4:71:3a:19:c3:9c:01:1e:a4:6d:b4 +-----BEGIN CERTIFICATE----- +MIIFQTCCAymgAwIBAgITBmyf0pY1hp8KD+WGePhbJruKNzANBgkqhkiG9w0BAQwF +ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6 +b24gUm9vdCBDQSAyMB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTEL +MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv +b3QgQ0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK2Wny2cSkxK +gXlRmeyKy2tgURO8TW0G/LAIjd0ZEGrHJgw12MBvIITplLGbhQPDW9tK6Mj4kHbZ +W0/jTOgGNk3Mmqw9DJArktQGGWCsN0R5hYGCrVo34A3MnaZMUnbqQ523BNFQ9lXg +1dKmSYXpN+nKfq5clU1Imj+uIFptiJXZNLhSGkOQsL9sBbm2eLfq0OQ6PBJTYv9K +8nu+NQWpEjTj82R0Yiw9AElaKP4yRLuH3WUnAnE72kr3H9rN9yFVkE8P7K6C4Z9r +2UXTu/Bfh+08LDmG2j/e7HJV63mjrdvdfLC6HM783k81ds8P+HgfajZRRidhW+me +z/CiVX18JYpvL7TFz4QuK/0NURBs+18bvBt+xa47mAExkv8LV/SasrlX6avvDXbR +8O70zoan4G7ptGmh32n2M8ZpLpcTnqWHsFcQgTfJU7O7f/aS0ZzQGPSSbtqDT6Zj +mUyl+17vIWR6IF9sZIUVyzfpYgwLKhbcAS4y2j5L9Z469hdAlO+ekQiG+r5jqFoz +7Mt0Q5X5bGlSNscpb/xVA1wf+5+9R+vnSUeVC06JIglJ4PVhHvG/LopyboBZ/1c6 ++XUyo05f7O0oYtlNc/LMgRdg7c3r3NunysV+Ar3yVAhU/bQtCSwXVEqY0VThUWcI +0u1ufm8/0i2BWSlmy5A5lREedCf+3euvAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMB +Af8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSwDPBMMPQFWAJI/TPlUq9LhONm +UjANBgkqhkiG9w0BAQwFAAOCAgEAqqiAjw54o+Ci1M3m9Zh6O+oAA7CXDpO8Wqj2 +LIxyh6mx/H9z/WNxeKWHWc8w4Q0QshNabYL1auaAn6AFC2jkR2vHat+2/XcycuUY ++gn0oJMsXdKMdYV2ZZAMA3m3MSNjrXiDCYZohMr/+c8mmpJ5581LxedhpxfL86kS +k5Nrp+gvU5LEYFiwzAJRGFuFjWJZY7attN6a+yb3ACfAXVU3dJnJUH/jWS5E4ywl +7uxMMne0nxrpS10gxdr9HIcWxkPo1LsmmkVwXqkLN1PiRnsn/eBG8om3zEK2yygm +btmlyTrIQRNg91CMFa6ybRoVGld45pIq2WWQgj9sAq+uEjonljYE1x2igGOpm/Hl +urR8FLBOybEfdF849lHqm/osohHUqS0nGkWxr7JOcQ3AWEbWaQbLU8uz/mtBzUF+ +fUwPfHJ5elnNXkoOrJupmHN5fLT0zLm4BwyydFy4x2+IoZCn9Kr5v2c69BoVYh63 +n749sSmvZ6ES8lgQGVMDMBu4Gon2nL2XA46jCfMdiyHxtN/kHNGfZQIG6lzWE7OE +76KlXIx3KadowGuuQNKotOrN8I1LOJwZmhsoVLiJkO/KdYE+HvJkJMcYr07/R54H +9jVlpNMKVv/1F2Rs76giJUmTtt8AF9pYfl3uxRuw0dFfIRDH+fO6AgonB8Xx1sfT +4PsJYGw= +-----END CERTIFICATE----- + +# Issuer: CN=Amazon Root CA 3 O=Amazon +# Subject: CN=Amazon Root CA 3 O=Amazon +# Label: "Amazon Root CA 3" +# Serial: 143266986699090766294700635381230934788665930 +# MD5 Fingerprint: a0:d4:ef:0b:f7:b5:d8:49:95:2a:ec:f5:c4:fc:81:87 +# SHA1 Fingerprint: 0d:44:dd:8c:3c:8c:1a:1a:58:75:64:81:e9:0f:2e:2a:ff:b3:d2:6e +# SHA256 Fingerprint: 18:ce:6c:fe:7b:f1:4e:60:b2:e3:47:b8:df:e8:68:cb:31:d0:2e:bb:3a:da:27:15:69:f5:03:43:b4:6d:b3:a4 +-----BEGIN CERTIFICATE----- +MIIBtjCCAVugAwIBAgITBmyf1XSXNmY/Owua2eiedgPySjAKBggqhkjOPQQDAjA5 +MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g +Um9vdCBDQSAzMB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkG +A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3Qg +Q0EgMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCmXp8ZBf8ANm+gBG1bG8lKl +ui2yEujSLtf6ycXYqm0fc4E7O5hrOXwzpcVOho6AF2hiRVd9RFgdszflZwjrZt6j +QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSr +ttvXBp43rDCGB5Fwx5zEGbF4wDAKBggqhkjOPQQDAgNJADBGAiEA4IWSoxe3jfkr +BqWTrBqYaGFy+uGh0PsceGCmQ5nFuMQCIQCcAu/xlJyzlvnrxir4tiz+OpAUFteM +YyRIHN8wfdVoOw== +-----END CERTIFICATE----- + +# Issuer: CN=Amazon Root CA 4 O=Amazon +# Subject: CN=Amazon Root CA 4 O=Amazon +# Label: "Amazon Root CA 4" +# Serial: 143266989758080763974105200630763877849284878 +# MD5 Fingerprint: 89:bc:27:d5:eb:17:8d:06:6a:69:d5:fd:89:47:b4:cd +# SHA1 Fingerprint: f6:10:84:07:d6:f8:bb:67:98:0c:c2:e2:44:c2:eb:ae:1c:ef:63:be +# SHA256 Fingerprint: e3:5d:28:41:9e:d0:20:25:cf:a6:90:38:cd:62:39:62:45:8d:a5:c6:95:fb:de:a3:c2:2b:0b:fb:25:89:70:92 +-----BEGIN CERTIFICATE----- +MIIB8jCCAXigAwIBAgITBmyf18G7EEwpQ+Vxe3ssyBrBDjAKBggqhkjOPQQDAzA5 +MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g +Um9vdCBDQSA0MB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkG +A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3Qg +Q0EgNDB2MBAGByqGSM49AgEGBSuBBAAiA2IABNKrijdPo1MN/sGKe0uoe0ZLY7Bi +9i0b2whxIdIA6GO9mif78DluXeo9pcmBqqNbIJhFXRbb/egQbeOc4OO9X4Ri83Bk +M6DLJC9wuoihKqB1+IGuYgbEgds5bimwHvouXKNCMEAwDwYDVR0TAQH/BAUwAwEB +/zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFNPsxzplbszh2naaVvuc84ZtV+WB +MAoGCCqGSM49BAMDA2gAMGUCMDqLIfG9fhGt0O9Yli/W651+kI0rz2ZVwyzjKKlw +CkcO8DdZEv8tmZQoTipPNU0zWgIxAOp1AE47xDqUEpHJWEadIRNyp4iciuRMStuW +1KyLa2tJElMzrdfkviT8tQp21KW8EA== +-----END CERTIFICATE----- + +# Issuer: CN=LuxTrust Global Root 2 O=LuxTrust S.A. +# Subject: CN=LuxTrust Global Root 2 O=LuxTrust S.A. +# Label: "LuxTrust Global Root 2" +# Serial: 59914338225734147123941058376788110305822489521 +# MD5 Fingerprint: b2:e1:09:00:61:af:f7:f1:91:6f:c4:ad:8d:5e:3b:7c +# SHA1 Fingerprint: 1e:0e:56:19:0a:d1:8b:25:98:b2:04:44:ff:66:8a:04:17:99:5f:3f +# SHA256 Fingerprint: 54:45:5f:71:29:c2:0b:14:47:c4:18:f9:97:16:8f:24:c5:8f:c5:02:3b:f5:da:5b:e2:eb:6e:1d:d8:90:2e:d5 +-----BEGIN CERTIFICATE----- +MIIFwzCCA6ugAwIBAgIUCn6m30tEntpqJIWe5rgV0xZ/u7EwDQYJKoZIhvcNAQEL +BQAwRjELMAkGA1UEBhMCTFUxFjAUBgNVBAoMDUx1eFRydXN0IFMuQS4xHzAdBgNV +BAMMFkx1eFRydXN0IEdsb2JhbCBSb290IDIwHhcNMTUwMzA1MTMyMTU3WhcNMzUw +MzA1MTMyMTU3WjBGMQswCQYDVQQGEwJMVTEWMBQGA1UECgwNTHV4VHJ1c3QgUy5B +LjEfMB0GA1UEAwwWTHV4VHJ1c3QgR2xvYmFsIFJvb3QgMjCCAiIwDQYJKoZIhvcN +AQEBBQADggIPADCCAgoCggIBANeFl78RmOnwYoNMPIf5U2o3C/IPPIfOb9wmKb3F +ibrJgz337spbxm1Jc7TJRqMbNBM/wYlFV/TZsfs2ZUv7COJIcRHIbjuend+JZTem +hfY7RBi2xjcwYkSSl2l9QjAk5A0MiWtj3sXh306pFGxT4GHO9hcvHTy95iJMHZP1 +EMShduxq3sVs35a0VkBCwGKSMKEtFZSg0iAGCW5qbeXrt77U8PEVfIvmTroTzEsn +Xpk8F12PgX8zPU/TPxvsXD/wPEx1bvKm1Z3aLQdjAsZy6ZS8TEmVT4hSyNvoaYL4 +zDRbIvCGp4m9SAptZoFtyMhk+wHh9OHe2Z7d21vUKpkmFRseTJIpgp7VkoGSQXAZ +96Tlk0u8d2cx3Rz9MXANF5kM+Qw5GSoXtTBxVdUPrljhPS80m8+f9niFwpN6cj5m +j5wWEWCPnolvZ77gR1o7DJpni89Gxq44o/KnvObWhWszJHAiS8sIm7vI+AIpHb4g +DEa/a4ebsypmQjVGbKq6rfmYe+lQVRQxv7HaLe2ArWgk+2mr2HETMOZns4dA/Yl+ +8kPREd8vZS9kzl8UubG/Mb2HeFpZZYiq/FkySIbWTLkpS5XTdvN3JW1CHDiDTf2j +X5t/Lax5Gw5CMZdjpPuKadUiDTSQMC6otOBttpSsvItO13D8xTiOZCXhTTmQzsmH +hFhxAgMBAAGjgagwgaUwDwYDVR0TAQH/BAUwAwEB/zBCBgNVHSAEOzA5MDcGByuB +KwEBAQowLDAqBggrBgEFBQcCARYeaHR0cHM6Ly9yZXBvc2l0b3J5Lmx1eHRydXN0 +Lmx1MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBT/GCh2+UgFLKGu8SsbK7JT ++Et8szAdBgNVHQ4EFgQU/xgodvlIBSyhrvErGyuyU/hLfLMwDQYJKoZIhvcNAQEL +BQADggIBAGoZFO1uecEsh9QNcH7X9njJCwROxLHOk3D+sFTAMs2ZMGQXvw/l4jP9 +BzZAcg4atmpZ1gDlaCDdLnINH2pkMSCEfUmmWjfrRcmF9dTHF5kH5ptV5AzoqbTO +jFu1EVzPig4N1qx3gf4ynCSecs5U89BvolbW7MM3LGVYvlcAGvI1+ut7MV3CwRI9 +loGIlonBWVx65n9wNOeD4rHh4bhY79SV5GCc8JaXcozrhAIuZY+kt9J/Z93I055c +qqmkoCUUBpvsT34tC38ddfEz2O3OuHVtPlu5mB0xDVbYQw8wkbIEa91WvpWAVWe+ +2M2D2RjuLg+GLZKecBPs3lHJQ3gCpU3I+V/EkVhGFndadKpAvAefMLmx9xIX3eP/ +JEAdemrRTxgKqpAd60Ae36EeRJIQmvKN4dFLRp7oRUKX6kWZ8+xm1QL68qZKJKre +zrnK+T+Tb/mjuuqlPpmt/f97mfVl7vBZKGfXkJWkE4SphMHozs51k2MavDzq1WQf +LSoSOcbDWjLtR5EWDrw4wVDej8oqkDQc7kGUnF4ZLvhFSZl0kbAEb+MEWrGrKqv+ +x9CWttrhSmQGbmBNvUJO/3jaJMobtNeWOWyu8Q6qp31IiyBMz2TWuJdGsE7RKlY6 +oJO9r4Ak4Ap+58rVyuiFVdw2KuGUaJPHZnJED4AhMmwlxyOAgwrr +-----END CERTIFICATE----- + +# Issuer: CN=TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 O=Turkiye Bilimsel ve Teknolojik Arastirma Kurumu - TUBITAK OU=Kamu Sertifikasyon Merkezi - Kamu SM +# Subject: CN=TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 O=Turkiye Bilimsel ve Teknolojik Arastirma Kurumu - TUBITAK OU=Kamu Sertifikasyon Merkezi - Kamu SM +# Label: "TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1" +# Serial: 1 +# MD5 Fingerprint: dc:00:81:dc:69:2f:3e:2f:b0:3b:f6:3d:5a:91:8e:49 +# SHA1 Fingerprint: 31:43:64:9b:ec:ce:27:ec:ed:3a:3f:0b:8f:0d:e4:e8:91:dd:ee:ca +# SHA256 Fingerprint: 46:ed:c3:68:90:46:d5:3a:45:3f:b3:10:4a:b8:0d:ca:ec:65:8b:26:60:ea:16:29:dd:7e:86:79:90:64:87:16 +-----BEGIN CERTIFICATE----- +MIIEYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQsFADCB0jELMAkGA1UEBhMCVFIx +GDAWBgNVBAcTD0dlYnplIC0gS29jYWVsaTFCMEAGA1UEChM5VHVya2l5ZSBCaWxp +bXNlbCB2ZSBUZWtub2xvamlrIEFyYXN0aXJtYSBLdXJ1bXUgLSBUVUJJVEFLMS0w +KwYDVQQLEyRLYW11IFNlcnRpZmlrYXN5b24gTWVya2V6aSAtIEthbXUgU00xNjA0 +BgNVBAMTLVRVQklUQUsgS2FtdSBTTSBTU0wgS29rIFNlcnRpZmlrYXNpIC0gU3Vy +dW0gMTAeFw0xMzExMjUwODI1NTVaFw00MzEwMjUwODI1NTVaMIHSMQswCQYDVQQG +EwJUUjEYMBYGA1UEBxMPR2ViemUgLSBLb2NhZWxpMUIwQAYDVQQKEzlUdXJraXll +IEJpbGltc2VsIHZlIFRla25vbG9qaWsgQXJhc3Rpcm1hIEt1cnVtdSAtIFRVQklU +QUsxLTArBgNVBAsTJEthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppIC0gS2FtdSBT +TTE2MDQGA1UEAxMtVFVCSVRBSyBLYW11IFNNIFNTTCBLb2sgU2VydGlmaWthc2kg +LSBTdXJ1bSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr3UwM6q7 +a9OZLBI3hNmNe5eA027n/5tQlT6QlVZC1xl8JoSNkvoBHToP4mQ4t4y86Ij5iySr +LqP1N+RAjhgleYN1Hzv/bKjFxlb4tO2KRKOrbEz8HdDc72i9z+SqzvBV96I01INr +N3wcwv61A+xXzry0tcXtAA9TNypN9E8Mg/uGz8v+jE69h/mniyFXnHrfA2eJLJ2X +YacQuFWQfw4tJzh03+f92k4S400VIgLI4OD8D62K18lUUMw7D8oWgITQUVbDjlZ/ +iSIzL+aFCr2lqBs23tPcLG07xxO9WSMs5uWk99gL7eqQQESolbuT1dCANLZGeA4f +AJNG4e7p+exPFwIDAQABo0IwQDAdBgNVHQ4EFgQUZT/HiobGPN08VFw1+DrtUgxH +V8gwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL +BQADggEBACo/4fEyjq7hmFxLXs9rHmoJ0iKpEsdeV31zVmSAhHqT5Am5EM2fKifh +AHe+SMg1qIGf5LgsyX8OsNJLN13qudULXjS99HMpw+0mFZx+CFOKWI3QSyjfwbPf +IPP54+M638yclNhOT8NrF7f3cuitZjO1JVOr4PhMqZ398g26rrnZqsZr+ZO7rqu4 +lzwDGrpDxpa5RXI4s6ehlj2Re37AIVNMh+3yC1SVUZPVIqUNivGTDj5UDrDYyU7c +8jEyVupk+eq1nRZmQnLzf9OxMUP8pI4X8W0jq5Rm+K37DwhuJi1/FwcJsoz7UMCf +lo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM= +-----END CERTIFICATE----- + +# Issuer: CN=GDCA TrustAUTH R5 ROOT O=GUANG DONG CERTIFICATE AUTHORITY CO.,LTD. +# Subject: CN=GDCA TrustAUTH R5 ROOT O=GUANG DONG CERTIFICATE AUTHORITY CO.,LTD. +# Label: "GDCA TrustAUTH R5 ROOT" +# Serial: 9009899650740120186 +# MD5 Fingerprint: 63:cc:d9:3d:34:35:5c:6f:53:a3:e2:08:70:48:1f:b4 +# SHA1 Fingerprint: 0f:36:38:5b:81:1a:25:c3:9b:31:4e:83:ca:e9:34:66:70:cc:74:b4 +# SHA256 Fingerprint: bf:ff:8f:d0:44:33:48:7d:6a:8a:a6:0c:1a:29:76:7a:9f:c2:bb:b0:5e:42:0f:71:3a:13:b9:92:89:1d:38:93 +-----BEGIN CERTIFICATE----- +MIIFiDCCA3CgAwIBAgIIfQmX/vBH6nowDQYJKoZIhvcNAQELBQAwYjELMAkGA1UE +BhMCQ04xMjAwBgNVBAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZ +IENPLixMVEQuMR8wHQYDVQQDDBZHRENBIFRydXN0QVVUSCBSNSBST09UMB4XDTE0 +MTEyNjA1MTMxNVoXDTQwMTIzMTE1NTk1OVowYjELMAkGA1UEBhMCQ04xMjAwBgNV +BAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZIENPLixMVEQuMR8w +HQYDVQQDDBZHRENBIFRydXN0QVVUSCBSNSBST09UMIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEA2aMW8Mh0dHeb7zMNOwZ+Vfy1YI92hhJCfVZmPoiC7XJj +Dp6L3TQsAlFRwxn9WVSEyfFrs0yw6ehGXTjGoqcuEVe6ghWinI9tsJlKCvLriXBj +TnnEt1u9ol2x8kECK62pOqPseQrsXzrj/e+APK00mxqriCZ7VqKChh/rNYmDf1+u +KU49tm7srsHwJ5uu4/Ts765/94Y9cnrrpftZTqfrlYwiOXnhLQiPzLyRuEH3FMEj +qcOtmkVEs7LXLM3GKeJQEK5cy4KOFxg2fZfmiJqwTTQJ9Cy5WmYqsBebnh52nUpm +MUHfP/vFBu8btn4aRjb3ZGM74zkYI+dndRTVdVeSN72+ahsmUPI2JgaQxXABZG12 +ZuGR224HwGGALrIuL4xwp9E7PLOR5G62xDtw8mySlwnNR30YwPO7ng/Wi64HtloP +zgsMR6flPri9fcebNaBhlzpBdRfMK5Z3KpIhHtmVdiBnaM8Nvd/WHwlqmuLMc3Gk +L30SgLdTMEZeS1SZD2fJpcjyIMGC7J0R38IC+xo70e0gmu9lZJIQDSri3nDxGGeC +jGHeuLzRL5z7D9Ar7Rt2ueQ5Vfj4oR24qoAATILnsn8JuLwwoC8N9VKejveSswoA +HQBUlwbgsQfZxw9cZX08bVlX5O2ljelAU58VS6Bx9hoh49pwBiFYFIeFd3mqgnkC +AwEAAaNCMEAwHQYDVR0OBBYEFOLJQJ9NzuiaoXzPDj9lxSmIahlRMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQDRSVfg +p8xoWLoBDysZzY2wYUWsEe1jUGn4H3++Fo/9nesLqjJHdtJnJO29fDMylyrHBYZm +DRd9FBUb1Ov9H5r2XpdptxolpAqzkT9fNqyL7FeoPueBihhXOYV0GkLH6VsTX4/5 +COmSdI31R9KrO9b7eGZONn356ZLpBN79SWP8bfsUcZNnL0dKt7n/HipzcEYwv1ry +L3ml4Y0M2fmyYzeMN2WFcGpcWwlyua1jPLHd+PwyvzeG5LuOmCd+uh8W4XAR8gPf +JWIyJyYYMoSf/wA6E7qaTfRPuBRwIrHKK5DOKcFw9C+df/KQHtZa37dG/OaG+svg +IHZ6uqbL9XzeYqWxi+7egmaKTjowHz+Ay60nugxe19CxVsp3cbK1daFQqUBDF8Io +2c9Si1vIY9RCPqAzekYu9wogRlR+ak8x8YF+QnQ4ZXMn7sZ8uI7XpTrXmKGcjBBV +09tL7ECQ8s1uV9JiDnxXk7Gnbc2dg7sq5+W2O3FYrf3RRbxake5TFW/TRQl1brqQ +XR4EzzffHqhmsYzmIGrv/EhOdJhCrylvLmrH+33RZjEizIYAfmaDDEL0vTSSwxrq +T8p+ck0LcIymSLumoRT2+1hEmRSuqguTaaApJUqlyyvdimYHFngVV3Eb7PVHhPOe +MTd61X8kreS8/f3MboPoDKi3QWwH3b08hpcv0g== +-----END CERTIFICATE----- + +# Issuer: CN=TrustCor RootCert CA-1 O=TrustCor Systems S. de R.L. OU=TrustCor Certificate Authority +# Subject: CN=TrustCor RootCert CA-1 O=TrustCor Systems S. de R.L. OU=TrustCor Certificate Authority +# Label: "TrustCor RootCert CA-1" +# Serial: 15752444095811006489 +# MD5 Fingerprint: 6e:85:f1:dc:1a:00:d3:22:d5:b2:b2:ac:6b:37:05:45 +# SHA1 Fingerprint: ff:bd:cd:e7:82:c8:43:5e:3c:6f:26:86:5c:ca:a8:3a:45:5b:c3:0a +# SHA256 Fingerprint: d4:0e:9c:86:cd:8f:e4:68:c1:77:69:59:f4:9e:a7:74:fa:54:86:84:b6:c4:06:f3:90:92:61:f4:dc:e2:57:5c +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIJANqb7HHzA7AZMA0GCSqGSIb3DQEBCwUAMIGkMQswCQYD +VQQGEwJQQTEPMA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEk +MCIGA1UECgwbVHJ1c3RDb3IgU3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5U +cnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxHzAdBgNVBAMMFlRydXN0Q29y +IFJvb3RDZXJ0IENBLTEwHhcNMTYwMjA0MTIzMjE2WhcNMjkxMjMxMTcyMzE2WjCB +pDELMAkGA1UEBhMCUEExDzANBgNVBAgMBlBhbmFtYTEUMBIGA1UEBwwLUGFuYW1h +IENpdHkxJDAiBgNVBAoMG1RydXN0Q29yIFN5c3RlbXMgUy4gZGUgUi5MLjEnMCUG +A1UECwweVHJ1c3RDb3IgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MR8wHQYDVQQDDBZU +cnVzdENvciBSb290Q2VydCBDQS0xMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAv463leLCJhJrMxnHQFgKq1mqjQCj/IDHUHuO1CAmujIS2CNUSSUQIpid +RtLByZ5OGy4sDjjzGiVoHKZaBeYei0i/mJZ0PmnK6bV4pQa81QBeCQryJ3pS/C3V +seq0iWEk8xoT26nPUu0MJLq5nux+AHT6k61sKZKuUbS701e/s/OojZz0JEsq1pme +9J7+wH5COucLlVPat2gOkEz7cD+PSiyU8ybdY2mplNgQTsVHCJCZGxdNuWxu72CV +EY4hgLW9oHPY0LJ3xEXqWib7ZnZ2+AYfYW0PVcWDtxBWcgYHpfOxGgMFZA6dWorW +hnAbJN7+KIor0Gqw/Hqi3LJ5DotlDwIDAQABo2MwYTAdBgNVHQ4EFgQU7mtJPHo/ +DeOxCbeKyKsZn3MzUOcwHwYDVR0jBBgwFoAU7mtJPHo/DeOxCbeKyKsZn3MzUOcw +DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQAD +ggEBACUY1JGPE+6PHh0RU9otRCkZoB5rMZ5NDp6tPVxBb5UrJKF5mDo4Nvu7Zp5I +/5CQ7z3UuJu0h3U/IJvOcs+hVcFNZKIZBqEHMwwLKeXx6quj7LUKdJDHfXLy11yf +ke+Ri7fc7Waiz45mO7yfOgLgJ90WmMCV1Aqk5IGadZQ1nJBfiDcGrVmVCrDRZ9MZ +yonnMlo2HD6CqFqTvsbQZJG2z9m2GM/bftJlo6bEjhcxwft+dtvTheNYsnd6djts +L1Ac59v2Z3kf9YKVmgenFK+P3CghZwnS1k1aHBkcjndcw5QkPTJrS37UeJSDvjdN +zl/HHk484IkzlQsPpTLWPFp5LBk= +-----END CERTIFICATE----- + +# Issuer: CN=TrustCor RootCert CA-2 O=TrustCor Systems S. de R.L. OU=TrustCor Certificate Authority +# Subject: CN=TrustCor RootCert CA-2 O=TrustCor Systems S. de R.L. OU=TrustCor Certificate Authority +# Label: "TrustCor RootCert CA-2" +# Serial: 2711694510199101698 +# MD5 Fingerprint: a2:e1:f8:18:0b:ba:45:d5:c7:41:2a:bb:37:52:45:64 +# SHA1 Fingerprint: b8:be:6d:cb:56:f1:55:b9:63:d4:12:ca:4e:06:34:c7:94:b2:1c:c0 +# SHA256 Fingerprint: 07:53:e9:40:37:8c:1b:d5:e3:83:6e:39:5d:ae:a5:cb:83:9e:50:46:f1:bd:0e:ae:19:51:cf:10:fe:c7:c9:65 +-----BEGIN CERTIFICATE----- +MIIGLzCCBBegAwIBAgIIJaHfyjPLWQIwDQYJKoZIhvcNAQELBQAwgaQxCzAJBgNV +BAYTAlBBMQ8wDQYDVQQIDAZQYW5hbWExFDASBgNVBAcMC1BhbmFtYSBDaXR5MSQw +IgYDVQQKDBtUcnVzdENvciBTeXN0ZW1zIFMuIGRlIFIuTC4xJzAlBgNVBAsMHlRy +dXN0Q29yIENlcnRpZmljYXRlIEF1dGhvcml0eTEfMB0GA1UEAwwWVHJ1c3RDb3Ig +Um9vdENlcnQgQ0EtMjAeFw0xNjAyMDQxMjMyMjNaFw0zNDEyMzExNzI2MzlaMIGk +MQswCQYDVQQGEwJQQTEPMA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEg +Q2l0eTEkMCIGA1UECgwbVHJ1c3RDb3IgU3lzdGVtcyBTLiBkZSBSLkwuMScwJQYD +VQQLDB5UcnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxHzAdBgNVBAMMFlRy +dXN0Q29yIFJvb3RDZXJ0IENBLTIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK +AoICAQCnIG7CKqJiJJWQdsg4foDSq8GbZQWU9MEKENUCrO2fk8eHyLAnK0IMPQo+ +QVqedd2NyuCb7GgypGmSaIwLgQ5WoD4a3SwlFIIvl9NkRvRUqdw6VC0xK5mC8tkq +1+9xALgxpL56JAfDQiDyitSSBBtlVkxs1Pu2YVpHI7TYabS3OtB0PAx1oYxOdqHp +2yqlO/rOsP9+aij9JxzIsekp8VduZLTQwRVtDr4uDkbIXvRR/u8OYzo7cbrPb1nK +DOObXUm4TOJXsZiKQlecdu/vvdFoqNL0Cbt3Nb4lggjEFixEIFapRBF37120Hape +az6LMvYHL1cEksr1/p3C6eizjkxLAjHZ5DxIgif3GIJ2SDpxsROhOdUuxTTCHWKF +3wP+TfSvPd9cW436cOGlfifHhi5qjxLGhF5DUVCcGZt45vz27Ud+ez1m7xMTiF88 +oWP7+ayHNZ/zgp6kPwqcMWmLmaSISo5uZk3vFsQPeSghYA2FFn3XVDjxklb9tTNM +g9zXEJ9L/cb4Qr26fHMC4P99zVvh1Kxhe1fVSntb1IVYJ12/+CtgrKAmrhQhJ8Z3 +mjOAPF5GP/fDsaOGM8boXg25NSyqRsGFAnWAoOsk+xWq5Gd/bnc/9ASKL3x74xdh +8N0JqSDIvgmk0H5Ew7IwSjiqqewYmgeCK9u4nBit2uBGF6zPXQIDAQABo2MwYTAd +BgNVHQ4EFgQU2f4hQG6UnrybPZx9mCAZ5YwwYrIwHwYDVR0jBBgwFoAU2f4hQG6U +nrybPZx9mCAZ5YwwYrIwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYw +DQYJKoZIhvcNAQELBQADggIBAJ5Fngw7tu/hOsh80QA9z+LqBrWyOrsGS2h60COX +dKcs8AjYeVrXWoSK2BKaG9l9XE1wxaX5q+WjiYndAfrs3fnpkpfbsEZC89NiqpX+ +MWcUaViQCqoL7jcjx1BRtPV+nuN79+TMQjItSQzL/0kMmx40/W5ulop5A7Zv2wnL +/V9lFDfhOPXzYRZY5LVtDQsEGz9QLX+zx3oaFoBg+Iof6Rsqxvm6ARppv9JYx1RX +CI/hOWB3S6xZhBqI8d3LT3jX5+EzLfzuQfogsL7L9ziUwOHQhQ+77Sxzq+3+knYa +ZH9bDTMJBzN7Bj8RpFxwPIXAz+OQqIN3+tvmxYxoZxBnpVIt8MSZj3+/0WvitUfW +2dCFmU2Umw9Lje4AWkcdEQOsQRivh7dvDDqPys/cA8GiCcjl/YBeyGBCARsaU1q7 +N6a3vLqE6R5sGtRk2tRD/pOLS/IseRYQ1JMLiI+h2IYURpFHmygk71dSTlxCnKr3 +Sewn6EAes6aJInKc9Q0ztFijMDvd1GpUk74aTfOTlPf8hAs/hCBcNANExdqtvArB +As8e5ZTZ845b2EzwnexhF7sUMlQMAimTHpKG9n/v55IFDlndmQguLvqcAFLTxWYp +5KeXRKQOKIETNcX2b2TmQcTVL8w0RSXPQQCWPUouwpaYT05KnJe32x+SMsj/D1Fu +1uwJ +-----END CERTIFICATE----- + +# Issuer: CN=TrustCor ECA-1 O=TrustCor Systems S. de R.L. OU=TrustCor Certificate Authority +# Subject: CN=TrustCor ECA-1 O=TrustCor Systems S. de R.L. OU=TrustCor Certificate Authority +# Label: "TrustCor ECA-1" +# Serial: 9548242946988625984 +# MD5 Fingerprint: 27:92:23:1d:0a:f5:40:7c:e9:e6:6b:9d:d8:f5:e7:6c +# SHA1 Fingerprint: 58:d1:df:95:95:67:6b:63:c0:f0:5b:1c:17:4d:8b:84:0b:c8:78:bd +# SHA256 Fingerprint: 5a:88:5d:b1:9c:01:d9:12:c5:75:93:88:93:8c:af:bb:df:03:1a:b2:d4:8e:91:ee:15:58:9b:42:97:1d:03:9c +-----BEGIN CERTIFICATE----- +MIIEIDCCAwigAwIBAgIJAISCLF8cYtBAMA0GCSqGSIb3DQEBCwUAMIGcMQswCQYD +VQQGEwJQQTEPMA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEk +MCIGA1UECgwbVHJ1c3RDb3IgU3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5U +cnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxFzAVBgNVBAMMDlRydXN0Q29y +IEVDQS0xMB4XDTE2MDIwNDEyMzIzM1oXDTI5MTIzMTE3MjgwN1owgZwxCzAJBgNV +BAYTAlBBMQ8wDQYDVQQIDAZQYW5hbWExFDASBgNVBAcMC1BhbmFtYSBDaXR5MSQw +IgYDVQQKDBtUcnVzdENvciBTeXN0ZW1zIFMuIGRlIFIuTC4xJzAlBgNVBAsMHlRy +dXN0Q29yIENlcnRpZmljYXRlIEF1dGhvcml0eTEXMBUGA1UEAwwOVHJ1c3RDb3Ig +RUNBLTEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDPj+ARtZ+odnbb +3w9U73NjKYKtR8aja+3+XzP4Q1HpGjORMRegdMTUpwHmspI+ap3tDvl0mEDTPwOA +BoJA6LHip1GnHYMma6ve+heRK9jGrB6xnhkB1Zem6g23xFUfJ3zSCNV2HykVh0A5 +3ThFEXXQmqc04L/NyFIduUd+Dbi7xgz2c1cWWn5DkR9VOsZtRASqnKmcp0yJF4Ou +owReUoCLHhIlERnXDH19MURB6tuvsBzvgdAsxZohmz3tQjtQJvLsznFhBmIhVE5/ +wZ0+fyCMgMsq2JdiyIMzkX2woloPV+g7zPIlstR8L+xNxqE6FXrntl019fZISjZF +ZtS6mFjBAgMBAAGjYzBhMB0GA1UdDgQWBBREnkj1zG1I1KBLf/5ZJC+Dl5mahjAf +BgNVHSMEGDAWgBREnkj1zG1I1KBLf/5ZJC+Dl5mahjAPBgNVHRMBAf8EBTADAQH/ +MA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAQEABT41XBVwm8nHc2Fv +civUwo/yQ10CzsSUuZQRg2dd4mdsdXa/uwyqNsatR5Nj3B5+1t4u/ukZMjgDfxT2 +AHMsWbEhBuH7rBiVDKP/mZb3Kyeb1STMHd3BOuCYRLDE5D53sXOpZCz2HAF8P11F +hcCF5yWPldwX8zyfGm6wyuMdKulMY/okYWLW2n62HGz1Ah3UKt1VkOsqEUc8Ll50 +soIipX1TH0XsJ5F95yIW6MBoNtjG8U+ARDL54dHRHareqKucBK+tIA5kmE2la8BI +WJZpTdwHjFGTot+fDz2LYLSCjaoITmJF4PkL0uDgPFveXHEnJcLmA4GLEFPjx1Wi +tJ/X5g== +-----END CERTIFICATE----- + +# Issuer: CN=SSL.com Root Certification Authority RSA O=SSL Corporation +# Subject: CN=SSL.com Root Certification Authority RSA O=SSL Corporation +# Label: "SSL.com Root Certification Authority RSA" +# Serial: 8875640296558310041 +# MD5 Fingerprint: 86:69:12:c0:70:f1:ec:ac:ac:c2:d5:bc:a5:5b:a1:29 +# SHA1 Fingerprint: b7:ab:33:08:d1:ea:44:77:ba:14:80:12:5a:6f:bd:a9:36:49:0c:bb +# SHA256 Fingerprint: 85:66:6a:56:2e:e0:be:5c:e9:25:c1:d8:89:0a:6f:76:a8:7e:c1:6d:4d:7d:5f:29:ea:74:19:cf:20:12:3b:69 +-----BEGIN CERTIFICATE----- +MIIF3TCCA8WgAwIBAgIIeyyb0xaAMpkwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UE +BhMCVVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQK +DA9TU0wgQ29ycG9yYXRpb24xMTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eSBSU0EwHhcNMTYwMjEyMTczOTM5WhcNNDEwMjEyMTcz +OTM5WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hv +dXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNv +bSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFJTQTCCAiIwDQYJKoZIhvcN +AQEBBQADggIPADCCAgoCggIBAPkP3aMrfcvQKv7sZ4Wm5y4bunfh4/WvpOz6Sl2R +xFdHaxh3a3by/ZPkPQ/CFp4LZsNWlJ4Xg4XOVu/yFv0AYvUiCVToZRdOQbngT0aX +qhvIuG5iXmmxX9sqAn78bMrzQdjt0Oj8P2FI7bADFB0QDksZ4LtO7IZl/zbzXmcC +C52GVWH9ejjt/uIZALdvoVBidXQ8oPrIJZK0bnoix/geoeOy3ZExqysdBP+lSgQ3 +6YWkMyv94tZVNHwZpEpox7Ko07fKoZOI68GXvIz5HdkihCR0xwQ9aqkpk8zruFvh +/l8lqjRYyMEjVJ0bmBHDOJx+PYZspQ9AhnwC9FwCTyjLrnGfDzrIM/4RJTXq/LrF +YD3ZfBjVsqnTdXgDciLKOsMf7yzlLqn6niy2UUb9rwPW6mBo6oUWNmuF6R7As93E +JNyAKoFBbZQ+yODJgUEAnl6/f8UImKIYLEJAs/lvOCdLToD0PYFH4Ih86hzOtXVc +US4cK38acijnALXRdMbX5J+tB5O2UzU1/Dfkw/ZdFr4hc96SCvigY2q8lpJqPvi8 +ZVWb3vUNiSYE/CUapiVpy8JtynziWV+XrOvvLsi81xtZPCvM8hnIk2snYxnP/Okm ++Mpxm3+T/jRnhE6Z6/yzeAkzcLpmpnbtG3PrGqUNxCITIJRWCk4sbE6x/c+cCbqi +M+2HAgMBAAGjYzBhMB0GA1UdDgQWBBTdBAkHovV6fVJTEpKV7jiAJQ2mWTAPBgNV +HRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFN0ECQei9Xp9UlMSkpXuOIAlDaZZMA4G +A1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAIBgRlCn7Jp0cHh5wYfGV +cpNxJK1ok1iOMq8bs3AD/CUrdIWQPXhq9LmLpZc7tRiRux6n+UBbkflVma8eEdBc +Hadm47GUBwwyOabqG7B52B2ccETjit3E+ZUfijhDPwGFpUenPUayvOUiaPd7nNgs +PgohyC0zrL/FgZkxdMF1ccW+sfAjRfSda/wZY52jvATGGAslu1OJD7OAUN5F7kR/ +q5R4ZJjT9ijdh9hwZXT7DrkT66cPYakylszeu+1jTBi7qUD3oFRuIIhxdRjqerQ0 +cuAjJ3dctpDqhiVAq+8zD8ufgr6iIPv2tS0a5sKFsXQP+8hlAqRSAUfdSSLBv9jr +a6x+3uxjMxW3IwiPxg+NQVrdjsW5j+VFP3jbutIbQLH+cU0/4IGiul607BXgk90I +H37hVZkLId6Tngr75qNJvTYw/ud3sqB1l7UtgYgXZSD32pAAn8lSzDLKNXz1PQ/Y +K9f1JmzJBjSWFupwWRoyeXkLtoh/D1JIPb9s2KJELtFOt3JY04kTlf5Eq/jXixtu +nLwsoFvVagCvXzfh1foQC5ichucmj87w7G6KVwuA406ywKBjYZC6VWg3dGq2ktuf +oYYitmUnDuy2n0Jg5GfCtdpBC8TTi2EbvPofkSvXRAdeuims2cXp71NIWuuA8ShY +Ic2wBlX7Jz9TkHCpBB5XJ7k= +-----END CERTIFICATE----- + +# Issuer: CN=SSL.com Root Certification Authority ECC O=SSL Corporation +# Subject: CN=SSL.com Root Certification Authority ECC O=SSL Corporation +# Label: "SSL.com Root Certification Authority ECC" +# Serial: 8495723813297216424 +# MD5 Fingerprint: 2e:da:e4:39:7f:9c:8f:37:d1:70:9f:26:17:51:3a:8e +# SHA1 Fingerprint: c3:19:7c:39:24:e6:54:af:1b:c4:ab:20:95:7a:e2:c3:0e:13:02:6a +# SHA256 Fingerprint: 34:17:bb:06:cc:60:07:da:1b:96:1c:92:0b:8a:b4:ce:3f:ad:82:0e:4a:a3:0b:9a:cb:c4:a7:4e:bd:ce:bc:65 +-----BEGIN CERTIFICATE----- +MIICjTCCAhSgAwIBAgIIdebfy8FoW6gwCgYIKoZIzj0EAwIwfDELMAkGA1UEBhMC +VVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9T +U0wgQ29ycG9yYXRpb24xMTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZpY2F0 +aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYwMjEyMTgxNDAzWhcNNDEwMjEyMTgxNDAz +WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0 +b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNvbSBS +b290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49AgEGBSuB +BAAiA2IABEVuqVDEpiM2nl8ojRfLliJkP9x6jh3MCLOicSS6jkm5BBtHllirLZXI +7Z4INcgn64mMU1jrYor+8FsPazFSY0E7ic3s7LaNGdM0B9y7xgZ/wkWV7Mt/qCPg +CemB+vNH06NjMGEwHQYDVR0OBBYEFILRhXMw5zUE044CkvvlpNHEIejNMA8GA1Ud +EwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUgtGFczDnNQTTjgKS++Wk0cQh6M0wDgYD +VR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2cAMGQCMG/n61kRpGDPYbCWe+0F+S8T +kdzt5fxQaxFGRrMcIQBiu77D5+jNB5n5DQtdcj7EqgIwH7y6C+IwJPt8bYBVCpk+ +gA0z5Wajs6O7pdWLjwkspl1+4vAHCGht0nxpbl/f5Wpl +-----END CERTIFICATE----- + +# Issuer: CN=SSL.com EV Root Certification Authority RSA R2 O=SSL Corporation +# Subject: CN=SSL.com EV Root Certification Authority RSA R2 O=SSL Corporation +# Label: "SSL.com EV Root Certification Authority RSA R2" +# Serial: 6248227494352943350 +# MD5 Fingerprint: e1:1e:31:58:1a:ae:54:53:02:f6:17:6a:11:7b:4d:95 +# SHA1 Fingerprint: 74:3a:f0:52:9b:d0:32:a0:f4:4a:83:cd:d4:ba:a9:7b:7c:2e:c4:9a +# SHA256 Fingerprint: 2e:7b:f1:6c:c2:24:85:a7:bb:e2:aa:86:96:75:07:61:b0:ae:39:be:3b:2f:e9:d0:cc:6d:4e:f7:34:91:42:5c +-----BEGIN CERTIFICATE----- +MIIF6zCCA9OgAwIBAgIIVrYpzTS8ePYwDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNV +BAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjEYMBYGA1UE +CgwPU1NMIENvcnBvcmF0aW9uMTcwNQYDVQQDDC5TU0wuY29tIEVWIFJvb3QgQ2Vy +dGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIyMB4XDTE3MDUzMTE4MTQzN1oXDTQy +MDUzMDE4MTQzN1owgYIxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4G +A1UEBwwHSG91c3RvbjEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMTcwNQYDVQQD +DC5TU0wuY29tIEVWIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIy +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAjzZlQOHWTcDXtOlG2mvq +M0fNTPl9fb69LT3w23jhhqXZuglXaO1XPqDQCEGD5yhBJB/jchXQARr7XnAjssuf +OePPxU7Gkm0mxnu7s9onnQqG6YE3Bf7wcXHswxzpY6IXFJ3vG2fThVUCAtZJycxa +4bH3bzKfydQ7iEGonL3Lq9ttewkfokxykNorCPzPPFTOZw+oz12WGQvE43LrrdF9 +HSfvkusQv1vrO6/PgN3B0pYEW3p+pKk8OHakYo6gOV7qd89dAFmPZiw+B6KjBSYR +aZfqhbcPlgtLyEDhULouisv3D5oi53+aNxPN8k0TayHRwMwi8qFG9kRpnMphNQcA +b9ZhCBHqurj26bNg5U257J8UZslXWNvNh2n4ioYSA0e/ZhN2rHd9NCSFg83XqpyQ +Gp8hLH94t2S42Oim9HizVcuE0jLEeK6jj2HdzghTreyI/BXkmg3mnxp3zkyPuBQV +PWKchjgGAGYS5Fl2WlPAApiiECtoRHuOec4zSnaqW4EWG7WK2NAAe15itAnWhmMO +pgWVSbooi4iTsjQc2KRVbrcc0N6ZVTsj9CLg+SlmJuwgUHfbSguPvuUCYHBBXtSu +UDkiFCbLsjtzdFVHB3mBOagwE0TlBIqulhMlQg+5U8Sb/M3kHN48+qvWBkofZ6aY +MBzdLNvcGJVXZsb/XItW9XcCAwEAAaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAfBgNV +HSMEGDAWgBT5YLvU49U09rj1BoAlp3PbRmmonjAdBgNVHQ4EFgQU+WC71OPVNPa4 +9QaAJadz20ZpqJ4wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBW +s47LCp1Jjr+kxJG7ZhcFUZh1++VQLHqe8RT6q9OKPv+RKY9ji9i0qVQBDb6Thi/5 +Sm3HXvVX+cpVHBK+Rw82xd9qt9t1wkclf7nxY/hoLVUE0fKNsKTPvDxeH3jnpaAg +cLAExbf3cqfeIg29MyVGjGSSJuM+LmOW2puMPfgYCdcDzH2GguDKBAdRUNf/ktUM +79qGn5nX67evaOI5JpS6aLe/g9Pqemc9YmeuJeVy6OLk7K4S9ksrPJ/psEDzOFSz +/bdoyNrGj1E8svuR3Bznm53htw1yj+KkxKl4+esUrMZDBcJlOSgYAsOCsp0FvmXt +ll9ldDz7CTUue5wT/RsPXcdtgTpWD8w74a8CLyKsRspGPKAcTNZEtF4uXBVmCeEm +Kf7GUmG6sXP/wwyc5WxqlD8UykAWlYTzWamsX0xhk23RO8yilQwipmdnRC652dKK +QbNmC1r7fSOl8hqw/96bg5Qu0T/fkreRrwU7ZcegbLHNYhLDkBvjJc40vG93drEQ +w/cFGsDWr3RiSBd3kmmQYRzelYB0VI8YHMPzA9C/pEN1hlMYegouCRw2n5H9gooi +S9EOUCXdywMMF8mDAAhONU2Ki+3wApRmLER/y5UnlhetCTCstnEXbosX9hwJ1C07 +mKVx01QT2WDz9UtmT/rx7iASjbSsV7FFY6GsdqnC+w== +-----END CERTIFICATE----- + +# Issuer: CN=SSL.com EV Root Certification Authority ECC O=SSL Corporation +# Subject: CN=SSL.com EV Root Certification Authority ECC O=SSL Corporation +# Label: "SSL.com EV Root Certification Authority ECC" +# Serial: 3182246526754555285 +# MD5 Fingerprint: 59:53:22:65:83:42:01:54:c0:ce:42:b9:5a:7c:f2:90 +# SHA1 Fingerprint: 4c:dd:51:a3:d1:f5:20:32:14:b0:c6:c5:32:23:03:91:c7:46:42:6d +# SHA256 Fingerprint: 22:a2:c1:f7:bd:ed:70:4c:c1:e7:01:b5:f4:08:c3:10:88:0f:e9:56:b5:de:2a:4a:44:f9:9c:87:3a:25:a7:c8 +-----BEGIN CERTIFICATE----- +MIIClDCCAhqgAwIBAgIILCmcWxbtBZUwCgYIKoZIzj0EAwIwfzELMAkGA1UEBhMC +VVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9T +U0wgQ29ycG9yYXRpb24xNDAyBgNVBAMMK1NTTC5jb20gRVYgUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYwMjEyMTgxNTIzWhcNNDEwMjEyMTgx +NTIzWjB/MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hv +dXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjE0MDIGA1UEAwwrU1NMLmNv +bSBFViBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49 +AgEGBSuBBAAiA2IABKoSR5CYG/vvw0AHgyBO8TCCogbR8pKGYfL2IWjKAMTH6kMA +VIbc/R/fALhBYlzccBYy3h+Z1MzFB8gIH2EWB1E9fVwHU+M1OIzfzZ/ZLg1Kthku +WnBaBu2+8KGwytAJKaNjMGEwHQYDVR0OBBYEFFvKXuXe0oGqzagtZFG22XKbl+ZP +MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUW8pe5d7SgarNqC1kUbbZcpuX +5k8wDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2gAMGUCMQCK5kCJN+vp1RPZ +ytRrJPOwPYdGWBrssd9v+1a6cGvHOMzosYxPD/fxZ3YOg9AeUY8CMD32IygmTMZg +h5Mmm7I1HrrW9zzRHM76JTymGoEVW/MSD2zuZYrJh6j5B+BimoxcSg== +-----END CERTIFICATE----- diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/certifi/core.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/certifi/core.py new file mode 100644 index 0000000000000000000000000000000000000000..eab9d1d178dc29a7ab0dd304084e130fb8a82969 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/certifi/core.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +certifi.py +~~~~~~~~~~ + +This module returns the installation location of cacert.pem. +""" +import os +import warnings + + +class DeprecatedBundleWarning(DeprecationWarning): + """ + The weak security bundle is being deprecated. Please bother your service + provider to get them to stop using cross-signed roots. + """ + + +def where(): + f = os.path.dirname(__file__) + + return os.path.join(f, 'cacert.pem') + + +def old_where(): + warnings.warn( + "The weak security bundle has been removed. certifi.old_where() is now an alias " + "of certifi.where(). Please update your code to use certifi.where() instead. " + "certifi.old_where() will be removed in 2018.", + DeprecatedBundleWarning + ) + return where() + +if __name__ == '__main__': + print(where()) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e810380105527fca9d46b518ef3be83d0ae818b6 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/__init__.py @@ -0,0 +1,39 @@ +######################## BEGIN LICENSE BLOCK ######################## +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +__version__ = "3.0.4" +from .compat import PY2, PY3 +from .universaldetector import UniversalDetector +from .version import __version__, VERSION + + +def detect(byte_str): + """ + Detect the encoding of the given byte string. + + :param byte_str: The byte sequence to examine. + :type byte_str: ``bytes`` or ``bytearray`` + """ + if not isinstance(byte_str, bytearray): + if not isinstance(byte_str, bytes): + raise TypeError('Expected object of type bytes or bytearray, got: ' + '{0}'.format(type(byte_str))) + else: + byte_str = bytearray(byte_str) + detector = UniversalDetector() + detector.feed(byte_str) + return detector.close() diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/big5freq.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/big5freq.py new file mode 100644 index 0000000000000000000000000000000000000000..38f32517aa8f6cf5970f7ceddd1a415289184c3e --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/big5freq.py @@ -0,0 +1,386 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Communicator client code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +# Big5 frequency table +# by Taiwan's Mandarin Promotion Council +# +# +# 128 --> 0.42261 +# 256 --> 0.57851 +# 512 --> 0.74851 +# 1024 --> 0.89384 +# 2048 --> 0.97583 +# +# Ideal Distribution Ratio = 0.74851/(1-0.74851) =2.98 +# Random Distribution Ration = 512/(5401-512)=0.105 +# +# Typical Distribution Ratio about 25% of Ideal one, still much higher than RDR + +BIG5_TYPICAL_DISTRIBUTION_RATIO = 0.75 + +#Char to FreqOrder table +BIG5_TABLE_SIZE = 5376 + +BIG5_CHAR_TO_FREQ_ORDER = ( + 1,1801,1506, 255,1431, 198, 9, 82, 6,5008, 177, 202,3681,1256,2821, 110, # 16 +3814, 33,3274, 261, 76, 44,2114, 16,2946,2187,1176, 659,3971, 26,3451,2653, # 32 +1198,3972,3350,4202, 410,2215, 302, 590, 361,1964, 8, 204, 58,4510,5009,1932, # 48 + 63,5010,5011, 317,1614, 75, 222, 159,4203,2417,1480,5012,3555,3091, 224,2822, # 64 +3682, 3, 10,3973,1471, 29,2787,1135,2866,1940, 873, 130,3275,1123, 312,5013, # 80 +4511,2052, 507, 252, 682,5014, 142,1915, 124, 206,2947, 34,3556,3204, 64, 604, # 96 +5015,2501,1977,1978, 155,1991, 645, 641,1606,5016,3452, 337, 72, 406,5017, 80, # 112 + 630, 238,3205,1509, 263, 939,1092,2654, 756,1440,1094,3453, 449, 69,2987, 591, # 128 + 179,2096, 471, 115,2035,1844, 60, 50,2988, 134, 806,1869, 734,2036,3454, 180, # 144 + 995,1607, 156, 537,2907, 688,5018, 319,1305, 779,2145, 514,2379, 298,4512, 359, # 160 +2502, 90,2716,1338, 663, 11, 906,1099,2553, 20,2441, 182, 532,1716,5019, 732, # 176 +1376,4204,1311,1420,3206, 25,2317,1056, 113, 399, 382,1950, 242,3455,2474, 529, # 192 +3276, 475,1447,3683,5020, 117, 21, 656, 810,1297,2300,2334,3557,5021, 126,4205, # 208 + 706, 456, 150, 613,4513, 71,1118,2037,4206, 145,3092, 85, 835, 486,2115,1246, # 224 +1426, 428, 727,1285,1015, 800, 106, 623, 303,1281,5022,2128,2359, 347,3815, 221, # 240 +3558,3135,5023,1956,1153,4207, 83, 296,1199,3093, 192, 624, 93,5024, 822,1898, # 256 +2823,3136, 795,2065, 991,1554,1542,1592, 27, 43,2867, 859, 139,1456, 860,4514, # 272 + 437, 712,3974, 164,2397,3137, 695, 211,3037,2097, 195,3975,1608,3559,3560,3684, # 288 +3976, 234, 811,2989,2098,3977,2233,1441,3561,1615,2380, 668,2077,1638, 305, 228, # 304 +1664,4515, 467, 415,5025, 262,2099,1593, 239, 108, 300, 200,1033, 512,1247,2078, # 320 +5026,5027,2176,3207,3685,2682, 593, 845,1062,3277, 88,1723,2038,3978,1951, 212, # 336 + 266, 152, 149, 468,1899,4208,4516, 77, 187,5028,3038, 37, 5,2990,5029,3979, # 352 +5030,5031, 39,2524,4517,2908,3208,2079, 55, 148, 74,4518, 545, 483,1474,1029, # 368 +1665, 217,1870,1531,3138,1104,2655,4209, 24, 172,3562, 900,3980,3563,3564,4519, # 384 + 32,1408,2824,1312, 329, 487,2360,2251,2717, 784,2683, 4,3039,3351,1427,1789, # 400 + 188, 109, 499,5032,3686,1717,1790, 888,1217,3040,4520,5033,3565,5034,3352,1520, # 416 +3687,3981, 196,1034, 775,5035,5036, 929,1816, 249, 439, 38,5037,1063,5038, 794, # 432 +3982,1435,2301, 46, 178,3278,2066,5039,2381,5040, 214,1709,4521, 804, 35, 707, # 448 + 324,3688,1601,2554, 140, 459,4210,5041,5042,1365, 839, 272, 978,2262,2580,3456, # 464 +2129,1363,3689,1423, 697, 100,3094, 48, 70,1231, 495,3139,2196,5043,1294,5044, # 480 +2080, 462, 586,1042,3279, 853, 256, 988, 185,2382,3457,1698, 434,1084,5045,3458, # 496 + 314,2625,2788,4522,2335,2336, 569,2285, 637,1817,2525, 757,1162,1879,1616,3459, # 512 + 287,1577,2116, 768,4523,1671,2868,3566,2526,1321,3816, 909,2418,5046,4211, 933, # 528 +3817,4212,2053,2361,1222,4524, 765,2419,1322, 786,4525,5047,1920,1462,1677,2909, # 544 +1699,5048,4526,1424,2442,3140,3690,2600,3353,1775,1941,3460,3983,4213, 309,1369, # 560 +1130,2825, 364,2234,1653,1299,3984,3567,3985,3986,2656, 525,1085,3041, 902,2001, # 576 +1475, 964,4527, 421,1845,1415,1057,2286, 940,1364,3141, 376,4528,4529,1381, 7, # 592 +2527, 983,2383, 336,1710,2684,1846, 321,3461, 559,1131,3042,2752,1809,1132,1313, # 608 + 265,1481,1858,5049, 352,1203,2826,3280, 167,1089, 420,2827, 776, 792,1724,3568, # 624 +4214,2443,3281,5050,4215,5051, 446, 229, 333,2753, 901,3818,1200,1557,4530,2657, # 640 +1921, 395,2754,2685,3819,4216,1836, 125, 916,3209,2626,4531,5052,5053,3820,5054, # 656 +5055,5056,4532,3142,3691,1133,2555,1757,3462,1510,2318,1409,3569,5057,2146, 438, # 672 +2601,2910,2384,3354,1068, 958,3043, 461, 311,2869,2686,4217,1916,3210,4218,1979, # 688 + 383, 750,2755,2627,4219, 274, 539, 385,1278,1442,5058,1154,1965, 384, 561, 210, # 704 + 98,1295,2556,3570,5059,1711,2420,1482,3463,3987,2911,1257, 129,5060,3821, 642, # 720 + 523,2789,2790,2658,5061, 141,2235,1333, 68, 176, 441, 876, 907,4220, 603,2602, # 736 + 710, 171,3464, 404, 549, 18,3143,2398,1410,3692,1666,5062,3571,4533,2912,4534, # 752 +5063,2991, 368,5064, 146, 366, 99, 871,3693,1543, 748, 807,1586,1185, 22,2263, # 768 + 379,3822,3211,5065,3212, 505,1942,2628,1992,1382,2319,5066, 380,2362, 218, 702, # 784 +1818,1248,3465,3044,3572,3355,3282,5067,2992,3694, 930,3283,3823,5068, 59,5069, # 800 + 585, 601,4221, 497,3466,1112,1314,4535,1802,5070,1223,1472,2177,5071, 749,1837, # 816 + 690,1900,3824,1773,3988,1476, 429,1043,1791,2236,2117, 917,4222, 447,1086,1629, # 832 +5072, 556,5073,5074,2021,1654, 844,1090, 105, 550, 966,1758,2828,1008,1783, 686, # 848 +1095,5075,2287, 793,1602,5076,3573,2603,4536,4223,2948,2302,4537,3825, 980,2503, # 864 + 544, 353, 527,4538, 908,2687,2913,5077, 381,2629,1943,1348,5078,1341,1252, 560, # 880 +3095,5079,3467,2870,5080,2054, 973, 886,2081, 143,4539,5081,5082, 157,3989, 496, # 896 +4224, 57, 840, 540,2039,4540,4541,3468,2118,1445, 970,2264,1748,1966,2082,4225, # 912 +3144,1234,1776,3284,2829,3695, 773,1206,2130,1066,2040,1326,3990,1738,1725,4226, # 928 + 279,3145, 51,1544,2604, 423,1578,2131,2067, 173,4542,1880,5083,5084,1583, 264, # 944 + 610,3696,4543,2444, 280, 154,5085,5086,5087,1739, 338,1282,3096, 693,2871,1411, # 960 +1074,3826,2445,5088,4544,5089,5090,1240, 952,2399,5091,2914,1538,2688, 685,1483, # 976 +4227,2475,1436, 953,4228,2055,4545, 671,2400, 79,4229,2446,3285, 608, 567,2689, # 992 +3469,4230,4231,1691, 393,1261,1792,2401,5092,4546,5093,5094,5095,5096,1383,1672, # 1008 +3827,3213,1464, 522,1119, 661,1150, 216, 675,4547,3991,1432,3574, 609,4548,2690, # 1024 +2402,5097,5098,5099,4232,3045, 0,5100,2476, 315, 231,2447, 301,3356,4549,2385, # 1040 +5101, 233,4233,3697,1819,4550,4551,5102, 96,1777,1315,2083,5103, 257,5104,1810, # 1056 +3698,2718,1139,1820,4234,2022,1124,2164,2791,1778,2659,5105,3097, 363,1655,3214, # 1072 +5106,2993,5107,5108,5109,3992,1567,3993, 718, 103,3215, 849,1443, 341,3357,2949, # 1088 +1484,5110,1712, 127, 67, 339,4235,2403, 679,1412, 821,5111,5112, 834, 738, 351, # 1104 +2994,2147, 846, 235,1497,1881, 418,1993,3828,2719, 186,1100,2148,2756,3575,1545, # 1120 +1355,2950,2872,1377, 583,3994,4236,2581,2995,5113,1298,3699,1078,2557,3700,2363, # 1136 + 78,3829,3830, 267,1289,2100,2002,1594,4237, 348, 369,1274,2197,2178,1838,4552, # 1152 +1821,2830,3701,2757,2288,2003,4553,2951,2758, 144,3358, 882,4554,3995,2759,3470, # 1168 +4555,2915,5114,4238,1726, 320,5115,3996,3046, 788,2996,5116,2831,1774,1327,2873, # 1184 +3997,2832,5117,1306,4556,2004,1700,3831,3576,2364,2660, 787,2023, 506, 824,3702, # 1200 + 534, 323,4557,1044,3359,2024,1901, 946,3471,5118,1779,1500,1678,5119,1882,4558, # 1216 + 165, 243,4559,3703,2528, 123, 683,4239, 764,4560, 36,3998,1793, 589,2916, 816, # 1232 + 626,1667,3047,2237,1639,1555,1622,3832,3999,5120,4000,2874,1370,1228,1933, 891, # 1248 +2084,2917, 304,4240,5121, 292,2997,2720,3577, 691,2101,4241,1115,4561, 118, 662, # 1264 +5122, 611,1156, 854,2386,1316,2875, 2, 386, 515,2918,5123,5124,3286, 868,2238, # 1280 +1486, 855,2661, 785,2216,3048,5125,1040,3216,3578,5126,3146, 448,5127,1525,5128, # 1296 +2165,4562,5129,3833,5130,4242,2833,3579,3147, 503, 818,4001,3148,1568, 814, 676, # 1312 +1444, 306,1749,5131,3834,1416,1030, 197,1428, 805,2834,1501,4563,5132,5133,5134, # 1328 +1994,5135,4564,5136,5137,2198, 13,2792,3704,2998,3149,1229,1917,5138,3835,2132, # 1344 +5139,4243,4565,2404,3580,5140,2217,1511,1727,1120,5141,5142, 646,3836,2448, 307, # 1360 +5143,5144,1595,3217,5145,5146,5147,3705,1113,1356,4002,1465,2529,2530,5148, 519, # 1376 +5149, 128,2133, 92,2289,1980,5150,4003,1512, 342,3150,2199,5151,2793,2218,1981, # 1392 +3360,4244, 290,1656,1317, 789, 827,2365,5152,3837,4566, 562, 581,4004,5153, 401, # 1408 +4567,2252, 94,4568,5154,1399,2794,5155,1463,2025,4569,3218,1944,5156, 828,1105, # 1424 +4245,1262,1394,5157,4246, 605,4570,5158,1784,2876,5159,2835, 819,2102, 578,2200, # 1440 +2952,5160,1502, 436,3287,4247,3288,2836,4005,2919,3472,3473,5161,2721,2320,5162, # 1456 +5163,2337,2068, 23,4571, 193, 826,3838,2103, 699,1630,4248,3098, 390,1794,1064, # 1472 +3581,5164,1579,3099,3100,1400,5165,4249,1839,1640,2877,5166,4572,4573, 137,4250, # 1488 + 598,3101,1967, 780, 104, 974,2953,5167, 278, 899, 253, 402, 572, 504, 493,1339, # 1504 +5168,4006,1275,4574,2582,2558,5169,3706,3049,3102,2253, 565,1334,2722, 863, 41, # 1520 +5170,5171,4575,5172,1657,2338, 19, 463,2760,4251, 606,5173,2999,3289,1087,2085, # 1536 +1323,2662,3000,5174,1631,1623,1750,4252,2691,5175,2878, 791,2723,2663,2339, 232, # 1552 +2421,5176,3001,1498,5177,2664,2630, 755,1366,3707,3290,3151,2026,1609, 119,1918, # 1568 +3474, 862,1026,4253,5178,4007,3839,4576,4008,4577,2265,1952,2477,5179,1125, 817, # 1584 +4254,4255,4009,1513,1766,2041,1487,4256,3050,3291,2837,3840,3152,5180,5181,1507, # 1600 +5182,2692, 733, 40,1632,1106,2879, 345,4257, 841,2531, 230,4578,3002,1847,3292, # 1616 +3475,5183,1263, 986,3476,5184, 735, 879, 254,1137, 857, 622,1300,1180,1388,1562, # 1632 +4010,4011,2954, 967,2761,2665,1349, 592,2134,1692,3361,3003,1995,4258,1679,4012, # 1648 +1902,2188,5185, 739,3708,2724,1296,1290,5186,4259,2201,2202,1922,1563,2605,2559, # 1664 +1871,2762,3004,5187, 435,5188, 343,1108, 596, 17,1751,4579,2239,3477,3709,5189, # 1680 +4580, 294,3582,2955,1693, 477, 979, 281,2042,3583, 643,2043,3710,2631,2795,2266, # 1696 +1031,2340,2135,2303,3584,4581, 367,1249,2560,5190,3585,5191,4582,1283,3362,2005, # 1712 + 240,1762,3363,4583,4584, 836,1069,3153, 474,5192,2149,2532, 268,3586,5193,3219, # 1728 +1521,1284,5194,1658,1546,4260,5195,3587,3588,5196,4261,3364,2693,1685,4262, 961, # 1744 +1673,2632, 190,2006,2203,3841,4585,4586,5197, 570,2504,3711,1490,5198,4587,2633, # 1760 +3293,1957,4588, 584,1514, 396,1045,1945,5199,4589,1968,2449,5200,5201,4590,4013, # 1776 + 619,5202,3154,3294, 215,2007,2796,2561,3220,4591,3221,4592, 763,4263,3842,4593, # 1792 +5203,5204,1958,1767,2956,3365,3712,1174, 452,1477,4594,3366,3155,5205,2838,1253, # 1808 +2387,2189,1091,2290,4264, 492,5206, 638,1169,1825,2136,1752,4014, 648, 926,1021, # 1824 +1324,4595, 520,4596, 997, 847,1007, 892,4597,3843,2267,1872,3713,2405,1785,4598, # 1840 +1953,2957,3103,3222,1728,4265,2044,3714,4599,2008,1701,3156,1551, 30,2268,4266, # 1856 +5207,2027,4600,3589,5208, 501,5209,4267, 594,3478,2166,1822,3590,3479,3591,3223, # 1872 + 829,2839,4268,5210,1680,3157,1225,4269,5211,3295,4601,4270,3158,2341,5212,4602, # 1888 +4271,5213,4015,4016,5214,1848,2388,2606,3367,5215,4603, 374,4017, 652,4272,4273, # 1904 + 375,1140, 798,5216,5217,5218,2366,4604,2269, 546,1659, 138,3051,2450,4605,5219, # 1920 +2254, 612,1849, 910, 796,3844,1740,1371, 825,3845,3846,5220,2920,2562,5221, 692, # 1936 + 444,3052,2634, 801,4606,4274,5222,1491, 244,1053,3053,4275,4276, 340,5223,4018, # 1952 +1041,3005, 293,1168, 87,1357,5224,1539, 959,5225,2240, 721, 694,4277,3847, 219, # 1968 +1478, 644,1417,3368,2666,1413,1401,1335,1389,4019,5226,5227,3006,2367,3159,1826, # 1984 + 730,1515, 184,2840, 66,4607,5228,1660,2958, 246,3369, 378,1457, 226,3480, 975, # 2000 +4020,2959,1264,3592, 674, 696,5229, 163,5230,1141,2422,2167, 713,3593,3370,4608, # 2016 +4021,5231,5232,1186, 15,5233,1079,1070,5234,1522,3224,3594, 276,1050,2725, 758, # 2032 +1126, 653,2960,3296,5235,2342, 889,3595,4022,3104,3007, 903,1250,4609,4023,3481, # 2048 +3596,1342,1681,1718, 766,3297, 286, 89,2961,3715,5236,1713,5237,2607,3371,3008, # 2064 +5238,2962,2219,3225,2880,5239,4610,2505,2533, 181, 387,1075,4024, 731,2190,3372, # 2080 +5240,3298, 310, 313,3482,2304, 770,4278, 54,3054, 189,4611,3105,3848,4025,5241, # 2096 +1230,1617,1850, 355,3597,4279,4612,3373, 111,4280,3716,1350,3160,3483,3055,4281, # 2112 +2150,3299,3598,5242,2797,4026,4027,3009, 722,2009,5243,1071, 247,1207,2343,2478, # 2128 +1378,4613,2010, 864,1437,1214,4614, 373,3849,1142,2220, 667,4615, 442,2763,2563, # 2144 +3850,4028,1969,4282,3300,1840, 837, 170,1107, 934,1336,1883,5244,5245,2119,4283, # 2160 +2841, 743,1569,5246,4616,4284, 582,2389,1418,3484,5247,1803,5248, 357,1395,1729, # 2176 +3717,3301,2423,1564,2241,5249,3106,3851,1633,4617,1114,2086,4285,1532,5250, 482, # 2192 +2451,4618,5251,5252,1492, 833,1466,5253,2726,3599,1641,2842,5254,1526,1272,3718, # 2208 +4286,1686,1795, 416,2564,1903,1954,1804,5255,3852,2798,3853,1159,2321,5256,2881, # 2224 +4619,1610,1584,3056,2424,2764, 443,3302,1163,3161,5257,5258,4029,5259,4287,2506, # 2240 +3057,4620,4030,3162,2104,1647,3600,2011,1873,4288,5260,4289, 431,3485,5261, 250, # 2256 + 97, 81,4290,5262,1648,1851,1558, 160, 848,5263, 866, 740,1694,5264,2204,2843, # 2272 +3226,4291,4621,3719,1687, 950,2479, 426, 469,3227,3720,3721,4031,5265,5266,1188, # 2288 + 424,1996, 861,3601,4292,3854,2205,2694, 168,1235,3602,4293,5267,2087,1674,4622, # 2304 +3374,3303, 220,2565,1009,5268,3855, 670,3010, 332,1208, 717,5269,5270,3603,2452, # 2320 +4032,3375,5271, 513,5272,1209,2882,3376,3163,4623,1080,5273,5274,5275,5276,2534, # 2336 +3722,3604, 815,1587,4033,4034,5277,3605,3486,3856,1254,4624,1328,3058,1390,4035, # 2352 +1741,4036,3857,4037,5278, 236,3858,2453,3304,5279,5280,3723,3859,1273,3860,4625, # 2368 +5281, 308,5282,4626, 245,4627,1852,2480,1307,2583, 430, 715,2137,2454,5283, 270, # 2384 + 199,2883,4038,5284,3606,2727,1753, 761,1754, 725,1661,1841,4628,3487,3724,5285, # 2400 +5286, 587, 14,3305, 227,2608, 326, 480,2270, 943,2765,3607, 291, 650,1884,5287, # 2416 +1702,1226, 102,1547, 62,3488, 904,4629,3489,1164,4294,5288,5289,1224,1548,2766, # 2432 + 391, 498,1493,5290,1386,1419,5291,2056,1177,4630, 813, 880,1081,2368, 566,1145, # 2448 +4631,2291,1001,1035,2566,2609,2242, 394,1286,5292,5293,2069,5294, 86,1494,1730, # 2464 +4039, 491,1588, 745, 897,2963, 843,3377,4040,2767,2884,3306,1768, 998,2221,2070, # 2480 + 397,1827,1195,1970,3725,3011,3378, 284,5295,3861,2507,2138,2120,1904,5296,4041, # 2496 +2151,4042,4295,1036,3490,1905, 114,2567,4296, 209,1527,5297,5298,2964,2844,2635, # 2512 +2390,2728,3164, 812,2568,5299,3307,5300,1559, 737,1885,3726,1210, 885, 28,2695, # 2528 +3608,3862,5301,4297,1004,1780,4632,5302, 346,1982,2222,2696,4633,3863,1742, 797, # 2544 +1642,4043,1934,1072,1384,2152, 896,4044,3308,3727,3228,2885,3609,5303,2569,1959, # 2560 +4634,2455,1786,5304,5305,5306,4045,4298,1005,1308,3728,4299,2729,4635,4636,1528, # 2576 +2610, 161,1178,4300,1983, 987,4637,1101,4301, 631,4046,1157,3229,2425,1343,1241, # 2592 +1016,2243,2570, 372, 877,2344,2508,1160, 555,1935, 911,4047,5307, 466,1170, 169, # 2608 +1051,2921,2697,3729,2481,3012,1182,2012,2571,1251,2636,5308, 992,2345,3491,1540, # 2624 +2730,1201,2071,2406,1997,2482,5309,4638, 528,1923,2191,1503,1874,1570,2369,3379, # 2640 +3309,5310, 557,1073,5311,1828,3492,2088,2271,3165,3059,3107, 767,3108,2799,4639, # 2656 +1006,4302,4640,2346,1267,2179,3730,3230, 778,4048,3231,2731,1597,2667,5312,4641, # 2672 +5313,3493,5314,5315,5316,3310,2698,1433,3311, 131, 95,1504,4049, 723,4303,3166, # 2688 +1842,3610,2768,2192,4050,2028,2105,3731,5317,3013,4051,1218,5318,3380,3232,4052, # 2704 +4304,2584, 248,1634,3864, 912,5319,2845,3732,3060,3865, 654, 53,5320,3014,5321, # 2720 +1688,4642, 777,3494,1032,4053,1425,5322, 191, 820,2121,2846, 971,4643, 931,3233, # 2736 + 135, 664, 783,3866,1998, 772,2922,1936,4054,3867,4644,2923,3234, 282,2732, 640, # 2752 +1372,3495,1127, 922, 325,3381,5323,5324, 711,2045,5325,5326,4055,2223,2800,1937, # 2768 +4056,3382,2224,2255,3868,2305,5327,4645,3869,1258,3312,4057,3235,2139,2965,4058, # 2784 +4059,5328,2225, 258,3236,4646, 101,1227,5329,3313,1755,5330,1391,3314,5331,2924, # 2800 +2057, 893,5332,5333,5334,1402,4305,2347,5335,5336,3237,3611,5337,5338, 878,1325, # 2816 +1781,2801,4647, 259,1385,2585, 744,1183,2272,4648,5339,4060,2509,5340, 684,1024, # 2832 +4306,5341, 472,3612,3496,1165,3315,4061,4062, 322,2153, 881, 455,1695,1152,1340, # 2848 + 660, 554,2154,4649,1058,4650,4307, 830,1065,3383,4063,4651,1924,5342,1703,1919, # 2864 +5343, 932,2273, 122,5344,4652, 947, 677,5345,3870,2637, 297,1906,1925,2274,4653, # 2880 +2322,3316,5346,5347,4308,5348,4309, 84,4310, 112, 989,5349, 547,1059,4064, 701, # 2896 +3613,1019,5350,4311,5351,3497, 942, 639, 457,2306,2456, 993,2966, 407, 851, 494, # 2912 +4654,3384, 927,5352,1237,5353,2426,3385, 573,4312, 680, 921,2925,1279,1875, 285, # 2928 + 790,1448,1984, 719,2168,5354,5355,4655,4065,4066,1649,5356,1541, 563,5357,1077, # 2944 +5358,3386,3061,3498, 511,3015,4067,4068,3733,4069,1268,2572,3387,3238,4656,4657, # 2960 +5359, 535,1048,1276,1189,2926,2029,3167,1438,1373,2847,2967,1134,2013,5360,4313, # 2976 +1238,2586,3109,1259,5361, 700,5362,2968,3168,3734,4314,5363,4315,1146,1876,1907, # 2992 +4658,2611,4070, 781,2427, 132,1589, 203, 147, 273,2802,2407, 898,1787,2155,4071, # 3008 +4072,5364,3871,2803,5365,5366,4659,4660,5367,3239,5368,1635,3872, 965,5369,1805, # 3024 +2699,1516,3614,1121,1082,1329,3317,4073,1449,3873, 65,1128,2848,2927,2769,1590, # 3040 +3874,5370,5371, 12,2668, 45, 976,2587,3169,4661, 517,2535,1013,1037,3240,5372, # 3056 +3875,2849,5373,3876,5374,3499,5375,2612, 614,1999,2323,3877,3110,2733,2638,5376, # 3072 +2588,4316, 599,1269,5377,1811,3735,5378,2700,3111, 759,1060, 489,1806,3388,3318, # 3088 +1358,5379,5380,2391,1387,1215,2639,2256, 490,5381,5382,4317,1759,2392,2348,5383, # 3104 +4662,3878,1908,4074,2640,1807,3241,4663,3500,3319,2770,2349, 874,5384,5385,3501, # 3120 +3736,1859, 91,2928,3737,3062,3879,4664,5386,3170,4075,2669,5387,3502,1202,1403, # 3136 +3880,2969,2536,1517,2510,4665,3503,2511,5388,4666,5389,2701,1886,1495,1731,4076, # 3152 +2370,4667,5390,2030,5391,5392,4077,2702,1216, 237,2589,4318,2324,4078,3881,4668, # 3168 +4669,2703,3615,3504, 445,4670,5393,5394,5395,5396,2771, 61,4079,3738,1823,4080, # 3184 +5397, 687,2046, 935, 925, 405,2670, 703,1096,1860,2734,4671,4081,1877,1367,2704, # 3200 +3389, 918,2106,1782,2483, 334,3320,1611,1093,4672, 564,3171,3505,3739,3390, 945, # 3216 +2641,2058,4673,5398,1926, 872,4319,5399,3506,2705,3112, 349,4320,3740,4082,4674, # 3232 +3882,4321,3741,2156,4083,4675,4676,4322,4677,2408,2047, 782,4084, 400, 251,4323, # 3248 +1624,5400,5401, 277,3742, 299,1265, 476,1191,3883,2122,4324,4325,1109, 205,5402, # 3264 +2590,1000,2157,3616,1861,5403,5404,5405,4678,5406,4679,2573, 107,2484,2158,4085, # 3280 +3507,3172,5407,1533, 541,1301, 158, 753,4326,2886,3617,5408,1696, 370,1088,4327, # 3296 +4680,3618, 579, 327, 440, 162,2244, 269,1938,1374,3508, 968,3063, 56,1396,3113, # 3312 +2107,3321,3391,5409,1927,2159,4681,3016,5410,3619,5411,5412,3743,4682,2485,5413, # 3328 +2804,5414,1650,4683,5415,2613,5416,5417,4086,2671,3392,1149,3393,4087,3884,4088, # 3344 +5418,1076, 49,5419, 951,3242,3322,3323, 450,2850, 920,5420,1812,2805,2371,4328, # 3360 +1909,1138,2372,3885,3509,5421,3243,4684,1910,1147,1518,2428,4685,3886,5422,4686, # 3376 +2393,2614, 260,1796,3244,5423,5424,3887,3324, 708,5425,3620,1704,5426,3621,1351, # 3392 +1618,3394,3017,1887, 944,4329,3395,4330,3064,3396,4331,5427,3744, 422, 413,1714, # 3408 +3325, 500,2059,2350,4332,2486,5428,1344,1911, 954,5429,1668,5430,5431,4089,2409, # 3424 +4333,3622,3888,4334,5432,2307,1318,2512,3114, 133,3115,2887,4687, 629, 31,2851, # 3440 +2706,3889,4688, 850, 949,4689,4090,2970,1732,2089,4335,1496,1853,5433,4091, 620, # 3456 +3245, 981,1242,3745,3397,1619,3746,1643,3326,2140,2457,1971,1719,3510,2169,5434, # 3472 +3246,5435,5436,3398,1829,5437,1277,4690,1565,2048,5438,1636,3623,3116,5439, 869, # 3488 +2852, 655,3890,3891,3117,4092,3018,3892,1310,3624,4691,5440,5441,5442,1733, 558, # 3504 +4692,3747, 335,1549,3065,1756,4336,3748,1946,3511,1830,1291,1192, 470,2735,2108, # 3520 +2806, 913,1054,4093,5443,1027,5444,3066,4094,4693, 982,2672,3399,3173,3512,3247, # 3536 +3248,1947,2807,5445, 571,4694,5446,1831,5447,3625,2591,1523,2429,5448,2090, 984, # 3552 +4695,3749,1960,5449,3750, 852, 923,2808,3513,3751, 969,1519, 999,2049,2325,1705, # 3568 +5450,3118, 615,1662, 151, 597,4095,2410,2326,1049, 275,4696,3752,4337, 568,3753, # 3584 +3626,2487,4338,3754,5451,2430,2275, 409,3249,5452,1566,2888,3514,1002, 769,2853, # 3600 + 194,2091,3174,3755,2226,3327,4339, 628,1505,5453,5454,1763,2180,3019,4096, 521, # 3616 +1161,2592,1788,2206,2411,4697,4097,1625,4340,4341, 412, 42,3119, 464,5455,2642, # 3632 +4698,3400,1760,1571,2889,3515,2537,1219,2207,3893,2643,2141,2373,4699,4700,3328, # 3648 +1651,3401,3627,5456,5457,3628,2488,3516,5458,3756,5459,5460,2276,2092, 460,5461, # 3664 +4701,5462,3020, 962, 588,3629, 289,3250,2644,1116, 52,5463,3067,1797,5464,5465, # 3680 +5466,1467,5467,1598,1143,3757,4342,1985,1734,1067,4702,1280,3402, 465,4703,1572, # 3696 + 510,5468,1928,2245,1813,1644,3630,5469,4704,3758,5470,5471,2673,1573,1534,5472, # 3712 +5473, 536,1808,1761,3517,3894,3175,2645,5474,5475,5476,4705,3518,2929,1912,2809, # 3728 +5477,3329,1122, 377,3251,5478, 360,5479,5480,4343,1529, 551,5481,2060,3759,1769, # 3744 +2431,5482,2930,4344,3330,3120,2327,2109,2031,4706,1404, 136,1468,1479, 672,1171, # 3760 +3252,2308, 271,3176,5483,2772,5484,2050, 678,2736, 865,1948,4707,5485,2014,4098, # 3776 +2971,5486,2737,2227,1397,3068,3760,4708,4709,1735,2931,3403,3631,5487,3895, 509, # 3792 +2854,2458,2890,3896,5488,5489,3177,3178,4710,4345,2538,4711,2309,1166,1010, 552, # 3808 + 681,1888,5490,5491,2972,2973,4099,1287,1596,1862,3179, 358, 453, 736, 175, 478, # 3824 +1117, 905,1167,1097,5492,1854,1530,5493,1706,5494,2181,3519,2292,3761,3520,3632, # 3840 +4346,2093,4347,5495,3404,1193,2489,4348,1458,2193,2208,1863,1889,1421,3331,2932, # 3856 +3069,2182,3521, 595,2123,5496,4100,5497,5498,4349,1707,2646, 223,3762,1359, 751, # 3872 +3121, 183,3522,5499,2810,3021, 419,2374, 633, 704,3897,2394, 241,5500,5501,5502, # 3888 + 838,3022,3763,2277,2773,2459,3898,1939,2051,4101,1309,3122,2246,1181,5503,1136, # 3904 +2209,3899,2375,1446,4350,2310,4712,5504,5505,4351,1055,2615, 484,3764,5506,4102, # 3920 + 625,4352,2278,3405,1499,4353,4103,5507,4104,4354,3253,2279,2280,3523,5508,5509, # 3936 +2774, 808,2616,3765,3406,4105,4355,3123,2539, 526,3407,3900,4356, 955,5510,1620, # 3952 +4357,2647,2432,5511,1429,3766,1669,1832, 994, 928,5512,3633,1260,5513,5514,5515, # 3968 +1949,2293, 741,2933,1626,4358,2738,2460, 867,1184, 362,3408,1392,5516,5517,4106, # 3984 +4359,1770,1736,3254,2934,4713,4714,1929,2707,1459,1158,5518,3070,3409,2891,1292, # 4000 +1930,2513,2855,3767,1986,1187,2072,2015,2617,4360,5519,2574,2514,2170,3768,2490, # 4016 +3332,5520,3769,4715,5521,5522, 666,1003,3023,1022,3634,4361,5523,4716,1814,2257, # 4032 + 574,3901,1603, 295,1535, 705,3902,4362, 283, 858, 417,5524,5525,3255,4717,4718, # 4048 +3071,1220,1890,1046,2281,2461,4107,1393,1599, 689,2575, 388,4363,5526,2491, 802, # 4064 +5527,2811,3903,2061,1405,2258,5528,4719,3904,2110,1052,1345,3256,1585,5529, 809, # 4080 +5530,5531,5532, 575,2739,3524, 956,1552,1469,1144,2328,5533,2329,1560,2462,3635, # 4096 +3257,4108, 616,2210,4364,3180,2183,2294,5534,1833,5535,3525,4720,5536,1319,3770, # 4112 +3771,1211,3636,1023,3258,1293,2812,5537,5538,5539,3905, 607,2311,3906, 762,2892, # 4128 +1439,4365,1360,4721,1485,3072,5540,4722,1038,4366,1450,2062,2648,4367,1379,4723, # 4144 +2593,5541,5542,4368,1352,1414,2330,2935,1172,5543,5544,3907,3908,4724,1798,1451, # 4160 +5545,5546,5547,5548,2936,4109,4110,2492,2351, 411,4111,4112,3637,3333,3124,4725, # 4176 +1561,2674,1452,4113,1375,5549,5550, 47,2974, 316,5551,1406,1591,2937,3181,5552, # 4192 +1025,2142,3125,3182, 354,2740, 884,2228,4369,2412, 508,3772, 726,3638, 996,2433, # 4208 +3639, 729,5553, 392,2194,1453,4114,4726,3773,5554,5555,2463,3640,2618,1675,2813, # 4224 + 919,2352,2975,2353,1270,4727,4115, 73,5556,5557, 647,5558,3259,2856,2259,1550, # 4240 +1346,3024,5559,1332, 883,3526,5560,5561,5562,5563,3334,2775,5564,1212, 831,1347, # 4256 +4370,4728,2331,3909,1864,3073, 720,3910,4729,4730,3911,5565,4371,5566,5567,4731, # 4272 +5568,5569,1799,4732,3774,2619,4733,3641,1645,2376,4734,5570,2938, 669,2211,2675, # 4288 +2434,5571,2893,5572,5573,1028,3260,5574,4372,2413,5575,2260,1353,5576,5577,4735, # 4304 +3183, 518,5578,4116,5579,4373,1961,5580,2143,4374,5581,5582,3025,2354,2355,3912, # 4320 + 516,1834,1454,4117,2708,4375,4736,2229,2620,1972,1129,3642,5583,2776,5584,2976, # 4336 +1422, 577,1470,3026,1524,3410,5585,5586, 432,4376,3074,3527,5587,2594,1455,2515, # 4352 +2230,1973,1175,5588,1020,2741,4118,3528,4737,5589,2742,5590,1743,1361,3075,3529, # 4368 +2649,4119,4377,4738,2295, 895, 924,4378,2171, 331,2247,3076, 166,1627,3077,1098, # 4384 +5591,1232,2894,2231,3411,4739, 657, 403,1196,2377, 542,3775,3412,1600,4379,3530, # 4400 +5592,4740,2777,3261, 576, 530,1362,4741,4742,2540,2676,3776,4120,5593, 842,3913, # 4416 +5594,2814,2032,1014,4121, 213,2709,3413, 665, 621,4380,5595,3777,2939,2435,5596, # 4432 +2436,3335,3643,3414,4743,4381,2541,4382,4744,3644,1682,4383,3531,1380,5597, 724, # 4448 +2282, 600,1670,5598,1337,1233,4745,3126,2248,5599,1621,4746,5600, 651,4384,5601, # 4464 +1612,4385,2621,5602,2857,5603,2743,2312,3078,5604, 716,2464,3079, 174,1255,2710, # 4480 +4122,3645, 548,1320,1398, 728,4123,1574,5605,1891,1197,3080,4124,5606,3081,3082, # 4496 +3778,3646,3779, 747,5607, 635,4386,4747,5608,5609,5610,4387,5611,5612,4748,5613, # 4512 +3415,4749,2437, 451,5614,3780,2542,2073,4388,2744,4389,4125,5615,1764,4750,5616, # 4528 +4390, 350,4751,2283,2395,2493,5617,4391,4126,2249,1434,4127, 488,4752, 458,4392, # 4544 +4128,3781, 771,1330,2396,3914,2576,3184,2160,2414,1553,2677,3185,4393,5618,2494, # 4560 +2895,2622,1720,2711,4394,3416,4753,5619,2543,4395,5620,3262,4396,2778,5621,2016, # 4576 +2745,5622,1155,1017,3782,3915,5623,3336,2313, 201,1865,4397,1430,5624,4129,5625, # 4592 +5626,5627,5628,5629,4398,1604,5630, 414,1866, 371,2595,4754,4755,3532,2017,3127, # 4608 +4756,1708, 960,4399, 887, 389,2172,1536,1663,1721,5631,2232,4130,2356,2940,1580, # 4624 +5632,5633,1744,4757,2544,4758,4759,5634,4760,5635,2074,5636,4761,3647,3417,2896, # 4640 +4400,5637,4401,2650,3418,2815, 673,2712,2465, 709,3533,4131,3648,4402,5638,1148, # 4656 + 502, 634,5639,5640,1204,4762,3649,1575,4763,2623,3783,5641,3784,3128, 948,3263, # 4672 + 121,1745,3916,1110,5642,4403,3083,2516,3027,4132,3785,1151,1771,3917,1488,4133, # 4688 +1987,5643,2438,3534,5644,5645,2094,5646,4404,3918,1213,1407,2816, 531,2746,2545, # 4704 +3264,1011,1537,4764,2779,4405,3129,1061,5647,3786,3787,1867,2897,5648,2018, 120, # 4720 +4406,4407,2063,3650,3265,2314,3919,2678,3419,1955,4765,4134,5649,3535,1047,2713, # 4736 +1266,5650,1368,4766,2858, 649,3420,3920,2546,2747,1102,2859,2679,5651,5652,2000, # 4752 +5653,1111,3651,2977,5654,2495,3921,3652,2817,1855,3421,3788,5655,5656,3422,2415, # 4768 +2898,3337,3266,3653,5657,2577,5658,3654,2818,4135,1460, 856,5659,3655,5660,2899, # 4784 +2978,5661,2900,3922,5662,4408, 632,2517, 875,3923,1697,3924,2296,5663,5664,4767, # 4800 +3028,1239, 580,4768,4409,5665, 914, 936,2075,1190,4136,1039,2124,5666,5667,5668, # 4816 +5669,3423,1473,5670,1354,4410,3925,4769,2173,3084,4137, 915,3338,4411,4412,3339, # 4832 +1605,1835,5671,2748, 398,3656,4413,3926,4138, 328,1913,2860,4139,3927,1331,4414, # 4848 +3029, 937,4415,5672,3657,4140,4141,3424,2161,4770,3425, 524, 742, 538,3085,1012, # 4864 +5673,5674,3928,2466,5675, 658,1103, 225,3929,5676,5677,4771,5678,4772,5679,3267, # 4880 +1243,5680,4142, 963,2250,4773,5681,2714,3658,3186,5682,5683,2596,2332,5684,4774, # 4896 +5685,5686,5687,3536, 957,3426,2547,2033,1931,2941,2467, 870,2019,3659,1746,2780, # 4912 +2781,2439,2468,5688,3930,5689,3789,3130,3790,3537,3427,3791,5690,1179,3086,5691, # 4928 +3187,2378,4416,3792,2548,3188,3131,2749,4143,5692,3428,1556,2549,2297, 977,2901, # 4944 +2034,4144,1205,3429,5693,1765,3430,3189,2125,1271, 714,1689,4775,3538,5694,2333, # 4960 +3931, 533,4417,3660,2184, 617,5695,2469,3340,3539,2315,5696,5697,3190,5698,5699, # 4976 +3932,1988, 618, 427,2651,3540,3431,5700,5701,1244,1690,5702,2819,4418,4776,5703, # 4992 +3541,4777,5704,2284,1576, 473,3661,4419,3432, 972,5705,3662,5706,3087,5707,5708, # 5008 +4778,4779,5709,3793,4145,4146,5710, 153,4780, 356,5711,1892,2902,4420,2144, 408, # 5024 + 803,2357,5712,3933,5713,4421,1646,2578,2518,4781,4782,3934,5714,3935,4422,5715, # 5040 +2416,3433, 752,5716,5717,1962,3341,2979,5718, 746,3030,2470,4783,4423,3794, 698, # 5056 +4784,1893,4424,3663,2550,4785,3664,3936,5719,3191,3434,5720,1824,1302,4147,2715, # 5072 +3937,1974,4425,5721,4426,3192, 823,1303,1288,1236,2861,3542,4148,3435, 774,3938, # 5088 +5722,1581,4786,1304,2862,3939,4787,5723,2440,2162,1083,3268,4427,4149,4428, 344, # 5104 +1173, 288,2316, 454,1683,5724,5725,1461,4788,4150,2597,5726,5727,4789, 985, 894, # 5120 +5728,3436,3193,5729,1914,2942,3795,1989,5730,2111,1975,5731,4151,5732,2579,1194, # 5136 + 425,5733,4790,3194,1245,3796,4429,5734,5735,2863,5736, 636,4791,1856,3940, 760, # 5152 +1800,5737,4430,2212,1508,4792,4152,1894,1684,2298,5738,5739,4793,4431,4432,2213, # 5168 + 479,5740,5741, 832,5742,4153,2496,5743,2980,2497,3797, 990,3132, 627,1815,2652, # 5184 +4433,1582,4434,2126,2112,3543,4794,5744, 799,4435,3195,5745,4795,2113,1737,3031, # 5200 +1018, 543, 754,4436,3342,1676,4796,4797,4154,4798,1489,5746,3544,5747,2624,2903, # 5216 +4155,5748,5749,2981,5750,5751,5752,5753,3196,4799,4800,2185,1722,5754,3269,3270, # 5232 +1843,3665,1715, 481, 365,1976,1857,5755,5756,1963,2498,4801,5757,2127,3666,3271, # 5248 + 433,1895,2064,2076,5758, 602,2750,5759,5760,5761,5762,5763,3032,1628,3437,5764, # 5264 +3197,4802,4156,2904,4803,2519,5765,2551,2782,5766,5767,5768,3343,4804,2905,5769, # 5280 +4805,5770,2864,4806,4807,1221,2982,4157,2520,5771,5772,5773,1868,1990,5774,5775, # 5296 +5776,1896,5777,5778,4808,1897,4158, 318,5779,2095,4159,4437,5780,5781, 485,5782, # 5312 + 938,3941, 553,2680, 116,5783,3942,3667,5784,3545,2681,2783,3438,3344,2820,5785, # 5328 +3668,2943,4160,1747,2944,2983,5786,5787, 207,5788,4809,5789,4810,2521,5790,3033, # 5344 + 890,3669,3943,5791,1878,3798,3439,5792,2186,2358,3440,1652,5793,5794,5795, 941, # 5360 +2299, 208,3546,4161,2020, 330,4438,3944,2906,2499,3799,4439,4811,5796,5797,5798, # 5376 +) + diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/big5prober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/big5prober.py new file mode 100644 index 0000000000000000000000000000000000000000..98f9970122088c14a5830e091ca8a12fc8e4c563 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/big5prober.py @@ -0,0 +1,47 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Communicator client code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .mbcharsetprober import MultiByteCharSetProber +from .codingstatemachine import CodingStateMachine +from .chardistribution import Big5DistributionAnalysis +from .mbcssm import BIG5_SM_MODEL + + +class Big5Prober(MultiByteCharSetProber): + def __init__(self): + super(Big5Prober, self).__init__() + self.coding_sm = CodingStateMachine(BIG5_SM_MODEL) + self.distribution_analyzer = Big5DistributionAnalysis() + self.reset() + + @property + def charset_name(self): + return "Big5" + + @property + def language(self): + return "Chinese" diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/chardistribution.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/chardistribution.py new file mode 100644 index 0000000000000000000000000000000000000000..c0395f4a45aaa5c4ba1824a81d8ef8f69b46dc60 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/chardistribution.py @@ -0,0 +1,233 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Communicator client code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .euctwfreq import (EUCTW_CHAR_TO_FREQ_ORDER, EUCTW_TABLE_SIZE, + EUCTW_TYPICAL_DISTRIBUTION_RATIO) +from .euckrfreq import (EUCKR_CHAR_TO_FREQ_ORDER, EUCKR_TABLE_SIZE, + EUCKR_TYPICAL_DISTRIBUTION_RATIO) +from .gb2312freq import (GB2312_CHAR_TO_FREQ_ORDER, GB2312_TABLE_SIZE, + GB2312_TYPICAL_DISTRIBUTION_RATIO) +from .big5freq import (BIG5_CHAR_TO_FREQ_ORDER, BIG5_TABLE_SIZE, + BIG5_TYPICAL_DISTRIBUTION_RATIO) +from .jisfreq import (JIS_CHAR_TO_FREQ_ORDER, JIS_TABLE_SIZE, + JIS_TYPICAL_DISTRIBUTION_RATIO) + + +class CharDistributionAnalysis(object): + ENOUGH_DATA_THRESHOLD = 1024 + SURE_YES = 0.99 + SURE_NO = 0.01 + MINIMUM_DATA_THRESHOLD = 3 + + def __init__(self): + # Mapping table to get frequency order from char order (get from + # GetOrder()) + self._char_to_freq_order = None + self._table_size = None # Size of above table + # This is a constant value which varies from language to language, + # used in calculating confidence. See + # http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html + # for further detail. + self.typical_distribution_ratio = None + self._done = None + self._total_chars = None + self._freq_chars = None + self.reset() + + def reset(self): + """reset analyser, clear any state""" + # If this flag is set to True, detection is done and conclusion has + # been made + self._done = False + self._total_chars = 0 # Total characters encountered + # The number of characters whose frequency order is less than 512 + self._freq_chars = 0 + + def feed(self, char, char_len): + """feed a character with known length""" + if char_len == 2: + # we only care about 2-bytes character in our distribution analysis + order = self.get_order(char) + else: + order = -1 + if order >= 0: + self._total_chars += 1 + # order is valid + if order < self._table_size: + if 512 > self._char_to_freq_order[order]: + self._freq_chars += 1 + + def get_confidence(self): + """return confidence based on existing data""" + # if we didn't receive any character in our consideration range, + # return negative answer + if self._total_chars <= 0 or self._freq_chars <= self.MINIMUM_DATA_THRESHOLD: + return self.SURE_NO + + if self._total_chars != self._freq_chars: + r = (self._freq_chars / ((self._total_chars - self._freq_chars) + * self.typical_distribution_ratio)) + if r < self.SURE_YES: + return r + + # normalize confidence (we don't want to be 100% sure) + return self.SURE_YES + + def got_enough_data(self): + # It is not necessary to receive all data to draw conclusion. + # For charset detection, certain amount of data is enough + return self._total_chars > self.ENOUGH_DATA_THRESHOLD + + def get_order(self, byte_str): + # We do not handle characters based on the original encoding string, + # but convert this encoding string to a number, here called order. + # This allows multiple encodings of a language to share one frequency + # table. + return -1 + + +class EUCTWDistributionAnalysis(CharDistributionAnalysis): + def __init__(self): + super(EUCTWDistributionAnalysis, self).__init__() + self._char_to_freq_order = EUCTW_CHAR_TO_FREQ_ORDER + self._table_size = EUCTW_TABLE_SIZE + self.typical_distribution_ratio = EUCTW_TYPICAL_DISTRIBUTION_RATIO + + def get_order(self, byte_str): + # for euc-TW encoding, we are interested + # first byte range: 0xc4 -- 0xfe + # second byte range: 0xa1 -- 0xfe + # no validation needed here. State machine has done that + first_char = byte_str[0] + if first_char >= 0xC4: + return 94 * (first_char - 0xC4) + byte_str[1] - 0xA1 + else: + return -1 + + +class EUCKRDistributionAnalysis(CharDistributionAnalysis): + def __init__(self): + super(EUCKRDistributionAnalysis, self).__init__() + self._char_to_freq_order = EUCKR_CHAR_TO_FREQ_ORDER + self._table_size = EUCKR_TABLE_SIZE + self.typical_distribution_ratio = EUCKR_TYPICAL_DISTRIBUTION_RATIO + + def get_order(self, byte_str): + # for euc-KR encoding, we are interested + # first byte range: 0xb0 -- 0xfe + # second byte range: 0xa1 -- 0xfe + # no validation needed here. State machine has done that + first_char = byte_str[0] + if first_char >= 0xB0: + return 94 * (first_char - 0xB0) + byte_str[1] - 0xA1 + else: + return -1 + + +class GB2312DistributionAnalysis(CharDistributionAnalysis): + def __init__(self): + super(GB2312DistributionAnalysis, self).__init__() + self._char_to_freq_order = GB2312_CHAR_TO_FREQ_ORDER + self._table_size = GB2312_TABLE_SIZE + self.typical_distribution_ratio = GB2312_TYPICAL_DISTRIBUTION_RATIO + + def get_order(self, byte_str): + # for GB2312 encoding, we are interested + # first byte range: 0xb0 -- 0xfe + # second byte range: 0xa1 -- 0xfe + # no validation needed here. State machine has done that + first_char, second_char = byte_str[0], byte_str[1] + if (first_char >= 0xB0) and (second_char >= 0xA1): + return 94 * (first_char - 0xB0) + second_char - 0xA1 + else: + return -1 + + +class Big5DistributionAnalysis(CharDistributionAnalysis): + def __init__(self): + super(Big5DistributionAnalysis, self).__init__() + self._char_to_freq_order = BIG5_CHAR_TO_FREQ_ORDER + self._table_size = BIG5_TABLE_SIZE + self.typical_distribution_ratio = BIG5_TYPICAL_DISTRIBUTION_RATIO + + def get_order(self, byte_str): + # for big5 encoding, we are interested + # first byte range: 0xa4 -- 0xfe + # second byte range: 0x40 -- 0x7e , 0xa1 -- 0xfe + # no validation needed here. State machine has done that + first_char, second_char = byte_str[0], byte_str[1] + if first_char >= 0xA4: + if second_char >= 0xA1: + return 157 * (first_char - 0xA4) + second_char - 0xA1 + 63 + else: + return 157 * (first_char - 0xA4) + second_char - 0x40 + else: + return -1 + + +class SJISDistributionAnalysis(CharDistributionAnalysis): + def __init__(self): + super(SJISDistributionAnalysis, self).__init__() + self._char_to_freq_order = JIS_CHAR_TO_FREQ_ORDER + self._table_size = JIS_TABLE_SIZE + self.typical_distribution_ratio = JIS_TYPICAL_DISTRIBUTION_RATIO + + def get_order(self, byte_str): + # for sjis encoding, we are interested + # first byte range: 0x81 -- 0x9f , 0xe0 -- 0xfe + # second byte range: 0x40 -- 0x7e, 0x81 -- oxfe + # no validation needed here. State machine has done that + first_char, second_char = byte_str[0], byte_str[1] + if (first_char >= 0x81) and (first_char <= 0x9F): + order = 188 * (first_char - 0x81) + elif (first_char >= 0xE0) and (first_char <= 0xEF): + order = 188 * (first_char - 0xE0 + 31) + else: + return -1 + order = order + second_char - 0x40 + if second_char > 0x7F: + order = -1 + return order + + +class EUCJPDistributionAnalysis(CharDistributionAnalysis): + def __init__(self): + super(EUCJPDistributionAnalysis, self).__init__() + self._char_to_freq_order = JIS_CHAR_TO_FREQ_ORDER + self._table_size = JIS_TABLE_SIZE + self.typical_distribution_ratio = JIS_TYPICAL_DISTRIBUTION_RATIO + + def get_order(self, byte_str): + # for euc-JP encoding, we are interested + # first byte range: 0xa0 -- 0xfe + # second byte range: 0xa1 -- 0xfe + # no validation needed here. State machine has done that + char = byte_str[0] + if char >= 0xA0: + return 94 * (char - 0xA1) + byte_str[1] - 0xa1 + else: + return -1 diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/charsetgroupprober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/charsetgroupprober.py new file mode 100644 index 0000000000000000000000000000000000000000..8b3738efd8ea1e42d196d381d2809beae7f4c649 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/charsetgroupprober.py @@ -0,0 +1,106 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Communicator client code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .enums import ProbingState +from .charsetprober import CharSetProber + + +class CharSetGroupProber(CharSetProber): + def __init__(self, lang_filter=None): + super(CharSetGroupProber, self).__init__(lang_filter=lang_filter) + self._active_num = 0 + self.probers = [] + self._best_guess_prober = None + + def reset(self): + super(CharSetGroupProber, self).reset() + self._active_num = 0 + for prober in self.probers: + if prober: + prober.reset() + prober.active = True + self._active_num += 1 + self._best_guess_prober = None + + @property + def charset_name(self): + if not self._best_guess_prober: + self.get_confidence() + if not self._best_guess_prober: + return None + return self._best_guess_prober.charset_name + + @property + def language(self): + if not self._best_guess_prober: + self.get_confidence() + if not self._best_guess_prober: + return None + return self._best_guess_prober.language + + def feed(self, byte_str): + for prober in self.probers: + if not prober: + continue + if not prober.active: + continue + state = prober.feed(byte_str) + if not state: + continue + if state == ProbingState.FOUND_IT: + self._best_guess_prober = prober + return self.state + elif state == ProbingState.NOT_ME: + prober.active = False + self._active_num -= 1 + if self._active_num <= 0: + self._state = ProbingState.NOT_ME + return self.state + return self.state + + def get_confidence(self): + state = self.state + if state == ProbingState.FOUND_IT: + return 0.99 + elif state == ProbingState.NOT_ME: + return 0.01 + best_conf = 0.0 + self._best_guess_prober = None + for prober in self.probers: + if not prober: + continue + if not prober.active: + self.logger.debug('%s not active', prober.charset_name) + continue + conf = prober.get_confidence() + self.logger.debug('%s %s confidence = %s', prober.charset_name, prober.language, conf) + if best_conf < conf: + best_conf = conf + self._best_guess_prober = prober + if not self._best_guess_prober: + return 0.0 + return best_conf diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/charsetprober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/charsetprober.py new file mode 100644 index 0000000000000000000000000000000000000000..eac4e5986578636ad414648e6015e8b7e9f10432 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/charsetprober.py @@ -0,0 +1,145 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Universal charset detector code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 2001 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# Shy Shalom - original C code +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +import logging +import re + +from .enums import ProbingState + + +class CharSetProber(object): + + SHORTCUT_THRESHOLD = 0.95 + + def __init__(self, lang_filter=None): + self._state = None + self.lang_filter = lang_filter + self.logger = logging.getLogger(__name__) + + def reset(self): + self._state = ProbingState.DETECTING + + @property + def charset_name(self): + return None + + def feed(self, buf): + pass + + @property + def state(self): + return self._state + + def get_confidence(self): + return 0.0 + + @staticmethod + def filter_high_byte_only(buf): + buf = re.sub(b'([\x00-\x7F])+', b' ', buf) + return buf + + @staticmethod + def filter_international_words(buf): + """ + We define three types of bytes: + alphabet: english alphabets [a-zA-Z] + international: international characters [\x80-\xFF] + marker: everything else [^a-zA-Z\x80-\xFF] + + The input buffer can be thought to contain a series of words delimited + by markers. This function works to filter all words that contain at + least one international character. All contiguous sequences of markers + are replaced by a single space ascii character. + + This filter applies to all scripts which do not use English characters. + """ + filtered = bytearray() + + # This regex expression filters out only words that have at-least one + # international character. The word may include one marker character at + # the end. + words = re.findall(b'[a-zA-Z]*[\x80-\xFF]+[a-zA-Z]*[^a-zA-Z\x80-\xFF]?', + buf) + + for word in words: + filtered.extend(word[:-1]) + + # If the last character in the word is a marker, replace it with a + # space as markers shouldn't affect our analysis (they are used + # similarly across all languages and may thus have similar + # frequencies). + last_char = word[-1:] + if not last_char.isalpha() and last_char < b'\x80': + last_char = b' ' + filtered.extend(last_char) + + return filtered + + @staticmethod + def filter_with_english_letters(buf): + """ + Returns a copy of ``buf`` that retains only the sequences of English + alphabet and high byte characters that are not between <> characters. + Also retains English alphabet and high byte characters immediately + before occurrences of >. + + This filter can be applied to all scripts which contain both English + characters and extended ASCII characters, but is currently only used by + ``Latin1Prober``. + """ + filtered = bytearray() + in_tag = False + prev = 0 + + for curr in range(len(buf)): + # Slice here to get bytes instead of an int with Python 3 + buf_char = buf[curr:curr + 1] + # Check if we're coming out of or entering an HTML tag + if buf_char == b'>': + in_tag = False + elif buf_char == b'<': + in_tag = True + + # If current character is not extended-ASCII and not alphabetic... + if buf_char < b'\x80' and not buf_char.isalpha(): + # ...and we're not in a tag + if curr > prev and not in_tag: + # Keep everything after last non-extended-ASCII, + # non-alphabetic character + filtered.extend(buf[prev:curr]) + # Output a space to delimit stretch we kept + filtered.extend(b' ') + prev = curr + 1 + + # If we're not in a tag... + if not in_tag: + # Keep everything after last non-extended-ASCII, non-alphabetic + # character + filtered.extend(buf[prev:]) + + return filtered diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/cli/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/cli/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/cli/__init__.py @@ -0,0 +1 @@ + diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/cli/chardetect.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/cli/chardetect.py new file mode 100644 index 0000000000000000000000000000000000000000..f0a4cc5d79f2b42486631f96558a47093dd6298e --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/cli/chardetect.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python +""" +Script which takes one or more file paths and reports on their detected +encodings + +Example:: + + % chardetect somefile someotherfile + somefile: windows-1252 with confidence 0.5 + someotherfile: ascii with confidence 1.0 + +If no paths are provided, it takes its input from stdin. + +""" + +from __future__ import absolute_import, print_function, unicode_literals + +import argparse +import sys + +from chardet import __version__ +from chardet.compat import PY2 +from chardet.universaldetector import UniversalDetector + + +def description_of(lines, name='stdin'): + """ + Return a string describing the probable encoding of a file or + list of strings. + + :param lines: The lines to get the encoding of. + :type lines: Iterable of bytes + :param name: Name of file or collection of lines + :type name: str + """ + u = UniversalDetector() + for line in lines: + line = bytearray(line) + u.feed(line) + # shortcut out of the loop to save reading further - particularly useful if we read a BOM. + if u.done: + break + u.close() + result = u.result + if PY2: + name = name.decode(sys.getfilesystemencoding(), 'ignore') + if result['encoding']: + return '{0}: {1} with confidence {2}'.format(name, result['encoding'], + result['confidence']) + else: + return '{0}: no result'.format(name) + + +def main(argv=None): + """ + Handles command line arguments and gets things started. + + :param argv: List of arguments, as if specified on the command-line. + If None, ``sys.argv[1:]`` is used instead. + :type argv: list of str + """ + # Get command line arguments + parser = argparse.ArgumentParser( + description="Takes one or more file paths and reports their detected \ + encodings") + parser.add_argument('input', + help='File whose encoding we would like to determine. \ + (default: stdin)', + type=argparse.FileType('rb'), nargs='*', + default=[sys.stdin if PY2 else sys.stdin.buffer]) + parser.add_argument('--version', action='version', + version='%(prog)s {0}'.format(__version__)) + args = parser.parse_args(argv) + + for f in args.input: + if f.isatty(): + print("You are running chardetect interactively. Press " + + "CTRL-D twice at the start of a blank line to signal the " + + "end of your input. If you want help, run chardetect " + + "--help\n", file=sys.stderr) + print(description_of(f, f.name)) + + +if __name__ == '__main__': + main() diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/codingstatemachine.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/codingstatemachine.py new file mode 100644 index 0000000000000000000000000000000000000000..68fba44f14366c448f13db3cf9cf1665af2e498c --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/codingstatemachine.py @@ -0,0 +1,88 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +import logging + +from .enums import MachineState + + +class CodingStateMachine(object): + """ + A state machine to verify a byte sequence for a particular encoding. For + each byte the detector receives, it will feed that byte to every active + state machine available, one byte at a time. The state machine changes its + state based on its previous state and the byte it receives. There are 3 + states in a state machine that are of interest to an auto-detector: + + START state: This is the state to start with, or a legal byte sequence + (i.e. a valid code point) for character has been identified. + + ME state: This indicates that the state machine identified a byte sequence + that is specific to the charset it is designed for and that + there is no other possible encoding which can contain this byte + sequence. This will to lead to an immediate positive answer for + the detector. + + ERROR state: This indicates the state machine identified an illegal byte + sequence for that encoding. This will lead to an immediate + negative answer for this encoding. Detector will exclude this + encoding from consideration from here on. + """ + def __init__(self, sm): + self._model = sm + self._curr_byte_pos = 0 + self._curr_char_len = 0 + self._curr_state = None + self.logger = logging.getLogger(__name__) + self.reset() + + def reset(self): + self._curr_state = MachineState.START + + def next_state(self, c): + # for each byte we get its class + # if it is first byte, we also get byte length + byte_class = self._model['class_table'][c] + if self._curr_state == MachineState.START: + self._curr_byte_pos = 0 + self._curr_char_len = self._model['char_len_table'][byte_class] + # from byte's class and state_table, we get its next state + curr_state = (self._curr_state * self._model['class_factor'] + + byte_class) + self._curr_state = self._model['state_table'][curr_state] + self._curr_byte_pos += 1 + return self._curr_state + + def get_current_charlen(self): + return self._curr_char_len + + def get_coding_state_machine(self): + return self._model['name'] + + @property + def language(self): + return self._model['language'] diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/compat.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/compat.py new file mode 100644 index 0000000000000000000000000000000000000000..ddd74687c02a12ecc296ee803997a345e984bc9d --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/compat.py @@ -0,0 +1,34 @@ +######################## BEGIN LICENSE BLOCK ######################## +# Contributor(s): +# Dan Blanchard +# Ian Cordasco +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +import sys + + +if sys.version_info < (3, 0): + PY2 = True + PY3 = False + base_str = (str, unicode) + text_type = unicode +else: + PY2 = False + PY3 = True + base_str = (bytes, str) + text_type = str diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/cp949prober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/cp949prober.py new file mode 100644 index 0000000000000000000000000000000000000000..efd793abca4bf496001a4e46a67557e5a6f16bba --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/cp949prober.py @@ -0,0 +1,49 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .chardistribution import EUCKRDistributionAnalysis +from .codingstatemachine import CodingStateMachine +from .mbcharsetprober import MultiByteCharSetProber +from .mbcssm import CP949_SM_MODEL + + +class CP949Prober(MultiByteCharSetProber): + def __init__(self): + super(CP949Prober, self).__init__() + self.coding_sm = CodingStateMachine(CP949_SM_MODEL) + # NOTE: CP949 is a superset of EUC-KR, so the distribution should be + # not different. + self.distribution_analyzer = EUCKRDistributionAnalysis() + self.reset() + + @property + def charset_name(self): + return "CP949" + + @property + def language(self): + return "Korean" diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/enums.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/enums.py new file mode 100644 index 0000000000000000000000000000000000000000..04512072251c429e63ed110cdbafaf4b3cca3412 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/enums.py @@ -0,0 +1,76 @@ +""" +All of the Enums that are used throughout the chardet package. + +:author: Dan Blanchard (dan.blanchard@gmail.com) +""" + + +class InputState(object): + """ + This enum represents the different states a universal detector can be in. + """ + PURE_ASCII = 0 + ESC_ASCII = 1 + HIGH_BYTE = 2 + + +class LanguageFilter(object): + """ + This enum represents the different language filters we can apply to a + ``UniversalDetector``. + """ + CHINESE_SIMPLIFIED = 0x01 + CHINESE_TRADITIONAL = 0x02 + JAPANESE = 0x04 + KOREAN = 0x08 + NON_CJK = 0x10 + ALL = 0x1F + CHINESE = CHINESE_SIMPLIFIED | CHINESE_TRADITIONAL + CJK = CHINESE | JAPANESE | KOREAN + + +class ProbingState(object): + """ + This enum represents the different states a prober can be in. + """ + DETECTING = 0 + FOUND_IT = 1 + NOT_ME = 2 + + +class MachineState(object): + """ + This enum represents the different states a state machine can be in. + """ + START = 0 + ERROR = 1 + ITS_ME = 2 + + +class SequenceLikelihood(object): + """ + This enum represents the likelihood of a character following the previous one. + """ + NEGATIVE = 0 + UNLIKELY = 1 + LIKELY = 2 + POSITIVE = 3 + + @classmethod + def get_num_categories(cls): + """:returns: The number of likelihood categories in the enum.""" + return 4 + + +class CharacterCategory(object): + """ + This enum represents the different categories language models for + ``SingleByteCharsetProber`` put characters into. + + Anything less than CONTROL is considered a letter. + """ + UNDEFINED = 255 + LINE_BREAK = 254 + SYMBOL = 253 + DIGIT = 252 + CONTROL = 251 diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/escprober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/escprober.py new file mode 100644 index 0000000000000000000000000000000000000000..c70493f2b131b32378612044f30173eabbfbc3f4 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/escprober.py @@ -0,0 +1,101 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .charsetprober import CharSetProber +from .codingstatemachine import CodingStateMachine +from .enums import LanguageFilter, ProbingState, MachineState +from .escsm import (HZ_SM_MODEL, ISO2022CN_SM_MODEL, ISO2022JP_SM_MODEL, + ISO2022KR_SM_MODEL) + + +class EscCharSetProber(CharSetProber): + """ + This CharSetProber uses a "code scheme" approach for detecting encodings, + whereby easily recognizable escape or shift sequences are relied on to + identify these encodings. + """ + + def __init__(self, lang_filter=None): + super(EscCharSetProber, self).__init__(lang_filter=lang_filter) + self.coding_sm = [] + if self.lang_filter & LanguageFilter.CHINESE_SIMPLIFIED: + self.coding_sm.append(CodingStateMachine(HZ_SM_MODEL)) + self.coding_sm.append(CodingStateMachine(ISO2022CN_SM_MODEL)) + if self.lang_filter & LanguageFilter.JAPANESE: + self.coding_sm.append(CodingStateMachine(ISO2022JP_SM_MODEL)) + if self.lang_filter & LanguageFilter.KOREAN: + self.coding_sm.append(CodingStateMachine(ISO2022KR_SM_MODEL)) + self.active_sm_count = None + self._detected_charset = None + self._detected_language = None + self._state = None + self.reset() + + def reset(self): + super(EscCharSetProber, self).reset() + for coding_sm in self.coding_sm: + if not coding_sm: + continue + coding_sm.active = True + coding_sm.reset() + self.active_sm_count = len(self.coding_sm) + self._detected_charset = None + self._detected_language = None + + @property + def charset_name(self): + return self._detected_charset + + @property + def language(self): + return self._detected_language + + def get_confidence(self): + if self._detected_charset: + return 0.99 + else: + return 0.00 + + def feed(self, byte_str): + for c in byte_str: + for coding_sm in self.coding_sm: + if not coding_sm or not coding_sm.active: + continue + coding_state = coding_sm.next_state(c) + if coding_state == MachineState.ERROR: + coding_sm.active = False + self.active_sm_count -= 1 + if self.active_sm_count <= 0: + self._state = ProbingState.NOT_ME + return self.state + elif coding_state == MachineState.ITS_ME: + self._state = ProbingState.FOUND_IT + self._detected_charset = coding_sm.get_coding_state_machine() + self._detected_language = coding_sm.language + return self.state + + return self.state diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/escsm.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/escsm.py new file mode 100644 index 0000000000000000000000000000000000000000..0069523a04969dd920ea4b43a497162157729174 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/escsm.py @@ -0,0 +1,246 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .enums import MachineState + +HZ_CLS = ( +1,0,0,0,0,0,0,0, # 00 - 07 +0,0,0,0,0,0,0,0, # 08 - 0f +0,0,0,0,0,0,0,0, # 10 - 17 +0,0,0,1,0,0,0,0, # 18 - 1f +0,0,0,0,0,0,0,0, # 20 - 27 +0,0,0,0,0,0,0,0, # 28 - 2f +0,0,0,0,0,0,0,0, # 30 - 37 +0,0,0,0,0,0,0,0, # 38 - 3f +0,0,0,0,0,0,0,0, # 40 - 47 +0,0,0,0,0,0,0,0, # 48 - 4f +0,0,0,0,0,0,0,0, # 50 - 57 +0,0,0,0,0,0,0,0, # 58 - 5f +0,0,0,0,0,0,0,0, # 60 - 67 +0,0,0,0,0,0,0,0, # 68 - 6f +0,0,0,0,0,0,0,0, # 70 - 77 +0,0,0,4,0,5,2,0, # 78 - 7f +1,1,1,1,1,1,1,1, # 80 - 87 +1,1,1,1,1,1,1,1, # 88 - 8f +1,1,1,1,1,1,1,1, # 90 - 97 +1,1,1,1,1,1,1,1, # 98 - 9f +1,1,1,1,1,1,1,1, # a0 - a7 +1,1,1,1,1,1,1,1, # a8 - af +1,1,1,1,1,1,1,1, # b0 - b7 +1,1,1,1,1,1,1,1, # b8 - bf +1,1,1,1,1,1,1,1, # c0 - c7 +1,1,1,1,1,1,1,1, # c8 - cf +1,1,1,1,1,1,1,1, # d0 - d7 +1,1,1,1,1,1,1,1, # d8 - df +1,1,1,1,1,1,1,1, # e0 - e7 +1,1,1,1,1,1,1,1, # e8 - ef +1,1,1,1,1,1,1,1, # f0 - f7 +1,1,1,1,1,1,1,1, # f8 - ff +) + +HZ_ST = ( +MachineState.START,MachineState.ERROR, 3,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,# 00-07 +MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,# 08-0f +MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START, 4,MachineState.ERROR,# 10-17 + 5,MachineState.ERROR, 6,MachineState.ERROR, 5, 5, 4,MachineState.ERROR,# 18-1f + 4,MachineState.ERROR, 4, 4, 4,MachineState.ERROR, 4,MachineState.ERROR,# 20-27 + 4,MachineState.ITS_ME,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,# 28-2f +) + +HZ_CHAR_LEN_TABLE = (0, 0, 0, 0, 0, 0) + +HZ_SM_MODEL = {'class_table': HZ_CLS, + 'class_factor': 6, + 'state_table': HZ_ST, + 'char_len_table': HZ_CHAR_LEN_TABLE, + 'name': "HZ-GB-2312", + 'language': 'Chinese'} + +ISO2022CN_CLS = ( +2,0,0,0,0,0,0,0, # 00 - 07 +0,0,0,0,0,0,0,0, # 08 - 0f +0,0,0,0,0,0,0,0, # 10 - 17 +0,0,0,1,0,0,0,0, # 18 - 1f +0,0,0,0,0,0,0,0, # 20 - 27 +0,3,0,0,0,0,0,0, # 28 - 2f +0,0,0,0,0,0,0,0, # 30 - 37 +0,0,0,0,0,0,0,0, # 38 - 3f +0,0,0,4,0,0,0,0, # 40 - 47 +0,0,0,0,0,0,0,0, # 48 - 4f +0,0,0,0,0,0,0,0, # 50 - 57 +0,0,0,0,0,0,0,0, # 58 - 5f +0,0,0,0,0,0,0,0, # 60 - 67 +0,0,0,0,0,0,0,0, # 68 - 6f +0,0,0,0,0,0,0,0, # 70 - 77 +0,0,0,0,0,0,0,0, # 78 - 7f +2,2,2,2,2,2,2,2, # 80 - 87 +2,2,2,2,2,2,2,2, # 88 - 8f +2,2,2,2,2,2,2,2, # 90 - 97 +2,2,2,2,2,2,2,2, # 98 - 9f +2,2,2,2,2,2,2,2, # a0 - a7 +2,2,2,2,2,2,2,2, # a8 - af +2,2,2,2,2,2,2,2, # b0 - b7 +2,2,2,2,2,2,2,2, # b8 - bf +2,2,2,2,2,2,2,2, # c0 - c7 +2,2,2,2,2,2,2,2, # c8 - cf +2,2,2,2,2,2,2,2, # d0 - d7 +2,2,2,2,2,2,2,2, # d8 - df +2,2,2,2,2,2,2,2, # e0 - e7 +2,2,2,2,2,2,2,2, # e8 - ef +2,2,2,2,2,2,2,2, # f0 - f7 +2,2,2,2,2,2,2,2, # f8 - ff +) + +ISO2022CN_ST = ( +MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,# 00-07 +MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 08-0f +MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,# 10-17 +MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 4,MachineState.ERROR,# 18-1f +MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 20-27 + 5, 6,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 28-2f +MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 30-37 +MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.START,# 38-3f +) + +ISO2022CN_CHAR_LEN_TABLE = (0, 0, 0, 0, 0, 0, 0, 0, 0) + +ISO2022CN_SM_MODEL = {'class_table': ISO2022CN_CLS, + 'class_factor': 9, + 'state_table': ISO2022CN_ST, + 'char_len_table': ISO2022CN_CHAR_LEN_TABLE, + 'name': "ISO-2022-CN", + 'language': 'Chinese'} + +ISO2022JP_CLS = ( +2,0,0,0,0,0,0,0, # 00 - 07 +0,0,0,0,0,0,2,2, # 08 - 0f +0,0,0,0,0,0,0,0, # 10 - 17 +0,0,0,1,0,0,0,0, # 18 - 1f +0,0,0,0,7,0,0,0, # 20 - 27 +3,0,0,0,0,0,0,0, # 28 - 2f +0,0,0,0,0,0,0,0, # 30 - 37 +0,0,0,0,0,0,0,0, # 38 - 3f +6,0,4,0,8,0,0,0, # 40 - 47 +0,9,5,0,0,0,0,0, # 48 - 4f +0,0,0,0,0,0,0,0, # 50 - 57 +0,0,0,0,0,0,0,0, # 58 - 5f +0,0,0,0,0,0,0,0, # 60 - 67 +0,0,0,0,0,0,0,0, # 68 - 6f +0,0,0,0,0,0,0,0, # 70 - 77 +0,0,0,0,0,0,0,0, # 78 - 7f +2,2,2,2,2,2,2,2, # 80 - 87 +2,2,2,2,2,2,2,2, # 88 - 8f +2,2,2,2,2,2,2,2, # 90 - 97 +2,2,2,2,2,2,2,2, # 98 - 9f +2,2,2,2,2,2,2,2, # a0 - a7 +2,2,2,2,2,2,2,2, # a8 - af +2,2,2,2,2,2,2,2, # b0 - b7 +2,2,2,2,2,2,2,2, # b8 - bf +2,2,2,2,2,2,2,2, # c0 - c7 +2,2,2,2,2,2,2,2, # c8 - cf +2,2,2,2,2,2,2,2, # d0 - d7 +2,2,2,2,2,2,2,2, # d8 - df +2,2,2,2,2,2,2,2, # e0 - e7 +2,2,2,2,2,2,2,2, # e8 - ef +2,2,2,2,2,2,2,2, # f0 - f7 +2,2,2,2,2,2,2,2, # f8 - ff +) + +ISO2022JP_ST = ( +MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,# 00-07 +MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 08-0f +MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,# 10-17 +MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,# 18-1f +MachineState.ERROR, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 4,MachineState.ERROR,MachineState.ERROR,# 20-27 +MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 6,MachineState.ITS_ME,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,# 28-2f +MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,# 30-37 +MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 38-3f +MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.START,MachineState.START,# 40-47 +) + +ISO2022JP_CHAR_LEN_TABLE = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0) + +ISO2022JP_SM_MODEL = {'class_table': ISO2022JP_CLS, + 'class_factor': 10, + 'state_table': ISO2022JP_ST, + 'char_len_table': ISO2022JP_CHAR_LEN_TABLE, + 'name': "ISO-2022-JP", + 'language': 'Japanese'} + +ISO2022KR_CLS = ( +2,0,0,0,0,0,0,0, # 00 - 07 +0,0,0,0,0,0,0,0, # 08 - 0f +0,0,0,0,0,0,0,0, # 10 - 17 +0,0,0,1,0,0,0,0, # 18 - 1f +0,0,0,0,3,0,0,0, # 20 - 27 +0,4,0,0,0,0,0,0, # 28 - 2f +0,0,0,0,0,0,0,0, # 30 - 37 +0,0,0,0,0,0,0,0, # 38 - 3f +0,0,0,5,0,0,0,0, # 40 - 47 +0,0,0,0,0,0,0,0, # 48 - 4f +0,0,0,0,0,0,0,0, # 50 - 57 +0,0,0,0,0,0,0,0, # 58 - 5f +0,0,0,0,0,0,0,0, # 60 - 67 +0,0,0,0,0,0,0,0, # 68 - 6f +0,0,0,0,0,0,0,0, # 70 - 77 +0,0,0,0,0,0,0,0, # 78 - 7f +2,2,2,2,2,2,2,2, # 80 - 87 +2,2,2,2,2,2,2,2, # 88 - 8f +2,2,2,2,2,2,2,2, # 90 - 97 +2,2,2,2,2,2,2,2, # 98 - 9f +2,2,2,2,2,2,2,2, # a0 - a7 +2,2,2,2,2,2,2,2, # a8 - af +2,2,2,2,2,2,2,2, # b0 - b7 +2,2,2,2,2,2,2,2, # b8 - bf +2,2,2,2,2,2,2,2, # c0 - c7 +2,2,2,2,2,2,2,2, # c8 - cf +2,2,2,2,2,2,2,2, # d0 - d7 +2,2,2,2,2,2,2,2, # d8 - df +2,2,2,2,2,2,2,2, # e0 - e7 +2,2,2,2,2,2,2,2, # e8 - ef +2,2,2,2,2,2,2,2, # f0 - f7 +2,2,2,2,2,2,2,2, # f8 - ff +) + +ISO2022KR_ST = ( +MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,# 00-07 +MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,# 08-0f +MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 4,MachineState.ERROR,MachineState.ERROR,# 10-17 +MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 18-1f +MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.START,MachineState.START,MachineState.START,MachineState.START,# 20-27 +) + +ISO2022KR_CHAR_LEN_TABLE = (0, 0, 0, 0, 0, 0) + +ISO2022KR_SM_MODEL = {'class_table': ISO2022KR_CLS, + 'class_factor': 6, + 'state_table': ISO2022KR_ST, + 'char_len_table': ISO2022KR_CHAR_LEN_TABLE, + 'name': "ISO-2022-KR", + 'language': 'Korean'} + + diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/eucjpprober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/eucjpprober.py new file mode 100644 index 0000000000000000000000000000000000000000..20ce8f7d15bad9d48a3e0363de2286093a4a28cc --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/eucjpprober.py @@ -0,0 +1,92 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .enums import ProbingState, MachineState +from .mbcharsetprober import MultiByteCharSetProber +from .codingstatemachine import CodingStateMachine +from .chardistribution import EUCJPDistributionAnalysis +from .jpcntx import EUCJPContextAnalysis +from .mbcssm import EUCJP_SM_MODEL + + +class EUCJPProber(MultiByteCharSetProber): + def __init__(self): + super(EUCJPProber, self).__init__() + self.coding_sm = CodingStateMachine(EUCJP_SM_MODEL) + self.distribution_analyzer = EUCJPDistributionAnalysis() + self.context_analyzer = EUCJPContextAnalysis() + self.reset() + + def reset(self): + super(EUCJPProber, self).reset() + self.context_analyzer.reset() + + @property + def charset_name(self): + return "EUC-JP" + + @property + def language(self): + return "Japanese" + + def feed(self, byte_str): + for i in range(len(byte_str)): + # PY3K: byte_str is a byte array, so byte_str[i] is an int, not a byte + coding_state = self.coding_sm.next_state(byte_str[i]) + if coding_state == MachineState.ERROR: + self.logger.debug('%s %s prober hit error at byte %s', + self.charset_name, self.language, i) + self._state = ProbingState.NOT_ME + break + elif coding_state == MachineState.ITS_ME: + self._state = ProbingState.FOUND_IT + break + elif coding_state == MachineState.START: + char_len = self.coding_sm.get_current_charlen() + if i == 0: + self._last_char[1] = byte_str[0] + self.context_analyzer.feed(self._last_char, char_len) + self.distribution_analyzer.feed(self._last_char, char_len) + else: + self.context_analyzer.feed(byte_str[i - 1:i + 1], + char_len) + self.distribution_analyzer.feed(byte_str[i - 1:i + 1], + char_len) + + self._last_char[0] = byte_str[-1] + + if self.state == ProbingState.DETECTING: + if (self.context_analyzer.got_enough_data() and + (self.get_confidence() > self.SHORTCUT_THRESHOLD)): + self._state = ProbingState.FOUND_IT + + return self.state + + def get_confidence(self): + context_conf = self.context_analyzer.get_confidence() + distrib_conf = self.distribution_analyzer.get_confidence() + return max(context_conf, distrib_conf) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/euckrfreq.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/euckrfreq.py new file mode 100644 index 0000000000000000000000000000000000000000..b68078cb9680de4cca65b1145632a37c5e751c38 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/euckrfreq.py @@ -0,0 +1,195 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Communicator client code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +# Sampling from about 20M text materials include literature and computer technology + +# 128 --> 0.79 +# 256 --> 0.92 +# 512 --> 0.986 +# 1024 --> 0.99944 +# 2048 --> 0.99999 +# +# Idea Distribution Ratio = 0.98653 / (1-0.98653) = 73.24 +# Random Distribution Ration = 512 / (2350-512) = 0.279. +# +# Typical Distribution Ratio + +EUCKR_TYPICAL_DISTRIBUTION_RATIO = 6.0 + +EUCKR_TABLE_SIZE = 2352 + +# Char to FreqOrder table , +EUCKR_CHAR_TO_FREQ_ORDER = ( + 13, 130, 120,1396, 481,1719,1720, 328, 609, 212,1721, 707, 400, 299,1722, 87, +1397,1723, 104, 536,1117,1203,1724,1267, 685,1268, 508,1725,1726,1727,1728,1398, +1399,1729,1730,1731, 141, 621, 326,1057, 368,1732, 267, 488, 20,1733,1269,1734, + 945,1400,1735, 47, 904,1270,1736,1737, 773, 248,1738, 409, 313, 786, 429,1739, + 116, 987, 813,1401, 683, 75,1204, 145,1740,1741,1742,1743, 16, 847, 667, 622, + 708,1744,1745,1746, 966, 787, 304, 129,1747, 60, 820, 123, 676,1748,1749,1750, +1751, 617,1752, 626,1753,1754,1755,1756, 653,1757,1758,1759,1760,1761,1762, 856, + 344,1763,1764,1765,1766, 89, 401, 418, 806, 905, 848,1767,1768,1769, 946,1205, + 709,1770,1118,1771, 241,1772,1773,1774,1271,1775, 569,1776, 999,1777,1778,1779, +1780, 337, 751,1058, 28, 628, 254,1781, 177, 906, 270, 349, 891,1079,1782, 19, +1783, 379,1784, 315,1785, 629, 754,1402, 559,1786, 636, 203,1206,1787, 710, 567, +1788, 935, 814,1789,1790,1207, 766, 528,1791,1792,1208,1793,1794,1795,1796,1797, +1403,1798,1799, 533,1059,1404,1405,1156,1406, 936, 884,1080,1800, 351,1801,1802, +1803,1804,1805, 801,1806,1807,1808,1119,1809,1157, 714, 474,1407,1810, 298, 899, + 885,1811,1120, 802,1158,1812, 892,1813,1814,1408, 659,1815,1816,1121,1817,1818, +1819,1820,1821,1822, 319,1823, 594, 545,1824, 815, 937,1209,1825,1826, 573,1409, +1022,1827,1210,1828,1829,1830,1831,1832,1833, 556, 722, 807,1122,1060,1834, 697, +1835, 900, 557, 715,1836,1410, 540,1411, 752,1159, 294, 597,1211, 976, 803, 770, +1412,1837,1838, 39, 794,1413, 358,1839, 371, 925,1840, 453, 661, 788, 531, 723, + 544,1023,1081, 869, 91,1841, 392, 430, 790, 602,1414, 677,1082, 457,1415,1416, +1842,1843, 475, 327,1024,1417, 795, 121,1844, 733, 403,1418,1845,1846,1847, 300, + 119, 711,1212, 627,1848,1272, 207,1849,1850, 796,1213, 382,1851, 519,1852,1083, + 893,1853,1854,1855, 367, 809, 487, 671,1856, 663,1857,1858, 956, 471, 306, 857, +1859,1860,1160,1084,1861,1862,1863,1864,1865,1061,1866,1867,1868,1869,1870,1871, + 282, 96, 574,1872, 502,1085,1873,1214,1874, 907,1875,1876, 827, 977,1419,1420, +1421, 268,1877,1422,1878,1879,1880, 308,1881, 2, 537,1882,1883,1215,1884,1885, + 127, 791,1886,1273,1423,1887, 34, 336, 404, 643,1888, 571, 654, 894, 840,1889, + 0, 886,1274, 122, 575, 260, 908, 938,1890,1275, 410, 316,1891,1892, 100,1893, +1894,1123, 48,1161,1124,1025,1895, 633, 901,1276,1896,1897, 115, 816,1898, 317, +1899, 694,1900, 909, 734,1424, 572, 866,1425, 691, 85, 524,1010, 543, 394, 841, +1901,1902,1903,1026,1904,1905,1906,1907,1908,1909, 30, 451, 651, 988, 310,1910, +1911,1426, 810,1216, 93,1912,1913,1277,1217,1914, 858, 759, 45, 58, 181, 610, + 269,1915,1916, 131,1062, 551, 443,1000, 821,1427, 957, 895,1086,1917,1918, 375, +1919, 359,1920, 687,1921, 822,1922, 293,1923,1924, 40, 662, 118, 692, 29, 939, + 887, 640, 482, 174,1925, 69,1162, 728,1428, 910,1926,1278,1218,1279, 386, 870, + 217, 854,1163, 823,1927,1928,1929,1930, 834,1931, 78,1932, 859,1933,1063,1934, +1935,1936,1937, 438,1164, 208, 595,1938,1939,1940,1941,1219,1125,1942, 280, 888, +1429,1430,1220,1431,1943,1944,1945,1946,1947,1280, 150, 510,1432,1948,1949,1950, +1951,1952,1953,1954,1011,1087,1955,1433,1043,1956, 881,1957, 614, 958,1064,1065, +1221,1958, 638,1001, 860, 967, 896,1434, 989, 492, 553,1281,1165,1959,1282,1002, +1283,1222,1960,1961,1962,1963, 36, 383, 228, 753, 247, 454,1964, 876, 678,1965, +1966,1284, 126, 464, 490, 835, 136, 672, 529, 940,1088,1435, 473,1967,1968, 467, + 50, 390, 227, 587, 279, 378, 598, 792, 968, 240, 151, 160, 849, 882,1126,1285, + 639,1044, 133, 140, 288, 360, 811, 563,1027, 561, 142, 523,1969,1970,1971, 7, + 103, 296, 439, 407, 506, 634, 990,1972,1973,1974,1975, 645,1976,1977,1978,1979, +1980,1981, 236,1982,1436,1983,1984,1089, 192, 828, 618, 518,1166, 333,1127,1985, + 818,1223,1986,1987,1988,1989,1990,1991,1992,1993, 342,1128,1286, 746, 842,1994, +1995, 560, 223,1287, 98, 8, 189, 650, 978,1288,1996,1437,1997, 17, 345, 250, + 423, 277, 234, 512, 226, 97, 289, 42, 167,1998, 201,1999,2000, 843, 836, 824, + 532, 338, 783,1090, 182, 576, 436,1438,1439, 527, 500,2001, 947, 889,2002,2003, +2004,2005, 262, 600, 314, 447,2006, 547,2007, 693, 738,1129,2008, 71,1440, 745, + 619, 688,2009, 829,2010,2011, 147,2012, 33, 948,2013,2014, 74, 224,2015, 61, + 191, 918, 399, 637,2016,1028,1130, 257, 902,2017,2018,2019,2020,2021,2022,2023, +2024,2025,2026, 837,2027,2028,2029,2030, 179, 874, 591, 52, 724, 246,2031,2032, +2033,2034,1167, 969,2035,1289, 630, 605, 911,1091,1168,2036,2037,2038,1441, 912, +2039, 623,2040,2041, 253,1169,1290,2042,1442, 146, 620, 611, 577, 433,2043,1224, + 719,1170, 959, 440, 437, 534, 84, 388, 480,1131, 159, 220, 198, 679,2044,1012, + 819,1066,1443, 113,1225, 194, 318,1003,1029,2045,2046,2047,2048,1067,2049,2050, +2051,2052,2053, 59, 913, 112,2054, 632,2055, 455, 144, 739,1291,2056, 273, 681, + 499,2057, 448,2058,2059, 760,2060,2061, 970, 384, 169, 245,1132,2062,2063, 414, +1444,2064,2065, 41, 235,2066, 157, 252, 877, 568, 919, 789, 580,2067, 725,2068, +2069,1292,2070,2071,1445,2072,1446,2073,2074, 55, 588, 66,1447, 271,1092,2075, +1226,2076, 960,1013, 372,2077,2078,2079,2080,2081,1293,2082,2083,2084,2085, 850, +2086,2087,2088,2089,2090, 186,2091,1068, 180,2092,2093,2094, 109,1227, 522, 606, +2095, 867,1448,1093, 991,1171, 926, 353,1133,2096, 581,2097,2098,2099,1294,1449, +1450,2100, 596,1172,1014,1228,2101,1451,1295,1173,1229,2102,2103,1296,1134,1452, + 949,1135,2104,2105,1094,1453,1454,1455,2106,1095,2107,2108,2109,2110,2111,2112, +2113,2114,2115,2116,2117, 804,2118,2119,1230,1231, 805,1456, 405,1136,2120,2121, +2122,2123,2124, 720, 701,1297, 992,1457, 927,1004,2125,2126,2127,2128,2129,2130, + 22, 417,2131, 303,2132, 385,2133, 971, 520, 513,2134,1174, 73,1096, 231, 274, + 962,1458, 673,2135,1459,2136, 152,1137,2137,2138,2139,2140,1005,1138,1460,1139, +2141,2142,2143,2144, 11, 374, 844,2145, 154,1232, 46,1461,2146, 838, 830, 721, +1233, 106,2147, 90, 428, 462, 578, 566,1175, 352,2148,2149, 538,1234, 124,1298, +2150,1462, 761, 565,2151, 686,2152, 649,2153, 72, 173,2154, 460, 415,2155,1463, +2156,1235, 305,2157,2158,2159,2160,2161,2162, 579,2163,2164,2165,2166,2167, 747, +2168,2169,2170,2171,1464, 669,2172,2173,2174,2175,2176,1465,2177, 23, 530, 285, +2178, 335, 729,2179, 397,2180,2181,2182,1030,2183,2184, 698,2185,2186, 325,2187, +2188, 369,2189, 799,1097,1015, 348,2190,1069, 680,2191, 851,1466,2192,2193, 10, +2194, 613, 424,2195, 979, 108, 449, 589, 27, 172, 81,1031, 80, 774, 281, 350, +1032, 525, 301, 582,1176,2196, 674,1045,2197,2198,1467, 730, 762,2199,2200,2201, +2202,1468,2203, 993,2204,2205, 266,1070, 963,1140,2206,2207,2208, 664,1098, 972, +2209,2210,2211,1177,1469,1470, 871,2212,2213,2214,2215,2216,1471,2217,2218,2219, +2220,2221,2222,2223,2224,2225,2226,2227,1472,1236,2228,2229,2230,2231,2232,2233, +2234,2235,1299,2236,2237, 200,2238, 477, 373,2239,2240, 731, 825, 777,2241,2242, +2243, 521, 486, 548,2244,2245,2246,1473,1300, 53, 549, 137, 875, 76, 158,2247, +1301,1474, 469, 396,1016, 278, 712,2248, 321, 442, 503, 767, 744, 941,1237,1178, +1475,2249, 82, 178,1141,1179, 973,2250,1302,2251, 297,2252,2253, 570,2254,2255, +2256, 18, 450, 206,2257, 290, 292,1142,2258, 511, 162, 99, 346, 164, 735,2259, +1476,1477, 4, 554, 343, 798,1099,2260,1100,2261, 43, 171,1303, 139, 215,2262, +2263, 717, 775,2264,1033, 322, 216,2265, 831,2266, 149,2267,1304,2268,2269, 702, +1238, 135, 845, 347, 309,2270, 484,2271, 878, 655, 238,1006,1478,2272, 67,2273, + 295,2274,2275, 461,2276, 478, 942, 412,2277,1034,2278,2279,2280, 265,2281, 541, +2282,2283,2284,2285,2286, 70, 852,1071,2287,2288,2289,2290, 21, 56, 509, 117, + 432,2291,2292, 331, 980, 552,1101, 148, 284, 105, 393,1180,1239, 755,2293, 187, +2294,1046,1479,2295, 340,2296, 63,1047, 230,2297,2298,1305, 763,1306, 101, 800, + 808, 494,2299,2300,2301, 903,2302, 37,1072, 14, 5,2303, 79, 675,2304, 312, +2305,2306,2307,2308,2309,1480, 6,1307,2310,2311,2312, 1, 470, 35, 24, 229, +2313, 695, 210, 86, 778, 15, 784, 592, 779, 32, 77, 855, 964,2314, 259,2315, + 501, 380,2316,2317, 83, 981, 153, 689,1308,1481,1482,1483,2318,2319, 716,1484, +2320,2321,2322,2323,2324,2325,1485,2326,2327, 128, 57, 68, 261,1048, 211, 170, +1240, 31,2328, 51, 435, 742,2329,2330,2331, 635,2332, 264, 456,2333,2334,2335, + 425,2336,1486, 143, 507, 263, 943,2337, 363, 920,1487, 256,1488,1102, 243, 601, +1489,2338,2339,2340,2341,2342,2343,2344, 861,2345,2346,2347,2348,2349,2350, 395, +2351,1490,1491, 62, 535, 166, 225,2352,2353, 668, 419,1241, 138, 604, 928,2354, +1181,2355,1492,1493,2356,2357,2358,1143,2359, 696,2360, 387, 307,1309, 682, 476, +2361,2362, 332, 12, 222, 156,2363, 232,2364, 641, 276, 656, 517,1494,1495,1035, + 416, 736,1496,2365,1017, 586,2366,2367,2368,1497,2369, 242,2370,2371,2372,1498, +2373, 965, 713,2374,2375,2376,2377, 740, 982,1499, 944,1500,1007,2378,2379,1310, +1501,2380,2381,2382, 785, 329,2383,2384,1502,2385,2386,2387, 932,2388,1503,2389, +2390,2391,2392,1242,2393,2394,2395,2396,2397, 994, 950,2398,2399,2400,2401,1504, +1311,2402,2403,2404,2405,1049, 749,2406,2407, 853, 718,1144,1312,2408,1182,1505, +2409,2410, 255, 516, 479, 564, 550, 214,1506,1507,1313, 413, 239, 444, 339,1145, +1036,1508,1509,1314,1037,1510,1315,2411,1511,2412,2413,2414, 176, 703, 497, 624, + 593, 921, 302,2415, 341, 165,1103,1512,2416,1513,2417,2418,2419, 376,2420, 700, +2421,2422,2423, 258, 768,1316,2424,1183,2425, 995, 608,2426,2427,2428,2429, 221, +2430,2431,2432,2433,2434,2435,2436,2437, 195, 323, 726, 188, 897, 983,1317, 377, + 644,1050, 879,2438, 452,2439,2440,2441,2442,2443,2444, 914,2445,2446,2447,2448, + 915, 489,2449,1514,1184,2450,2451, 515, 64, 427, 495,2452, 583,2453, 483, 485, +1038, 562, 213,1515, 748, 666,2454,2455,2456,2457, 334,2458, 780, 996,1008, 705, +1243,2459,2460,2461,2462,2463, 114,2464, 493,1146, 366, 163,1516, 961,1104,2465, + 291,2466,1318,1105,2467,1517, 365,2468, 355, 951,1244,2469,1319,2470, 631,2471, +2472, 218,1320, 364, 320, 756,1518,1519,1321,1520,1322,2473,2474,2475,2476, 997, +2477,2478,2479,2480, 665,1185,2481, 916,1521,2482,2483,2484, 584, 684,2485,2486, + 797,2487,1051,1186,2488,2489,2490,1522,2491,2492, 370,2493,1039,1187, 65,2494, + 434, 205, 463,1188,2495, 125, 812, 391, 402, 826, 699, 286, 398, 155, 781, 771, + 585,2496, 590, 505,1073,2497, 599, 244, 219, 917,1018, 952, 646,1523,2498,1323, +2499,2500, 49, 984, 354, 741,2501, 625,2502,1324,2503,1019, 190, 357, 757, 491, + 95, 782, 868,2504,2505,2506,2507,2508,2509, 134,1524,1074, 422,1525, 898,2510, + 161,2511,2512,2513,2514, 769,2515,1526,2516,2517, 411,1325,2518, 472,1527,2519, +2520,2521,2522,2523,2524, 985,2525,2526,2527,2528,2529,2530, 764,2531,1245,2532, +2533, 25, 204, 311,2534, 496,2535,1052,2536,2537,2538,2539,2540,2541,2542, 199, + 704, 504, 468, 758, 657,1528, 196, 44, 839,1246, 272, 750,2543, 765, 862,2544, +2545,1326,2546, 132, 615, 933,2547, 732,2548,2549,2550,1189,1529,2551, 283,1247, +1053, 607, 929,2552,2553,2554, 930, 183, 872, 616,1040,1147,2555,1148,1020, 441, + 249,1075,2556,2557,2558, 466, 743,2559,2560,2561, 92, 514, 426, 420, 526,2562, +2563,2564,2565,2566,2567,2568, 185,2569,2570,2571,2572, 776,1530, 658,2573, 362, +2574, 361, 922,1076, 793,2575,2576,2577,2578,2579,2580,1531, 251,2581,2582,2583, +2584,1532, 54, 612, 237,1327,2585,2586, 275, 408, 647, 111,2587,1533,1106, 465, + 3, 458, 9, 38,2588, 107, 110, 890, 209, 26, 737, 498,2589,1534,2590, 431, + 202, 88,1535, 356, 287,1107, 660,1149,2591, 381,1536, 986,1150, 445,1248,1151, + 974,2592,2593, 846,2594, 446, 953, 184,1249,1250, 727,2595, 923, 193, 883,2596, +2597,2598, 102, 324, 539, 817,2599, 421,1041,2600, 832,2601, 94, 175, 197, 406, +2602, 459,2603,2604,2605,2606,2607, 330, 555,2608,2609,2610, 706,1108, 389,2611, +2612,2613,2614, 233,2615, 833, 558, 931, 954,1251,2616,2617,1537, 546,2618,2619, +1009,2620,2621,2622,1538, 690,1328,2623, 955,2624,1539,2625,2626, 772,2627,2628, +2629,2630,2631, 924, 648, 863, 603,2632,2633, 934,1540, 864, 865,2634, 642,1042, + 670,1190,2635,2636,2637,2638, 168,2639, 652, 873, 542,1054,1541,2640,2641,2642, # 512, 256 +) + diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/euckrprober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/euckrprober.py new file mode 100644 index 0000000000000000000000000000000000000000..345a060d0230ada58f769b0f6b55f43a428fc3bd --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/euckrprober.py @@ -0,0 +1,47 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .mbcharsetprober import MultiByteCharSetProber +from .codingstatemachine import CodingStateMachine +from .chardistribution import EUCKRDistributionAnalysis +from .mbcssm import EUCKR_SM_MODEL + + +class EUCKRProber(MultiByteCharSetProber): + def __init__(self): + super(EUCKRProber, self).__init__() + self.coding_sm = CodingStateMachine(EUCKR_SM_MODEL) + self.distribution_analyzer = EUCKRDistributionAnalysis() + self.reset() + + @property + def charset_name(self): + return "EUC-KR" + + @property + def language(self): + return "Korean" diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/euctwfreq.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/euctwfreq.py new file mode 100644 index 0000000000000000000000000000000000000000..ed7a995a3aa311583efa5a47e316d4490e5f3463 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/euctwfreq.py @@ -0,0 +1,387 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Communicator client code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +# EUCTW frequency table +# Converted from big5 work +# by Taiwan's Mandarin Promotion Council +# + +# 128 --> 0.42261 +# 256 --> 0.57851 +# 512 --> 0.74851 +# 1024 --> 0.89384 +# 2048 --> 0.97583 +# +# Idea Distribution Ratio = 0.74851/(1-0.74851) =2.98 +# Random Distribution Ration = 512/(5401-512)=0.105 +# +# Typical Distribution Ratio about 25% of Ideal one, still much higher than RDR + +EUCTW_TYPICAL_DISTRIBUTION_RATIO = 0.75 + +# Char to FreqOrder table , +EUCTW_TABLE_SIZE = 5376 + +EUCTW_CHAR_TO_FREQ_ORDER = ( + 1,1800,1506, 255,1431, 198, 9, 82, 6,7310, 177, 202,3615,1256,2808, 110, # 2742 +3735, 33,3241, 261, 76, 44,2113, 16,2931,2184,1176, 659,3868, 26,3404,2643, # 2758 +1198,3869,3313,4060, 410,2211, 302, 590, 361,1963, 8, 204, 58,4296,7311,1931, # 2774 + 63,7312,7313, 317,1614, 75, 222, 159,4061,2412,1480,7314,3500,3068, 224,2809, # 2790 +3616, 3, 10,3870,1471, 29,2774,1135,2852,1939, 873, 130,3242,1123, 312,7315, # 2806 +4297,2051, 507, 252, 682,7316, 142,1914, 124, 206,2932, 34,3501,3173, 64, 604, # 2822 +7317,2494,1976,1977, 155,1990, 645, 641,1606,7318,3405, 337, 72, 406,7319, 80, # 2838 + 630, 238,3174,1509, 263, 939,1092,2644, 756,1440,1094,3406, 449, 69,2969, 591, # 2854 + 179,2095, 471, 115,2034,1843, 60, 50,2970, 134, 806,1868, 734,2035,3407, 180, # 2870 + 995,1607, 156, 537,2893, 688,7320, 319,1305, 779,2144, 514,2374, 298,4298, 359, # 2886 +2495, 90,2707,1338, 663, 11, 906,1099,2545, 20,2436, 182, 532,1716,7321, 732, # 2902 +1376,4062,1311,1420,3175, 25,2312,1056, 113, 399, 382,1949, 242,3408,2467, 529, # 2918 +3243, 475,1447,3617,7322, 117, 21, 656, 810,1297,2295,2329,3502,7323, 126,4063, # 2934 + 706, 456, 150, 613,4299, 71,1118,2036,4064, 145,3069, 85, 835, 486,2114,1246, # 2950 +1426, 428, 727,1285,1015, 800, 106, 623, 303,1281,7324,2127,2354, 347,3736, 221, # 2966 +3503,3110,7325,1955,1153,4065, 83, 296,1199,3070, 192, 624, 93,7326, 822,1897, # 2982 +2810,3111, 795,2064, 991,1554,1542,1592, 27, 43,2853, 859, 139,1456, 860,4300, # 2998 + 437, 712,3871, 164,2392,3112, 695, 211,3017,2096, 195,3872,1608,3504,3505,3618, # 3014 +3873, 234, 811,2971,2097,3874,2229,1441,3506,1615,2375, 668,2076,1638, 305, 228, # 3030 +1664,4301, 467, 415,7327, 262,2098,1593, 239, 108, 300, 200,1033, 512,1247,2077, # 3046 +7328,7329,2173,3176,3619,2673, 593, 845,1062,3244, 88,1723,2037,3875,1950, 212, # 3062 + 266, 152, 149, 468,1898,4066,4302, 77, 187,7330,3018, 37, 5,2972,7331,3876, # 3078 +7332,7333, 39,2517,4303,2894,3177,2078, 55, 148, 74,4304, 545, 483,1474,1029, # 3094 +1665, 217,1869,1531,3113,1104,2645,4067, 24, 172,3507, 900,3877,3508,3509,4305, # 3110 + 32,1408,2811,1312, 329, 487,2355,2247,2708, 784,2674, 4,3019,3314,1427,1788, # 3126 + 188, 109, 499,7334,3620,1717,1789, 888,1217,3020,4306,7335,3510,7336,3315,1520, # 3142 +3621,3878, 196,1034, 775,7337,7338, 929,1815, 249, 439, 38,7339,1063,7340, 794, # 3158 +3879,1435,2296, 46, 178,3245,2065,7341,2376,7342, 214,1709,4307, 804, 35, 707, # 3174 + 324,3622,1601,2546, 140, 459,4068,7343,7344,1365, 839, 272, 978,2257,2572,3409, # 3190 +2128,1363,3623,1423, 697, 100,3071, 48, 70,1231, 495,3114,2193,7345,1294,7346, # 3206 +2079, 462, 586,1042,3246, 853, 256, 988, 185,2377,3410,1698, 434,1084,7347,3411, # 3222 + 314,2615,2775,4308,2330,2331, 569,2280, 637,1816,2518, 757,1162,1878,1616,3412, # 3238 + 287,1577,2115, 768,4309,1671,2854,3511,2519,1321,3737, 909,2413,7348,4069, 933, # 3254 +3738,7349,2052,2356,1222,4310, 765,2414,1322, 786,4311,7350,1919,1462,1677,2895, # 3270 +1699,7351,4312,1424,2437,3115,3624,2590,3316,1774,1940,3413,3880,4070, 309,1369, # 3286 +1130,2812, 364,2230,1653,1299,3881,3512,3882,3883,2646, 525,1085,3021, 902,2000, # 3302 +1475, 964,4313, 421,1844,1415,1057,2281, 940,1364,3116, 376,4314,4315,1381, 7, # 3318 +2520, 983,2378, 336,1710,2675,1845, 321,3414, 559,1131,3022,2742,1808,1132,1313, # 3334 + 265,1481,1857,7352, 352,1203,2813,3247, 167,1089, 420,2814, 776, 792,1724,3513, # 3350 +4071,2438,3248,7353,4072,7354, 446, 229, 333,2743, 901,3739,1200,1557,4316,2647, # 3366 +1920, 395,2744,2676,3740,4073,1835, 125, 916,3178,2616,4317,7355,7356,3741,7357, # 3382 +7358,7359,4318,3117,3625,1133,2547,1757,3415,1510,2313,1409,3514,7360,2145, 438, # 3398 +2591,2896,2379,3317,1068, 958,3023, 461, 311,2855,2677,4074,1915,3179,4075,1978, # 3414 + 383, 750,2745,2617,4076, 274, 539, 385,1278,1442,7361,1154,1964, 384, 561, 210, # 3430 + 98,1295,2548,3515,7362,1711,2415,1482,3416,3884,2897,1257, 129,7363,3742, 642, # 3446 + 523,2776,2777,2648,7364, 141,2231,1333, 68, 176, 441, 876, 907,4077, 603,2592, # 3462 + 710, 171,3417, 404, 549, 18,3118,2393,1410,3626,1666,7365,3516,4319,2898,4320, # 3478 +7366,2973, 368,7367, 146, 366, 99, 871,3627,1543, 748, 807,1586,1185, 22,2258, # 3494 + 379,3743,3180,7368,3181, 505,1941,2618,1991,1382,2314,7369, 380,2357, 218, 702, # 3510 +1817,1248,3418,3024,3517,3318,3249,7370,2974,3628, 930,3250,3744,7371, 59,7372, # 3526 + 585, 601,4078, 497,3419,1112,1314,4321,1801,7373,1223,1472,2174,7374, 749,1836, # 3542 + 690,1899,3745,1772,3885,1476, 429,1043,1790,2232,2116, 917,4079, 447,1086,1629, # 3558 +7375, 556,7376,7377,2020,1654, 844,1090, 105, 550, 966,1758,2815,1008,1782, 686, # 3574 +1095,7378,2282, 793,1602,7379,3518,2593,4322,4080,2933,2297,4323,3746, 980,2496, # 3590 + 544, 353, 527,4324, 908,2678,2899,7380, 381,2619,1942,1348,7381,1341,1252, 560, # 3606 +3072,7382,3420,2856,7383,2053, 973, 886,2080, 143,4325,7384,7385, 157,3886, 496, # 3622 +4081, 57, 840, 540,2038,4326,4327,3421,2117,1445, 970,2259,1748,1965,2081,4082, # 3638 +3119,1234,1775,3251,2816,3629, 773,1206,2129,1066,2039,1326,3887,1738,1725,4083, # 3654 + 279,3120, 51,1544,2594, 423,1578,2130,2066, 173,4328,1879,7386,7387,1583, 264, # 3670 + 610,3630,4329,2439, 280, 154,7388,7389,7390,1739, 338,1282,3073, 693,2857,1411, # 3686 +1074,3747,2440,7391,4330,7392,7393,1240, 952,2394,7394,2900,1538,2679, 685,1483, # 3702 +4084,2468,1436, 953,4085,2054,4331, 671,2395, 79,4086,2441,3252, 608, 567,2680, # 3718 +3422,4087,4088,1691, 393,1261,1791,2396,7395,4332,7396,7397,7398,7399,1383,1672, # 3734 +3748,3182,1464, 522,1119, 661,1150, 216, 675,4333,3888,1432,3519, 609,4334,2681, # 3750 +2397,7400,7401,7402,4089,3025, 0,7403,2469, 315, 231,2442, 301,3319,4335,2380, # 3766 +7404, 233,4090,3631,1818,4336,4337,7405, 96,1776,1315,2082,7406, 257,7407,1809, # 3782 +3632,2709,1139,1819,4091,2021,1124,2163,2778,1777,2649,7408,3074, 363,1655,3183, # 3798 +7409,2975,7410,7411,7412,3889,1567,3890, 718, 103,3184, 849,1443, 341,3320,2934, # 3814 +1484,7413,1712, 127, 67, 339,4092,2398, 679,1412, 821,7414,7415, 834, 738, 351, # 3830 +2976,2146, 846, 235,1497,1880, 418,1992,3749,2710, 186,1100,2147,2746,3520,1545, # 3846 +1355,2935,2858,1377, 583,3891,4093,2573,2977,7416,1298,3633,1078,2549,3634,2358, # 3862 + 78,3750,3751, 267,1289,2099,2001,1594,4094, 348, 369,1274,2194,2175,1837,4338, # 3878 +1820,2817,3635,2747,2283,2002,4339,2936,2748, 144,3321, 882,4340,3892,2749,3423, # 3894 +4341,2901,7417,4095,1726, 320,7418,3893,3026, 788,2978,7419,2818,1773,1327,2859, # 3910 +3894,2819,7420,1306,4342,2003,1700,3752,3521,2359,2650, 787,2022, 506, 824,3636, # 3926 + 534, 323,4343,1044,3322,2023,1900, 946,3424,7421,1778,1500,1678,7422,1881,4344, # 3942 + 165, 243,4345,3637,2521, 123, 683,4096, 764,4346, 36,3895,1792, 589,2902, 816, # 3958 + 626,1667,3027,2233,1639,1555,1622,3753,3896,7423,3897,2860,1370,1228,1932, 891, # 3974 +2083,2903, 304,4097,7424, 292,2979,2711,3522, 691,2100,4098,1115,4347, 118, 662, # 3990 +7425, 611,1156, 854,2381,1316,2861, 2, 386, 515,2904,7426,7427,3253, 868,2234, # 4006 +1486, 855,2651, 785,2212,3028,7428,1040,3185,3523,7429,3121, 448,7430,1525,7431, # 4022 +2164,4348,7432,3754,7433,4099,2820,3524,3122, 503, 818,3898,3123,1568, 814, 676, # 4038 +1444, 306,1749,7434,3755,1416,1030, 197,1428, 805,2821,1501,4349,7435,7436,7437, # 4054 +1993,7438,4350,7439,7440,2195, 13,2779,3638,2980,3124,1229,1916,7441,3756,2131, # 4070 +7442,4100,4351,2399,3525,7443,2213,1511,1727,1120,7444,7445, 646,3757,2443, 307, # 4086 +7446,7447,1595,3186,7448,7449,7450,3639,1113,1356,3899,1465,2522,2523,7451, 519, # 4102 +7452, 128,2132, 92,2284,1979,7453,3900,1512, 342,3125,2196,7454,2780,2214,1980, # 4118 +3323,7455, 290,1656,1317, 789, 827,2360,7456,3758,4352, 562, 581,3901,7457, 401, # 4134 +4353,2248, 94,4354,1399,2781,7458,1463,2024,4355,3187,1943,7459, 828,1105,4101, # 4150 +1262,1394,7460,4102, 605,4356,7461,1783,2862,7462,2822, 819,2101, 578,2197,2937, # 4166 +7463,1502, 436,3254,4103,3255,2823,3902,2905,3425,3426,7464,2712,2315,7465,7466, # 4182 +2332,2067, 23,4357, 193, 826,3759,2102, 699,1630,4104,3075, 390,1793,1064,3526, # 4198 +7467,1579,3076,3077,1400,7468,4105,1838,1640,2863,7469,4358,4359, 137,4106, 598, # 4214 +3078,1966, 780, 104, 974,2938,7470, 278, 899, 253, 402, 572, 504, 493,1339,7471, # 4230 +3903,1275,4360,2574,2550,7472,3640,3029,3079,2249, 565,1334,2713, 863, 41,7473, # 4246 +7474,4361,7475,1657,2333, 19, 463,2750,4107, 606,7476,2981,3256,1087,2084,1323, # 4262 +2652,2982,7477,1631,1623,1750,4108,2682,7478,2864, 791,2714,2653,2334, 232,2416, # 4278 +7479,2983,1498,7480,2654,2620, 755,1366,3641,3257,3126,2025,1609, 119,1917,3427, # 4294 + 862,1026,4109,7481,3904,3760,4362,3905,4363,2260,1951,2470,7482,1125, 817,4110, # 4310 +4111,3906,1513,1766,2040,1487,4112,3030,3258,2824,3761,3127,7483,7484,1507,7485, # 4326 +2683, 733, 40,1632,1106,2865, 345,4113, 841,2524, 230,4364,2984,1846,3259,3428, # 4342 +7486,1263, 986,3429,7487, 735, 879, 254,1137, 857, 622,1300,1180,1388,1562,3907, # 4358 +3908,2939, 967,2751,2655,1349, 592,2133,1692,3324,2985,1994,4114,1679,3909,1901, # 4374 +2185,7488, 739,3642,2715,1296,1290,7489,4115,2198,2199,1921,1563,2595,2551,1870, # 4390 +2752,2986,7490, 435,7491, 343,1108, 596, 17,1751,4365,2235,3430,3643,7492,4366, # 4406 + 294,3527,2940,1693, 477, 979, 281,2041,3528, 643,2042,3644,2621,2782,2261,1031, # 4422 +2335,2134,2298,3529,4367, 367,1249,2552,7493,3530,7494,4368,1283,3325,2004, 240, # 4438 +1762,3326,4369,4370, 836,1069,3128, 474,7495,2148,2525, 268,3531,7496,3188,1521, # 4454 +1284,7497,1658,1546,4116,7498,3532,3533,7499,4117,3327,2684,1685,4118, 961,1673, # 4470 +2622, 190,2005,2200,3762,4371,4372,7500, 570,2497,3645,1490,7501,4373,2623,3260, # 4486 +1956,4374, 584,1514, 396,1045,1944,7502,4375,1967,2444,7503,7504,4376,3910, 619, # 4502 +7505,3129,3261, 215,2006,2783,2553,3189,4377,3190,4378, 763,4119,3763,4379,7506, # 4518 +7507,1957,1767,2941,3328,3646,1174, 452,1477,4380,3329,3130,7508,2825,1253,2382, # 4534 +2186,1091,2285,4120, 492,7509, 638,1169,1824,2135,1752,3911, 648, 926,1021,1324, # 4550 +4381, 520,4382, 997, 847,1007, 892,4383,3764,2262,1871,3647,7510,2400,1784,4384, # 4566 +1952,2942,3080,3191,1728,4121,2043,3648,4385,2007,1701,3131,1551, 30,2263,4122, # 4582 +7511,2026,4386,3534,7512, 501,7513,4123, 594,3431,2165,1821,3535,3432,3536,3192, # 4598 + 829,2826,4124,7514,1680,3132,1225,4125,7515,3262,4387,4126,3133,2336,7516,4388, # 4614 +4127,7517,3912,3913,7518,1847,2383,2596,3330,7519,4389, 374,3914, 652,4128,4129, # 4630 + 375,1140, 798,7520,7521,7522,2361,4390,2264, 546,1659, 138,3031,2445,4391,7523, # 4646 +2250, 612,1848, 910, 796,3765,1740,1371, 825,3766,3767,7524,2906,2554,7525, 692, # 4662 + 444,3032,2624, 801,4392,4130,7526,1491, 244,1053,3033,4131,4132, 340,7527,3915, # 4678 +1041,2987, 293,1168, 87,1357,7528,1539, 959,7529,2236, 721, 694,4133,3768, 219, # 4694 +1478, 644,1417,3331,2656,1413,1401,1335,1389,3916,7530,7531,2988,2362,3134,1825, # 4710 + 730,1515, 184,2827, 66,4393,7532,1660,2943, 246,3332, 378,1457, 226,3433, 975, # 4726 +3917,2944,1264,3537, 674, 696,7533, 163,7534,1141,2417,2166, 713,3538,3333,4394, # 4742 +3918,7535,7536,1186, 15,7537,1079,1070,7538,1522,3193,3539, 276,1050,2716, 758, # 4758 +1126, 653,2945,3263,7539,2337, 889,3540,3919,3081,2989, 903,1250,4395,3920,3434, # 4774 +3541,1342,1681,1718, 766,3264, 286, 89,2946,3649,7540,1713,7541,2597,3334,2990, # 4790 +7542,2947,2215,3194,2866,7543,4396,2498,2526, 181, 387,1075,3921, 731,2187,3335, # 4806 +7544,3265, 310, 313,3435,2299, 770,4134, 54,3034, 189,4397,3082,3769,3922,7545, # 4822 +1230,1617,1849, 355,3542,4135,4398,3336, 111,4136,3650,1350,3135,3436,3035,4137, # 4838 +2149,3266,3543,7546,2784,3923,3924,2991, 722,2008,7547,1071, 247,1207,2338,2471, # 4854 +1378,4399,2009, 864,1437,1214,4400, 373,3770,1142,2216, 667,4401, 442,2753,2555, # 4870 +3771,3925,1968,4138,3267,1839, 837, 170,1107, 934,1336,1882,7548,7549,2118,4139, # 4886 +2828, 743,1569,7550,4402,4140, 582,2384,1418,3437,7551,1802,7552, 357,1395,1729, # 4902 +3651,3268,2418,1564,2237,7553,3083,3772,1633,4403,1114,2085,4141,1532,7554, 482, # 4918 +2446,4404,7555,7556,1492, 833,1466,7557,2717,3544,1641,2829,7558,1526,1272,3652, # 4934 +4142,1686,1794, 416,2556,1902,1953,1803,7559,3773,2785,3774,1159,2316,7560,2867, # 4950 +4405,1610,1584,3036,2419,2754, 443,3269,1163,3136,7561,7562,3926,7563,4143,2499, # 4966 +3037,4406,3927,3137,2103,1647,3545,2010,1872,4144,7564,4145, 431,3438,7565, 250, # 4982 + 97, 81,4146,7566,1648,1850,1558, 160, 848,7567, 866, 740,1694,7568,2201,2830, # 4998 +3195,4147,4407,3653,1687, 950,2472, 426, 469,3196,3654,3655,3928,7569,7570,1188, # 5014 + 424,1995, 861,3546,4148,3775,2202,2685, 168,1235,3547,4149,7571,2086,1674,4408, # 5030 +3337,3270, 220,2557,1009,7572,3776, 670,2992, 332,1208, 717,7573,7574,3548,2447, # 5046 +3929,3338,7575, 513,7576,1209,2868,3339,3138,4409,1080,7577,7578,7579,7580,2527, # 5062 +3656,3549, 815,1587,3930,3931,7581,3550,3439,3777,1254,4410,1328,3038,1390,3932, # 5078 +1741,3933,3778,3934,7582, 236,3779,2448,3271,7583,7584,3657,3780,1273,3781,4411, # 5094 +7585, 308,7586,4412, 245,4413,1851,2473,1307,2575, 430, 715,2136,2449,7587, 270, # 5110 + 199,2869,3935,7588,3551,2718,1753, 761,1754, 725,1661,1840,4414,3440,3658,7589, # 5126 +7590, 587, 14,3272, 227,2598, 326, 480,2265, 943,2755,3552, 291, 650,1883,7591, # 5142 +1702,1226, 102,1547, 62,3441, 904,4415,3442,1164,4150,7592,7593,1224,1548,2756, # 5158 + 391, 498,1493,7594,1386,1419,7595,2055,1177,4416, 813, 880,1081,2363, 566,1145, # 5174 +4417,2286,1001,1035,2558,2599,2238, 394,1286,7596,7597,2068,7598, 86,1494,1730, # 5190 +3936, 491,1588, 745, 897,2948, 843,3340,3937,2757,2870,3273,1768, 998,2217,2069, # 5206 + 397,1826,1195,1969,3659,2993,3341, 284,7599,3782,2500,2137,2119,1903,7600,3938, # 5222 +2150,3939,4151,1036,3443,1904, 114,2559,4152, 209,1527,7601,7602,2949,2831,2625, # 5238 +2385,2719,3139, 812,2560,7603,3274,7604,1559, 737,1884,3660,1210, 885, 28,2686, # 5254 +3553,3783,7605,4153,1004,1779,4418,7606, 346,1981,2218,2687,4419,3784,1742, 797, # 5270 +1642,3940,1933,1072,1384,2151, 896,3941,3275,3661,3197,2871,3554,7607,2561,1958, # 5286 +4420,2450,1785,7608,7609,7610,3942,4154,1005,1308,3662,4155,2720,4421,4422,1528, # 5302 +2600, 161,1178,4156,1982, 987,4423,1101,4157, 631,3943,1157,3198,2420,1343,1241, # 5318 +1016,2239,2562, 372, 877,2339,2501,1160, 555,1934, 911,3944,7611, 466,1170, 169, # 5334 +1051,2907,2688,3663,2474,2994,1182,2011,2563,1251,2626,7612, 992,2340,3444,1540, # 5350 +2721,1201,2070,2401,1996,2475,7613,4424, 528,1922,2188,1503,1873,1570,2364,3342, # 5366 +3276,7614, 557,1073,7615,1827,3445,2087,2266,3140,3039,3084, 767,3085,2786,4425, # 5382 +1006,4158,4426,2341,1267,2176,3664,3199, 778,3945,3200,2722,1597,2657,7616,4427, # 5398 +7617,3446,7618,7619,7620,3277,2689,1433,3278, 131, 95,1504,3946, 723,4159,3141, # 5414 +1841,3555,2758,2189,3947,2027,2104,3665,7621,2995,3948,1218,7622,3343,3201,3949, # 5430 +4160,2576, 248,1634,3785, 912,7623,2832,3666,3040,3786, 654, 53,7624,2996,7625, # 5446 +1688,4428, 777,3447,1032,3950,1425,7626, 191, 820,2120,2833, 971,4429, 931,3202, # 5462 + 135, 664, 783,3787,1997, 772,2908,1935,3951,3788,4430,2909,3203, 282,2723, 640, # 5478 +1372,3448,1127, 922, 325,3344,7627,7628, 711,2044,7629,7630,3952,2219,2787,1936, # 5494 +3953,3345,2220,2251,3789,2300,7631,4431,3790,1258,3279,3954,3204,2138,2950,3955, # 5510 +3956,7632,2221, 258,3205,4432, 101,1227,7633,3280,1755,7634,1391,3281,7635,2910, # 5526 +2056, 893,7636,7637,7638,1402,4161,2342,7639,7640,3206,3556,7641,7642, 878,1325, # 5542 +1780,2788,4433, 259,1385,2577, 744,1183,2267,4434,7643,3957,2502,7644, 684,1024, # 5558 +4162,7645, 472,3557,3449,1165,3282,3958,3959, 322,2152, 881, 455,1695,1152,1340, # 5574 + 660, 554,2153,4435,1058,4436,4163, 830,1065,3346,3960,4437,1923,7646,1703,1918, # 5590 +7647, 932,2268, 122,7648,4438, 947, 677,7649,3791,2627, 297,1905,1924,2269,4439, # 5606 +2317,3283,7650,7651,4164,7652,4165, 84,4166, 112, 989,7653, 547,1059,3961, 701, # 5622 +3558,1019,7654,4167,7655,3450, 942, 639, 457,2301,2451, 993,2951, 407, 851, 494, # 5638 +4440,3347, 927,7656,1237,7657,2421,3348, 573,4168, 680, 921,2911,1279,1874, 285, # 5654 + 790,1448,1983, 719,2167,7658,7659,4441,3962,3963,1649,7660,1541, 563,7661,1077, # 5670 +7662,3349,3041,3451, 511,2997,3964,3965,3667,3966,1268,2564,3350,3207,4442,4443, # 5686 +7663, 535,1048,1276,1189,2912,2028,3142,1438,1373,2834,2952,1134,2012,7664,4169, # 5702 +1238,2578,3086,1259,7665, 700,7666,2953,3143,3668,4170,7667,4171,1146,1875,1906, # 5718 +4444,2601,3967, 781,2422, 132,1589, 203, 147, 273,2789,2402, 898,1786,2154,3968, # 5734 +3969,7668,3792,2790,7669,7670,4445,4446,7671,3208,7672,1635,3793, 965,7673,1804, # 5750 +2690,1516,3559,1121,1082,1329,3284,3970,1449,3794, 65,1128,2835,2913,2759,1590, # 5766 +3795,7674,7675, 12,2658, 45, 976,2579,3144,4447, 517,2528,1013,1037,3209,7676, # 5782 +3796,2836,7677,3797,7678,3452,7679,2602, 614,1998,2318,3798,3087,2724,2628,7680, # 5798 +2580,4172, 599,1269,7681,1810,3669,7682,2691,3088, 759,1060, 489,1805,3351,3285, # 5814 +1358,7683,7684,2386,1387,1215,2629,2252, 490,7685,7686,4173,1759,2387,2343,7687, # 5830 +4448,3799,1907,3971,2630,1806,3210,4449,3453,3286,2760,2344, 874,7688,7689,3454, # 5846 +3670,1858, 91,2914,3671,3042,3800,4450,7690,3145,3972,2659,7691,3455,1202,1403, # 5862 +3801,2954,2529,1517,2503,4451,3456,2504,7692,4452,7693,2692,1885,1495,1731,3973, # 5878 +2365,4453,7694,2029,7695,7696,3974,2693,1216, 237,2581,4174,2319,3975,3802,4454, # 5894 +4455,2694,3560,3457, 445,4456,7697,7698,7699,7700,2761, 61,3976,3672,1822,3977, # 5910 +7701, 687,2045, 935, 925, 405,2660, 703,1096,1859,2725,4457,3978,1876,1367,2695, # 5926 +3352, 918,2105,1781,2476, 334,3287,1611,1093,4458, 564,3146,3458,3673,3353, 945, # 5942 +2631,2057,4459,7702,1925, 872,4175,7703,3459,2696,3089, 349,4176,3674,3979,4460, # 5958 +3803,4177,3675,2155,3980,4461,4462,4178,4463,2403,2046, 782,3981, 400, 251,4179, # 5974 +1624,7704,7705, 277,3676, 299,1265, 476,1191,3804,2121,4180,4181,1109, 205,7706, # 5990 +2582,1000,2156,3561,1860,7707,7708,7709,4464,7710,4465,2565, 107,2477,2157,3982, # 6006 +3460,3147,7711,1533, 541,1301, 158, 753,4182,2872,3562,7712,1696, 370,1088,4183, # 6022 +4466,3563, 579, 327, 440, 162,2240, 269,1937,1374,3461, 968,3043, 56,1396,3090, # 6038 +2106,3288,3354,7713,1926,2158,4467,2998,7714,3564,7715,7716,3677,4468,2478,7717, # 6054 +2791,7718,1650,4469,7719,2603,7720,7721,3983,2661,3355,1149,3356,3984,3805,3985, # 6070 +7722,1076, 49,7723, 951,3211,3289,3290, 450,2837, 920,7724,1811,2792,2366,4184, # 6086 +1908,1138,2367,3806,3462,7725,3212,4470,1909,1147,1518,2423,4471,3807,7726,4472, # 6102 +2388,2604, 260,1795,3213,7727,7728,3808,3291, 708,7729,3565,1704,7730,3566,1351, # 6118 +1618,3357,2999,1886, 944,4185,3358,4186,3044,3359,4187,7731,3678, 422, 413,1714, # 6134 +3292, 500,2058,2345,4188,2479,7732,1344,1910, 954,7733,1668,7734,7735,3986,2404, # 6150 +4189,3567,3809,4190,7736,2302,1318,2505,3091, 133,3092,2873,4473, 629, 31,2838, # 6166 +2697,3810,4474, 850, 949,4475,3987,2955,1732,2088,4191,1496,1852,7737,3988, 620, # 6182 +3214, 981,1242,3679,3360,1619,3680,1643,3293,2139,2452,1970,1719,3463,2168,7738, # 6198 +3215,7739,7740,3361,1828,7741,1277,4476,1565,2047,7742,1636,3568,3093,7743, 869, # 6214 +2839, 655,3811,3812,3094,3989,3000,3813,1310,3569,4477,7744,7745,7746,1733, 558, # 6230 +4478,3681, 335,1549,3045,1756,4192,3682,1945,3464,1829,1291,1192, 470,2726,2107, # 6246 +2793, 913,1054,3990,7747,1027,7748,3046,3991,4479, 982,2662,3362,3148,3465,3216, # 6262 +3217,1946,2794,7749, 571,4480,7750,1830,7751,3570,2583,1523,2424,7752,2089, 984, # 6278 +4481,3683,1959,7753,3684, 852, 923,2795,3466,3685, 969,1519, 999,2048,2320,1705, # 6294 +7754,3095, 615,1662, 151, 597,3992,2405,2321,1049, 275,4482,3686,4193, 568,3687, # 6310 +3571,2480,4194,3688,7755,2425,2270, 409,3218,7756,1566,2874,3467,1002, 769,2840, # 6326 + 194,2090,3149,3689,2222,3294,4195, 628,1505,7757,7758,1763,2177,3001,3993, 521, # 6342 +1161,2584,1787,2203,2406,4483,3994,1625,4196,4197, 412, 42,3096, 464,7759,2632, # 6358 +4484,3363,1760,1571,2875,3468,2530,1219,2204,3814,2633,2140,2368,4485,4486,3295, # 6374 +1651,3364,3572,7760,7761,3573,2481,3469,7762,3690,7763,7764,2271,2091, 460,7765, # 6390 +4487,7766,3002, 962, 588,3574, 289,3219,2634,1116, 52,7767,3047,1796,7768,7769, # 6406 +7770,1467,7771,1598,1143,3691,4198,1984,1734,1067,4488,1280,3365, 465,4489,1572, # 6422 + 510,7772,1927,2241,1812,1644,3575,7773,4490,3692,7774,7775,2663,1573,1534,7776, # 6438 +7777,4199, 536,1807,1761,3470,3815,3150,2635,7778,7779,7780,4491,3471,2915,1911, # 6454 +2796,7781,3296,1122, 377,3220,7782, 360,7783,7784,4200,1529, 551,7785,2059,3693, # 6470 +1769,2426,7786,2916,4201,3297,3097,2322,2108,2030,4492,1404, 136,1468,1479, 672, # 6486 +1171,3221,2303, 271,3151,7787,2762,7788,2049, 678,2727, 865,1947,4493,7789,2013, # 6502 +3995,2956,7790,2728,2223,1397,3048,3694,4494,4495,1735,2917,3366,3576,7791,3816, # 6518 + 509,2841,2453,2876,3817,7792,7793,3152,3153,4496,4202,2531,4497,2304,1166,1010, # 6534 + 552, 681,1887,7794,7795,2957,2958,3996,1287,1596,1861,3154, 358, 453, 736, 175, # 6550 + 478,1117, 905,1167,1097,7796,1853,1530,7797,1706,7798,2178,3472,2287,3695,3473, # 6566 +3577,4203,2092,4204,7799,3367,1193,2482,4205,1458,2190,2205,1862,1888,1421,3298, # 6582 +2918,3049,2179,3474, 595,2122,7800,3997,7801,7802,4206,1707,2636, 223,3696,1359, # 6598 + 751,3098, 183,3475,7803,2797,3003, 419,2369, 633, 704,3818,2389, 241,7804,7805, # 6614 +7806, 838,3004,3697,2272,2763,2454,3819,1938,2050,3998,1309,3099,2242,1181,7807, # 6630 +1136,2206,3820,2370,1446,4207,2305,4498,7808,7809,4208,1055,2605, 484,3698,7810, # 6646 +3999, 625,4209,2273,3368,1499,4210,4000,7811,4001,4211,3222,2274,2275,3476,7812, # 6662 +7813,2764, 808,2606,3699,3369,4002,4212,3100,2532, 526,3370,3821,4213, 955,7814, # 6678 +1620,4214,2637,2427,7815,1429,3700,1669,1831, 994, 928,7816,3578,1260,7817,7818, # 6694 +7819,1948,2288, 741,2919,1626,4215,2729,2455, 867,1184, 362,3371,1392,7820,7821, # 6710 +4003,4216,1770,1736,3223,2920,4499,4500,1928,2698,1459,1158,7822,3050,3372,2877, # 6726 +1292,1929,2506,2842,3701,1985,1187,2071,2014,2607,4217,7823,2566,2507,2169,3702, # 6742 +2483,3299,7824,3703,4501,7825,7826, 666,1003,3005,1022,3579,4218,7827,4502,1813, # 6758 +2253, 574,3822,1603, 295,1535, 705,3823,4219, 283, 858, 417,7828,7829,3224,4503, # 6774 +4504,3051,1220,1889,1046,2276,2456,4004,1393,1599, 689,2567, 388,4220,7830,2484, # 6790 + 802,7831,2798,3824,2060,1405,2254,7832,4505,3825,2109,1052,1345,3225,1585,7833, # 6806 + 809,7834,7835,7836, 575,2730,3477, 956,1552,1469,1144,2323,7837,2324,1560,2457, # 6822 +3580,3226,4005, 616,2207,3155,2180,2289,7838,1832,7839,3478,4506,7840,1319,3704, # 6838 +3705,1211,3581,1023,3227,1293,2799,7841,7842,7843,3826, 607,2306,3827, 762,2878, # 6854 +1439,4221,1360,7844,1485,3052,7845,4507,1038,4222,1450,2061,2638,4223,1379,4508, # 6870 +2585,7846,7847,4224,1352,1414,2325,2921,1172,7848,7849,3828,3829,7850,1797,1451, # 6886 +7851,7852,7853,7854,2922,4006,4007,2485,2346, 411,4008,4009,3582,3300,3101,4509, # 6902 +1561,2664,1452,4010,1375,7855,7856, 47,2959, 316,7857,1406,1591,2923,3156,7858, # 6918 +1025,2141,3102,3157, 354,2731, 884,2224,4225,2407, 508,3706, 726,3583, 996,2428, # 6934 +3584, 729,7859, 392,2191,1453,4011,4510,3707,7860,7861,2458,3585,2608,1675,2800, # 6950 + 919,2347,2960,2348,1270,4511,4012, 73,7862,7863, 647,7864,3228,2843,2255,1550, # 6966 +1346,3006,7865,1332, 883,3479,7866,7867,7868,7869,3301,2765,7870,1212, 831,1347, # 6982 +4226,4512,2326,3830,1863,3053, 720,3831,4513,4514,3832,7871,4227,7872,7873,4515, # 6998 +7874,7875,1798,4516,3708,2609,4517,3586,1645,2371,7876,7877,2924, 669,2208,2665, # 7014 +2429,7878,2879,7879,7880,1028,3229,7881,4228,2408,7882,2256,1353,7883,7884,4518, # 7030 +3158, 518,7885,4013,7886,4229,1960,7887,2142,4230,7888,7889,3007,2349,2350,3833, # 7046 + 516,1833,1454,4014,2699,4231,4519,2225,2610,1971,1129,3587,7890,2766,7891,2961, # 7062 +1422, 577,1470,3008,1524,3373,7892,7893, 432,4232,3054,3480,7894,2586,1455,2508, # 7078 +2226,1972,1175,7895,1020,2732,4015,3481,4520,7896,2733,7897,1743,1361,3055,3482, # 7094 +2639,4016,4233,4521,2290, 895, 924,4234,2170, 331,2243,3056, 166,1627,3057,1098, # 7110 +7898,1232,2880,2227,3374,4522, 657, 403,1196,2372, 542,3709,3375,1600,4235,3483, # 7126 +7899,4523,2767,3230, 576, 530,1362,7900,4524,2533,2666,3710,4017,7901, 842,3834, # 7142 +7902,2801,2031,1014,4018, 213,2700,3376, 665, 621,4236,7903,3711,2925,2430,7904, # 7158 +2431,3302,3588,3377,7905,4237,2534,4238,4525,3589,1682,4239,3484,1380,7906, 724, # 7174 +2277, 600,1670,7907,1337,1233,4526,3103,2244,7908,1621,4527,7909, 651,4240,7910, # 7190 +1612,4241,2611,7911,2844,7912,2734,2307,3058,7913, 716,2459,3059, 174,1255,2701, # 7206 +4019,3590, 548,1320,1398, 728,4020,1574,7914,1890,1197,3060,4021,7915,3061,3062, # 7222 +3712,3591,3713, 747,7916, 635,4242,4528,7917,7918,7919,4243,7920,7921,4529,7922, # 7238 +3378,4530,2432, 451,7923,3714,2535,2072,4244,2735,4245,4022,7924,1764,4531,7925, # 7254 +4246, 350,7926,2278,2390,2486,7927,4247,4023,2245,1434,4024, 488,4532, 458,4248, # 7270 +4025,3715, 771,1330,2391,3835,2568,3159,2159,2409,1553,2667,3160,4249,7928,2487, # 7286 +2881,2612,1720,2702,4250,3379,4533,7929,2536,4251,7930,3231,4252,2768,7931,2015, # 7302 +2736,7932,1155,1017,3716,3836,7933,3303,2308, 201,1864,4253,1430,7934,4026,7935, # 7318 +7936,7937,7938,7939,4254,1604,7940, 414,1865, 371,2587,4534,4535,3485,2016,3104, # 7334 +4536,1708, 960,4255, 887, 389,2171,1536,1663,1721,7941,2228,4027,2351,2926,1580, # 7350 +7942,7943,7944,1744,7945,2537,4537,4538,7946,4539,7947,2073,7948,7949,3592,3380, # 7366 +2882,4256,7950,4257,2640,3381,2802, 673,2703,2460, 709,3486,4028,3593,4258,7951, # 7382 +1148, 502, 634,7952,7953,1204,4540,3594,1575,4541,2613,3717,7954,3718,3105, 948, # 7398 +3232, 121,1745,3837,1110,7955,4259,3063,2509,3009,4029,3719,1151,1771,3838,1488, # 7414 +4030,1986,7956,2433,3487,7957,7958,2093,7959,4260,3839,1213,1407,2803, 531,2737, # 7430 +2538,3233,1011,1537,7960,2769,4261,3106,1061,7961,3720,3721,1866,2883,7962,2017, # 7446 + 120,4262,4263,2062,3595,3234,2309,3840,2668,3382,1954,4542,7963,7964,3488,1047, # 7462 +2704,1266,7965,1368,4543,2845, 649,3383,3841,2539,2738,1102,2846,2669,7966,7967, # 7478 +1999,7968,1111,3596,2962,7969,2488,3842,3597,2804,1854,3384,3722,7970,7971,3385, # 7494 +2410,2884,3304,3235,3598,7972,2569,7973,3599,2805,4031,1460, 856,7974,3600,7975, # 7510 +2885,2963,7976,2886,3843,7977,4264, 632,2510, 875,3844,1697,3845,2291,7978,7979, # 7526 +4544,3010,1239, 580,4545,4265,7980, 914, 936,2074,1190,4032,1039,2123,7981,7982, # 7542 +7983,3386,1473,7984,1354,4266,3846,7985,2172,3064,4033, 915,3305,4267,4268,3306, # 7558 +1605,1834,7986,2739, 398,3601,4269,3847,4034, 328,1912,2847,4035,3848,1331,4270, # 7574 +3011, 937,4271,7987,3602,4036,4037,3387,2160,4546,3388, 524, 742, 538,3065,1012, # 7590 +7988,7989,3849,2461,7990, 658,1103, 225,3850,7991,7992,4547,7993,4548,7994,3236, # 7606 +1243,7995,4038, 963,2246,4549,7996,2705,3603,3161,7997,7998,2588,2327,7999,4550, # 7622 +8000,8001,8002,3489,3307, 957,3389,2540,2032,1930,2927,2462, 870,2018,3604,1746, # 7638 +2770,2771,2434,2463,8003,3851,8004,3723,3107,3724,3490,3390,3725,8005,1179,3066, # 7654 +8006,3162,2373,4272,3726,2541,3163,3108,2740,4039,8007,3391,1556,2542,2292, 977, # 7670 +2887,2033,4040,1205,3392,8008,1765,3393,3164,2124,1271,1689, 714,4551,3491,8009, # 7686 +2328,3852, 533,4273,3605,2181, 617,8010,2464,3308,3492,2310,8011,8012,3165,8013, # 7702 +8014,3853,1987, 618, 427,2641,3493,3394,8015,8016,1244,1690,8017,2806,4274,4552, # 7718 +8018,3494,8019,8020,2279,1576, 473,3606,4275,3395, 972,8021,3607,8022,3067,8023, # 7734 +8024,4553,4554,8025,3727,4041,4042,8026, 153,4555, 356,8027,1891,2888,4276,2143, # 7750 + 408, 803,2352,8028,3854,8029,4277,1646,2570,2511,4556,4557,3855,8030,3856,4278, # 7766 +8031,2411,3396, 752,8032,8033,1961,2964,8034, 746,3012,2465,8035,4279,3728, 698, # 7782 +4558,1892,4280,3608,2543,4559,3609,3857,8036,3166,3397,8037,1823,1302,4043,2706, # 7798 +3858,1973,4281,8038,4282,3167, 823,1303,1288,1236,2848,3495,4044,3398, 774,3859, # 7814 +8039,1581,4560,1304,2849,3860,4561,8040,2435,2161,1083,3237,4283,4045,4284, 344, # 7830 +1173, 288,2311, 454,1683,8041,8042,1461,4562,4046,2589,8043,8044,4563, 985, 894, # 7846 +8045,3399,3168,8046,1913,2928,3729,1988,8047,2110,1974,8048,4047,8049,2571,1194, # 7862 + 425,8050,4564,3169,1245,3730,4285,8051,8052,2850,8053, 636,4565,1855,3861, 760, # 7878 +1799,8054,4286,2209,1508,4566,4048,1893,1684,2293,8055,8056,8057,4287,4288,2210, # 7894 + 479,8058,8059, 832,8060,4049,2489,8061,2965,2490,3731, 990,3109, 627,1814,2642, # 7910 +4289,1582,4290,2125,2111,3496,4567,8062, 799,4291,3170,8063,4568,2112,1737,3013, # 7926 +1018, 543, 754,4292,3309,1676,4569,4570,4050,8064,1489,8065,3497,8066,2614,2889, # 7942 +4051,8067,8068,2966,8069,8070,8071,8072,3171,4571,4572,2182,1722,8073,3238,3239, # 7958 +1842,3610,1715, 481, 365,1975,1856,8074,8075,1962,2491,4573,8076,2126,3611,3240, # 7974 + 433,1894,2063,2075,8077, 602,2741,8078,8079,8080,8081,8082,3014,1628,3400,8083, # 7990 +3172,4574,4052,2890,4575,2512,8084,2544,2772,8085,8086,8087,3310,4576,2891,8088, # 8006 +4577,8089,2851,4578,4579,1221,2967,4053,2513,8090,8091,8092,1867,1989,8093,8094, # 8022 +8095,1895,8096,8097,4580,1896,4054, 318,8098,2094,4055,4293,8099,8100, 485,8101, # 8038 + 938,3862, 553,2670, 116,8102,3863,3612,8103,3498,2671,2773,3401,3311,2807,8104, # 8054 +3613,2929,4056,1747,2930,2968,8105,8106, 207,8107,8108,2672,4581,2514,8109,3015, # 8070 + 890,3614,3864,8110,1877,3732,3402,8111,2183,2353,3403,1652,8112,8113,8114, 941, # 8086 +2294, 208,3499,4057,2019, 330,4294,3865,2892,2492,3733,4295,8115,8116,8117,8118, # 8102 +) + diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/euctwprober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/euctwprober.py new file mode 100644 index 0000000000000000000000000000000000000000..35669cc4dd809fa4007ee67c752f1be991135e77 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/euctwprober.py @@ -0,0 +1,46 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .mbcharsetprober import MultiByteCharSetProber +from .codingstatemachine import CodingStateMachine +from .chardistribution import EUCTWDistributionAnalysis +from .mbcssm import EUCTW_SM_MODEL + +class EUCTWProber(MultiByteCharSetProber): + def __init__(self): + super(EUCTWProber, self).__init__() + self.coding_sm = CodingStateMachine(EUCTW_SM_MODEL) + self.distribution_analyzer = EUCTWDistributionAnalysis() + self.reset() + + @property + def charset_name(self): + return "EUC-TW" + + @property + def language(self): + return "Taiwan" diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/gb2312freq.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/gb2312freq.py new file mode 100644 index 0000000000000000000000000000000000000000..697837bd9a87a77fc468fd1f10dd470d01701362 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/gb2312freq.py @@ -0,0 +1,283 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Communicator client code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +# GB2312 most frequently used character table +# +# Char to FreqOrder table , from hz6763 + +# 512 --> 0.79 -- 0.79 +# 1024 --> 0.92 -- 0.13 +# 2048 --> 0.98 -- 0.06 +# 6768 --> 1.00 -- 0.02 +# +# Ideal Distribution Ratio = 0.79135/(1-0.79135) = 3.79 +# Random Distribution Ration = 512 / (3755 - 512) = 0.157 +# +# Typical Distribution Ratio about 25% of Ideal one, still much higher that RDR + +GB2312_TYPICAL_DISTRIBUTION_RATIO = 0.9 + +GB2312_TABLE_SIZE = 3760 + +GB2312_CHAR_TO_FREQ_ORDER = ( +1671, 749,1443,2364,3924,3807,2330,3921,1704,3463,2691,1511,1515, 572,3191,2205, +2361, 224,2558, 479,1711, 963,3162, 440,4060,1905,2966,2947,3580,2647,3961,3842, +2204, 869,4207, 970,2678,5626,2944,2956,1479,4048, 514,3595, 588,1346,2820,3409, + 249,4088,1746,1873,2047,1774, 581,1813, 358,1174,3590,1014,1561,4844,2245, 670, +1636,3112, 889,1286, 953, 556,2327,3060,1290,3141, 613, 185,3477,1367, 850,3820, +1715,2428,2642,2303,2732,3041,2562,2648,3566,3946,1349, 388,3098,2091,1360,3585, + 152,1687,1539, 738,1559, 59,1232,2925,2267,1388,1249,1741,1679,2960, 151,1566, +1125,1352,4271, 924,4296, 385,3166,4459, 310,1245,2850, 70,3285,2729,3534,3575, +2398,3298,3466,1960,2265, 217,3647, 864,1909,2084,4401,2773,1010,3269,5152, 853, +3051,3121,1244,4251,1895, 364,1499,1540,2313,1180,3655,2268, 562, 715,2417,3061, + 544, 336,3768,2380,1752,4075, 950, 280,2425,4382, 183,2759,3272, 333,4297,2155, +1688,2356,1444,1039,4540, 736,1177,3349,2443,2368,2144,2225, 565, 196,1482,3406, + 927,1335,4147, 692, 878,1311,1653,3911,3622,1378,4200,1840,2969,3149,2126,1816, +2534,1546,2393,2760, 737,2494, 13, 447, 245,2747, 38,2765,2129,2589,1079, 606, + 360, 471,3755,2890, 404, 848, 699,1785,1236, 370,2221,1023,3746,2074,2026,2023, +2388,1581,2119, 812,1141,3091,2536,1519, 804,2053, 406,1596,1090, 784, 548,4414, +1806,2264,2936,1100, 343,4114,5096, 622,3358, 743,3668,1510,1626,5020,3567,2513, +3195,4115,5627,2489,2991, 24,2065,2697,1087,2719, 48,1634, 315, 68, 985,2052, + 198,2239,1347,1107,1439, 597,2366,2172, 871,3307, 919,2487,2790,1867, 236,2570, +1413,3794, 906,3365,3381,1701,1982,1818,1524,2924,1205, 616,2586,2072,2004, 575, + 253,3099, 32,1365,1182, 197,1714,2454,1201, 554,3388,3224,2748, 756,2587, 250, +2567,1507,1517,3529,1922,2761,2337,3416,1961,1677,2452,2238,3153, 615, 911,1506, +1474,2495,1265,1906,2749,3756,3280,2161, 898,2714,1759,3450,2243,2444, 563, 26, +3286,2266,3769,3344,2707,3677, 611,1402, 531,1028,2871,4548,1375, 261,2948, 835, +1190,4134, 353, 840,2684,1900,3082,1435,2109,1207,1674, 329,1872,2781,4055,2686, +2104, 608,3318,2423,2957,2768,1108,3739,3512,3271,3985,2203,1771,3520,1418,2054, +1681,1153, 225,1627,2929, 162,2050,2511,3687,1954, 124,1859,2431,1684,3032,2894, + 585,4805,3969,2869,2704,2088,2032,2095,3656,2635,4362,2209, 256, 518,2042,2105, +3777,3657, 643,2298,1148,1779, 190, 989,3544, 414, 11,2135,2063,2979,1471, 403, +3678, 126, 770,1563, 671,2499,3216,2877, 600,1179, 307,2805,4937,1268,1297,2694, + 252,4032,1448,1494,1331,1394, 127,2256, 222,1647,1035,1481,3056,1915,1048, 873, +3651, 210, 33,1608,2516, 200,1520, 415, 102, 0,3389,1287, 817, 91,3299,2940, + 836,1814, 549,2197,1396,1669,2987,3582,2297,2848,4528,1070, 687, 20,1819, 121, +1552,1364,1461,1968,2617,3540,2824,2083, 177, 948,4938,2291, 110,4549,2066, 648, +3359,1755,2110,2114,4642,4845,1693,3937,3308,1257,1869,2123, 208,1804,3159,2992, +2531,2549,3361,2418,1350,2347,2800,2568,1291,2036,2680, 72, 842,1990, 212,1233, +1154,1586, 75,2027,3410,4900,1823,1337,2710,2676, 728,2810,1522,3026,4995, 157, + 755,1050,4022, 710, 785,1936,2194,2085,1406,2777,2400, 150,1250,4049,1206, 807, +1910, 534, 529,3309,1721,1660, 274, 39,2827, 661,2670,1578, 925,3248,3815,1094, +4278,4901,4252, 41,1150,3747,2572,2227,4501,3658,4902,3813,3357,3617,2884,2258, + 887, 538,4187,3199,1294,2439,3042,2329,2343,2497,1255, 107, 543,1527, 521,3478, +3568, 194,5062, 15, 961,3870,1241,1192,2664, 66,5215,3260,2111,1295,1127,2152, +3805,4135, 901,1164,1976, 398,1278, 530,1460, 748, 904,1054,1966,1426, 53,2909, + 509, 523,2279,1534, 536,1019, 239,1685, 460,2353, 673,1065,2401,3600,4298,2272, +1272,2363, 284,1753,3679,4064,1695, 81, 815,2677,2757,2731,1386, 859, 500,4221, +2190,2566, 757,1006,2519,2068,1166,1455, 337,2654,3203,1863,1682,1914,3025,1252, +1409,1366, 847, 714,2834,2038,3209, 964,2970,1901, 885,2553,1078,1756,3049, 301, +1572,3326, 688,2130,1996,2429,1805,1648,2930,3421,2750,3652,3088, 262,1158,1254, + 389,1641,1812, 526,1719, 923,2073,1073,1902, 468, 489,4625,1140, 857,2375,3070, +3319,2863, 380, 116,1328,2693,1161,2244, 273,1212,1884,2769,3011,1775,1142, 461, +3066,1200,2147,2212, 790, 702,2695,4222,1601,1058, 434,2338,5153,3640, 67,2360, +4099,2502, 618,3472,1329, 416,1132, 830,2782,1807,2653,3211,3510,1662, 192,2124, + 296,3979,1739,1611,3684, 23, 118, 324, 446,1239,1225, 293,2520,3814,3795,2535, +3116, 17,1074, 467,2692,2201, 387,2922, 45,1326,3055,1645,3659,2817, 958, 243, +1903,2320,1339,2825,1784,3289, 356, 576, 865,2315,2381,3377,3916,1088,3122,1713, +1655, 935, 628,4689,1034,1327, 441, 800, 720, 894,1979,2183,1528,5289,2702,1071, +4046,3572,2399,1571,3281, 79, 761,1103, 327, 134, 758,1899,1371,1615, 879, 442, + 215,2605,2579, 173,2048,2485,1057,2975,3317,1097,2253,3801,4263,1403,1650,2946, + 814,4968,3487,1548,2644,1567,1285, 2, 295,2636, 97, 946,3576, 832, 141,4257, +3273, 760,3821,3521,3156,2607, 949,1024,1733,1516,1803,1920,2125,2283,2665,3180, +1501,2064,3560,2171,1592, 803,3518,1416, 732,3897,4258,1363,1362,2458, 119,1427, + 602,1525,2608,1605,1639,3175, 694,3064, 10, 465, 76,2000,4846,4208, 444,3781, +1619,3353,2206,1273,3796, 740,2483, 320,1723,2377,3660,2619,1359,1137,1762,1724, +2345,2842,1850,1862, 912, 821,1866, 612,2625,1735,2573,3369,1093, 844, 89, 937, + 930,1424,3564,2413,2972,1004,3046,3019,2011, 711,3171,1452,4178, 428, 801,1943, + 432, 445,2811, 206,4136,1472, 730, 349, 73, 397,2802,2547, 998,1637,1167, 789, + 396,3217, 154,1218, 716,1120,1780,2819,4826,1931,3334,3762,2139,1215,2627, 552, +3664,3628,3232,1405,2383,3111,1356,2652,3577,3320,3101,1703, 640,1045,1370,1246, +4996, 371,1575,2436,1621,2210, 984,4033,1734,2638, 16,4529, 663,2755,3255,1451, +3917,2257,1253,1955,2234,1263,2951, 214,1229, 617, 485, 359,1831,1969, 473,2310, + 750,2058, 165, 80,2864,2419, 361,4344,2416,2479,1134, 796,3726,1266,2943, 860, +2715, 938, 390,2734,1313,1384, 248, 202, 877,1064,2854, 522,3907, 279,1602, 297, +2357, 395,3740, 137,2075, 944,4089,2584,1267,3802, 62,1533,2285, 178, 176, 780, +2440, 201,3707, 590, 478,1560,4354,2117,1075, 30, 74,4643,4004,1635,1441,2745, + 776,2596, 238,1077,1692,1912,2844, 605, 499,1742,3947, 241,3053, 980,1749, 936, +2640,4511,2582, 515,1543,2162,5322,2892,2993, 890,2148,1924, 665,1827,3581,1032, + 968,3163, 339,1044,1896, 270, 583,1791,1720,4367,1194,3488,3669, 43,2523,1657, + 163,2167, 290,1209,1622,3378, 550, 634,2508,2510, 695,2634,2384,2512,1476,1414, + 220,1469,2341,2138,2852,3183,2900,4939,2865,3502,1211,3680, 854,3227,1299,2976, +3172, 186,2998,1459, 443,1067,3251,1495, 321,1932,3054, 909, 753,1410,1828, 436, +2441,1119,1587,3164,2186,1258, 227, 231,1425,1890,3200,3942, 247, 959, 725,5254, +2741, 577,2158,2079, 929, 120, 174, 838,2813, 591,1115, 417,2024, 40,3240,1536, +1037, 291,4151,2354, 632,1298,2406,2500,3535,1825,1846,3451, 205,1171, 345,4238, + 18,1163, 811, 685,2208,1217, 425,1312,1508,1175,4308,2552,1033, 587,1381,3059, +2984,3482, 340,1316,4023,3972, 792,3176, 519, 777,4690, 918, 933,4130,2981,3741, + 90,3360,2911,2200,5184,4550, 609,3079,2030, 272,3379,2736, 363,3881,1130,1447, + 286, 779, 357,1169,3350,3137,1630,1220,2687,2391, 747,1277,3688,2618,2682,2601, +1156,3196,5290,4034,3102,1689,3596,3128, 874, 219,2783, 798, 508,1843,2461, 269, +1658,1776,1392,1913,2983,3287,2866,2159,2372, 829,4076, 46,4253,2873,1889,1894, + 915,1834,1631,2181,2318, 298, 664,2818,3555,2735, 954,3228,3117, 527,3511,2173, + 681,2712,3033,2247,2346,3467,1652, 155,2164,3382, 113,1994, 450, 899, 494, 994, +1237,2958,1875,2336,1926,3727, 545,1577,1550, 633,3473, 204,1305,3072,2410,1956, +2471, 707,2134, 841,2195,2196,2663,3843,1026,4940, 990,3252,4997, 368,1092, 437, +3212,3258,1933,1829, 675,2977,2893, 412, 943,3723,4644,3294,3283,2230,2373,5154, +2389,2241,2661,2323,1404,2524, 593, 787, 677,3008,1275,2059, 438,2709,2609,2240, +2269,2246,1446, 36,1568,1373,3892,1574,2301,1456,3962, 693,2276,5216,2035,1143, +2720,1919,1797,1811,2763,4137,2597,1830,1699,1488,1198,2090, 424,1694, 312,3634, +3390,4179,3335,2252,1214, 561,1059,3243,2295,2561, 975,5155,2321,2751,3772, 472, +1537,3282,3398,1047,2077,2348,2878,1323,3340,3076, 690,2906, 51, 369, 170,3541, +1060,2187,2688,3670,2541,1083,1683, 928,3918, 459, 109,4427, 599,3744,4286, 143, +2101,2730,2490, 82,1588,3036,2121, 281,1860, 477,4035,1238,2812,3020,2716,3312, +1530,2188,2055,1317, 843, 636,1808,1173,3495, 649, 181,1002, 147,3641,1159,2414, +3750,2289,2795, 813,3123,2610,1136,4368, 5,3391,4541,2174, 420, 429,1728, 754, +1228,2115,2219, 347,2223,2733, 735,1518,3003,2355,3134,1764,3948,3329,1888,2424, +1001,1234,1972,3321,3363,1672,1021,1450,1584, 226, 765, 655,2526,3404,3244,2302, +3665, 731, 594,2184, 319,1576, 621, 658,2656,4299,2099,3864,1279,2071,2598,2739, + 795,3086,3699,3908,1707,2352,2402,1382,3136,2475,1465,4847,3496,3865,1085,3004, +2591,1084, 213,2287,1963,3565,2250, 822, 793,4574,3187,1772,1789,3050, 595,1484, +1959,2770,1080,2650, 456, 422,2996, 940,3322,4328,4345,3092,2742, 965,2784, 739, +4124, 952,1358,2498,2949,2565, 332,2698,2378, 660,2260,2473,4194,3856,2919, 535, +1260,2651,1208,1428,1300,1949,1303,2942, 433,2455,2450,1251,1946, 614,1269, 641, +1306,1810,2737,3078,2912, 564,2365,1419,1415,1497,4460,2367,2185,1379,3005,1307, +3218,2175,1897,3063, 682,1157,4040,4005,1712,1160,1941,1399, 394, 402,2952,1573, +1151,2986,2404, 862, 299,2033,1489,3006, 346, 171,2886,3401,1726,2932, 168,2533, + 47,2507,1030,3735,1145,3370,1395,1318,1579,3609,4560,2857,4116,1457,2529,1965, + 504,1036,2690,2988,2405, 745,5871, 849,2397,2056,3081, 863,2359,3857,2096, 99, +1397,1769,2300,4428,1643,3455,1978,1757,3718,1440, 35,4879,3742,1296,4228,2280, + 160,5063,1599,2013, 166, 520,3479,1646,3345,3012, 490,1937,1545,1264,2182,2505, +1096,1188,1369,1436,2421,1667,2792,2460,1270,2122, 727,3167,2143, 806,1706,1012, +1800,3037, 960,2218,1882, 805, 139,2456,1139,1521, 851,1052,3093,3089, 342,2039, + 744,5097,1468,1502,1585,2087, 223, 939, 326,2140,2577, 892,2481,1623,4077, 982, +3708, 135,2131, 87,2503,3114,2326,1106, 876,1616, 547,2997,2831,2093,3441,4530, +4314, 9,3256,4229,4148, 659,1462,1986,1710,2046,2913,2231,4090,4880,5255,3392, +3274,1368,3689,4645,1477, 705,3384,3635,1068,1529,2941,1458,3782,1509, 100,1656, +2548, 718,2339, 408,1590,2780,3548,1838,4117,3719,1345,3530, 717,3442,2778,3220, +2898,1892,4590,3614,3371,2043,1998,1224,3483, 891, 635, 584,2559,3355, 733,1766, +1729,1172,3789,1891,2307, 781,2982,2271,1957,1580,5773,2633,2005,4195,3097,1535, +3213,1189,1934,5693,3262, 586,3118,1324,1598, 517,1564,2217,1868,1893,4445,3728, +2703,3139,1526,1787,1992,3882,2875,1549,1199,1056,2224,1904,2711,5098,4287, 338, +1993,3129,3489,2689,1809,2815,1997, 957,1855,3898,2550,3275,3057,1105,1319, 627, +1505,1911,1883,3526, 698,3629,3456,1833,1431, 746, 77,1261,2017,2296,1977,1885, + 125,1334,1600, 525,1798,1109,2222,1470,1945, 559,2236,1186,3443,2476,1929,1411, +2411,3135,1777,3372,2621,1841,1613,3229, 668,1430,1839,2643,2916, 195,1989,2671, +2358,1387, 629,3205,2293,5256,4439, 123,1310, 888,1879,4300,3021,3605,1003,1162, +3192,2910,2010, 140,2395,2859, 55,1082,2012,2901, 662, 419,2081,1438, 680,2774, +4654,3912,1620,1731,1625,5035,4065,2328, 512,1344, 802,5443,2163,2311,2537, 524, +3399, 98,1155,2103,1918,2606,3925,2816,1393,2465,1504,3773,2177,3963,1478,4346, + 180,1113,4655,3461,2028,1698, 833,2696,1235,1322,1594,4408,3623,3013,3225,2040, +3022, 541,2881, 607,3632,2029,1665,1219, 639,1385,1686,1099,2803,3231,1938,3188, +2858, 427, 676,2772,1168,2025, 454,3253,2486,3556, 230,1950, 580, 791,1991,1280, +1086,1974,2034, 630, 257,3338,2788,4903,1017, 86,4790, 966,2789,1995,1696,1131, + 259,3095,4188,1308, 179,1463,5257, 289,4107,1248, 42,3413,1725,2288, 896,1947, + 774,4474,4254, 604,3430,4264, 392,2514,2588, 452, 237,1408,3018, 988,4531,1970, +3034,3310, 540,2370,1562,1288,2990, 502,4765,1147, 4,1853,2708, 207, 294,2814, +4078,2902,2509, 684, 34,3105,3532,2551, 644, 709,2801,2344, 573,1727,3573,3557, +2021,1081,3100,4315,2100,3681, 199,2263,1837,2385, 146,3484,1195,2776,3949, 997, +1939,3973,1008,1091,1202,1962,1847,1149,4209,5444,1076, 493, 117,5400,2521, 972, +1490,2934,1796,4542,2374,1512,2933,2657, 413,2888,1135,2762,2314,2156,1355,2369, + 766,2007,2527,2170,3124,2491,2593,2632,4757,2437, 234,3125,3591,1898,1750,1376, +1942,3468,3138, 570,2127,2145,3276,4131, 962, 132,1445,4196, 19, 941,3624,3480, +3366,1973,1374,4461,3431,2629, 283,2415,2275, 808,2887,3620,2112,2563,1353,3610, + 955,1089,3103,1053, 96, 88,4097, 823,3808,1583, 399, 292,4091,3313, 421,1128, + 642,4006, 903,2539,1877,2082, 596, 29,4066,1790, 722,2157, 130, 995,1569, 769, +1485, 464, 513,2213, 288,1923,1101,2453,4316, 133, 486,2445, 50, 625, 487,2207, + 57, 423, 481,2962, 159,3729,1558, 491, 303, 482, 501, 240,2837, 112,3648,2392, +1783, 362, 8,3433,3422, 610,2793,3277,1390,1284,1654, 21,3823, 734, 367, 623, + 193, 287, 374,1009,1483, 816, 476, 313,2255,2340,1262,2150,2899,1146,2581, 782, +2116,1659,2018,1880, 255,3586,3314,1110,2867,2137,2564, 986,2767,5185,2006, 650, + 158, 926, 762, 881,3157,2717,2362,3587, 306,3690,3245,1542,3077,2427,1691,2478, +2118,2985,3490,2438, 539,2305, 983, 129,1754, 355,4201,2386, 827,2923, 104,1773, +2838,2771, 411,2905,3919, 376, 767, 122,1114, 828,2422,1817,3506, 266,3460,1007, +1609,4998, 945,2612,4429,2274, 726,1247,1964,2914,2199,2070,4002,4108, 657,3323, +1422, 579, 455,2764,4737,1222,2895,1670, 824,1223,1487,2525, 558, 861,3080, 598, +2659,2515,1967, 752,2583,2376,2214,4180, 977, 704,2464,4999,2622,4109,1210,2961, + 819,1541, 142,2284, 44, 418, 457,1126,3730,4347,4626,1644,1876,3671,1864, 302, +1063,5694, 624, 723,1984,3745,1314,1676,2488,1610,1449,3558,3569,2166,2098, 409, +1011,2325,3704,2306, 818,1732,1383,1824,1844,3757, 999,2705,3497,1216,1423,2683, +2426,2954,2501,2726,2229,1475,2554,5064,1971,1794,1666,2014,1343, 783, 724, 191, +2434,1354,2220,5065,1763,2752,2472,4152, 131, 175,2885,3434, 92,1466,4920,2616, +3871,3872,3866, 128,1551,1632, 669,1854,3682,4691,4125,1230, 188,2973,3290,1302, +1213, 560,3266, 917, 763,3909,3249,1760, 868,1958, 764,1782,2097, 145,2277,3774, +4462, 64,1491,3062, 971,2132,3606,2442, 221,1226,1617, 218, 323,1185,3207,3147, + 571, 619,1473,1005,1744,2281, 449,1887,2396,3685, 275, 375,3816,1743,3844,3731, + 845,1983,2350,4210,1377, 773, 967,3499,3052,3743,2725,4007,1697,1022,3943,1464, +3264,2855,2722,1952,1029,2839,2467, 84,4383,2215, 820,1391,2015,2448,3672, 377, +1948,2168, 797,2545,3536,2578,2645, 94,2874,1678, 405,1259,3071, 771, 546,1315, + 470,1243,3083, 895,2468, 981, 969,2037, 846,4181, 653,1276,2928, 14,2594, 557, +3007,2474, 156, 902,1338,1740,2574, 537,2518, 973,2282,2216,2433,1928, 138,2903, +1293,2631,1612, 646,3457, 839,2935, 111, 496,2191,2847, 589,3186, 149,3994,2060, +4031,2641,4067,3145,1870, 37,3597,2136,1025,2051,3009,3383,3549,1121,1016,3261, +1301, 251,2446,2599,2153, 872,3246, 637, 334,3705, 831, 884, 921,3065,3140,4092, +2198,1944, 246,2964, 108,2045,1152,1921,2308,1031, 203,3173,4170,1907,3890, 810, +1401,2003,1690, 506, 647,1242,2828,1761,1649,3208,2249,1589,3709,2931,5156,1708, + 498, 666,2613, 834,3817,1231, 184,2851,1124, 883,3197,2261,3710,1765,1553,2658, +1178,2639,2351, 93,1193, 942,2538,2141,4402, 235,1821, 870,1591,2192,1709,1871, +3341,1618,4126,2595,2334, 603, 651, 69, 701, 268,2662,3411,2555,1380,1606, 503, + 448, 254,2371,2646, 574,1187,2309,1770, 322,2235,1292,1801, 305, 566,1133, 229, +2067,2057, 706, 167, 483,2002,2672,3295,1820,3561,3067, 316, 378,2746,3452,1112, + 136,1981, 507,1651,2917,1117, 285,4591, 182,2580,3522,1304, 335,3303,1835,2504, +1795,1792,2248, 674,1018,2106,2449,1857,2292,2845, 976,3047,1781,2600,2727,1389, +1281, 52,3152, 153, 265,3950, 672,3485,3951,4463, 430,1183, 365, 278,2169, 27, +1407,1336,2304, 209,1340,1730,2202,1852,2403,2883, 979,1737,1062, 631,2829,2542, +3876,2592, 825,2086,2226,3048,3625, 352,1417,3724, 542, 991, 431,1351,3938,1861, +2294, 826,1361,2927,3142,3503,1738, 463,2462,2723, 582,1916,1595,2808, 400,3845, +3891,2868,3621,2254, 58,2492,1123, 910,2160,2614,1372,1603,1196,1072,3385,1700, +3267,1980, 696, 480,2430, 920, 799,1570,2920,1951,2041,4047,2540,1321,4223,2469, +3562,2228,1271,2602, 401,2833,3351,2575,5157, 907,2312,1256, 410, 263,3507,1582, + 996, 678,1849,2316,1480, 908,3545,2237, 703,2322, 667,1826,2849,1531,2604,2999, +2407,3146,2151,2630,1786,3711, 469,3542, 497,3899,2409, 858, 837,4446,3393,1274, + 786, 620,1845,2001,3311, 484, 308,3367,1204,1815,3691,2332,1532,2557,1842,2020, +2724,1927,2333,4440, 567, 22,1673,2728,4475,1987,1858,1144,1597, 101,1832,3601, + 12, 974,3783,4391, 951,1412, 1,3720, 453,4608,4041, 528,1041,1027,3230,2628, +1129, 875,1051,3291,1203,2262,1069,2860,2799,2149,2615,3278, 144,1758,3040, 31, + 475,1680, 366,2685,3184, 311,1642,4008,2466,5036,1593,1493,2809, 216,1420,1668, + 233, 304,2128,3284, 232,1429,1768,1040,2008,3407,2740,2967,2543, 242,2133, 778, +1565,2022,2620, 505,2189,2756,1098,2273, 372,1614, 708, 553,2846,2094,2278, 169, +3626,2835,4161, 228,2674,3165, 809,1454,1309, 466,1705,1095, 900,3423, 880,2667, +3751,5258,2317,3109,2571,4317,2766,1503,1342, 866,4447,1118, 63,2076, 314,1881, +1348,1061, 172, 978,3515,1747, 532, 511,3970, 6, 601, 905,2699,3300,1751, 276, +1467,3725,2668, 65,4239,2544,2779,2556,1604, 578,2451,1802, 992,2331,2624,1320, +3446, 713,1513,1013, 103,2786,2447,1661, 886,1702, 916, 654,3574,2031,1556, 751, +2178,2821,2179,1498,1538,2176, 271, 914,2251,2080,1325, 638,1953,2937,3877,2432, +2754, 95,3265,1716, 260,1227,4083, 775, 106,1357,3254, 426,1607, 555,2480, 772, +1985, 244,2546, 474, 495,1046,2611,1851,2061, 71,2089,1675,2590, 742,3758,2843, +3222,1433, 267,2180,2576,2826,2233,2092,3913,2435, 956,1745,3075, 856,2113,1116, + 451, 3,1988,2896,1398, 993,2463,1878,2049,1341,2718,2721,2870,2108, 712,2904, +4363,2753,2324, 277,2872,2349,2649, 384, 987, 435, 691,3000, 922, 164,3939, 652, +1500,1184,4153,2482,3373,2165,4848,2335,3775,3508,3154,2806,2830,1554,2102,1664, +2530,1434,2408, 893,1547,2623,3447,2832,2242,2532,3169,2856,3223,2078, 49,3770, +3469, 462, 318, 656,2259,3250,3069, 679,1629,2758, 344,1138,1104,3120,1836,1283, +3115,2154,1437,4448, 934, 759,1999, 794,2862,1038, 533,2560,1722,2342, 855,2626, +1197,1663,4476,3127, 85,4240,2528, 25,1111,1181,3673, 407,3470,4561,2679,2713, + 768,1925,2841,3986,1544,1165, 932, 373,1240,2146,1930,2673, 721,4766, 354,4333, + 391,2963, 187, 61,3364,1442,1102, 330,1940,1767, 341,3809,4118, 393,2496,2062, +2211, 105, 331, 300, 439, 913,1332, 626, 379,3304,1557, 328, 689,3952, 309,1555, + 931, 317,2517,3027, 325, 569, 686,2107,3084, 60,1042,1333,2794, 264,3177,4014, +1628, 258,3712, 7,4464,1176,1043,1778, 683, 114,1975, 78,1492, 383,1886, 510, + 386, 645,5291,2891,2069,3305,4138,3867,2939,2603,2493,1935,1066,1848,3588,1015, +1282,1289,4609, 697,1453,3044,2666,3611,1856,2412, 54, 719,1330, 568,3778,2459, +1748, 788, 492, 551,1191,1000, 488,3394,3763, 282,1799, 348,2016,1523,3155,2390, +1049, 382,2019,1788,1170, 729,2968,3523, 897,3926,2785,2938,3292, 350,2319,3238, +1718,1717,2655,3453,3143,4465, 161,2889,2980,2009,1421, 56,1908,1640,2387,2232, +1917,1874,2477,4921, 148, 83,3438, 592,4245,2882,1822,1055, 741, 115,1496,1624, + 381,1638,4592,1020, 516,3214, 458, 947,4575,1432, 211,1514,2926,1865,2142, 189, + 852,1221,1400,1486, 882,2299,4036, 351, 28,1122, 700,6479,6480,6481,6482,6483, #last 512 +) + diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/gb2312prober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/gb2312prober.py new file mode 100644 index 0000000000000000000000000000000000000000..8446d2dd959721cc86d4ae5a7699197454f3aa91 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/gb2312prober.py @@ -0,0 +1,46 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .mbcharsetprober import MultiByteCharSetProber +from .codingstatemachine import CodingStateMachine +from .chardistribution import GB2312DistributionAnalysis +from .mbcssm import GB2312_SM_MODEL + +class GB2312Prober(MultiByteCharSetProber): + def __init__(self): + super(GB2312Prober, self).__init__() + self.coding_sm = CodingStateMachine(GB2312_SM_MODEL) + self.distribution_analyzer = GB2312DistributionAnalysis() + self.reset() + + @property + def charset_name(self): + return "GB2312" + + @property + def language(self): + return "Chinese" diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/hebrewprober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/hebrewprober.py new file mode 100644 index 0000000000000000000000000000000000000000..b0e1bf49268203d1f9d14cbe73753d95dc66c8a4 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/hebrewprober.py @@ -0,0 +1,292 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Universal charset detector code. +# +# The Initial Developer of the Original Code is +# Shy Shalom +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .charsetprober import CharSetProber +from .enums import ProbingState + +# This prober doesn't actually recognize a language or a charset. +# It is a helper prober for the use of the Hebrew model probers + +### General ideas of the Hebrew charset recognition ### +# +# Four main charsets exist in Hebrew: +# "ISO-8859-8" - Visual Hebrew +# "windows-1255" - Logical Hebrew +# "ISO-8859-8-I" - Logical Hebrew +# "x-mac-hebrew" - ?? Logical Hebrew ?? +# +# Both "ISO" charsets use a completely identical set of code points, whereas +# "windows-1255" and "x-mac-hebrew" are two different proper supersets of +# these code points. windows-1255 defines additional characters in the range +# 0x80-0x9F as some misc punctuation marks as well as some Hebrew-specific +# diacritics and additional 'Yiddish' ligature letters in the range 0xc0-0xd6. +# x-mac-hebrew defines similar additional code points but with a different +# mapping. +# +# As far as an average Hebrew text with no diacritics is concerned, all four +# charsets are identical with respect to code points. Meaning that for the +# main Hebrew alphabet, all four map the same values to all 27 Hebrew letters +# (including final letters). +# +# The dominant difference between these charsets is their directionality. +# "Visual" directionality means that the text is ordered as if the renderer is +# not aware of a BIDI rendering algorithm. The renderer sees the text and +# draws it from left to right. The text itself when ordered naturally is read +# backwards. A buffer of Visual Hebrew generally looks like so: +# "[last word of first line spelled backwards] [whole line ordered backwards +# and spelled backwards] [first word of first line spelled backwards] +# [end of line] [last word of second line] ... etc' " +# adding punctuation marks, numbers and English text to visual text is +# naturally also "visual" and from left to right. +# +# "Logical" directionality means the text is ordered "naturally" according to +# the order it is read. It is the responsibility of the renderer to display +# the text from right to left. A BIDI algorithm is used to place general +# punctuation marks, numbers and English text in the text. +# +# Texts in x-mac-hebrew are almost impossible to find on the Internet. From +# what little evidence I could find, it seems that its general directionality +# is Logical. +# +# To sum up all of the above, the Hebrew probing mechanism knows about two +# charsets: +# Visual Hebrew - "ISO-8859-8" - backwards text - Words and sentences are +# backwards while line order is natural. For charset recognition purposes +# the line order is unimportant (In fact, for this implementation, even +# word order is unimportant). +# Logical Hebrew - "windows-1255" - normal, naturally ordered text. +# +# "ISO-8859-8-I" is a subset of windows-1255 and doesn't need to be +# specifically identified. +# "x-mac-hebrew" is also identified as windows-1255. A text in x-mac-hebrew +# that contain special punctuation marks or diacritics is displayed with +# some unconverted characters showing as question marks. This problem might +# be corrected using another model prober for x-mac-hebrew. Due to the fact +# that x-mac-hebrew texts are so rare, writing another model prober isn't +# worth the effort and performance hit. +# +#### The Prober #### +# +# The prober is divided between two SBCharSetProbers and a HebrewProber, +# all of which are managed, created, fed data, inquired and deleted by the +# SBCSGroupProber. The two SBCharSetProbers identify that the text is in +# fact some kind of Hebrew, Logical or Visual. The final decision about which +# one is it is made by the HebrewProber by combining final-letter scores +# with the scores of the two SBCharSetProbers to produce a final answer. +# +# The SBCSGroupProber is responsible for stripping the original text of HTML +# tags, English characters, numbers, low-ASCII punctuation characters, spaces +# and new lines. It reduces any sequence of such characters to a single space. +# The buffer fed to each prober in the SBCS group prober is pure text in +# high-ASCII. +# The two SBCharSetProbers (model probers) share the same language model: +# Win1255Model. +# The first SBCharSetProber uses the model normally as any other +# SBCharSetProber does, to recognize windows-1255, upon which this model was +# built. The second SBCharSetProber is told to make the pair-of-letter +# lookup in the language model backwards. This in practice exactly simulates +# a visual Hebrew model using the windows-1255 logical Hebrew model. +# +# The HebrewProber is not using any language model. All it does is look for +# final-letter evidence suggesting the text is either logical Hebrew or visual +# Hebrew. Disjointed from the model probers, the results of the HebrewProber +# alone are meaningless. HebrewProber always returns 0.00 as confidence +# since it never identifies a charset by itself. Instead, the pointer to the +# HebrewProber is passed to the model probers as a helper "Name Prober". +# When the Group prober receives a positive identification from any prober, +# it asks for the name of the charset identified. If the prober queried is a +# Hebrew model prober, the model prober forwards the call to the +# HebrewProber to make the final decision. In the HebrewProber, the +# decision is made according to the final-letters scores maintained and Both +# model probers scores. The answer is returned in the form of the name of the +# charset identified, either "windows-1255" or "ISO-8859-8". + +class HebrewProber(CharSetProber): + # windows-1255 / ISO-8859-8 code points of interest + FINAL_KAF = 0xea + NORMAL_KAF = 0xeb + FINAL_MEM = 0xed + NORMAL_MEM = 0xee + FINAL_NUN = 0xef + NORMAL_NUN = 0xf0 + FINAL_PE = 0xf3 + NORMAL_PE = 0xf4 + FINAL_TSADI = 0xf5 + NORMAL_TSADI = 0xf6 + + # Minimum Visual vs Logical final letter score difference. + # If the difference is below this, don't rely solely on the final letter score + # distance. + MIN_FINAL_CHAR_DISTANCE = 5 + + # Minimum Visual vs Logical model score difference. + # If the difference is below this, don't rely at all on the model score + # distance. + MIN_MODEL_DISTANCE = 0.01 + + VISUAL_HEBREW_NAME = "ISO-8859-8" + LOGICAL_HEBREW_NAME = "windows-1255" + + def __init__(self): + super(HebrewProber, self).__init__() + self._final_char_logical_score = None + self._final_char_visual_score = None + self._prev = None + self._before_prev = None + self._logical_prober = None + self._visual_prober = None + self.reset() + + def reset(self): + self._final_char_logical_score = 0 + self._final_char_visual_score = 0 + # The two last characters seen in the previous buffer, + # mPrev and mBeforePrev are initialized to space in order to simulate + # a word delimiter at the beginning of the data + self._prev = ' ' + self._before_prev = ' ' + # These probers are owned by the group prober. + + def set_model_probers(self, logicalProber, visualProber): + self._logical_prober = logicalProber + self._visual_prober = visualProber + + def is_final(self, c): + return c in [self.FINAL_KAF, self.FINAL_MEM, self.FINAL_NUN, + self.FINAL_PE, self.FINAL_TSADI] + + def is_non_final(self, c): + # The normal Tsadi is not a good Non-Final letter due to words like + # 'lechotet' (to chat) containing an apostrophe after the tsadi. This + # apostrophe is converted to a space in FilterWithoutEnglishLetters + # causing the Non-Final tsadi to appear at an end of a word even + # though this is not the case in the original text. + # The letters Pe and Kaf rarely display a related behavior of not being + # a good Non-Final letter. Words like 'Pop', 'Winamp' and 'Mubarak' + # for example legally end with a Non-Final Pe or Kaf. However, the + # benefit of these letters as Non-Final letters outweighs the damage + # since these words are quite rare. + return c in [self.NORMAL_KAF, self.NORMAL_MEM, + self.NORMAL_NUN, self.NORMAL_PE] + + def feed(self, byte_str): + # Final letter analysis for logical-visual decision. + # Look for evidence that the received buffer is either logical Hebrew + # or visual Hebrew. + # The following cases are checked: + # 1) A word longer than 1 letter, ending with a final letter. This is + # an indication that the text is laid out "naturally" since the + # final letter really appears at the end. +1 for logical score. + # 2) A word longer than 1 letter, ending with a Non-Final letter. In + # normal Hebrew, words ending with Kaf, Mem, Nun, Pe or Tsadi, + # should not end with the Non-Final form of that letter. Exceptions + # to this rule are mentioned above in isNonFinal(). This is an + # indication that the text is laid out backwards. +1 for visual + # score + # 3) A word longer than 1 letter, starting with a final letter. Final + # letters should not appear at the beginning of a word. This is an + # indication that the text is laid out backwards. +1 for visual + # score. + # + # The visual score and logical score are accumulated throughout the + # text and are finally checked against each other in GetCharSetName(). + # No checking for final letters in the middle of words is done since + # that case is not an indication for either Logical or Visual text. + # + # We automatically filter out all 7-bit characters (replace them with + # spaces) so the word boundary detection works properly. [MAP] + + if self.state == ProbingState.NOT_ME: + # Both model probers say it's not them. No reason to continue. + return ProbingState.NOT_ME + + byte_str = self.filter_high_byte_only(byte_str) + + for cur in byte_str: + if cur == ' ': + # We stand on a space - a word just ended + if self._before_prev != ' ': + # next-to-last char was not a space so self._prev is not a + # 1 letter word + if self.is_final(self._prev): + # case (1) [-2:not space][-1:final letter][cur:space] + self._final_char_logical_score += 1 + elif self.is_non_final(self._prev): + # case (2) [-2:not space][-1:Non-Final letter][ + # cur:space] + self._final_char_visual_score += 1 + else: + # Not standing on a space + if ((self._before_prev == ' ') and + (self.is_final(self._prev)) and (cur != ' ')): + # case (3) [-2:space][-1:final letter][cur:not space] + self._final_char_visual_score += 1 + self._before_prev = self._prev + self._prev = cur + + # Forever detecting, till the end or until both model probers return + # ProbingState.NOT_ME (handled above) + return ProbingState.DETECTING + + @property + def charset_name(self): + # Make the decision: is it Logical or Visual? + # If the final letter score distance is dominant enough, rely on it. + finalsub = self._final_char_logical_score - self._final_char_visual_score + if finalsub >= self.MIN_FINAL_CHAR_DISTANCE: + return self.LOGICAL_HEBREW_NAME + if finalsub <= -self.MIN_FINAL_CHAR_DISTANCE: + return self.VISUAL_HEBREW_NAME + + # It's not dominant enough, try to rely on the model scores instead. + modelsub = (self._logical_prober.get_confidence() + - self._visual_prober.get_confidence()) + if modelsub > self.MIN_MODEL_DISTANCE: + return self.LOGICAL_HEBREW_NAME + if modelsub < -self.MIN_MODEL_DISTANCE: + return self.VISUAL_HEBREW_NAME + + # Still no good, back to final letter distance, maybe it'll save the + # day. + if finalsub < 0.0: + return self.VISUAL_HEBREW_NAME + + # (finalsub > 0 - Logical) or (don't know what to do) default to + # Logical. + return self.LOGICAL_HEBREW_NAME + + @property + def language(self): + return 'Hebrew' + + @property + def state(self): + # Remain active as long as any of the model probers are active. + if (self._logical_prober.state == ProbingState.NOT_ME) and \ + (self._visual_prober.state == ProbingState.NOT_ME): + return ProbingState.NOT_ME + return ProbingState.DETECTING diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/jisfreq.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/jisfreq.py new file mode 100644 index 0000000000000000000000000000000000000000..83fc082b545106d02622de20f2083e8a7562f96c --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/jisfreq.py @@ -0,0 +1,325 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Communicator client code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +# Sampling from about 20M text materials include literature and computer technology +# +# Japanese frequency table, applied to both S-JIS and EUC-JP +# They are sorted in order. + +# 128 --> 0.77094 +# 256 --> 0.85710 +# 512 --> 0.92635 +# 1024 --> 0.97130 +# 2048 --> 0.99431 +# +# Ideal Distribution Ratio = 0.92635 / (1-0.92635) = 12.58 +# Random Distribution Ration = 512 / (2965+62+83+86-512) = 0.191 +# +# Typical Distribution Ratio, 25% of IDR + +JIS_TYPICAL_DISTRIBUTION_RATIO = 3.0 + +# Char to FreqOrder table , +JIS_TABLE_SIZE = 4368 + +JIS_CHAR_TO_FREQ_ORDER = ( + 40, 1, 6, 182, 152, 180, 295,2127, 285, 381,3295,4304,3068,4606,3165,3510, # 16 +3511,1822,2785,4607,1193,2226,5070,4608, 171,2996,1247, 18, 179,5071, 856,1661, # 32 +1262,5072, 619, 127,3431,3512,3230,1899,1700, 232, 228,1294,1298, 284, 283,2041, # 48 +2042,1061,1062, 48, 49, 44, 45, 433, 434,1040,1041, 996, 787,2997,1255,4305, # 64 +2108,4609,1684,1648,5073,5074,5075,5076,5077,5078,3687,5079,4610,5080,3927,3928, # 80 +5081,3296,3432, 290,2285,1471,2187,5082,2580,2825,1303,2140,1739,1445,2691,3375, # 96 +1691,3297,4306,4307,4611, 452,3376,1182,2713,3688,3069,4308,5083,5084,5085,5086, # 112 +5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102, # 128 +5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,4097,5113,5114,5115,5116,5117, # 144 +5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132,5133, # 160 +5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149, # 176 +5150,5151,5152,4612,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164, # 192 +5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,1472, 598, 618, 820,1205, # 208 +1309,1412,1858,1307,1692,5176,5177,5178,5179,5180,5181,5182,1142,1452,1234,1172, # 224 +1875,2043,2149,1793,1382,2973, 925,2404,1067,1241, 960,1377,2935,1491, 919,1217, # 240 +1865,2030,1406,1499,2749,4098,5183,5184,5185,5186,5187,5188,2561,4099,3117,1804, # 256 +2049,3689,4309,3513,1663,5189,3166,3118,3298,1587,1561,3433,5190,3119,1625,2998, # 272 +3299,4613,1766,3690,2786,4614,5191,5192,5193,5194,2161, 26,3377, 2,3929, 20, # 288 +3691, 47,4100, 50, 17, 16, 35, 268, 27, 243, 42, 155, 24, 154, 29, 184, # 304 + 4, 91, 14, 92, 53, 396, 33, 289, 9, 37, 64, 620, 21, 39, 321, 5, # 320 + 12, 11, 52, 13, 3, 208, 138, 0, 7, 60, 526, 141, 151,1069, 181, 275, # 336 +1591, 83, 132,1475, 126, 331, 829, 15, 69, 160, 59, 22, 157, 55,1079, 312, # 352 + 109, 38, 23, 25, 10, 19, 79,5195, 61, 382,1124, 8, 30,5196,5197,5198, # 368 +5199,5200,5201,5202,5203,5204,5205,5206, 89, 62, 74, 34,2416, 112, 139, 196, # 384 + 271, 149, 84, 607, 131, 765, 46, 88, 153, 683, 76, 874, 101, 258, 57, 80, # 400 + 32, 364, 121,1508, 169,1547, 68, 235, 145,2999, 41, 360,3027, 70, 63, 31, # 416 + 43, 259, 262,1383, 99, 533, 194, 66, 93, 846, 217, 192, 56, 106, 58, 565, # 432 + 280, 272, 311, 256, 146, 82, 308, 71, 100, 128, 214, 655, 110, 261, 104,1140, # 448 + 54, 51, 36, 87, 67,3070, 185,2618,2936,2020, 28,1066,2390,2059,5207,5208, # 464 +5209,5210,5211,5212,5213,5214,5215,5216,4615,5217,5218,5219,5220,5221,5222,5223, # 480 +5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,3514,5237,5238, # 496 +5239,5240,5241,5242,5243,5244,2297,2031,4616,4310,3692,5245,3071,5246,3598,5247, # 512 +4617,3231,3515,5248,4101,4311,4618,3808,4312,4102,5249,4103,4104,3599,5250,5251, # 528 +5252,5253,5254,5255,5256,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267, # 544 +5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283, # 560 +5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299, # 576 +5300,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315, # 592 +5316,5317,5318,5319,5320,5321,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331, # 608 +5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347, # 624 +5348,5349,5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363, # 640 +5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379, # 656 +5380,5381, 363, 642,2787,2878,2788,2789,2316,3232,2317,3434,2011, 165,1942,3930, # 672 +3931,3932,3933,5382,4619,5383,4620,5384,5385,5386,5387,5388,5389,5390,5391,5392, # 688 +5393,5394,5395,5396,5397,5398,5399,5400,5401,5402,5403,5404,5405,5406,5407,5408, # 704 +5409,5410,5411,5412,5413,5414,5415,5416,5417,5418,5419,5420,5421,5422,5423,5424, # 720 +5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440, # 736 +5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456, # 752 +5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472, # 768 +5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488, # 784 +5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504, # 800 +5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520, # 816 +5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536, # 832 +5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,5549,5550,5551,5552, # 848 +5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568, # 864 +5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584, # 880 +5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,5597,5598,5599,5600, # 896 +5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,5616, # 912 +5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632, # 928 +5633,5634,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648, # 944 +5649,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664, # 960 +5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680, # 976 +5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696, # 992 +5697,5698,5699,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712, # 1008 +5713,5714,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,5726,5727,5728, # 1024 +5729,5730,5731,5732,5733,5734,5735,5736,5737,5738,5739,5740,5741,5742,5743,5744, # 1040 +5745,5746,5747,5748,5749,5750,5751,5752,5753,5754,5755,5756,5757,5758,5759,5760, # 1056 +5761,5762,5763,5764,5765,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776, # 1072 +5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792, # 1088 +5793,5794,5795,5796,5797,5798,5799,5800,5801,5802,5803,5804,5805,5806,5807,5808, # 1104 +5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824, # 1120 +5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840, # 1136 +5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856, # 1152 +5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872, # 1168 +5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888, # 1184 +5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904, # 1200 +5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920, # 1216 +5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936, # 1232 +5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952, # 1248 +5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968, # 1264 +5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984, # 1280 +5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6000, # 1296 +6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016, # 1312 +6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032, # 1328 +6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048, # 1344 +6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064, # 1360 +6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080, # 1376 +6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096, # 1392 +6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112, # 1408 +6113,6114,2044,2060,4621, 997,1235, 473,1186,4622, 920,3378,6115,6116, 379,1108, # 1424 +4313,2657,2735,3934,6117,3809, 636,3233, 573,1026,3693,3435,2974,3300,2298,4105, # 1440 + 854,2937,2463, 393,2581,2417, 539, 752,1280,2750,2480, 140,1161, 440, 708,1569, # 1456 + 665,2497,1746,1291,1523,3000, 164,1603, 847,1331, 537,1997, 486, 508,1693,2418, # 1472 +1970,2227, 878,1220, 299,1030, 969, 652,2751, 624,1137,3301,2619, 65,3302,2045, # 1488 +1761,1859,3120,1930,3694,3516, 663,1767, 852, 835,3695, 269, 767,2826,2339,1305, # 1504 + 896,1150, 770,1616,6118, 506,1502,2075,1012,2519, 775,2520,2975,2340,2938,4314, # 1520 +3028,2086,1224,1943,2286,6119,3072,4315,2240,1273,1987,3935,1557, 175, 597, 985, # 1536 +3517,2419,2521,1416,3029, 585, 938,1931,1007,1052,1932,1685,6120,3379,4316,4623, # 1552 + 804, 599,3121,1333,2128,2539,1159,1554,2032,3810, 687,2033,2904, 952, 675,1467, # 1568 +3436,6121,2241,1096,1786,2440,1543,1924, 980,1813,2228, 781,2692,1879, 728,1918, # 1584 +3696,4624, 548,1950,4625,1809,1088,1356,3303,2522,1944, 502, 972, 373, 513,2827, # 1600 + 586,2377,2391,1003,1976,1631,6122,2464,1084, 648,1776,4626,2141, 324, 962,2012, # 1616 +2177,2076,1384, 742,2178,1448,1173,1810, 222, 102, 301, 445, 125,2420, 662,2498, # 1632 + 277, 200,1476,1165,1068, 224,2562,1378,1446, 450,1880, 659, 791, 582,4627,2939, # 1648 +3936,1516,1274, 555,2099,3697,1020,1389,1526,3380,1762,1723,1787,2229, 412,2114, # 1664 +1900,2392,3518, 512,2597, 427,1925,2341,3122,1653,1686,2465,2499, 697, 330, 273, # 1680 + 380,2162, 951, 832, 780, 991,1301,3073, 965,2270,3519, 668,2523,2636,1286, 535, # 1696 +1407, 518, 671, 957,2658,2378, 267, 611,2197,3030,6123, 248,2299, 967,1799,2356, # 1712 + 850,1418,3437,1876,1256,1480,2828,1718,6124,6125,1755,1664,2405,6126,4628,2879, # 1728 +2829, 499,2179, 676,4629, 557,2329,2214,2090, 325,3234, 464, 811,3001, 992,2342, # 1744 +2481,1232,1469, 303,2242, 466,1070,2163, 603,1777,2091,4630,2752,4631,2714, 322, # 1760 +2659,1964,1768, 481,2188,1463,2330,2857,3600,2092,3031,2421,4632,2318,2070,1849, # 1776 +2598,4633,1302,2254,1668,1701,2422,3811,2905,3032,3123,2046,4106,1763,1694,4634, # 1792 +1604, 943,1724,1454, 917, 868,2215,1169,2940, 552,1145,1800,1228,1823,1955, 316, # 1808 +1080,2510, 361,1807,2830,4107,2660,3381,1346,1423,1134,4108,6127, 541,1263,1229, # 1824 +1148,2540, 545, 465,1833,2880,3438,1901,3074,2482, 816,3937, 713,1788,2500, 122, # 1840 +1575, 195,1451,2501,1111,6128, 859, 374,1225,2243,2483,4317, 390,1033,3439,3075, # 1856 +2524,1687, 266, 793,1440,2599, 946, 779, 802, 507, 897,1081, 528,2189,1292, 711, # 1872 +1866,1725,1167,1640, 753, 398,2661,1053, 246, 348,4318, 137,1024,3440,1600,2077, # 1888 +2129, 825,4319, 698, 238, 521, 187,2300,1157,2423,1641,1605,1464,1610,1097,2541, # 1904 +1260,1436, 759,2255,1814,2150, 705,3235, 409,2563,3304, 561,3033,2005,2564, 726, # 1920 +1956,2343,3698,4109, 949,3812,3813,3520,1669, 653,1379,2525, 881,2198, 632,2256, # 1936 +1027, 778,1074, 733,1957, 514,1481,2466, 554,2180, 702,3938,1606,1017,1398,6129, # 1952 +1380,3521, 921, 993,1313, 594, 449,1489,1617,1166, 768,1426,1360, 495,1794,3601, # 1968 +1177,3602,1170,4320,2344, 476, 425,3167,4635,3168,1424, 401,2662,1171,3382,1998, # 1984 +1089,4110, 477,3169, 474,6130,1909, 596,2831,1842, 494, 693,1051,1028,1207,3076, # 2000 + 606,2115, 727,2790,1473,1115, 743,3522, 630, 805,1532,4321,2021, 366,1057, 838, # 2016 + 684,1114,2142,4322,2050,1492,1892,1808,2271,3814,2424,1971,1447,1373,3305,1090, # 2032 +1536,3939,3523,3306,1455,2199, 336, 369,2331,1035, 584,2393, 902, 718,2600,6131, # 2048 +2753, 463,2151,1149,1611,2467, 715,1308,3124,1268, 343,1413,3236,1517,1347,2663, # 2064 +2093,3940,2022,1131,1553,2100,2941,1427,3441,2942,1323,2484,6132,1980, 872,2368, # 2080 +2441,2943, 320,2369,2116,1082, 679,1933,3941,2791,3815, 625,1143,2023, 422,2200, # 2096 +3816,6133, 730,1695, 356,2257,1626,2301,2858,2637,1627,1778, 937, 883,2906,2693, # 2112 +3002,1769,1086, 400,1063,1325,3307,2792,4111,3077, 456,2345,1046, 747,6134,1524, # 2128 + 884,1094,3383,1474,2164,1059, 974,1688,2181,2258,1047, 345,1665,1187, 358, 875, # 2144 +3170, 305, 660,3524,2190,1334,1135,3171,1540,1649,2542,1527, 927, 968,2793, 885, # 2160 +1972,1850, 482, 500,2638,1218,1109,1085,2543,1654,2034, 876, 78,2287,1482,1277, # 2176 + 861,1675,1083,1779, 724,2754, 454, 397,1132,1612,2332, 893, 672,1237, 257,2259, # 2192 +2370, 135,3384, 337,2244, 547, 352, 340, 709,2485,1400, 788,1138,2511, 540, 772, # 2208 +1682,2260,2272,2544,2013,1843,1902,4636,1999,1562,2288,4637,2201,1403,1533, 407, # 2224 + 576,3308,1254,2071, 978,3385, 170, 136,1201,3125,2664,3172,2394, 213, 912, 873, # 2240 +3603,1713,2202, 699,3604,3699, 813,3442, 493, 531,1054, 468,2907,1483, 304, 281, # 2256 +4112,1726,1252,2094, 339,2319,2130,2639, 756,1563,2944, 748, 571,2976,1588,2425, # 2272 +2715,1851,1460,2426,1528,1392,1973,3237, 288,3309, 685,3386, 296, 892,2716,2216, # 2288 +1570,2245, 722,1747,2217, 905,3238,1103,6135,1893,1441,1965, 251,1805,2371,3700, # 2304 +2601,1919,1078, 75,2182,1509,1592,1270,2640,4638,2152,6136,3310,3817, 524, 706, # 2320 +1075, 292,3818,1756,2602, 317, 98,3173,3605,3525,1844,2218,3819,2502, 814, 567, # 2336 + 385,2908,1534,6137, 534,1642,3239, 797,6138,1670,1529, 953,4323, 188,1071, 538, # 2352 + 178, 729,3240,2109,1226,1374,2000,2357,2977, 731,2468,1116,2014,2051,6139,1261, # 2368 +1593, 803,2859,2736,3443, 556, 682, 823,1541,6140,1369,2289,1706,2794, 845, 462, # 2384 +2603,2665,1361, 387, 162,2358,1740, 739,1770,1720,1304,1401,3241,1049, 627,1571, # 2400 +2427,3526,1877,3942,1852,1500, 431,1910,1503, 677, 297,2795, 286,1433,1038,1198, # 2416 +2290,1133,1596,4113,4639,2469,1510,1484,3943,6141,2442, 108, 712,4640,2372, 866, # 2432 +3701,2755,3242,1348, 834,1945,1408,3527,2395,3243,1811, 824, 994,1179,2110,1548, # 2448 +1453, 790,3003, 690,4324,4325,2832,2909,3820,1860,3821, 225,1748, 310, 346,1780, # 2464 +2470, 821,1993,2717,2796, 828, 877,3528,2860,2471,1702,2165,2910,2486,1789, 453, # 2480 + 359,2291,1676, 73,1164,1461,1127,3311, 421, 604, 314,1037, 589, 116,2487, 737, # 2496 + 837,1180, 111, 244, 735,6142,2261,1861,1362, 986, 523, 418, 581,2666,3822, 103, # 2512 + 855, 503,1414,1867,2488,1091, 657,1597, 979, 605,1316,4641,1021,2443,2078,2001, # 2528 +1209, 96, 587,2166,1032, 260,1072,2153, 173, 94, 226,3244, 819,2006,4642,4114, # 2544 +2203, 231,1744, 782, 97,2667, 786,3387, 887, 391, 442,2219,4326,1425,6143,2694, # 2560 + 633,1544,1202, 483,2015, 592,2052,1958,2472,1655, 419, 129,4327,3444,3312,1714, # 2576 +1257,3078,4328,1518,1098, 865,1310,1019,1885,1512,1734, 469,2444, 148, 773, 436, # 2592 +1815,1868,1128,1055,4329,1245,2756,3445,2154,1934,1039,4643, 579,1238, 932,2320, # 2608 + 353, 205, 801, 115,2428, 944,2321,1881, 399,2565,1211, 678, 766,3944, 335,2101, # 2624 +1459,1781,1402,3945,2737,2131,1010, 844, 981,1326,1013, 550,1816,1545,2620,1335, # 2640 +1008, 371,2881, 936,1419,1613,3529,1456,1395,2273,1834,2604,1317,2738,2503, 416, # 2656 +1643,4330, 806,1126, 229, 591,3946,1314,1981,1576,1837,1666, 347,1790, 977,3313, # 2672 + 764,2861,1853, 688,2429,1920,1462, 77, 595, 415,2002,3034, 798,1192,4115,6144, # 2688 +2978,4331,3035,2695,2582,2072,2566, 430,2430,1727, 842,1396,3947,3702, 613, 377, # 2704 + 278, 236,1417,3388,3314,3174, 757,1869, 107,3530,6145,1194, 623,2262, 207,1253, # 2720 +2167,3446,3948, 492,1117,1935, 536,1838,2757,1246,4332, 696,2095,2406,1393,1572, # 2736 +3175,1782, 583, 190, 253,1390,2230, 830,3126,3389, 934,3245,1703,1749,2979,1870, # 2752 +2545,1656,2204, 869,2346,4116,3176,1817, 496,1764,4644, 942,1504, 404,1903,1122, # 2768 +1580,3606,2945,1022, 515, 372,1735, 955,2431,3036,6146,2797,1110,2302,2798, 617, # 2784 +6147, 441, 762,1771,3447,3607,3608,1904, 840,3037, 86, 939,1385, 572,1370,2445, # 2800 +1336, 114,3703, 898, 294, 203,3315, 703,1583,2274, 429, 961,4333,1854,1951,3390, # 2816 +2373,3704,4334,1318,1381, 966,1911,2322,1006,1155, 309, 989, 458,2718,1795,1372, # 2832 +1203, 252,1689,1363,3177, 517,1936, 168,1490, 562, 193,3823,1042,4117,1835, 551, # 2848 + 470,4645, 395, 489,3448,1871,1465,2583,2641, 417,1493, 279,1295, 511,1236,1119, # 2864 + 72,1231,1982,1812,3004, 871,1564, 984,3449,1667,2696,2096,4646,2347,2833,1673, # 2880 +3609, 695,3246,2668, 807,1183,4647, 890, 388,2333,1801,1457,2911,1765,1477,1031, # 2896 +3316,3317,1278,3391,2799,2292,2526, 163,3450,4335,2669,1404,1802,6148,2323,2407, # 2912 +1584,1728,1494,1824,1269, 298, 909,3318,1034,1632, 375, 776,1683,2061, 291, 210, # 2928 +1123, 809,1249,1002,2642,3038, 206,1011,2132, 144, 975, 882,1565, 342, 667, 754, # 2944 +1442,2143,1299,2303,2062, 447, 626,2205,1221,2739,2912,1144,1214,2206,2584, 760, # 2960 +1715, 614, 950,1281,2670,2621, 810, 577,1287,2546,4648, 242,2168, 250,2643, 691, # 2976 + 123,2644, 647, 313,1029, 689,1357,2946,1650, 216, 771,1339,1306, 808,2063, 549, # 2992 + 913,1371,2913,2914,6149,1466,1092,1174,1196,1311,2605,2396,1783,1796,3079, 406, # 3008 +2671,2117,3949,4649, 487,1825,2220,6150,2915, 448,2348,1073,6151,2397,1707, 130, # 3024 + 900,1598, 329, 176,1959,2527,1620,6152,2275,4336,3319,1983,2191,3705,3610,2155, # 3040 +3706,1912,1513,1614,6153,1988, 646, 392,2304,1589,3320,3039,1826,1239,1352,1340, # 3056 +2916, 505,2567,1709,1437,2408,2547, 906,6154,2672, 384,1458,1594,1100,1329, 710, # 3072 + 423,3531,2064,2231,2622,1989,2673,1087,1882, 333, 841,3005,1296,2882,2379, 580, # 3088 +1937,1827,1293,2585, 601, 574, 249,1772,4118,2079,1120, 645, 901,1176,1690, 795, # 3104 +2207, 478,1434, 516,1190,1530, 761,2080, 930,1264, 355, 435,1552, 644,1791, 987, # 3120 + 220,1364,1163,1121,1538, 306,2169,1327,1222, 546,2645, 218, 241, 610,1704,3321, # 3136 +1984,1839,1966,2528, 451,6155,2586,3707,2568, 907,3178, 254,2947, 186,1845,4650, # 3152 + 745, 432,1757, 428,1633, 888,2246,2221,2489,3611,2118,1258,1265, 956,3127,1784, # 3168 +4337,2490, 319, 510, 119, 457,3612, 274,2035,2007,4651,1409,3128, 970,2758, 590, # 3184 +2800, 661,2247,4652,2008,3950,1420,1549,3080,3322,3951,1651,1375,2111, 485,2491, # 3200 +1429,1156,6156,2548,2183,1495, 831,1840,2529,2446, 501,1657, 307,1894,3247,1341, # 3216 + 666, 899,2156,1539,2549,1559, 886, 349,2208,3081,2305,1736,3824,2170,2759,1014, # 3232 +1913,1386, 542,1397,2948, 490, 368, 716, 362, 159, 282,2569,1129,1658,1288,1750, # 3248 +2674, 276, 649,2016, 751,1496, 658,1818,1284,1862,2209,2087,2512,3451, 622,2834, # 3264 + 376, 117,1060,2053,1208,1721,1101,1443, 247,1250,3179,1792,3952,2760,2398,3953, # 3280 +6157,2144,3708, 446,2432,1151,2570,3452,2447,2761,2835,1210,2448,3082, 424,2222, # 3296 +1251,2449,2119,2836, 504,1581,4338, 602, 817, 857,3825,2349,2306, 357,3826,1470, # 3312 +1883,2883, 255, 958, 929,2917,3248, 302,4653,1050,1271,1751,2307,1952,1430,2697, # 3328 +2719,2359, 354,3180, 777, 158,2036,4339,1659,4340,4654,2308,2949,2248,1146,2232, # 3344 +3532,2720,1696,2623,3827,6158,3129,1550,2698,1485,1297,1428, 637, 931,2721,2145, # 3360 + 914,2550,2587, 81,2450, 612, 827,2646,1242,4655,1118,2884, 472,1855,3181,3533, # 3376 +3534, 569,1353,2699,1244,1758,2588,4119,2009,2762,2171,3709,1312,1531,6159,1152, # 3392 +1938, 134,1830, 471,3710,2276,1112,1535,3323,3453,3535, 982,1337,2950, 488, 826, # 3408 + 674,1058,1628,4120,2017, 522,2399, 211, 568,1367,3454, 350, 293,1872,1139,3249, # 3424 +1399,1946,3006,1300,2360,3324, 588, 736,6160,2606, 744, 669,3536,3828,6161,1358, # 3440 + 199, 723, 848, 933, 851,1939,1505,1514,1338,1618,1831,4656,1634,3613, 443,2740, # 3456 +3829, 717,1947, 491,1914,6162,2551,1542,4121,1025,6163,1099,1223, 198,3040,2722, # 3472 + 370, 410,1905,2589, 998,1248,3182,2380, 519,1449,4122,1710, 947, 928,1153,4341, # 3488 +2277, 344,2624,1511, 615, 105, 161,1212,1076,1960,3130,2054,1926,1175,1906,2473, # 3504 + 414,1873,2801,6164,2309, 315,1319,3325, 318,2018,2146,2157, 963, 631, 223,4342, # 3520 +4343,2675, 479,3711,1197,2625,3712,2676,2361,6165,4344,4123,6166,2451,3183,1886, # 3536 +2184,1674,1330,1711,1635,1506, 799, 219,3250,3083,3954,1677,3713,3326,2081,3614, # 3552 +1652,2073,4657,1147,3041,1752, 643,1961, 147,1974,3955,6167,1716,2037, 918,3007, # 3568 +1994, 120,1537, 118, 609,3184,4345, 740,3455,1219, 332,1615,3830,6168,1621,2980, # 3584 +1582, 783, 212, 553,2350,3714,1349,2433,2082,4124, 889,6169,2310,1275,1410, 973, # 3600 + 166,1320,3456,1797,1215,3185,2885,1846,2590,2763,4658, 629, 822,3008, 763, 940, # 3616 +1990,2862, 439,2409,1566,1240,1622, 926,1282,1907,2764, 654,2210,1607, 327,1130, # 3632 +3956,1678,1623,6170,2434,2192, 686, 608,3831,3715, 903,3957,3042,6171,2741,1522, # 3648 +1915,1105,1555,2552,1359, 323,3251,4346,3457, 738,1354,2553,2311,2334,1828,2003, # 3664 +3832,1753,2351,1227,6172,1887,4125,1478,6173,2410,1874,1712,1847, 520,1204,2607, # 3680 + 264,4659, 836,2677,2102, 600,4660,3833,2278,3084,6174,4347,3615,1342, 640, 532, # 3696 + 543,2608,1888,2400,2591,1009,4348,1497, 341,1737,3616,2723,1394, 529,3252,1321, # 3712 + 983,4661,1515,2120, 971,2592, 924, 287,1662,3186,4349,2700,4350,1519, 908,1948, # 3728 +2452, 156, 796,1629,1486,2223,2055, 694,4126,1259,1036,3392,1213,2249,2742,1889, # 3744 +1230,3958,1015, 910, 408, 559,3617,4662, 746, 725, 935,4663,3959,3009,1289, 563, # 3760 + 867,4664,3960,1567,2981,2038,2626, 988,2263,2381,4351, 143,2374, 704,1895,6175, # 3776 +1188,3716,2088, 673,3085,2362,4352, 484,1608,1921,2765,2918, 215, 904,3618,3537, # 3792 + 894, 509, 976,3043,2701,3961,4353,2837,2982, 498,6176,6177,1102,3538,1332,3393, # 3808 +1487,1636,1637, 233, 245,3962, 383, 650, 995,3044, 460,1520,1206,2352, 749,3327, # 3824 + 530, 700, 389,1438,1560,1773,3963,2264, 719,2951,2724,3834, 870,1832,1644,1000, # 3840 + 839,2474,3717, 197,1630,3394, 365,2886,3964,1285,2133, 734, 922, 818,1106, 732, # 3856 + 480,2083,1774,3458, 923,2279,1350, 221,3086, 85,2233,2234,3835,1585,3010,2147, # 3872 +1387,1705,2382,1619,2475, 133, 239,2802,1991,1016,2084,2383, 411,2838,1113, 651, # 3888 +1985,1160,3328, 990,1863,3087,1048,1276,2647, 265,2627,1599,3253,2056, 150, 638, # 3904 +2019, 656, 853, 326,1479, 680,1439,4354,1001,1759, 413,3459,3395,2492,1431, 459, # 3920 +4355,1125,3329,2265,1953,1450,2065,2863, 849, 351,2678,3131,3254,3255,1104,1577, # 3936 + 227,1351,1645,2453,2193,1421,2887, 812,2121, 634, 95,2435, 201,2312,4665,1646, # 3952 +1671,2743,1601,2554,2702,2648,2280,1315,1366,2089,3132,1573,3718,3965,1729,1189, # 3968 + 328,2679,1077,1940,1136, 558,1283, 964,1195, 621,2074,1199,1743,3460,3619,1896, # 3984 +1916,1890,3836,2952,1154,2112,1064, 862, 378,3011,2066,2113,2803,1568,2839,6178, # 4000 +3088,2919,1941,1660,2004,1992,2194, 142, 707,1590,1708,1624,1922,1023,1836,1233, # 4016 +1004,2313, 789, 741,3620,6179,1609,2411,1200,4127,3719,3720,4666,2057,3721, 593, # 4032 +2840, 367,2920,1878,6180,3461,1521, 628,1168, 692,2211,2649, 300, 720,2067,2571, # 4048 +2953,3396, 959,2504,3966,3539,3462,1977, 701,6181, 954,1043, 800, 681, 183,3722, # 4064 +1803,1730,3540,4128,2103, 815,2314, 174, 467, 230,2454,1093,2134, 755,3541,3397, # 4080 +1141,1162,6182,1738,2039, 270,3256,2513,1005,1647,2185,3837, 858,1679,1897,1719, # 4096 +2954,2324,1806, 402, 670, 167,4129,1498,2158,2104, 750,6183, 915, 189,1680,1551, # 4112 + 455,4356,1501,2455, 405,1095,2955, 338,1586,1266,1819, 570, 641,1324, 237,1556, # 4128 +2650,1388,3723,6184,1368,2384,1343,1978,3089,2436, 879,3724, 792,1191, 758,3012, # 4144 +1411,2135,1322,4357, 240,4667,1848,3725,1574,6185, 420,3045,1546,1391, 714,4358, # 4160 +1967, 941,1864, 863, 664, 426, 560,1731,2680,1785,2864,1949,2363, 403,3330,1415, # 4176 +1279,2136,1697,2335, 204, 721,2097,3838, 90,6186,2085,2505, 191,3967, 124,2148, # 4192 +1376,1798,1178,1107,1898,1405, 860,4359,1243,1272,2375,2983,1558,2456,1638, 113, # 4208 +3621, 578,1923,2609, 880, 386,4130, 784,2186,2266,1422,2956,2172,1722, 497, 263, # 4224 +2514,1267,2412,2610, 177,2703,3542, 774,1927,1344, 616,1432,1595,1018, 172,4360, # 4240 +2325, 911,4361, 438,1468,3622, 794,3968,2024,2173,1681,1829,2957, 945, 895,3090, # 4256 + 575,2212,2476, 475,2401,2681, 785,2744,1745,2293,2555,1975,3133,2865, 394,4668, # 4272 +3839, 635,4131, 639, 202,1507,2195,2766,1345,1435,2572,3726,1908,1184,1181,2457, # 4288 +3727,3134,4362, 843,2611, 437, 916,4669, 234, 769,1884,3046,3047,3623, 833,6187, # 4304 +1639,2250,2402,1355,1185,2010,2047, 999, 525,1732,1290,1488,2612, 948,1578,3728, # 4320 +2413,2477,1216,2725,2159, 334,3840,1328,3624,2921,1525,4132, 564,1056, 891,4363, # 4336 +1444,1698,2385,2251,3729,1365,2281,2235,1717,6188, 864,3841,2515, 444, 527,2767, # 4352 +2922,3625, 544, 461,6189, 566, 209,2437,3398,2098,1065,2068,3331,3626,3257,2137, # 4368 #last 512 +) + + diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/jpcntx.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/jpcntx.py new file mode 100644 index 0000000000000000000000000000000000000000..20044e4bc8f5a9775d82be0ecf387ce752732507 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/jpcntx.py @@ -0,0 +1,233 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Communicator client code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + + +# This is hiragana 2-char sequence table, the number in each cell represents its frequency category +jp2CharContext = ( +(0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1), +(2,4,0,4,0,3,0,4,0,3,4,4,4,2,4,3,3,4,3,2,3,3,4,2,3,3,3,2,4,1,4,3,3,1,5,4,3,4,3,4,3,5,3,0,3,5,4,2,0,3,1,0,3,3,0,3,3,0,1,1,0,4,3,0,3,3,0,4,0,2,0,3,5,5,5,5,4,0,4,1,0,3,4), +(0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2), +(0,4,0,5,0,5,0,4,0,4,5,4,4,3,5,3,5,1,5,3,4,3,4,4,3,4,3,3,4,3,5,4,4,3,5,5,3,5,5,5,3,5,5,3,4,5,5,3,1,3,2,0,3,4,0,4,2,0,4,2,1,5,3,2,3,5,0,4,0,2,0,5,4,4,5,4,5,0,4,0,0,4,4), +(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), +(0,3,0,4,0,3,0,3,0,4,5,4,3,3,3,3,4,3,5,4,4,3,5,4,4,3,4,3,4,4,4,4,5,3,4,4,3,4,5,5,4,5,5,1,4,5,4,3,0,3,3,1,3,3,0,4,4,0,3,3,1,5,3,3,3,5,0,4,0,3,0,4,4,3,4,3,3,0,4,1,1,3,4), +(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), +(0,4,0,3,0,3,0,4,0,3,4,4,3,2,2,1,2,1,3,1,3,3,3,3,3,4,3,1,3,3,5,3,3,0,4,3,0,5,4,3,3,5,4,4,3,4,4,5,0,1,2,0,1,2,0,2,2,0,1,0,0,5,2,2,1,4,0,3,0,1,0,4,4,3,5,4,3,0,2,1,0,4,3), +(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), +(0,3,0,5,0,4,0,2,1,4,4,2,4,1,4,2,4,2,4,3,3,3,4,3,3,3,3,1,4,2,3,3,3,1,4,4,1,1,1,4,3,3,2,0,2,4,3,2,0,3,3,0,3,1,1,0,0,0,3,3,0,4,2,2,3,4,0,4,0,3,0,4,4,5,3,4,4,0,3,0,0,1,4), +(1,4,0,4,0,4,0,4,0,3,5,4,4,3,4,3,5,4,3,3,4,3,5,4,4,4,4,3,4,2,4,3,3,1,5,4,3,2,4,5,4,5,5,4,4,5,4,4,0,3,2,2,3,3,0,4,3,1,3,2,1,4,3,3,4,5,0,3,0,2,0,4,5,5,4,5,4,0,4,0,0,5,4), +(0,5,0,5,0,4,0,3,0,4,4,3,4,3,3,3,4,0,4,4,4,3,4,3,4,3,3,1,4,2,4,3,4,0,5,4,1,4,5,4,4,5,3,2,4,3,4,3,2,4,1,3,3,3,2,3,2,0,4,3,3,4,3,3,3,4,0,4,0,3,0,4,5,4,4,4,3,0,4,1,0,1,3), +(0,3,1,4,0,3,0,2,0,3,4,4,3,1,4,2,3,3,4,3,4,3,4,3,4,4,3,2,3,1,5,4,4,1,4,4,3,5,4,4,3,5,5,4,3,4,4,3,1,2,3,1,2,2,0,3,2,0,3,1,0,5,3,3,3,4,3,3,3,3,4,4,4,4,5,4,2,0,3,3,2,4,3), +(0,2,0,3,0,1,0,1,0,0,3,2,0,0,2,0,1,0,2,1,3,3,3,1,2,3,1,0,1,0,4,2,1,1,3,3,0,4,3,3,1,4,3,3,0,3,3,2,0,0,0,0,1,0,0,2,0,0,0,0,0,4,1,0,2,3,2,2,2,1,3,3,3,4,4,3,2,0,3,1,0,3,3), +(0,4,0,4,0,3,0,3,0,4,4,4,3,3,3,3,3,3,4,3,4,2,4,3,4,3,3,2,4,3,4,5,4,1,4,5,3,5,4,5,3,5,4,0,3,5,5,3,1,3,3,2,2,3,0,3,4,1,3,3,2,4,3,3,3,4,0,4,0,3,0,4,5,4,4,5,3,0,4,1,0,3,4), +(0,2,0,3,0,3,0,0,0,2,2,2,1,0,1,0,0,0,3,0,3,0,3,0,1,3,1,0,3,1,3,3,3,1,3,3,3,0,1,3,1,3,4,0,0,3,1,1,0,3,2,0,0,0,0,1,3,0,1,0,0,3,3,2,0,3,0,0,0,0,0,3,4,3,4,3,3,0,3,0,0,2,3), +(2,3,0,3,0,2,0,1,0,3,3,4,3,1,3,1,1,1,3,1,4,3,4,3,3,3,0,0,3,1,5,4,3,1,4,3,2,5,5,4,4,4,4,3,3,4,4,4,0,2,1,1,3,2,0,1,2,0,0,1,0,4,1,3,3,3,0,3,0,1,0,4,4,4,5,5,3,0,2,0,0,4,4), +(0,2,0,1,0,3,1,3,0,2,3,3,3,0,3,1,0,0,3,0,3,2,3,1,3,2,1,1,0,0,4,2,1,0,2,3,1,4,3,2,0,4,4,3,1,3,1,3,0,1,0,0,1,0,0,0,1,0,0,0,0,4,1,1,1,2,0,3,0,0,0,3,4,2,4,3,2,0,1,0,0,3,3), +(0,1,0,4,0,5,0,4,0,2,4,4,2,3,3,2,3,3,5,3,3,3,4,3,4,2,3,0,4,3,3,3,4,1,4,3,2,1,5,5,3,4,5,1,3,5,4,2,0,3,3,0,1,3,0,4,2,0,1,3,1,4,3,3,3,3,0,3,0,1,0,3,4,4,4,5,5,0,3,0,1,4,5), +(0,2,0,3,0,3,0,0,0,2,3,1,3,0,4,0,1,1,3,0,3,4,3,2,3,1,0,3,3,2,3,1,3,0,2,3,0,2,1,4,1,2,2,0,0,3,3,0,0,2,0,0,0,1,0,0,0,0,2,2,0,3,2,1,3,3,0,2,0,2,0,0,3,3,1,2,4,0,3,0,2,2,3), +(2,4,0,5,0,4,0,4,0,2,4,4,4,3,4,3,3,3,1,2,4,3,4,3,4,4,5,0,3,3,3,3,2,0,4,3,1,4,3,4,1,4,4,3,3,4,4,3,1,2,3,0,4,2,0,4,1,0,3,3,0,4,3,3,3,4,0,4,0,2,0,3,5,3,4,5,2,0,3,0,0,4,5), +(0,3,0,4,0,1,0,1,0,1,3,2,2,1,3,0,3,0,2,0,2,0,3,0,2,0,0,0,1,0,1,1,0,0,3,1,0,0,0,4,0,3,1,0,2,1,3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,4,2,2,3,1,0,3,0,0,0,1,4,4,4,3,0,0,4,0,0,1,4), +(1,4,1,5,0,3,0,3,0,4,5,4,4,3,5,3,3,4,4,3,4,1,3,3,3,3,2,1,4,1,5,4,3,1,4,4,3,5,4,4,3,5,4,3,3,4,4,4,0,3,3,1,2,3,0,3,1,0,3,3,0,5,4,4,4,4,4,4,3,3,5,4,4,3,3,5,4,0,3,2,0,4,4), +(0,2,0,3,0,1,0,0,0,1,3,3,3,2,4,1,3,0,3,1,3,0,2,2,1,1,0,0,2,0,4,3,1,0,4,3,0,4,4,4,1,4,3,1,1,3,3,1,0,2,0,0,1,3,0,0,0,0,2,0,0,4,3,2,4,3,5,4,3,3,3,4,3,3,4,3,3,0,2,1,0,3,3), +(0,2,0,4,0,3,0,2,0,2,5,5,3,4,4,4,4,1,4,3,3,0,4,3,4,3,1,3,3,2,4,3,0,3,4,3,0,3,4,4,2,4,4,0,4,5,3,3,2,2,1,1,1,2,0,1,5,0,3,3,2,4,3,3,3,4,0,3,0,2,0,4,4,3,5,5,0,0,3,0,2,3,3), +(0,3,0,4,0,3,0,1,0,3,4,3,3,1,3,3,3,0,3,1,3,0,4,3,3,1,1,0,3,0,3,3,0,0,4,4,0,1,5,4,3,3,5,0,3,3,4,3,0,2,0,1,1,1,0,1,3,0,1,2,1,3,3,2,3,3,0,3,0,1,0,1,3,3,4,4,1,0,1,2,2,1,3), +(0,1,0,4,0,4,0,3,0,1,3,3,3,2,3,1,1,0,3,0,3,3,4,3,2,4,2,0,1,0,4,3,2,0,4,3,0,5,3,3,2,4,4,4,3,3,3,4,0,1,3,0,0,1,0,0,1,0,0,0,0,4,2,3,3,3,0,3,0,0,0,4,4,4,5,3,2,0,3,3,0,3,5), +(0,2,0,3,0,0,0,3,0,1,3,0,2,0,0,0,1,0,3,1,1,3,3,0,0,3,0,0,3,0,2,3,1,0,3,1,0,3,3,2,0,4,2,2,0,2,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,1,2,0,1,0,1,0,0,0,1,3,1,2,0,0,0,1,0,0,1,4), +(0,3,0,3,0,5,0,1,0,2,4,3,1,3,3,2,1,1,5,2,1,0,5,1,2,0,0,0,3,3,2,2,3,2,4,3,0,0,3,3,1,3,3,0,2,5,3,4,0,3,3,0,1,2,0,2,2,0,3,2,0,2,2,3,3,3,0,2,0,1,0,3,4,4,2,5,4,0,3,0,0,3,5), +(0,3,0,3,0,3,0,1,0,3,3,3,3,0,3,0,2,0,2,1,1,0,2,0,1,0,0,0,2,1,0,0,1,0,3,2,0,0,3,3,1,2,3,1,0,3,3,0,0,1,0,0,0,0,0,2,0,0,0,0,0,2,3,1,2,3,0,3,0,1,0,3,2,1,0,4,3,0,1,1,0,3,3), +(0,4,0,5,0,3,0,3,0,4,5,5,4,3,5,3,4,3,5,3,3,2,5,3,4,4,4,3,4,3,4,5,5,3,4,4,3,4,4,5,4,4,4,3,4,5,5,4,2,3,4,2,3,4,0,3,3,1,4,3,2,4,3,3,5,5,0,3,0,3,0,5,5,5,5,4,4,0,4,0,1,4,4), +(0,4,0,4,0,3,0,3,0,3,5,4,4,2,3,2,5,1,3,2,5,1,4,2,3,2,3,3,4,3,3,3,3,2,5,4,1,3,3,5,3,4,4,0,4,4,3,1,1,3,1,0,2,3,0,2,3,0,3,0,0,4,3,1,3,4,0,3,0,2,0,4,4,4,3,4,5,0,4,0,0,3,4), +(0,3,0,3,0,3,1,2,0,3,4,4,3,3,3,0,2,2,4,3,3,1,3,3,3,1,1,0,3,1,4,3,2,3,4,4,2,4,4,4,3,4,4,3,2,4,4,3,1,3,3,1,3,3,0,4,1,0,2,2,1,4,3,2,3,3,5,4,3,3,5,4,4,3,3,0,4,0,3,2,2,4,4), +(0,2,0,1,0,0,0,0,0,1,2,1,3,0,0,0,0,0,2,0,1,2,1,0,0,1,0,0,0,0,3,0,0,1,0,1,1,3,1,0,0,0,1,1,0,1,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,1,2,2,0,3,4,0,0,0,1,1,0,0,1,0,0,0,0,0,1,1), +(0,1,0,0,0,1,0,0,0,0,4,0,4,1,4,0,3,0,4,0,3,0,4,0,3,0,3,0,4,1,5,1,4,0,0,3,0,5,0,5,2,0,1,0,0,0,2,1,4,0,1,3,0,0,3,0,0,3,1,1,4,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0), +(1,4,0,5,0,3,0,2,0,3,5,4,4,3,4,3,5,3,4,3,3,0,4,3,3,3,3,3,3,2,4,4,3,1,3,4,4,5,4,4,3,4,4,1,3,5,4,3,3,3,1,2,2,3,3,1,3,1,3,3,3,5,3,3,4,5,0,3,0,3,0,3,4,3,4,4,3,0,3,0,2,4,3), +(0,1,0,4,0,0,0,0,0,1,4,0,4,1,4,2,4,0,3,0,1,0,1,0,0,0,0,0,2,0,3,1,1,1,0,3,0,0,0,1,2,1,0,0,1,1,1,1,0,1,0,0,0,1,0,0,3,0,0,0,0,3,2,0,2,2,0,1,0,0,0,2,3,2,3,3,0,0,0,0,2,1,0), +(0,5,1,5,0,3,0,3,0,5,4,4,5,1,5,3,3,0,4,3,4,3,5,3,4,3,3,2,4,3,4,3,3,0,3,3,1,4,4,3,4,4,4,3,4,5,5,3,2,3,1,1,3,3,1,3,1,1,3,3,2,4,5,3,3,5,0,4,0,3,0,4,4,3,5,3,3,0,3,4,0,4,3), +(0,5,0,5,0,3,0,2,0,4,4,3,5,2,4,3,3,3,4,4,4,3,5,3,5,3,3,1,4,0,4,3,3,0,3,3,0,4,4,4,4,5,4,3,3,5,5,3,2,3,1,2,3,2,0,1,0,0,3,2,2,4,4,3,1,5,0,4,0,3,0,4,3,1,3,2,1,0,3,3,0,3,3), +(0,4,0,5,0,5,0,4,0,4,5,5,5,3,4,3,3,2,5,4,4,3,5,3,5,3,4,0,4,3,4,4,3,2,4,4,3,4,5,4,4,5,5,0,3,5,5,4,1,3,3,2,3,3,1,3,1,0,4,3,1,4,4,3,4,5,0,4,0,2,0,4,3,4,4,3,3,0,4,0,0,5,5), +(0,4,0,4,0,5,0,1,1,3,3,4,4,3,4,1,3,0,5,1,3,0,3,1,3,1,1,0,3,0,3,3,4,0,4,3,0,4,4,4,3,4,4,0,3,5,4,1,0,3,0,0,2,3,0,3,1,0,3,1,0,3,2,1,3,5,0,3,0,1,0,3,2,3,3,4,4,0,2,2,0,4,4), +(2,4,0,5,0,4,0,3,0,4,5,5,4,3,5,3,5,3,5,3,5,2,5,3,4,3,3,4,3,4,5,3,2,1,5,4,3,2,3,4,5,3,4,1,2,5,4,3,0,3,3,0,3,2,0,2,3,0,4,1,0,3,4,3,3,5,0,3,0,1,0,4,5,5,5,4,3,0,4,2,0,3,5), +(0,5,0,4,0,4,0,2,0,5,4,3,4,3,4,3,3,3,4,3,4,2,5,3,5,3,4,1,4,3,4,4,4,0,3,5,0,4,4,4,4,5,3,1,3,4,5,3,3,3,3,3,3,3,0,2,2,0,3,3,2,4,3,3,3,5,3,4,1,3,3,5,3,2,0,0,0,0,4,3,1,3,3), +(0,1,0,3,0,3,0,1,0,1,3,3,3,2,3,3,3,0,3,0,0,0,3,1,3,0,0,0,2,2,2,3,0,0,3,2,0,1,2,4,1,3,3,0,0,3,3,3,0,1,0,0,2,1,0,0,3,0,3,1,0,3,0,0,1,3,0,2,0,1,0,3,3,1,3,3,0,0,1,1,0,3,3), +(0,2,0,3,0,2,1,4,0,2,2,3,1,1,3,1,1,0,2,0,3,1,2,3,1,3,0,0,1,0,4,3,2,3,3,3,1,4,2,3,3,3,3,1,0,3,1,4,0,1,1,0,1,2,0,1,1,0,1,1,0,3,1,3,2,2,0,1,0,0,0,2,3,3,3,1,0,0,0,0,0,2,3), +(0,5,0,4,0,5,0,2,0,4,5,5,3,3,4,3,3,1,5,4,4,2,4,4,4,3,4,2,4,3,5,5,4,3,3,4,3,3,5,5,4,5,5,1,3,4,5,3,1,4,3,1,3,3,0,3,3,1,4,3,1,4,5,3,3,5,0,4,0,3,0,5,3,3,1,4,3,0,4,0,1,5,3), +(0,5,0,5,0,4,0,2,0,4,4,3,4,3,3,3,3,3,5,4,4,4,4,4,4,5,3,3,5,2,4,4,4,3,4,4,3,3,4,4,5,5,3,3,4,3,4,3,3,4,3,3,3,3,1,2,2,1,4,3,3,5,4,4,3,4,0,4,0,3,0,4,4,4,4,4,1,0,4,2,0,2,4), +(0,4,0,4,0,3,0,1,0,3,5,2,3,0,3,0,2,1,4,2,3,3,4,1,4,3,3,2,4,1,3,3,3,0,3,3,0,0,3,3,3,5,3,3,3,3,3,2,0,2,0,0,2,0,0,2,0,0,1,0,0,3,1,2,2,3,0,3,0,2,0,4,4,3,3,4,1,0,3,0,0,2,4), +(0,0,0,4,0,0,0,0,0,0,1,0,1,0,2,0,0,0,0,0,1,0,2,0,1,0,0,0,0,0,3,1,3,0,3,2,0,0,0,1,0,3,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,0,2,0,0,0,0,0,0,2), +(0,2,1,3,0,2,0,2,0,3,3,3,3,1,3,1,3,3,3,3,3,3,4,2,2,1,2,1,4,0,4,3,1,3,3,3,2,4,3,5,4,3,3,3,3,3,3,3,0,1,3,0,2,0,0,1,0,0,1,0,0,4,2,0,2,3,0,3,3,0,3,3,4,2,3,1,4,0,1,2,0,2,3), +(0,3,0,3,0,1,0,3,0,2,3,3,3,0,3,1,2,0,3,3,2,3,3,2,3,2,3,1,3,0,4,3,2,0,3,3,1,4,3,3,2,3,4,3,1,3,3,1,1,0,1,1,0,1,0,1,0,1,0,0,0,4,1,1,0,3,0,3,1,0,2,3,3,3,3,3,1,0,0,2,0,3,3), +(0,0,0,0,0,0,0,0,0,0,3,0,2,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,3,0,3,0,3,1,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,2,3,0,0,0,0,0,0,0,0,3), +(0,2,0,3,1,3,0,3,0,2,3,3,3,1,3,1,3,1,3,1,3,3,3,1,3,0,2,3,1,1,4,3,3,2,3,3,1,2,2,4,1,3,3,0,1,4,2,3,0,1,3,0,3,0,0,1,3,0,2,0,0,3,3,2,1,3,0,3,0,2,0,3,4,4,4,3,1,0,3,0,0,3,3), +(0,2,0,1,0,2,0,0,0,1,3,2,2,1,3,0,1,1,3,0,3,2,3,1,2,0,2,0,1,1,3,3,3,0,3,3,1,1,2,3,2,3,3,1,2,3,2,0,0,1,0,0,0,0,0,0,3,0,1,0,0,2,1,2,1,3,0,3,0,0,0,3,4,4,4,3,2,0,2,0,0,2,4), +(0,0,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,2,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,3,1,0,0,0,0,0,0,0,3), +(0,3,0,3,0,2,0,3,0,3,3,3,2,3,2,2,2,0,3,1,3,3,3,2,3,3,0,0,3,0,3,2,2,0,2,3,1,4,3,4,3,3,2,3,1,5,4,4,0,3,1,2,1,3,0,3,1,1,2,0,2,3,1,3,1,3,0,3,0,1,0,3,3,4,4,2,1,0,2,1,0,2,4), +(0,1,0,3,0,1,0,2,0,1,4,2,5,1,4,0,2,0,2,1,3,1,4,0,2,1,0,0,2,1,4,1,1,0,3,3,0,5,1,3,2,3,3,1,0,3,2,3,0,1,0,0,0,0,0,0,1,0,0,0,0,4,0,1,0,3,0,2,0,1,0,3,3,3,4,3,3,0,0,0,0,2,3), +(0,0,0,1,0,0,0,0,0,0,2,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,1,0,0,0,0,0,3), +(0,1,0,3,0,4,0,3,0,2,4,3,1,0,3,2,2,1,3,1,2,2,3,1,1,1,2,1,3,0,1,2,0,1,3,2,1,3,0,5,5,1,0,0,1,3,2,1,0,3,0,0,1,0,0,0,0,0,3,4,0,1,1,1,3,2,0,2,0,1,0,2,3,3,1,2,3,0,1,0,1,0,4), +(0,0,0,1,0,3,0,3,0,2,2,1,0,0,4,0,3,0,3,1,3,0,3,0,3,0,1,0,3,0,3,1,3,0,3,3,0,0,1,2,1,1,1,0,1,2,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,2,2,1,2,0,0,2,0,0,0,0,2,3,3,3,3,0,0,0,0,1,4), +(0,0,0,3,0,3,0,0,0,0,3,1,1,0,3,0,1,0,2,0,1,0,0,0,0,0,0,0,1,0,3,0,2,0,2,3,0,0,2,2,3,1,2,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,2,0,0,0,0,2,3), +(2,4,0,5,0,5,0,4,0,3,4,3,3,3,4,3,3,3,4,3,4,4,5,4,5,5,5,2,3,0,5,5,4,1,5,4,3,1,5,4,3,4,4,3,3,4,3,3,0,3,2,0,2,3,0,3,0,0,3,3,0,5,3,2,3,3,0,3,0,3,0,3,4,5,4,5,3,0,4,3,0,3,4), +(0,3,0,3,0,3,0,3,0,3,3,4,3,2,3,2,3,0,4,3,3,3,3,3,3,3,3,0,3,2,4,3,3,1,3,4,3,4,4,4,3,4,4,3,2,4,4,1,0,2,0,0,1,1,0,2,0,0,3,1,0,5,3,2,1,3,0,3,0,1,2,4,3,2,4,3,3,0,3,2,0,4,4), +(0,3,0,3,0,1,0,0,0,1,4,3,3,2,3,1,3,1,4,2,3,2,4,2,3,4,3,0,2,2,3,3,3,0,3,3,3,0,3,4,1,3,3,0,3,4,3,3,0,1,1,0,1,0,0,0,4,0,3,0,0,3,1,2,1,3,0,4,0,1,0,4,3,3,4,3,3,0,2,0,0,3,3), +(0,3,0,4,0,1,0,3,0,3,4,3,3,0,3,3,3,1,3,1,3,3,4,3,3,3,0,0,3,1,5,3,3,1,3,3,2,5,4,3,3,4,5,3,2,5,3,4,0,1,0,0,0,0,0,2,0,0,1,1,0,4,2,2,1,3,0,3,0,2,0,4,4,3,5,3,2,0,1,1,0,3,4), +(0,5,0,4,0,5,0,2,0,4,4,3,3,2,3,3,3,1,4,3,4,1,5,3,4,3,4,0,4,2,4,3,4,1,5,4,0,4,4,4,4,5,4,1,3,5,4,2,1,4,1,1,3,2,0,3,1,0,3,2,1,4,3,3,3,4,0,4,0,3,0,4,4,4,3,3,3,0,4,2,0,3,4), +(1,4,0,4,0,3,0,1,0,3,3,3,1,1,3,3,2,2,3,3,1,0,3,2,2,1,2,0,3,1,2,1,2,0,3,2,0,2,2,3,3,4,3,0,3,3,1,2,0,1,1,3,1,2,0,0,3,0,1,1,0,3,2,2,3,3,0,3,0,0,0,2,3,3,4,3,3,0,1,0,0,1,4), +(0,4,0,4,0,4,0,0,0,3,4,4,3,1,4,2,3,2,3,3,3,1,4,3,4,0,3,0,4,2,3,3,2,2,5,4,2,1,3,4,3,4,3,1,3,3,4,2,0,2,1,0,3,3,0,0,2,0,3,1,0,4,4,3,4,3,0,4,0,1,0,2,4,4,4,4,4,0,3,2,0,3,3), +(0,0,0,1,0,4,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,3,2,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,2), +(0,2,0,3,0,4,0,4,0,1,3,3,3,0,4,0,2,1,2,1,1,1,2,0,3,1,1,0,1,0,3,1,0,0,3,3,2,0,1,1,0,0,0,0,0,1,0,2,0,2,2,0,3,1,0,0,1,0,1,1,0,1,2,0,3,0,0,0,0,1,0,0,3,3,4,3,1,0,1,0,3,0,2), +(0,0,0,3,0,5,0,0,0,0,1,0,2,0,3,1,0,1,3,0,0,0,2,0,0,0,1,0,0,0,1,1,0,0,4,0,0,0,2,3,0,1,4,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,0,3,0,0,0,0,0,3), +(0,2,0,5,0,5,0,1,0,2,4,3,3,2,5,1,3,2,3,3,3,0,4,1,2,0,3,0,4,0,2,2,1,1,5,3,0,0,1,4,2,3,2,0,3,3,3,2,0,2,4,1,1,2,0,1,1,0,3,1,0,1,3,1,2,3,0,2,0,0,0,1,3,5,4,4,4,0,3,0,0,1,3), +(0,4,0,5,0,4,0,4,0,4,5,4,3,3,4,3,3,3,4,3,4,4,5,3,4,5,4,2,4,2,3,4,3,1,4,4,1,3,5,4,4,5,5,4,4,5,5,5,2,3,3,1,4,3,1,3,3,0,3,3,1,4,3,4,4,4,0,3,0,4,0,3,3,4,4,5,0,0,4,3,0,4,5), +(0,4,0,4,0,3,0,3,0,3,4,4,4,3,3,2,4,3,4,3,4,3,5,3,4,3,2,1,4,2,4,4,3,1,3,4,2,4,5,5,3,4,5,4,1,5,4,3,0,3,2,2,3,2,1,3,1,0,3,3,3,5,3,3,3,5,4,4,2,3,3,4,3,3,3,2,1,0,3,2,1,4,3), +(0,4,0,5,0,4,0,3,0,3,5,5,3,2,4,3,4,0,5,4,4,1,4,4,4,3,3,3,4,3,5,5,2,3,3,4,1,2,5,5,3,5,5,2,3,5,5,4,0,3,2,0,3,3,1,1,5,1,4,1,0,4,3,2,3,5,0,4,0,3,0,5,4,3,4,3,0,0,4,1,0,4,4), +(1,3,0,4,0,2,0,2,0,2,5,5,3,3,3,3,3,0,4,2,3,4,4,4,3,4,0,0,3,4,5,4,3,3,3,3,2,5,5,4,5,5,5,4,3,5,5,5,1,3,1,0,1,0,0,3,2,0,4,2,0,5,2,3,2,4,1,3,0,3,0,4,5,4,5,4,3,0,4,2,0,5,4), +(0,3,0,4,0,5,0,3,0,3,4,4,3,2,3,2,3,3,3,3,3,2,4,3,3,2,2,0,3,3,3,3,3,1,3,3,3,0,4,4,3,4,4,1,1,4,4,2,0,3,1,0,1,1,0,4,1,0,2,3,1,3,3,1,3,4,0,3,0,1,0,3,1,3,0,0,1,0,2,0,0,4,4), +(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0), +(0,3,0,3,0,2,0,3,0,1,5,4,3,3,3,1,4,2,1,2,3,4,4,2,4,4,5,0,3,1,4,3,4,0,4,3,3,3,2,3,2,5,3,4,3,2,2,3,0,0,3,0,2,1,0,1,2,0,0,0,0,2,1,1,3,1,0,2,0,4,0,3,4,4,4,5,2,0,2,0,0,1,3), +(0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,0,0,1,1,0,0,0,4,2,1,1,0,1,0,3,2,0,0,3,1,1,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0,0,0,2,0,0,0,1,4,0,4,2,1,0,0,0,0,0,1), +(0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,3,1,0,0,0,2,0,2,1,0,0,1,2,1,0,1,1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,1,3,1,0,0,0,0,0,1,0,0,2,1,0,0,0,0,0,0,0,0,2), +(0,4,0,4,0,4,0,3,0,4,4,3,4,2,4,3,2,0,4,4,4,3,5,3,5,3,3,2,4,2,4,3,4,3,1,4,0,2,3,4,4,4,3,3,3,4,4,4,3,4,1,3,4,3,2,1,2,1,3,3,3,4,4,3,3,5,0,4,0,3,0,4,3,3,3,2,1,0,3,0,0,3,3), +(0,4,0,3,0,3,0,3,0,3,5,5,3,3,3,3,4,3,4,3,3,3,4,4,4,3,3,3,3,4,3,5,3,3,1,3,2,4,5,5,5,5,4,3,4,5,5,3,2,2,3,3,3,3,2,3,3,1,2,3,2,4,3,3,3,4,0,4,0,2,0,4,3,2,2,1,2,0,3,0,0,4,1), +) + +class JapaneseContextAnalysis(object): + NUM_OF_CATEGORY = 6 + DONT_KNOW = -1 + ENOUGH_REL_THRESHOLD = 100 + MAX_REL_THRESHOLD = 1000 + MINIMUM_DATA_THRESHOLD = 4 + + def __init__(self): + self._total_rel = None + self._rel_sample = None + self._need_to_skip_char_num = None + self._last_char_order = None + self._done = None + self.reset() + + def reset(self): + self._total_rel = 0 # total sequence received + # category counters, each integer counts sequence in its category + self._rel_sample = [0] * self.NUM_OF_CATEGORY + # if last byte in current buffer is not the last byte of a character, + # we need to know how many bytes to skip in next buffer + self._need_to_skip_char_num = 0 + self._last_char_order = -1 # The order of previous char + # If this flag is set to True, detection is done and conclusion has + # been made + self._done = False + + def feed(self, byte_str, num_bytes): + if self._done: + return + + # The buffer we got is byte oriented, and a character may span in more than one + # buffers. In case the last one or two byte in last buffer is not + # complete, we record how many byte needed to complete that character + # and skip these bytes here. We can choose to record those bytes as + # well and analyse the character once it is complete, but since a + # character will not make much difference, by simply skipping + # this character will simply our logic and improve performance. + i = self._need_to_skip_char_num + while i < num_bytes: + order, char_len = self.get_order(byte_str[i:i + 2]) + i += char_len + if i > num_bytes: + self._need_to_skip_char_num = i - num_bytes + self._last_char_order = -1 + else: + if (order != -1) and (self._last_char_order != -1): + self._total_rel += 1 + if self._total_rel > self.MAX_REL_THRESHOLD: + self._done = True + break + self._rel_sample[jp2CharContext[self._last_char_order][order]] += 1 + self._last_char_order = order + + def got_enough_data(self): + return self._total_rel > self.ENOUGH_REL_THRESHOLD + + def get_confidence(self): + # This is just one way to calculate confidence. It works well for me. + if self._total_rel > self.MINIMUM_DATA_THRESHOLD: + return (self._total_rel - self._rel_sample[0]) / self._total_rel + else: + return self.DONT_KNOW + + def get_order(self, byte_str): + return -1, 1 + +class SJISContextAnalysis(JapaneseContextAnalysis): + def __init__(self): + super(SJISContextAnalysis, self).__init__() + self._charset_name = "SHIFT_JIS" + + @property + def charset_name(self): + return self._charset_name + + def get_order(self, byte_str): + if not byte_str: + return -1, 1 + # find out current char's byte length + first_char = byte_str[0] + if (0x81 <= first_char <= 0x9F) or (0xE0 <= first_char <= 0xFC): + char_len = 2 + if (first_char == 0x87) or (0xFA <= first_char <= 0xFC): + self._charset_name = "CP932" + else: + char_len = 1 + + # return its order if it is hiragana + if len(byte_str) > 1: + second_char = byte_str[1] + if (first_char == 202) and (0x9F <= second_char <= 0xF1): + return second_char - 0x9F, char_len + + return -1, char_len + +class EUCJPContextAnalysis(JapaneseContextAnalysis): + def get_order(self, byte_str): + if not byte_str: + return -1, 1 + # find out current char's byte length + first_char = byte_str[0] + if (first_char == 0x8E) or (0xA1 <= first_char <= 0xFE): + char_len = 2 + elif first_char == 0x8F: + char_len = 3 + else: + char_len = 1 + + # return its order if it is hiragana + if len(byte_str) > 1: + second_char = byte_str[1] + if (first_char == 0xA4) and (0xA1 <= second_char <= 0xF3): + return second_char - 0xA1, char_len + + return -1, char_len + + diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langbulgarianmodel.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langbulgarianmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..2aa4fb2e22fc3bfa26b569273c6cb18c4c415dd9 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langbulgarianmodel.py @@ -0,0 +1,228 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Communicator client code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +# 255: Control characters that usually does not exist in any text +# 254: Carriage/Return +# 253: symbol (punctuation) that does not belong to word +# 252: 0 - 9 + +# Character Mapping Table: +# this table is modified base on win1251BulgarianCharToOrderMap, so +# only number <64 is sure valid + +Latin5_BulgarianCharToOrderMap = ( +255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 +253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 +252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 +253, 77, 90, 99,100, 72,109,107,101, 79,185, 81,102, 76, 94, 82, # 40 +110,186,108, 91, 74,119, 84, 96,111,187,115,253,253,253,253,253, # 50 +253, 65, 69, 70, 66, 63, 68,112,103, 92,194,104, 95, 86, 87, 71, # 60 +116,195, 85, 93, 97,113,196,197,198,199,200,253,253,253,253,253, # 70 +194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209, # 80 +210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225, # 90 + 81,226,227,228,229,230,105,231,232,233,234,235,236, 45,237,238, # a0 + 31, 32, 35, 43, 37, 44, 55, 47, 40, 59, 33, 46, 38, 36, 41, 30, # b0 + 39, 28, 34, 51, 48, 49, 53, 50, 54, 57, 61,239, 67,240, 60, 56, # c0 + 1, 18, 9, 20, 11, 3, 23, 15, 2, 26, 12, 10, 14, 6, 4, 13, # d0 + 7, 8, 5, 19, 29, 25, 22, 21, 27, 24, 17, 75, 52,241, 42, 16, # e0 + 62,242,243,244, 58,245, 98,246,247,248,249,250,251, 91,252,253, # f0 +) + +win1251BulgarianCharToOrderMap = ( +255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 +253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 +252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 +253, 77, 90, 99,100, 72,109,107,101, 79,185, 81,102, 76, 94, 82, # 40 +110,186,108, 91, 74,119, 84, 96,111,187,115,253,253,253,253,253, # 50 +253, 65, 69, 70, 66, 63, 68,112,103, 92,194,104, 95, 86, 87, 71, # 60 +116,195, 85, 93, 97,113,196,197,198,199,200,253,253,253,253,253, # 70 +206,207,208,209,210,211,212,213,120,214,215,216,217,218,219,220, # 80 +221, 78, 64, 83,121, 98,117,105,222,223,224,225,226,227,228,229, # 90 + 88,230,231,232,233,122, 89,106,234,235,236,237,238, 45,239,240, # a0 + 73, 80,118,114,241,242,243,244,245, 62, 58,246,247,248,249,250, # b0 + 31, 32, 35, 43, 37, 44, 55, 47, 40, 59, 33, 46, 38, 36, 41, 30, # c0 + 39, 28, 34, 51, 48, 49, 53, 50, 54, 57, 61,251, 67,252, 60, 56, # d0 + 1, 18, 9, 20, 11, 3, 23, 15, 2, 26, 12, 10, 14, 6, 4, 13, # e0 + 7, 8, 5, 19, 29, 25, 22, 21, 27, 24, 17, 75, 52,253, 42, 16, # f0 +) + +# Model Table: +# total sequences: 100% +# first 512 sequences: 96.9392% +# first 1024 sequences:3.0618% +# rest sequences: 0.2992% +# negative sequences: 0.0020% +BulgarianLangModel = ( +0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,3,3,3,3,3, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,2,2,3,2,2,1,2,2, +3,1,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,3,3,3,3,3,0,3,0,1, +0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,3,3,3,3,3,3,3,0,3,1,0, +0,1,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, +3,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,2,3,3,3,3,3,3,3,3,0,3,0,0, +0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,1,3,2,3,3,3,3,3,3,3,3,0,3,0,0, +0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,3,3,3,3,2,3,2,2,1,3,3,3,3,2,2,2,1,1,2,0,1,0,1,0,0, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1, +3,3,3,3,3,3,3,2,3,2,2,3,3,1,1,2,3,3,2,3,3,3,3,2,1,2,0,2,0,3,0,0, +0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1, +3,3,3,3,3,3,3,1,3,3,3,3,3,2,3,2,3,3,3,3,3,2,3,3,1,3,0,3,0,2,0,0, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, +3,3,3,3,3,3,3,3,1,3,3,2,3,3,3,1,3,3,2,3,2,2,2,0,0,2,0,2,0,2,0,0, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1, +3,3,3,3,3,3,3,3,3,0,3,3,3,2,2,3,3,3,1,2,2,3,2,1,1,2,0,2,0,0,0,0, +1,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, +3,3,3,3,3,3,3,2,3,3,1,2,3,2,2,2,3,3,3,3,3,2,2,3,1,2,0,2,1,2,0,0, +0,0,0,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1, +3,3,3,3,3,1,3,3,3,3,3,2,3,3,3,2,3,3,2,3,2,2,2,3,1,2,0,1,0,1,0,0, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, +3,3,3,3,3,3,3,3,3,3,3,1,1,1,2,2,1,3,1,3,2,2,3,0,0,1,0,1,0,1,0,0, +0,0,0,1,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, +3,3,3,3,3,2,2,3,2,2,3,1,2,1,1,1,2,3,1,3,1,2,2,0,1,1,1,1,0,1,0,0, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, +3,3,3,3,3,1,3,2,2,3,3,1,2,3,1,1,3,3,3,3,1,2,2,1,1,1,0,2,0,2,0,1, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,2,2,3,3,3,2,2,1,1,2,0,2,0,1,0,0, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, +3,0,1,2,1,3,3,2,3,3,3,3,3,2,3,2,1,0,3,1,2,1,2,1,2,3,2,1,0,1,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,1,1,2,3,3,3,3,3,3,3,3,3,3,3,3,0,0,3,1,3,3,2,3,3,2,2,2,0,1,0,0, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,3,3,3,3,0,3,3,3,3,3,2,1,1,2,1,3,3,0,3,1,1,1,1,3,2,0,1,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, +3,3,2,2,2,3,3,3,3,3,3,3,3,3,3,3,1,1,3,1,3,3,2,3,2,2,2,3,0,2,0,0, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,2,3,3,2,2,3,2,1,1,1,1,1,3,1,3,1,1,0,0,0,1,0,0,0,1,0,0, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,2,3,2,0,3,2,0,3,0,2,0,0,2,1,3,1,0,0,1,0,0,0,1,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, +3,3,3,3,2,1,1,1,1,2,1,1,2,1,1,1,2,2,1,2,1,1,1,0,1,1,0,1,0,1,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, +3,3,3,3,2,1,3,1,1,2,1,3,2,1,1,0,1,2,3,2,1,1,1,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,3,3,3,3,2,2,1,0,1,0,0,1,0,0,0,2,1,0,3,0,0,1,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, +3,3,3,2,3,2,3,3,1,3,2,1,1,1,2,1,1,2,1,3,0,1,0,0,0,1,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,1,1,2,2,3,3,2,3,2,2,2,3,1,2,2,1,1,2,1,1,2,2,0,1,1,0,1,0,2,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,2,1,3,1,0,2,2,1,3,2,1,0,0,2,0,2,0,1,0,0,0,0,0,0,0,1,0,0, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1, +3,3,3,3,3,3,1,2,0,2,3,1,2,3,2,0,1,3,1,2,1,1,1,0,0,1,0,0,2,2,2,3, +2,2,2,2,1,2,1,1,2,2,1,1,2,0,1,1,1,0,0,1,1,0,0,1,1,0,0,0,1,1,0,1, +3,3,3,3,3,2,1,2,2,1,2,0,2,0,1,0,1,2,1,2,1,1,0,0,0,1,0,1,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1, +3,3,2,3,3,1,1,3,1,0,3,2,1,0,0,0,1,2,0,2,0,1,0,0,0,1,0,1,2,1,2,2, +1,1,1,1,1,1,1,2,2,2,1,1,1,1,1,1,1,0,1,2,1,1,1,0,0,0,0,0,1,1,0,0, +3,1,0,1,0,2,3,2,2,2,3,2,2,2,2,2,1,0,2,1,2,1,1,1,0,1,2,1,2,2,2,1, +1,1,2,2,2,2,1,2,1,1,0,1,2,1,2,2,2,1,1,1,0,1,1,1,1,2,0,1,0,0,0,0, +2,3,2,3,3,0,0,2,1,0,2,1,0,0,0,0,2,3,0,2,0,0,0,0,0,1,0,0,2,0,1,2, +2,1,2,1,2,2,1,1,1,2,1,1,1,0,1,2,2,1,1,1,1,1,0,1,1,1,0,0,1,2,0,0, +3,3,2,2,3,0,2,3,1,1,2,0,0,0,1,0,0,2,0,2,0,0,0,1,0,1,0,1,2,0,2,2, +1,1,1,1,2,1,0,1,2,2,2,1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,1,1,0,0, +2,3,2,3,3,0,0,3,0,1,1,0,1,0,0,0,2,2,1,2,0,0,0,0,0,0,0,0,2,0,1,2, +2,2,1,1,1,1,1,2,2,2,1,0,2,0,1,0,1,0,0,1,0,1,0,0,1,0,0,0,0,1,0,0, +3,3,3,3,2,2,2,2,2,0,2,1,1,1,1,2,1,2,1,1,0,2,0,1,0,1,0,0,2,0,1,2, +1,1,1,1,1,1,1,2,2,1,1,0,2,0,1,0,2,0,0,1,1,1,0,0,2,0,0,0,1,1,0,0, +2,3,3,3,3,1,0,0,0,0,0,0,0,0,0,0,2,0,0,1,1,0,0,0,0,0,0,1,2,0,1,2, +2,2,2,1,1,2,1,1,2,2,2,1,2,0,1,1,1,1,1,1,0,1,1,1,1,0,0,1,1,1,0,0, +2,3,3,3,3,0,2,2,0,2,1,0,0,0,1,1,1,2,0,2,0,0,0,3,0,0,0,0,2,0,2,2, +1,1,1,2,1,2,1,1,2,2,2,1,2,0,1,1,1,0,1,1,1,1,0,2,1,0,0,0,1,1,0,0, +2,3,3,3,3,0,2,1,0,0,2,0,0,0,0,0,1,2,0,2,0,0,0,0,0,0,0,0,2,0,1,2, +1,1,1,2,1,1,1,1,2,2,2,0,1,0,1,1,1,0,0,1,1,1,0,0,1,0,0,0,0,1,0,0, +3,3,2,2,3,0,1,0,1,0,0,0,0,0,0,0,1,1,0,3,0,0,0,0,0,0,0,0,1,0,2,2, +1,1,1,1,1,2,1,1,2,2,1,2,2,1,0,1,1,1,1,1,0,1,0,0,1,0,0,0,1,1,0,0, +3,1,0,1,0,2,2,2,2,3,2,1,1,1,2,3,0,0,1,0,2,1,1,0,1,1,1,1,2,1,1,1, +1,2,2,1,2,1,2,2,1,1,0,1,2,1,2,2,1,1,1,0,0,1,1,1,2,1,0,1,0,0,0,0, +2,1,0,1,0,3,1,2,2,2,2,1,2,2,1,1,1,0,2,1,2,2,1,1,2,1,1,0,2,1,1,1, +1,2,2,2,2,2,2,2,1,2,0,1,1,0,2,1,1,1,1,1,0,0,1,1,1,1,0,1,0,0,0,0, +2,1,1,1,1,2,2,2,2,1,2,2,2,1,2,2,1,1,2,1,2,3,2,2,1,1,1,1,0,1,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,2,2,3,2,0,1,2,0,1,2,1,1,0,1,0,1,2,1,2,0,0,0,1,1,0,0,0,1,0,0,2, +1,1,0,0,1,1,0,1,1,1,1,0,2,0,1,1,1,0,0,1,1,0,0,0,0,1,0,0,0,1,0,0, +2,0,0,0,0,1,2,2,2,2,2,2,2,1,2,1,1,1,1,1,1,1,0,1,1,1,1,1,2,1,1,1, +1,2,2,2,2,1,1,2,1,2,1,1,1,0,2,1,2,1,1,1,0,2,1,1,1,1,0,1,0,0,0,0, +3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0, +1,1,0,1,0,1,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,2,2,3,2,0,0,0,0,1,0,0,0,0,0,0,1,1,0,2,0,0,0,0,0,0,0,0,1,0,1,2, +1,1,1,1,1,1,0,0,2,2,2,2,2,0,1,1,0,1,1,1,1,1,0,0,1,0,0,0,1,1,0,1, +2,3,1,2,1,0,1,1,0,2,2,2,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,2, +1,1,1,1,2,1,1,1,1,1,1,1,1,0,1,1,0,1,0,1,0,1,0,0,1,0,0,0,0,1,0,0, +2,2,2,2,2,0,0,2,0,0,2,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,2,0,2,2, +1,1,1,1,1,0,0,1,2,1,1,0,1,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0, +1,2,2,2,2,0,0,2,0,1,1,0,0,0,1,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,1,1, +0,0,0,1,1,1,1,1,1,1,1,1,1,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0, +1,2,2,3,2,0,0,1,0,0,1,0,0,0,0,0,0,1,0,2,0,0,0,1,0,0,0,0,0,0,0,2, +1,1,0,0,1,0,0,0,1,1,0,0,1,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0, +2,1,2,2,2,1,2,1,2,2,1,1,2,1,1,1,0,1,1,1,1,2,0,1,0,1,1,1,1,0,1,1, +1,1,2,1,1,1,1,1,1,0,0,1,2,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0, +1,0,0,1,3,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,2,2,2,1,0,0,1,0,2,0,0,0,0,0,1,1,1,0,1,0,0,0,0,0,0,0,0,2,0,0,1, +0,2,0,1,0,0,1,1,2,0,1,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0, +1,2,2,2,2,0,1,1,0,2,1,0,1,1,1,0,0,1,0,2,0,1,0,0,0,0,0,0,0,0,0,1, +0,1,0,0,1,0,0,0,1,1,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0, +2,2,2,2,2,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1, +0,1,0,1,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0, +2,0,1,0,0,1,2,1,1,1,1,1,1,2,2,1,0,0,1,0,1,0,0,0,0,1,1,1,1,0,0,0, +1,1,2,1,1,1,1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,2,1,2,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1, +0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0, +0,1,1,0,1,1,1,0,0,1,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0, +1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,2,0,0,2,0,1,0,0,1,0,0,1, +1,1,0,0,1,1,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0, +1,1,1,1,1,1,1,2,0,0,0,0,0,0,2,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0, +2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,1,1,0,1,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, +) + +Latin5BulgarianModel = { + 'char_to_order_map': Latin5_BulgarianCharToOrderMap, + 'precedence_matrix': BulgarianLangModel, + 'typical_positive_ratio': 0.969392, + 'keep_english_letter': False, + 'charset_name': "ISO-8859-5", + 'language': 'Bulgairan', +} + +Win1251BulgarianModel = { + 'char_to_order_map': win1251BulgarianCharToOrderMap, + 'precedence_matrix': BulgarianLangModel, + 'typical_positive_ratio': 0.969392, + 'keep_english_letter': False, + 'charset_name': "windows-1251", + 'language': 'Bulgarian', +} diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langcyrillicmodel.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langcyrillicmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..e5f9a1fd19cca472d785bf90c6395cd11b524766 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langcyrillicmodel.py @@ -0,0 +1,333 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Communicator client code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +# KOI8-R language model +# Character Mapping Table: +KOI8R_char_to_order_map = ( +255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 +253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 +252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 +253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 +155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 +253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 + 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 +191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206, # 80 +207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222, # 90 +223,224,225, 68,226,227,228,229,230,231,232,233,234,235,236,237, # a0 +238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253, # b0 + 27, 3, 21, 28, 13, 2, 39, 19, 26, 4, 23, 11, 8, 12, 5, 1, # c0 + 15, 16, 9, 7, 6, 14, 24, 10, 17, 18, 20, 25, 30, 29, 22, 54, # d0 + 59, 37, 44, 58, 41, 48, 53, 46, 55, 42, 60, 36, 49, 38, 31, 34, # e0 + 35, 43, 45, 32, 40, 52, 56, 33, 61, 62, 51, 57, 47, 63, 50, 70, # f0 +) + +win1251_char_to_order_map = ( +255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 +253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 +252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 +253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 +155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 +253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 + 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 +191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206, +207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222, +223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238, +239,240,241,242,243,244,245,246, 68,247,248,249,250,251,252,253, + 37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35, + 45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43, + 3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15, + 9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16, +) + +latin5_char_to_order_map = ( +255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 +253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 +252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 +253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 +155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 +253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 + 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 +191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206, +207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222, +223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238, + 37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35, + 45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43, + 3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15, + 9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16, +239, 68,240,241,242,243,244,245,246,247,248,249,250,251,252,255, +) + +macCyrillic_char_to_order_map = ( +255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 +253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 +252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 +253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 +155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 +253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 + 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 + 37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35, + 45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43, +191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206, +207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222, +223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238, +239,240,241,242,243,244,245,246,247,248,249,250,251,252, 68, 16, + 3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15, + 9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27,255, +) + +IBM855_char_to_order_map = ( +255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 +253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 +252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 +253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 +155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 +253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 + 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 +191,192,193,194, 68,195,196,197,198,199,200,201,202,203,204,205, +206,207,208,209,210,211,212,213,214,215,216,217, 27, 59, 54, 70, + 3, 37, 21, 44, 28, 58, 13, 41, 2, 48, 39, 53, 19, 46,218,219, +220,221,222,223,224, 26, 55, 4, 42,225,226,227,228, 23, 60,229, +230,231,232,233,234,235, 11, 36,236,237,238,239,240,241,242,243, + 8, 49, 12, 38, 5, 31, 1, 34, 15,244,245,246,247, 35, 16,248, + 43, 9, 45, 7, 32, 6, 40, 14, 52, 24, 56, 10, 33, 17, 61,249, +250, 18, 62, 20, 51, 25, 57, 30, 47, 29, 63, 22, 50,251,252,255, +) + +IBM866_char_to_order_map = ( +255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 +253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 +252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 +253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40 +155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50 +253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60 + 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70 + 37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35, + 45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43, + 3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15, +191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206, +207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222, +223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238, + 9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16, +239, 68,240,241,242,243,244,245,246,247,248,249,250,251,252,255, +) + +# Model Table: +# total sequences: 100% +# first 512 sequences: 97.6601% +# first 1024 sequences: 2.3389% +# rest sequences: 0.1237% +# negative sequences: 0.0009% +RussianLangModel = ( +0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,3,3,3,3,1,3,3,3,2,3,2,3,3, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,2,2,2,2,0,0,2, +3,3,3,2,3,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,3,2,3,2,0, +0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,2,2,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,2,3,3,1,0, +0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,2,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,3,3,3,3,3,3,3,3,3,3,3,2,1, +0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,3,3,3,2,1, +0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,3,2,2,2,3,1,3,3,1,3,3,3,3,2,2,3,0,2,2,2,3,3,2,1,0, +0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,2,3,3,3,3,3,2,2,3,2,3,3,3,2,1,2,2,0,1,2,2,2,2,2,2,0, +0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,3,0,2,2,3,3,2,1,2,0, +0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,2,3,3,1,2,3,2,2,3,2,3,3,3,3,2,2,3,0,3,2,2,3,1,1,1,0, +0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,2,3,3,3,3,2,2,2,0,3,3,3,2,2,2,2,0, +0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,3,3,3,2,3,2,3,3,3,3,3,3,2,3,2,2,0,1,3,2,1,2,2,1,0, +0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,3,3,3,3,2,1,1,3,0,1,1,1,1,2,1,1,0,2,2,2,1,2,0,1,0, +0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,2,3,3,2,2,2,2,1,3,2,3,2,3,2,1,2,2,0,1,1,2,1,2,1,2,0, +0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,2,3,3,3,2,2,2,2,0,2,2,2,2,3,1,1,0, +0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, +3,2,3,2,2,3,3,3,3,3,3,3,3,3,1,3,2,0,0,3,3,3,3,2,3,3,3,3,2,3,2,0, +0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,3,3,3,3,3,2,2,3,3,0,2,1,0,3,2,3,2,3,0,0,1,2,0,0,1,0,1,2,1,1,0, +0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,0,3,0,2,3,3,3,3,2,3,3,3,3,1,2,2,0,0,2,3,2,2,2,3,2,3,2,2,3,0,0, +0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,2,3,0,2,3,2,3,0,1,2,3,3,2,0,2,3,0,0,2,3,2,2,0,1,3,1,3,2,2,1,0, +0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,1,3,0,2,3,3,3,3,3,3,3,3,2,1,3,2,0,0,2,2,3,3,3,2,3,3,0,2,2,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,2,2,3,3,2,2,2,3,3,0,0,1,1,1,1,1,2,0,0,1,1,1,1,0,1,0, +0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,2,2,3,3,3,3,3,3,3,0,3,2,3,3,2,3,2,0,2,1,0,1,1,0,1,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,2,3,3,3,2,2,2,2,3,1,3,2,3,1,1,2,1,0,2,2,2,2,1,3,1,0, +0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, +2,2,3,3,3,3,3,1,2,2,1,3,1,0,3,0,0,3,0,0,0,1,1,0,1,2,1,0,0,0,0,0, +0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,2,2,1,1,3,3,3,2,2,1,2,2,3,1,1,2,0,0,2,2,1,3,0,0,2,1,1,2,1,1,0, +0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,2,3,3,3,3,1,2,2,2,1,2,1,3,3,1,1,2,1,2,1,2,2,0,2,0,0,1,1,0,1,0, +0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,3,3,3,3,3,2,1,3,2,2,3,2,0,3,2,0,3,0,1,0,1,1,0,0,1,1,1,1,0,1,0, +0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,2,3,3,3,2,2,2,3,3,1,2,1,2,1,0,1,0,1,1,0,1,0,0,2,1,1,1,0,1,0, +0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, +3,1,1,2,1,2,3,3,2,2,1,2,2,3,0,2,1,0,0,2,2,3,2,1,2,2,2,2,2,3,1,0, +0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,1,1,0,1,1,2,2,1,1,3,0,0,1,3,1,1,1,0,0,0,1,0,1,1,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,1,3,3,3,2,0,0,0,2,1,0,1,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,0,1,0,0,2,3,2,2,2,1,2,2,2,1,2,1,0,0,1,1,1,0,2,0,1,1,1,0,0,1,1, +1,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0, +2,3,3,3,3,0,0,0,0,1,0,0,0,0,3,0,1,2,1,0,0,0,0,0,0,0,1,1,0,0,1,1, +1,0,1,0,1,2,0,0,1,1,2,1,0,1,1,1,1,0,1,1,1,1,0,1,0,0,1,0,0,1,1,0, +2,2,3,2,2,2,3,1,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,0,1,0,1,1,1,0,2,1, +1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,0, +3,3,3,2,2,2,2,3,2,2,1,1,2,2,2,2,1,1,3,1,2,1,2,0,0,1,1,0,1,0,2,1, +1,1,1,1,1,2,1,0,1,1,1,1,0,1,0,0,1,1,0,0,1,0,1,0,0,1,0,0,0,1,1,0, +2,0,0,1,0,3,2,2,2,2,1,2,1,2,1,2,0,0,0,2,1,2,2,1,1,2,2,0,1,1,0,2, +1,1,1,1,1,0,1,1,1,2,1,1,1,2,1,0,1,2,1,1,1,1,0,1,1,1,0,0,1,0,0,1, +1,3,2,2,2,1,1,1,2,3,0,0,0,0,2,0,2,2,1,0,0,0,0,0,0,1,0,0,0,0,1,1, +1,0,1,1,0,1,0,1,1,0,1,1,0,2,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0, +2,3,2,3,2,1,2,2,2,2,1,0,0,0,2,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,2,1, +1,1,2,1,0,2,0,0,1,0,1,0,0,1,0,0,1,1,0,1,1,0,0,0,0,0,1,0,0,0,0,0, +3,0,0,1,0,2,2,2,3,2,2,2,2,2,2,2,0,0,0,2,1,2,1,1,1,2,2,0,0,0,1,2, +1,1,1,1,1,0,1,2,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,1, +2,3,2,3,3,2,0,1,1,1,0,0,1,0,2,0,1,1,3,1,0,0,0,0,0,0,0,1,0,0,2,1, +1,1,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,1,0,0,1,1,0,1,0,0,0,0,0,0,1,0, +2,3,3,3,3,1,2,2,2,2,0,1,1,0,2,1,1,1,2,1,0,1,1,0,0,1,0,1,0,0,2,0, +0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,3,3,3,2,0,0,1,1,2,2,1,0,0,2,0,1,1,3,0,0,1,0,0,0,0,0,1,0,1,2,1, +1,1,2,0,1,1,1,0,1,0,1,1,0,1,0,1,1,1,1,0,1,0,0,0,0,0,0,1,0,1,1,0, +1,3,2,3,2,1,0,0,2,2,2,0,1,0,2,0,1,1,1,0,1,0,0,0,3,0,1,1,0,0,2,1, +1,1,1,0,1,1,0,0,0,0,1,1,0,1,0,0,2,1,1,0,1,0,0,0,1,0,1,0,0,1,1,0, +3,1,2,1,1,2,2,2,2,2,2,1,2,2,1,1,0,0,0,2,2,2,0,0,0,1,2,1,0,1,0,1, +2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,2,1,1,1,0,1,0,1,1,0,1,1,1,0,0,1, +3,0,0,0,0,2,0,1,1,1,1,1,1,1,0,1,0,0,0,1,1,1,0,1,0,1,1,0,0,1,0,1, +1,1,0,0,1,0,0,0,1,0,1,1,0,0,1,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,1, +1,3,3,2,2,0,0,0,2,2,0,0,0,1,2,0,1,1,2,0,0,0,0,0,0,0,0,1,0,0,2,1, +0,1,1,0,0,1,1,0,0,0,1,1,0,1,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0, +2,3,2,3,2,0,0,0,0,1,1,0,0,0,2,0,2,0,2,0,0,0,0,0,1,0,0,1,0,0,1,1, +1,1,2,0,1,2,1,0,1,1,2,1,1,1,1,1,2,1,1,0,1,0,0,1,1,1,1,1,0,1,1,0, +1,3,2,2,2,1,0,0,2,2,1,0,1,2,2,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,1, +0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0, +1,0,0,1,0,2,3,1,2,2,2,2,2,2,1,1,0,0,0,1,0,1,0,2,1,1,1,0,0,0,0,1, +1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0, +2,0,2,0,0,1,0,3,2,1,2,1,2,2,0,1,0,0,0,2,1,0,0,2,1,1,1,1,0,2,0,2, +2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,0,1,1,1,1,0,0,0,1,1,1,1,0,1,0,0,1, +1,2,2,2,2,1,0,0,1,0,0,0,0,0,2,0,1,1,1,1,0,0,0,0,1,0,1,2,0,0,2,0, +1,0,1,1,1,2,1,0,1,0,1,1,0,0,1,0,1,1,1,0,1,0,0,0,1,0,0,1,0,1,1,0, +2,1,2,2,2,0,3,0,1,1,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1, +0,0,0,1,1,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0, +1,2,2,3,2,2,0,0,1,1,2,0,1,2,1,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1, +0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0, +2,2,1,1,2,1,2,2,2,2,2,1,2,2,0,1,0,0,0,1,2,2,2,1,2,1,1,1,1,1,2,1, +1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,1,1,1,0,0,0,0,1,1,1,0,1,1,0,0,1, +1,2,2,2,2,0,1,0,2,2,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0, +0,0,1,0,0,1,0,0,0,0,1,0,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0, +0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,2,2,2,2,0,0,0,2,2,2,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1, +0,1,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,2,2,2,2,0,0,0,0,1,0,0,1,1,2,0,0,0,0,1,0,1,0,0,1,0,0,2,0,0,0,1, +0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0, +1,2,2,2,1,1,2,0,2,1,1,1,1,0,2,2,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1, +0,0,1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0, +1,0,2,1,2,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0, +0,0,1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0, +1,0,0,0,0,2,0,1,2,1,0,1,1,1,0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1, +0,0,0,0,0,1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1, +2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, +1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0, +2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, +1,1,1,0,1,0,1,0,0,1,1,1,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0, +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, +1,1,0,1,1,0,1,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,1,0,1,1,0,1,0,0,0, +0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0, +) + +Koi8rModel = { + 'char_to_order_map': KOI8R_char_to_order_map, + 'precedence_matrix': RussianLangModel, + 'typical_positive_ratio': 0.976601, + 'keep_english_letter': False, + 'charset_name': "KOI8-R", + 'language': 'Russian', +} + +Win1251CyrillicModel = { + 'char_to_order_map': win1251_char_to_order_map, + 'precedence_matrix': RussianLangModel, + 'typical_positive_ratio': 0.976601, + 'keep_english_letter': False, + 'charset_name': "windows-1251", + 'language': 'Russian', +} + +Latin5CyrillicModel = { + 'char_to_order_map': latin5_char_to_order_map, + 'precedence_matrix': RussianLangModel, + 'typical_positive_ratio': 0.976601, + 'keep_english_letter': False, + 'charset_name': "ISO-8859-5", + 'language': 'Russian', +} + +MacCyrillicModel = { + 'char_to_order_map': macCyrillic_char_to_order_map, + 'precedence_matrix': RussianLangModel, + 'typical_positive_ratio': 0.976601, + 'keep_english_letter': False, + 'charset_name': "MacCyrillic", + 'language': 'Russian', +} + +Ibm866Model = { + 'char_to_order_map': IBM866_char_to_order_map, + 'precedence_matrix': RussianLangModel, + 'typical_positive_ratio': 0.976601, + 'keep_english_letter': False, + 'charset_name': "IBM866", + 'language': 'Russian', +} + +Ibm855Model = { + 'char_to_order_map': IBM855_char_to_order_map, + 'precedence_matrix': RussianLangModel, + 'typical_positive_ratio': 0.976601, + 'keep_english_letter': False, + 'charset_name': "IBM855", + 'language': 'Russian', +} diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langgreekmodel.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langgreekmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..533222166cca9fce442655d9f3098126f50e6140 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langgreekmodel.py @@ -0,0 +1,225 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Communicator client code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +# 255: Control characters that usually does not exist in any text +# 254: Carriage/Return +# 253: symbol (punctuation) that does not belong to word +# 252: 0 - 9 + +# Character Mapping Table: +Latin7_char_to_order_map = ( +255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 +253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 +252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 +253, 82,100,104, 94, 98,101,116,102,111,187,117, 92, 88,113, 85, # 40 + 79,118,105, 83, 67,114,119, 95, 99,109,188,253,253,253,253,253, # 50 +253, 72, 70, 80, 81, 60, 96, 93, 89, 68,120, 97, 77, 86, 69, 55, # 60 + 78,115, 65, 66, 58, 76,106,103, 87,107,112,253,253,253,253,253, # 70 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 80 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 90 +253,233, 90,253,253,253,253,253,253,253,253,253,253, 74,253,253, # a0 +253,253,253,253,247,248, 61, 36, 46, 71, 73,253, 54,253,108,123, # b0 +110, 31, 51, 43, 41, 34, 91, 40, 52, 47, 44, 53, 38, 49, 59, 39, # c0 + 35, 48,250, 37, 33, 45, 56, 50, 84, 57,120,121, 17, 18, 22, 15, # d0 +124, 1, 29, 20, 21, 3, 32, 13, 25, 5, 11, 16, 10, 6, 30, 4, # e0 + 9, 8, 14, 7, 2, 12, 28, 23, 42, 24, 64, 75, 19, 26, 27,253, # f0 +) + +win1253_char_to_order_map = ( +255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 +253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 +252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 +253, 82,100,104, 94, 98,101,116,102,111,187,117, 92, 88,113, 85, # 40 + 79,118,105, 83, 67,114,119, 95, 99,109,188,253,253,253,253,253, # 50 +253, 72, 70, 80, 81, 60, 96, 93, 89, 68,120, 97, 77, 86, 69, 55, # 60 + 78,115, 65, 66, 58, 76,106,103, 87,107,112,253,253,253,253,253, # 70 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 80 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 90 +253,233, 61,253,253,253,253,253,253,253,253,253,253, 74,253,253, # a0 +253,253,253,253,247,253,253, 36, 46, 71, 73,253, 54,253,108,123, # b0 +110, 31, 51, 43, 41, 34, 91, 40, 52, 47, 44, 53, 38, 49, 59, 39, # c0 + 35, 48,250, 37, 33, 45, 56, 50, 84, 57,120,121, 17, 18, 22, 15, # d0 +124, 1, 29, 20, 21, 3, 32, 13, 25, 5, 11, 16, 10, 6, 30, 4, # e0 + 9, 8, 14, 7, 2, 12, 28, 23, 42, 24, 64, 75, 19, 26, 27,253, # f0 +) + +# Model Table: +# total sequences: 100% +# first 512 sequences: 98.2851% +# first 1024 sequences:1.7001% +# rest sequences: 0.0359% +# negative sequences: 0.0148% +GreekLangModel = ( +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,3,2,2,3,3,3,3,3,3,3,3,1,3,3,3,0,2,2,3,3,0,3,0,3,2,0,3,3,3,0, +3,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,3,3,3,3,0,3,3,0,3,2,3,3,0,3,2,3,3,3,0,0,3,0,3,0,3,3,2,0,0,0, +2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0, +0,2,3,2,2,3,3,3,3,3,3,3,3,0,3,3,3,3,0,2,3,3,0,3,3,3,3,2,3,3,3,0, +2,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,0,2,1,3,3,3,3,2,3,3,2,3,3,2,0, +0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,3,3,3,0,3,3,3,3,3,3,0,3,3,0,3,3,3,3,3,3,3,3,3,3,0,3,2,3,3,0, +2,0,1,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, +0,3,3,3,3,3,2,3,0,0,0,0,3,3,0,3,1,3,3,3,0,3,3,0,3,3,3,3,0,0,0,0, +2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,3,3,3,3,0,3,0,3,3,3,3,3,0,3,2,2,2,3,0,2,3,3,3,3,3,2,3,3,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,3,3,3,3,3,2,2,2,3,3,3,3,0,3,1,3,3,3,3,2,3,3,3,3,3,3,3,2,2,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,3,3,3,3,2,0,3,0,0,0,3,3,2,3,3,3,3,3,0,0,3,2,3,0,2,3,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,0,3,3,3,3,0,0,3,3,0,2,3,0,3,0,3,3,3,0,0,3,0,3,0,2,2,3,3,0,0, +0,0,1,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,3,3,3,3,2,0,3,2,3,3,3,3,0,3,3,3,3,3,0,3,3,2,3,2,3,3,2,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,3,2,3,2,3,3,3,3,3,3,0,2,3,2,3,2,2,2,3,2,3,3,2,3,0,2,2,2,3,0, +2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,3,0,0,0,3,3,3,2,3,3,0,0,3,0,3,0,0,0,3,2,0,3,0,3,0,0,2,0,2,0, +0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,3,3,3,0,3,3,3,3,3,3,0,3,3,0,3,0,0,0,3,3,0,3,3,3,0,0,1,2,3,0, +3,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,3,3,3,3,2,0,0,3,2,2,3,3,0,3,3,3,3,3,2,1,3,0,3,2,3,3,2,1,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,3,3,0,2,3,3,3,3,3,3,0,0,3,0,3,0,0,0,3,3,0,3,2,3,0,0,3,3,3,0, +3,0,0,0,2,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,3,3,3,0,3,3,3,3,3,3,0,0,3,0,3,0,0,0,3,2,0,3,2,3,0,0,3,2,3,0, +2,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,3,1,2,2,3,3,3,3,3,3,0,2,3,0,3,0,0,0,3,3,0,3,0,2,0,0,2,3,1,0, +2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,0,3,3,3,3,0,3,0,3,3,2,3,0,3,3,3,3,3,3,0,3,3,3,0,2,3,0,0,3,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,0,3,3,3,0,0,3,0,0,0,3,3,0,3,0,2,3,3,0,0,3,0,3,0,3,3,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,3,0,0,0,3,3,3,3,3,3,0,0,3,0,2,0,0,0,3,3,0,3,0,3,0,0,2,0,2,0, +0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,3,3,3,3,3,0,3,0,2,0,3,2,0,3,2,3,2,3,0,0,3,2,3,2,3,3,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,3,0,0,2,3,3,3,3,3,0,0,0,3,0,2,1,0,0,3,2,2,2,0,3,0,0,2,2,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,0,3,3,3,2,0,3,0,3,0,3,3,0,2,1,2,3,3,0,0,3,0,3,0,3,3,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,2,3,3,3,0,3,3,3,3,3,3,0,2,3,0,3,0,0,0,2,1,0,2,2,3,0,0,2,2,2,0, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,3,0,0,2,3,3,3,2,3,0,0,1,3,0,2,0,0,0,0,3,0,1,0,2,0,0,1,1,1,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,3,3,3,3,1,0,3,0,0,0,3,2,0,3,2,3,3,3,0,0,3,0,3,2,2,2,1,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,0,3,3,3,0,0,3,0,0,0,0,2,0,2,3,3,2,2,2,2,3,0,2,0,2,2,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,3,3,3,2,0,0,0,0,0,0,2,3,0,2,0,2,3,2,0,0,3,0,3,0,3,1,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,3,2,3,3,2,2,3,0,2,0,3,0,0,0,2,0,0,0,0,1,2,0,2,0,2,0, +0,2,0,2,0,2,2,0,0,1,0,2,2,2,0,2,2,2,0,2,2,2,0,0,2,0,0,1,0,0,0,0, +0,2,0,3,3,2,0,0,0,0,0,0,1,3,0,2,0,2,2,2,0,0,2,0,3,0,0,2,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,0,2,3,2,0,2,2,0,2,0,2,2,0,2,0,2,2,2,0,0,0,0,0,0,2,3,0,0,0,2, +0,1,2,0,0,0,0,2,2,0,0,0,2,1,0,2,2,0,0,0,0,0,0,1,0,2,0,0,0,0,0,0, +0,0,2,1,0,2,3,2,2,3,2,3,2,0,0,3,3,3,0,0,3,2,0,0,0,1,1,0,2,0,2,2, +0,2,0,2,0,2,2,0,0,2,0,2,2,2,0,2,2,2,2,0,0,2,0,0,0,2,0,1,0,0,0,0, +0,3,0,3,3,2,2,0,3,0,0,0,2,2,0,2,2,2,1,2,0,0,1,2,2,0,0,3,0,0,0,2, +0,1,2,0,0,0,1,2,0,0,0,0,0,0,0,2,2,0,1,0,0,2,0,0,0,2,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,2,3,3,2,2,0,0,0,2,0,2,3,3,0,2,0,0,0,0,0,0,2,2,2,0,2,2,0,2,0,2, +0,2,2,0,0,2,2,2,2,1,0,0,2,2,0,2,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0, +0,2,0,3,2,3,0,0,0,3,0,0,2,2,0,2,0,2,2,2,0,0,2,0,0,0,0,0,0,0,0,2, +0,0,2,2,0,0,2,2,2,0,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,2,0,0,3,2,0,2,2,2,2,2,0,0,0,2,0,0,0,0,2,0,1,0,0,2,0,1,0,0,0, +0,2,2,2,0,2,2,0,1,2,0,2,2,2,0,2,2,2,2,1,2,2,0,0,2,0,0,0,0,0,0,0, +0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, +0,2,0,2,0,2,2,0,0,0,0,1,2,1,0,0,2,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,3,2,3,0,0,2,0,0,0,2,2,0,2,0,0,0,1,0,0,2,0,2,0,2,2,0,0,0,0, +0,0,2,0,0,0,0,2,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0, +0,2,2,3,2,2,0,0,0,0,0,0,1,3,0,2,0,2,2,0,0,0,1,0,2,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,2,0,2,0,3,2,0,2,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, +0,0,2,0,0,0,0,1,1,0,0,2,1,2,0,2,2,0,1,0,0,1,0,0,0,2,0,0,0,0,0,0, +0,3,0,2,2,2,0,0,2,0,0,0,2,0,0,0,2,3,0,2,0,0,0,0,0,0,2,2,0,0,0,2, +0,1,2,0,0,0,1,2,2,1,0,0,0,2,0,0,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,2,1,2,0,2,2,0,2,0,0,2,0,0,0,0,1,2,1,0,2,1,0,0,0,0,0,0,0,0,0,0, +0,0,2,0,0,0,3,1,2,2,0,2,0,0,0,0,2,0,0,0,2,0,0,3,0,0,0,0,2,2,2,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,2,1,0,2,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,0,0,2, +0,2,2,0,0,2,2,2,2,2,0,1,2,0,0,0,2,2,0,1,0,2,0,0,2,2,0,0,0,0,0,0, +0,0,0,0,1,0,0,0,0,0,0,0,3,0,0,2,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,2, +0,1,2,0,0,0,0,2,2,1,0,1,0,1,0,2,2,2,1,0,0,0,0,0,0,1,0,0,0,0,0,0, +0,2,0,1,2,0,0,0,0,0,0,0,0,0,0,2,0,0,2,2,0,0,0,0,1,0,0,0,0,0,0,2, +0,2,2,0,0,0,0,2,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0, +0,2,2,2,2,0,0,0,3,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,1, +0,0,2,0,0,0,0,1,2,0,0,0,0,0,0,2,2,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0, +0,2,0,2,2,2,0,0,2,0,0,0,0,0,0,0,2,2,2,0,0,0,2,0,0,0,0,0,0,0,0,2, +0,0,1,0,0,0,0,2,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0, +0,3,0,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,2, +0,0,2,0,0,0,0,2,2,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,2,0,2,2,1,0,0,0,0,0,0,2,0,0,2,0,2,2,2,0,0,0,0,0,0,2,0,0,0,0,2, +0,0,2,0,0,2,0,2,2,0,0,0,0,2,0,2,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0, +0,0,3,0,0,0,2,2,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,0, +0,2,2,2,2,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1, +0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, +0,2,0,0,0,2,0,0,0,0,0,1,0,0,0,0,2,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,2,0,0,0, +0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,2,0,2,0,0,0, +0,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,2,0,0,0,1,2,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +) + +Latin7GreekModel = { + 'char_to_order_map': Latin7_char_to_order_map, + 'precedence_matrix': GreekLangModel, + 'typical_positive_ratio': 0.982851, + 'keep_english_letter': False, + 'charset_name': "ISO-8859-7", + 'language': 'Greek', +} + +Win1253GreekModel = { + 'char_to_order_map': win1253_char_to_order_map, + 'precedence_matrix': GreekLangModel, + 'typical_positive_ratio': 0.982851, + 'keep_english_letter': False, + 'charset_name': "windows-1253", + 'language': 'Greek', +} diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langhebrewmodel.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langhebrewmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..58f4c875ec926b85256fd3866369fc8a81a14350 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langhebrewmodel.py @@ -0,0 +1,200 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Universal charset detector code. +# +# The Initial Developer of the Original Code is +# Simon Montagu +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# Shy Shalom - original C code +# Shoshannah Forbes - original C code (?) +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +# 255: Control characters that usually does not exist in any text +# 254: Carriage/Return +# 253: symbol (punctuation) that does not belong to word +# 252: 0 - 9 + +# Windows-1255 language model +# Character Mapping Table: +WIN1255_CHAR_TO_ORDER_MAP = ( +255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 +253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 +252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 +253, 69, 91, 79, 80, 92, 89, 97, 90, 68,111,112, 82, 73, 95, 85, # 40 + 78,121, 86, 71, 67,102,107, 84,114,103,115,253,253,253,253,253, # 50 +253, 50, 74, 60, 61, 42, 76, 70, 64, 53,105, 93, 56, 65, 54, 49, # 60 + 66,110, 51, 43, 44, 63, 81, 77, 98, 75,108,253,253,253,253,253, # 70 +124,202,203,204,205, 40, 58,206,207,208,209,210,211,212,213,214, +215, 83, 52, 47, 46, 72, 32, 94,216,113,217,109,218,219,220,221, + 34,116,222,118,100,223,224,117,119,104,125,225,226, 87, 99,227, +106,122,123,228, 55,229,230,101,231,232,120,233, 48, 39, 57,234, + 30, 59, 41, 88, 33, 37, 36, 31, 29, 35,235, 62, 28,236,126,237, +238, 38, 45,239,240,241,242,243,127,244,245,246,247,248,249,250, + 9, 8, 20, 16, 3, 2, 24, 14, 22, 1, 25, 15, 4, 11, 6, 23, + 12, 19, 13, 26, 18, 27, 21, 17, 7, 10, 5,251,252,128, 96,253, +) + +# Model Table: +# total sequences: 100% +# first 512 sequences: 98.4004% +# first 1024 sequences: 1.5981% +# rest sequences: 0.087% +# negative sequences: 0.0015% +HEBREW_LANG_MODEL = ( +0,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,2,3,2,1,2,0,1,0,0, +3,0,3,1,0,0,1,3,2,0,1,1,2,0,2,2,2,1,1,1,1,2,1,1,1,2,0,0,2,2,0,1, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2, +1,2,1,2,1,2,0,0,2,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2, +1,2,1,3,1,1,0,0,2,0,0,0,1,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,0,1,2,2,1,3, +1,2,1,1,2,2,0,0,2,2,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,1,0,1,1,0, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,2,2,2,3,2, +1,2,1,2,2,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,3,2,2,3,2,2,2,1,2,2,2,2, +1,2,1,1,2,2,0,1,2,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,0,2,2,2,2,2, +0,2,0,2,2,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,0,2,2,2, +0,2,1,2,2,2,0,0,2,1,0,0,0,0,1,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0, +3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,2,1,2,3,2,2,2, +1,2,1,2,2,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0, +3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,0,2,0,2, +0,2,1,2,2,2,0,0,1,2,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,2,0,0,1,0, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,2,2,3,2,1,2,1,1,1, +0,1,1,1,1,1,3,0,1,0,0,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, +3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,0,0,1,0,0,1,0,0,0,0, +0,0,1,0,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2, +0,2,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, +3,3,3,3,3,3,3,3,3,2,3,3,3,2,1,2,3,3,2,3,3,3,3,2,3,2,1,2,0,2,1,2, +0,2,0,2,2,2,0,0,1,2,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0, +3,3,3,3,3,3,3,3,3,2,3,3,3,1,2,2,3,3,2,3,2,3,2,2,3,1,2,2,0,2,2,2, +0,2,1,2,2,2,0,0,1,2,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0, +3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,2,2,2,3,3,3,3,1,3,2,2,2, +0,2,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,2,3,2,2,2,1,2,2,0,2,2,2,2, +0,2,0,2,2,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, +3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,1,3,2,3,3,2,3,3,2,2,1,2,2,2,2,2,2, +0,2,1,2,1,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,1,0, +3,3,3,3,3,3,2,3,2,3,3,2,3,3,3,3,2,3,2,3,3,3,3,3,2,2,2,2,2,2,2,1, +0,2,0,1,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0, +3,3,3,3,3,3,3,3,3,2,1,2,3,3,3,3,3,3,3,2,3,2,3,2,1,2,3,0,2,1,2,2, +0,2,1,1,2,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,2,0, +3,3,3,3,3,3,3,3,3,2,3,3,3,3,2,1,3,1,2,2,2,1,2,3,3,1,2,1,2,2,2,2, +0,1,1,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,3,3,3,0,2,3,3,3,1,3,3,3,1,2,2,2,2,1,1,2,2,2,2,2,2, +0,2,0,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0, +3,3,3,3,3,3,2,3,3,3,2,2,3,3,3,2,1,2,3,2,3,2,2,2,2,1,2,1,1,1,2,2, +0,2,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, +3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,1,0,0,0,0,0, +1,0,1,0,0,0,0,0,2,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,2,3,3,2,3,1,2,2,2,2,3,2,3,1,1,2,2,1,2,2,1,1,0,2,2,2,2, +0,1,0,1,2,2,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0, +3,0,0,1,1,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,0, +0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,0,1,0,1,0,1,1,0,1,1,0,0,0,1,1,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0, +0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,0,0,0,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, +3,2,2,1,2,2,2,2,2,2,2,1,2,2,1,2,2,1,1,1,1,1,1,1,1,2,1,1,0,3,3,3, +0,3,0,2,2,2,2,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, +2,2,2,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,1,2,2,2,1,1,1,2,0,1, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,0,0,0,0,0,0, +0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,3,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,1,0,2,1,0, +0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, +0,3,1,1,2,2,2,2,2,1,2,2,2,1,1,2,2,2,2,2,2,2,1,2,2,1,0,1,1,1,1,0, +0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,2,1,1,1,1,2,1,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0, +0,0,2,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,1,0,0, +2,1,1,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,1,2,1,2,1,1,1,1,0,0,0,0, +0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,2,1,2,2,2,2,2,2,2,2,2,2,1,2,1,2,1,1,2,1,1,1,2,1,2,1,2,0,1,0,1, +0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,3,1,2,2,2,1,2,2,2,2,2,2,2,2,1,2,1,1,1,1,1,1,2,1,2,1,1,0,1,0,1, +0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,1,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2, +0,2,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, +3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,1,1,1,1,1,1,1,0,1,1,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,2,0,1,1,1,0,1,0,0,0,1,1,0,1,1,0,0,0,0,0,1,1,0,0, +0,1,1,1,2,1,2,2,2,0,2,0,2,0,1,1,2,1,1,1,1,2,1,0,1,1,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,0,1,0,0,0,0,0,1,0,1,2,2,0,1,0,0,1,1,2,2,1,2,0,2,0,0,0,1,2,0,1, +2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,2,0,2,1,2,0,2,0,0,1,1,1,1,1,1,0,1,0,0,0,1,0,0,1, +2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,1,0,0,0,0,0,1,0,2,1,1,0,1,0,0,1,1,1,2,2,0,0,1,0,0,0,1,0,0,1, +1,1,2,1,0,1,1,1,0,1,0,1,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,2,2,1, +0,2,0,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,1,0,0,1,0,1,1,1,1,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,1,1,1,1,1,1,1,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,1,1,0,1,0,0,0,1,1,0,1, +2,0,1,0,1,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,0,1,1,2,1,1,2,0,1,0,0,0,1,1,0,1, +1,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,1,0,1,1,2,0,1,0,0,0,0,2,1,1,2,0,2,0,0,0,1,1,0,1, +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,1,0,2,1,1,0,1,0,0,2,2,1,2,1,1,0,1,0,0,0,1,1,0,1, +2,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,0,1,1,0,1,0,0,1,0,0,0,0,1,0,1, +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,2,1,1,1,0,2,1,1,0,0,0,2,1,0,1, +1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,1,0,1,1,2,0,1,0,0,1,1,0,2,1,1,0,1,0,0,0,1,1,0,1, +2,2,1,1,1,0,1,1,0,1,1,0,1,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,1,0,2,1,1,0,1,0,0,1,1,0,1,2,1,0,2,0,0,0,1,1,0,1, +2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0, +0,1,0,0,2,0,2,1,1,0,1,0,1,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,1,0,1,1,2,0,1,0,0,1,1,1,0,1,0,0,1,0,0,0,1,0,0,1, +1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,0,0,0,0,0,0,0,1,0,1,1,0,0,1,0,0,2,1,1,1,1,1,0,1,0,0,0,0,1,0,1, +0,1,1,1,2,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,1,2,1,0,0,0,0,0,1,1,1,1,1,0,1,0,0,0,1,1,0,0, +) + +Win1255HebrewModel = { + 'char_to_order_map': WIN1255_CHAR_TO_ORDER_MAP, + 'precedence_matrix': HEBREW_LANG_MODEL, + 'typical_positive_ratio': 0.984004, + 'keep_english_letter': False, + 'charset_name': "windows-1255", + 'language': 'Hebrew', +} diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langhungarianmodel.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langhungarianmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..bb7c095e1ea6523bd00365384e4c662954c678a0 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langhungarianmodel.py @@ -0,0 +1,225 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Communicator client code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +# 255: Control characters that usually does not exist in any text +# 254: Carriage/Return +# 253: symbol (punctuation) that does not belong to word +# 252: 0 - 9 + +# Character Mapping Table: +Latin2_HungarianCharToOrderMap = ( +255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 +253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 +252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 +253, 28, 40, 54, 45, 32, 50, 49, 38, 39, 53, 36, 41, 34, 35, 47, + 46, 71, 43, 33, 37, 57, 48, 64, 68, 55, 52,253,253,253,253,253, +253, 2, 18, 26, 17, 1, 27, 12, 20, 9, 22, 7, 6, 13, 4, 8, + 23, 67, 10, 5, 3, 21, 19, 65, 62, 16, 11,253,253,253,253,253, +159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174, +175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190, +191,192,193,194,195,196,197, 75,198,199,200,201,202,203,204,205, + 79,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220, +221, 51, 81,222, 78,223,224,225,226, 44,227,228,229, 61,230,231, +232,233,234, 58,235, 66, 59,236,237,238, 60, 69, 63,239,240,241, + 82, 14, 74,242, 70, 80,243, 72,244, 15, 83, 77, 84, 30, 76, 85, +245,246,247, 25, 73, 42, 24,248,249,250, 31, 56, 29,251,252,253, +) + +win1250HungarianCharToOrderMap = ( +255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 +253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 +252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 +253, 28, 40, 54, 45, 32, 50, 49, 38, 39, 53, 36, 41, 34, 35, 47, + 46, 72, 43, 33, 37, 57, 48, 64, 68, 55, 52,253,253,253,253,253, +253, 2, 18, 26, 17, 1, 27, 12, 20, 9, 22, 7, 6, 13, 4, 8, + 23, 67, 10, 5, 3, 21, 19, 65, 62, 16, 11,253,253,253,253,253, +161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176, +177,178,179,180, 78,181, 69,182,183,184,185,186,187,188,189,190, +191,192,193,194,195,196,197, 76,198,199,200,201,202,203,204,205, + 81,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220, +221, 51, 83,222, 80,223,224,225,226, 44,227,228,229, 61,230,231, +232,233,234, 58,235, 66, 59,236,237,238, 60, 70, 63,239,240,241, + 84, 14, 75,242, 71, 82,243, 73,244, 15, 85, 79, 86, 30, 77, 87, +245,246,247, 25, 74, 42, 24,248,249,250, 31, 56, 29,251,252,253, +) + +# Model Table: +# total sequences: 100% +# first 512 sequences: 94.7368% +# first 1024 sequences:5.2623% +# rest sequences: 0.8894% +# negative sequences: 0.0009% +HungarianLangModel = ( +0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, +3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,2,3,3,1,1,2,2,2,2,2,1,2, +3,2,2,3,3,3,3,3,2,3,3,3,3,3,3,1,2,3,3,3,3,2,3,3,1,1,3,3,0,1,1,1, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0, +3,2,1,3,3,3,3,3,2,3,3,3,3,3,1,1,2,3,3,3,3,3,3,3,1,1,3,2,0,1,1,1, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, +3,3,3,3,3,3,3,3,3,3,3,1,1,2,3,3,3,1,3,3,3,3,3,1,3,3,2,2,0,3,2,3, +0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0, +3,3,3,3,3,3,2,3,3,3,2,3,3,2,3,3,3,3,3,2,3,3,2,2,3,2,3,2,0,3,2,2, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0, +3,3,3,3,3,3,2,3,3,3,3,3,2,3,3,3,1,2,3,2,2,3,1,2,3,3,2,2,0,3,3,3, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,3,2,3,3,3,3,2,3,3,3,3,0,2,3,2, +0,0,0,1,1,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,3,3,3,3,1,1,1,3,3,2,1,3,2,2,3,2,1,3,2,2,1,0,3,3,1, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, +3,2,2,3,3,3,3,3,1,2,3,3,3,3,1,2,1,3,3,3,3,2,2,3,1,1,3,2,0,1,1,1, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, +3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,2,1,3,3,3,3,3,2,2,1,3,3,3,0,1,1,2, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,2,3,3,3,2,0,3,2,3, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,1,0, +3,3,3,3,3,3,2,3,3,3,2,3,2,3,3,3,1,3,2,2,2,3,1,1,3,3,1,1,0,3,3,2, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,2,3,3,3,2,3,2,3,3,3,2,3,3,3,3,3,1,2,3,2,2,0,2,2,2, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, +3,3,3,2,2,2,3,1,3,3,2,2,1,3,3,3,1,1,3,1,2,3,2,3,2,2,2,1,0,2,2,2, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0, +3,1,1,3,3,3,3,3,1,2,3,3,3,3,1,2,1,3,3,3,2,2,3,2,1,0,3,2,0,1,1,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,1,1,3,3,3,3,3,1,2,3,3,3,3,1,1,0,3,3,3,3,0,2,3,0,0,2,1,0,1,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,2,2,3,3,2,2,2,2,3,3,0,1,2,3,2,3,2,2,3,2,1,2,0,2,2,2, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0, +3,3,3,3,3,3,1,2,3,3,3,2,1,2,3,3,2,2,2,3,2,3,3,1,3,3,1,1,0,2,3,2, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, +3,3,3,1,2,2,2,2,3,3,3,1,1,1,3,3,1,1,3,1,1,3,2,1,2,3,1,1,0,2,2,2, +0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, +3,3,3,2,1,2,1,1,3,3,1,1,1,1,3,3,1,1,2,2,1,2,1,1,2,2,1,1,0,2,2,1, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, +3,3,3,1,1,2,1,1,3,3,1,0,1,1,3,3,2,0,1,1,2,3,1,0,2,2,1,0,0,1,3,2, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, +3,2,1,3,3,3,3,3,1,2,3,2,3,3,2,1,1,3,2,3,2,1,2,2,0,1,2,1,0,0,1,1, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0, +3,3,3,3,2,2,2,2,3,1,2,2,1,1,3,3,0,3,2,1,2,3,2,1,3,3,1,1,0,2,1,3, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, +3,3,3,2,2,2,3,2,3,3,3,2,1,1,3,3,1,1,1,2,2,3,2,3,2,2,2,1,0,2,2,1, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, +1,0,0,3,3,3,3,3,0,0,3,3,2,3,0,0,0,2,3,3,1,0,1,2,0,0,1,1,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,1,2,3,3,3,3,3,1,2,3,3,2,2,1,1,0,3,3,2,2,1,2,2,1,0,2,2,0,1,1,1, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,2,2,1,3,1,2,3,3,2,2,1,1,2,2,1,1,1,1,3,2,1,1,1,1,2,1,0,1,2,1, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0, +2,3,3,1,1,1,1,1,3,3,3,0,1,1,3,3,1,1,1,1,1,2,2,0,3,1,1,2,0,2,1,1, +0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, +3,1,0,1,2,1,2,2,0,1,2,3,1,2,0,0,0,2,1,1,1,1,1,2,0,0,1,1,0,0,0,0, +1,2,1,2,2,2,1,2,1,2,0,2,0,2,2,1,1,2,1,1,2,1,1,1,0,1,0,0,0,1,1,0, +1,1,1,2,3,2,3,3,0,1,2,2,3,1,0,1,0,2,1,2,2,0,1,1,0,0,1,1,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,0,0,3,3,2,2,1,0,0,3,2,3,2,0,0,0,1,1,3,0,0,1,1,0,0,2,1,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,1,1,2,2,3,3,1,0,1,3,2,3,1,1,1,0,1,1,1,1,1,3,1,0,0,2,2,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,1,1,1,2,2,2,1,0,1,2,3,3,2,0,0,0,2,1,1,1,2,1,1,1,0,1,1,1,0,0,0, +1,2,2,2,2,2,1,1,1,2,0,2,1,1,1,1,1,2,1,1,1,1,1,1,0,1,1,1,0,0,1,1, +3,2,2,1,0,0,1,1,2,2,0,3,0,1,2,1,1,0,0,1,1,1,0,1,1,1,1,0,2,1,1,1, +2,2,1,1,1,2,1,2,1,1,1,1,1,1,1,2,1,1,1,2,3,1,1,1,1,1,1,1,1,1,0,1, +2,3,3,0,1,0,0,0,3,3,1,0,0,1,2,2,1,0,0,0,0,2,0,0,1,1,1,0,2,1,1,1, +2,1,1,1,1,1,1,2,1,1,0,1,1,0,1,1,1,0,1,2,1,1,0,1,1,1,1,1,1,1,0,1, +2,3,3,0,1,0,0,0,2,2,0,0,0,0,1,2,2,0,0,0,0,1,0,0,1,1,0,0,2,0,1,0, +2,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,2,0,1,1,1,1,1,0,1, +3,2,2,0,1,0,1,0,2,3,2,0,0,1,2,2,1,0,0,1,1,1,0,0,2,1,0,1,2,2,1,1, +2,1,1,1,1,1,1,2,1,1,1,1,1,1,0,2,1,0,1,1,0,1,1,1,0,1,1,2,1,1,0,1, +2,2,2,0,0,1,0,0,2,2,1,1,0,0,2,1,1,0,0,0,1,2,0,0,2,1,0,0,2,1,1,1, +2,1,1,1,1,2,1,2,1,1,1,2,2,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,0,1, +1,2,3,0,0,0,1,0,3,2,1,0,0,1,2,1,1,0,0,0,0,2,1,0,1,1,0,0,2,1,2,1, +1,1,0,0,0,1,0,1,1,1,1,1,2,0,0,1,0,0,0,2,0,0,1,1,1,1,1,1,1,1,0,1, +3,0,0,2,1,2,2,1,0,0,2,1,2,2,0,0,0,2,1,1,1,0,1,1,0,0,1,1,2,0,0,0, +1,2,1,2,2,1,1,2,1,2,0,1,1,1,1,1,1,1,1,1,2,1,1,0,0,1,1,1,1,0,0,1, +1,3,2,0,0,0,1,0,2,2,2,0,0,0,2,2,1,0,0,0,0,3,1,1,1,1,0,0,2,1,1,1, +2,1,0,1,1,1,0,1,1,1,1,1,1,1,0,2,1,0,0,1,0,1,1,0,1,1,1,1,1,1,0,1, +2,3,2,0,0,0,1,0,2,2,0,0,0,0,2,1,1,0,0,0,0,2,1,0,1,1,0,0,2,1,1,0, +2,1,1,1,1,2,1,2,1,2,0,1,1,1,0,2,1,1,1,2,1,1,1,1,0,1,1,1,1,1,0,1, +3,1,1,2,2,2,3,2,1,1,2,2,1,1,0,1,0,2,2,1,1,1,1,1,0,0,1,1,0,1,1,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,2,2,0,0,0,0,0,2,2,0,0,0,0,2,2,1,0,0,0,1,1,0,0,1,2,0,0,2,1,1,1, +2,2,1,1,1,2,1,2,1,1,0,1,1,1,1,2,1,1,1,2,1,1,1,1,0,1,2,1,1,1,0,1, +1,0,0,1,2,3,2,1,0,0,2,0,1,1,0,0,0,1,1,1,1,0,1,1,0,0,1,0,0,0,0,0, +1,2,1,2,1,2,1,1,1,2,0,2,1,1,1,0,1,2,0,0,1,1,1,0,0,0,0,0,0,0,0,0, +2,3,2,0,0,0,0,0,1,1,2,1,0,0,1,1,1,0,0,0,0,2,0,0,1,1,0,0,2,1,1,1, +2,1,1,1,1,1,1,2,1,0,1,1,1,1,0,2,1,1,1,1,1,1,0,1,0,1,1,1,1,1,0,1, +1,2,2,0,1,1,1,0,2,2,2,0,0,0,3,2,1,0,0,0,1,1,0,0,1,1,0,1,1,1,0,0, +1,1,0,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,0,0,1,1,1,0,1,0,1, +2,1,0,2,1,1,2,2,1,1,2,1,1,1,0,0,0,1,1,0,1,1,1,1,0,0,1,1,1,0,0,0, +1,2,2,2,2,2,1,1,1,2,0,2,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,1,0, +1,2,3,0,0,0,1,0,2,2,0,0,0,0,2,2,0,0,0,0,0,1,0,0,1,0,0,0,2,0,1,0, +2,1,1,1,1,1,0,2,0,0,0,1,2,1,1,1,1,0,1,2,0,1,0,1,0,1,1,1,0,1,0,1, +2,2,2,0,0,0,1,0,2,1,2,0,0,0,1,1,2,0,0,0,0,1,0,0,1,1,0,0,2,1,0,1, +2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,1,1,1,1,1,0,1, +1,2,2,0,0,0,1,0,2,2,2,0,0,0,1,1,0,0,0,0,0,1,1,0,2,0,0,1,1,1,0,1, +1,0,1,1,1,1,1,1,0,1,1,1,1,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,0,0,1, +1,0,0,1,0,1,2,1,0,0,1,1,1,2,0,0,0,1,1,0,1,0,1,1,0,0,1,0,0,0,0,0, +0,2,1,2,1,1,1,1,1,2,0,2,0,1,1,0,1,2,1,0,1,1,1,0,0,0,0,0,0,1,0,0, +2,1,1,0,1,2,0,0,1,1,1,0,0,0,1,1,0,0,0,0,0,1,0,0,1,0,0,0,2,1,0,1, +2,2,1,1,1,1,1,2,1,1,0,1,1,1,1,2,1,1,1,2,1,1,0,1,0,1,1,1,1,1,0,1, +1,2,2,0,0,0,0,0,1,1,0,0,0,0,2,1,0,0,0,0,0,2,0,0,2,2,0,0,2,0,0,1, +2,1,1,1,1,1,1,1,0,1,1,0,1,1,0,1,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1, +1,1,2,0,0,3,1,0,2,1,1,1,0,0,1,1,1,0,0,0,1,1,0,0,0,1,0,0,1,0,1,0, +1,2,1,0,1,1,1,2,1,1,0,1,1,1,1,1,0,0,0,1,1,1,1,1,0,1,0,0,0,1,0,0, +2,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,2,0,0,0, +2,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,2,1,1,0,0,1,1,1,1,1,0,1, +2,1,1,1,2,1,1,1,0,1,1,2,1,0,0,0,0,1,1,1,1,0,1,0,0,0,0,1,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,1,0,1,1,1,1,1,0,0,1,1,2,1,0,0,0,1,1,0,0,0,1,1,0,0,1,0,1,0,0,0, +1,2,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,1,0,0, +2,0,0,0,1,1,1,1,0,0,1,1,0,0,0,0,0,1,1,1,2,0,0,1,0,0,1,0,1,0,0,0, +0,1,1,1,1,1,1,1,1,2,0,1,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0, +1,0,0,1,1,1,1,1,0,0,2,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0, +0,1,1,1,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0, +1,0,0,1,1,1,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, +0,1,1,1,1,1,0,0,1,1,0,1,0,1,0,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0, +0,0,0,1,0,0,0,0,0,0,1,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,1,1,1,0,1,0,0,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0, +2,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,0,1,0,1,1,1,0,0,1,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, +0,1,1,1,1,1,1,0,1,1,0,1,0,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0, +) + +Latin2HungarianModel = { + 'char_to_order_map': Latin2_HungarianCharToOrderMap, + 'precedence_matrix': HungarianLangModel, + 'typical_positive_ratio': 0.947368, + 'keep_english_letter': True, + 'charset_name': "ISO-8859-2", + 'language': 'Hungarian', +} + +Win1250HungarianModel = { + 'char_to_order_map': win1250HungarianCharToOrderMap, + 'precedence_matrix': HungarianLangModel, + 'typical_positive_ratio': 0.947368, + 'keep_english_letter': True, + 'charset_name': "windows-1250", + 'language': 'Hungarian', +} diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langthaimodel.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langthaimodel.py new file mode 100644 index 0000000000000000000000000000000000000000..15f94c2df021c9cccc761ebeec80146edbb000c9 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langthaimodel.py @@ -0,0 +1,199 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Communicator client code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +# 255: Control characters that usually does not exist in any text +# 254: Carriage/Return +# 253: symbol (punctuation) that does not belong to word +# 252: 0 - 9 + +# The following result for thai was collected from a limited sample (1M). + +# Character Mapping Table: +TIS620CharToOrderMap = ( +255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00 +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10 +253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20 +252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30 +253,182,106,107,100,183,184,185,101, 94,186,187,108,109,110,111, # 40 +188,189,190, 89, 95,112,113,191,192,193,194,253,253,253,253,253, # 50 +253, 64, 72, 73,114, 74,115,116,102, 81,201,117, 90,103, 78, 82, # 60 + 96,202, 91, 79, 84,104,105, 97, 98, 92,203,253,253,253,253,253, # 70 +209,210,211,212,213, 88,214,215,216,217,218,219,220,118,221,222, +223,224, 99, 85, 83,225,226,227,228,229,230,231,232,233,234,235, +236, 5, 30,237, 24,238, 75, 8, 26, 52, 34, 51,119, 47, 58, 57, + 49, 53, 55, 43, 20, 19, 44, 14, 48, 3, 17, 25, 39, 62, 31, 54, + 45, 9, 16, 2, 61, 15,239, 12, 42, 46, 18, 21, 76, 4, 66, 63, + 22, 10, 1, 36, 23, 13, 40, 27, 32, 35, 86,240,241,242,243,244, + 11, 28, 41, 29, 33,245, 50, 37, 6, 7, 67, 77, 38, 93,246,247, + 68, 56, 59, 65, 69, 60, 70, 80, 71, 87,248,249,250,251,252,253, +) + +# Model Table: +# total sequences: 100% +# first 512 sequences: 92.6386% +# first 1024 sequences:7.3177% +# rest sequences: 1.0230% +# negative sequences: 0.0436% +ThaiLangModel = ( +0,1,3,3,3,3,0,0,3,3,0,3,3,0,3,3,3,3,3,3,3,3,0,0,3,3,3,0,3,3,3,3, +0,3,3,0,0,0,1,3,0,3,3,2,3,3,0,1,2,3,3,3,3,0,2,0,2,0,0,3,2,1,2,2, +3,0,3,3,2,3,0,0,3,3,0,3,3,0,3,3,3,3,3,3,3,3,3,0,3,2,3,0,2,2,2,3, +0,2,3,0,0,0,0,1,0,1,2,3,1,1,3,2,2,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1, +3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,3,3,2,3,2,3,3,2,2,2, +3,1,2,3,0,3,3,2,2,1,2,3,3,1,2,0,1,3,0,1,0,0,1,0,0,0,0,0,0,0,1,1, +3,3,2,2,3,3,3,3,1,2,3,3,3,3,3,2,2,2,2,3,3,2,2,3,3,2,2,3,2,3,2,2, +3,3,1,2,3,1,2,2,3,3,1,0,2,1,0,0,3,1,2,1,0,0,1,0,0,0,0,0,0,1,0,1, +3,3,3,3,3,3,2,2,3,3,3,3,2,3,2,2,3,3,2,2,3,2,2,2,2,1,1,3,1,2,1,1, +3,2,1,0,2,1,0,1,0,1,1,0,1,1,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0, +3,3,3,2,3,2,3,3,2,2,3,2,3,3,2,3,1,1,2,3,2,2,2,3,2,2,2,2,2,1,2,1, +2,2,1,1,3,3,2,1,0,1,2,2,0,1,3,0,0,0,1,1,0,0,0,0,0,2,3,0,0,2,1,1, +3,3,2,3,3,2,0,0,3,3,0,3,3,0,2,2,3,1,2,2,1,1,1,0,2,2,2,0,2,2,1,1, +0,2,1,0,2,0,0,2,0,1,0,0,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0, +3,3,2,3,3,2,0,0,3,3,0,2,3,0,2,1,2,2,2,2,1,2,0,0,2,2,2,0,2,2,1,1, +0,2,1,0,2,0,0,2,0,1,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0, +3,3,2,3,2,3,2,0,2,2,1,3,2,1,3,2,1,2,3,2,2,3,0,2,3,2,2,1,2,2,2,2, +1,2,2,0,0,0,0,2,0,1,2,0,1,1,1,0,1,0,3,1,1,0,0,0,0,0,0,0,0,0,1,0, +3,3,2,3,3,2,3,2,2,2,3,2,2,3,2,2,1,2,3,2,2,3,1,3,2,2,2,3,2,2,2,3, +3,2,1,3,0,1,1,1,0,2,1,1,1,1,1,0,1,0,1,1,0,0,0,0,0,0,0,0,0,2,0,0, +1,0,0,3,0,3,3,3,3,3,0,0,3,0,2,2,3,3,3,3,3,0,0,0,1,1,3,0,0,0,0,2, +0,0,1,0,0,0,0,0,0,0,2,3,0,0,0,3,0,2,0,0,0,0,0,3,0,0,0,0,0,0,0,0, +2,0,3,3,3,3,0,0,2,3,0,0,3,0,3,3,2,3,3,3,3,3,0,0,3,3,3,0,0,0,3,3, +0,0,3,0,0,0,0,2,0,0,2,1,1,3,0,0,1,0,0,2,3,0,1,0,0,0,0,0,0,0,1,0, +3,3,3,3,2,3,3,3,3,3,3,3,1,2,1,3,3,2,2,1,2,2,2,3,1,1,2,0,2,1,2,1, +2,2,1,0,0,0,1,1,0,1,0,1,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0, +3,0,2,1,2,3,3,3,0,2,0,2,2,0,2,1,3,2,2,1,2,1,0,0,2,2,1,0,2,1,2,2, +0,1,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,2,1,3,3,1,1,3,0,2,3,1,1,3,2,1,1,2,0,2,2,3,2,1,1,1,1,1,2, +3,0,0,1,3,1,2,1,2,0,3,0,0,0,1,0,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0, +3,3,1,1,3,2,3,3,3,1,3,2,1,3,2,1,3,2,2,2,2,1,3,3,1,2,1,3,1,2,3,0, +2,1,1,3,2,2,2,1,2,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2, +3,3,2,3,2,3,3,2,3,2,3,2,3,3,2,1,0,3,2,2,2,1,2,2,2,1,2,2,1,2,1,1, +2,2,2,3,0,1,3,1,1,1,1,0,1,1,0,2,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,2,3,2,2,1,1,3,2,3,2,3,2,0,3,2,2,1,2,0,2,2,2,1,2,2,2,2,1, +3,2,1,2,2,1,0,2,0,1,0,0,1,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,1, +3,3,3,3,3,2,3,1,2,3,3,2,2,3,0,1,1,2,0,3,3,2,2,3,0,1,1,3,0,0,0,0, +3,1,0,3,3,0,2,0,2,1,0,0,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,2,3,2,3,3,0,1,3,1,1,2,1,2,1,1,3,1,1,0,2,3,1,1,1,1,1,1,1,1, +3,1,1,2,2,2,2,1,1,1,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, +3,2,2,1,1,2,1,3,3,2,3,2,2,3,2,2,3,1,2,2,1,2,0,3,2,1,2,2,2,2,2,1, +3,2,1,2,2,2,1,1,1,1,0,0,1,1,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,3,1,3,3,0,2,1,0,3,2,0,0,3,1,0,1,1,0,1,0,0,0,0,0,1, +1,0,0,1,0,3,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,0,2,2,2,3,0,0,1,3,0,3,2,0,3,2,2,3,3,3,3,3,1,0,2,2,2,0,2,2,1,2, +0,2,3,0,0,0,0,1,0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, +3,0,2,3,1,3,3,2,3,3,0,3,3,0,3,2,2,3,2,3,3,3,0,0,2,2,3,0,1,1,1,3, +0,0,3,0,0,0,2,2,0,1,3,0,1,2,2,2,3,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1, +3,2,3,3,2,0,3,3,2,2,3,1,3,2,1,3,2,0,1,2,2,0,2,3,2,1,0,3,0,0,0,0, +3,0,0,2,3,1,3,0,0,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,1,3,2,2,2,1,2,0,1,3,1,1,3,1,3,0,0,2,1,1,1,1,2,1,1,1,0,2,1,0,1, +1,2,0,0,0,3,1,1,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,0,3,1,0,0,0,1,0, +3,3,3,3,2,2,2,2,2,1,3,1,1,1,2,0,1,1,2,1,2,1,3,2,0,0,3,1,1,1,1,1, +3,1,0,2,3,0,0,0,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,2,3,0,3,3,0,2,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,0,0,0,0,0, +0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,2,3,1,3,0,0,1,2,0,0,2,0,3,3,2,3,3,3,2,3,0,0,2,2,2,0,0,0,2,2, +0,0,1,0,0,0,0,3,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, +0,0,0,3,0,2,0,0,0,0,0,0,0,0,0,0,1,2,3,1,3,3,0,0,1,0,3,0,0,0,0,0, +0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,1,2,3,1,2,3,1,0,3,0,2,2,1,0,2,1,1,2,0,1,0,0,1,1,1,1,0,1,0,0, +1,0,0,0,0,1,1,0,3,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,2,1,0,1,1,1,3,1,2,2,2,2,2,2,1,1,1,1,0,3,1,0,1,3,1,1,1,1, +1,1,0,2,0,1,3,1,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1, +3,0,2,2,1,3,3,2,3,3,0,1,1,0,2,2,1,2,1,3,3,1,0,0,3,2,0,0,0,0,2,1, +0,1,0,0,0,0,1,2,0,1,1,3,1,1,2,2,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, +0,0,3,0,0,1,0,0,0,3,0,0,3,0,3,1,0,1,1,1,3,2,0,0,0,3,0,0,0,0,2,0, +0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0, +3,3,1,3,2,1,3,3,1,2,2,0,1,2,1,0,1,2,0,0,0,0,0,3,0,0,0,3,0,0,0,0, +3,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,0,1,2,0,3,3,3,2,2,0,1,1,0,1,3,0,0,0,2,2,0,0,0,0,3,1,0,1,0,0,0, +0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,0,2,3,1,2,0,0,2,1,0,3,1,0,1,2,0,1,1,1,1,3,0,0,3,1,1,0,2,2,1,1, +0,2,0,0,0,0,0,1,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,0,0,3,1,2,0,0,2,2,0,1,2,0,1,0,1,3,1,2,1,0,0,0,2,0,3,0,0,0,1,0, +0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,0,1,1,2,2,0,0,0,2,0,2,1,0,1,1,0,1,1,1,2,1,0,0,1,1,1,0,2,1,1,1, +0,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1, +0,0,0,2,0,1,3,1,1,1,1,0,0,0,0,3,2,0,1,0,0,0,1,2,0,0,0,1,0,0,0,0, +0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,3,3,3,3,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,0,2,3,2,2,0,0,0,1,0,0,0,0,2,3,2,1,2,2,3,0,0,0,2,3,1,0,0,0,1,1, +0,0,1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0, +3,3,2,2,0,1,0,0,0,0,2,0,2,0,1,0,0,0,1,1,0,0,0,2,1,0,1,0,1,1,0,0, +0,1,0,2,0,0,1,0,3,0,1,0,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,1,0,0,1,0,0,0,0,0,1,1,2,0,0,0,0,1,0,0,1,3,1,0,0,0,0,1,1,0,0, +0,1,0,0,0,0,3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0, +3,3,1,1,1,1,2,3,0,0,2,1,1,1,1,1,0,2,1,1,0,0,0,2,1,0,1,2,1,1,0,1, +2,1,0,3,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,3,1,0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1, +0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,2,0,0,0,0,0,0,1,2,1,0,1,1,0,2,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,2,0,0,0,1,3,0,1,0,0,0,2,0,0,0,0,0,0,0,1,2,0,0,0,0,0, +3,3,0,0,1,1,2,0,0,1,2,1,0,1,1,1,0,1,1,0,0,2,1,1,0,1,0,0,1,1,1,0, +0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,2,2,1,0,0,0,0,1,0,0,0,0,3,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0, +2,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,3,0,0,1,1,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +1,1,0,1,2,0,1,2,0,0,1,1,0,2,0,1,0,0,1,0,0,0,0,1,0,0,0,2,0,0,0,0, +1,0,0,1,0,1,1,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,1,0,0,0,0,0,0,0,1,1,0,1,1,0,2,1,3,0,0,0,0,1,1,0,0,0,0,0,0,0,3, +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,0,1,0,1,0,0,2,0,0,2,0,0,1,1,2,0,0,1,1,0,0,0,1,0,0,0,1,1,0,0,0, +1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, +1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,1,0,0,0, +2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,3,0,0,0, +2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0, +1,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,1,1,0,0,2,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +) + +TIS620ThaiModel = { + 'char_to_order_map': TIS620CharToOrderMap, + 'precedence_matrix': ThaiLangModel, + 'typical_positive_ratio': 0.926386, + 'keep_english_letter': False, + 'charset_name': "TIS-620", + 'language': 'Thai', +} diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langturkishmodel.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langturkishmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..a427a457398de8076cdcefb5a6c391e89500bce8 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/langturkishmodel.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Communicator client code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# Özgür Baskın - Turkish Language Model +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +# 255: Control characters that usually does not exist in any text +# 254: Carriage/Return +# 253: symbol (punctuation) that does not belong to word +# 252: 0 - 9 + +# Character Mapping Table: +Latin5_TurkishCharToOrderMap = ( +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, +255, 23, 37, 47, 39, 29, 52, 36, 45, 53, 60, 16, 49, 20, 46, 42, + 48, 69, 44, 35, 31, 51, 38, 62, 65, 43, 56,255,255,255,255,255, +255, 1, 21, 28, 12, 2, 18, 27, 25, 3, 24, 10, 5, 13, 4, 15, + 26, 64, 7, 8, 9, 14, 32, 57, 58, 11, 22,255,255,255,255,255, +180,179,178,177,176,175,174,173,172,171,170,169,168,167,166,165, +164,163,162,161,160,159,101,158,157,156,155,154,153,152,151,106, +150,149,148,147,146,145,144,100,143,142,141,140,139,138,137,136, + 94, 80, 93,135,105,134,133, 63,132,131,130,129,128,127,126,125, +124,104, 73, 99, 79, 85,123, 54,122, 98, 92,121,120, 91,103,119, + 68,118,117, 97,116,115, 50, 90,114,113,112,111, 55, 41, 40, 86, + 89, 70, 59, 78, 71, 82, 88, 33, 77, 66, 84, 83,110, 75, 61, 96, + 30, 67,109, 74, 87,102, 34, 95, 81,108, 76, 72, 17, 6, 19,107, +) + +TurkishLangModel = ( +3,2,3,3,3,1,3,3,3,3,3,3,3,3,2,1,1,3,3,1,3,3,0,3,3,3,3,3,0,3,1,3, +3,2,1,0,0,1,1,0,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,0,2,2,0,0,1,0,0,1, +3,2,2,3,3,0,3,3,3,3,3,3,3,2,3,1,0,3,3,1,3,3,0,3,3,3,3,3,0,3,0,3, +3,1,1,0,1,0,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,2,2,0,0,0,1,0,1, +3,3,2,3,3,0,3,3,3,3,3,3,3,2,3,1,1,3,3,0,3,3,1,2,3,3,3,3,0,3,0,3, +3,1,1,0,0,0,1,0,0,0,0,1,1,0,1,2,1,0,0,0,1,0,0,0,0,2,0,0,0,0,0,1, +3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,1,3,3,2,0,3,2,1,2,2,1,3,3,0,0,0,2, +2,2,0,1,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,1, +3,3,3,2,3,3,1,2,3,3,3,3,3,3,3,1,3,2,1,0,3,2,0,1,2,3,3,2,1,0,0,2, +2,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0, +1,0,1,3,3,1,3,3,3,3,3,3,3,1,2,0,0,2,3,0,2,3,0,0,2,2,2,3,0,3,0,1, +2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,0,3,2,0,2,3,2,3,3,1,0,0,2, +3,2,0,0,1,0,0,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,2,0,0,1, +3,3,3,2,3,3,2,3,3,3,3,2,3,3,3,0,3,3,0,0,2,1,0,0,2,3,2,2,0,0,0,2, +2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,1,0,2,0,0,1, +3,3,3,2,3,3,3,3,3,3,3,2,3,3,3,0,3,2,0,1,3,2,1,1,3,2,3,2,1,0,0,2, +2,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, +3,3,3,2,3,3,3,3,3,3,3,2,3,3,3,0,3,2,2,0,2,3,0,0,2,2,2,2,0,0,0,2, +3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,1,0,0,0, +3,3,3,3,3,3,3,2,2,2,2,3,2,3,3,0,3,3,1,1,2,2,0,0,2,2,3,2,0,0,1,3, +0,3,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1, +3,3,3,2,3,3,3,2,1,2,2,3,2,3,3,0,3,2,0,0,1,1,0,1,1,2,1,2,0,0,0,1, +0,3,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0, +3,3,3,2,3,3,2,3,2,2,2,3,3,3,3,1,3,1,1,0,3,2,1,1,3,3,2,3,1,0,0,1, +1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,1, +3,2,2,3,3,0,3,3,3,3,3,3,3,2,2,1,0,3,3,1,3,3,0,1,3,3,2,3,0,3,0,3, +2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0, +2,2,2,3,3,0,3,3,3,3,3,3,3,3,3,0,0,3,2,0,3,3,0,3,2,3,3,3,0,3,1,3, +2,0,0,0,0,0,0,0,0,0,0,1,0,1,2,0,1,0,0,0,0,0,0,0,2,2,0,0,1,0,0,1, +3,3,3,1,2,3,3,1,0,0,1,0,0,3,3,2,3,0,0,2,0,0,2,0,2,0,0,0,2,0,2,0, +0,3,1,0,1,0,0,0,2,2,1,0,1,1,2,1,2,2,2,0,2,1,1,0,0,0,2,0,0,0,0,0, +1,2,1,3,3,0,3,3,3,3,3,2,3,0,0,0,0,2,3,0,2,3,1,0,2,3,1,3,0,3,0,2, +3,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,1,3,3,2,2,3,2,2,0,1,2,3,0,1,2,1,0,1,0,0,0,1,0,2,2,0,0,0,1, +1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0, +3,3,3,1,3,3,1,1,3,3,1,1,3,3,1,0,2,1,2,0,2,1,0,0,1,1,2,1,0,0,0,2, +2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,1,0,2,1,3,0,0,2,0,0,3,3,0,3,0,0,1,0,1,2,0,0,1,1,2,2,0,1,0, +0,1,2,1,1,0,1,0,1,1,1,1,1,0,1,1,1,2,2,1,2,0,1,0,0,0,0,0,0,1,0,0, +3,3,3,2,3,2,3,3,0,2,2,2,3,3,3,0,3,0,0,0,2,2,0,1,2,1,1,1,0,0,0,1, +0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, +3,3,3,3,3,3,2,1,2,2,3,3,3,3,2,0,2,0,0,0,2,2,0,0,2,1,3,3,0,0,1,1, +1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0, +1,1,2,3,3,0,3,3,3,3,3,3,2,2,0,2,0,2,3,2,3,2,2,2,2,2,2,2,1,3,2,3, +2,0,2,1,2,2,2,2,1,1,2,2,1,2,2,1,2,0,0,2,1,1,0,2,1,0,0,1,0,0,0,1, +2,3,3,1,1,1,0,1,1,1,2,3,2,1,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0, +0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,2,2,2,3,2,3,2,2,1,3,3,3,0,2,1,2,0,2,1,0,0,1,1,1,1,1,0,0,1, +2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,2,0,1,0,0,0, +3,3,3,2,3,3,3,3,3,2,3,1,2,3,3,1,2,0,0,0,0,0,0,0,3,2,1,1,0,0,0,0, +2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0, +3,3,3,2,2,3,3,2,1,1,1,1,1,3,3,0,3,1,0,0,1,1,0,0,3,1,2,1,0,0,0,0, +0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0, +3,3,3,2,2,3,2,2,2,3,2,1,1,3,3,0,3,0,0,0,0,1,0,0,3,1,1,2,0,0,0,1, +1,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, +1,1,1,3,3,0,3,3,3,3,3,2,2,2,1,2,0,2,1,2,2,1,1,0,1,2,2,2,2,2,2,2, +0,0,2,1,2,1,2,1,0,1,1,3,1,2,1,1,2,0,0,2,0,1,0,1,0,1,0,0,0,1,0,1, +3,3,3,1,3,3,3,0,1,1,0,2,2,3,1,0,3,0,0,0,1,0,0,0,1,0,0,1,0,1,0,0, +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,2,0,0,2,2,1,0,0,1,0,0,3,3,1,3,0,0,1,1,0,2,0,3,0,0,0,2,0,1,1, +0,1,2,0,1,2,2,0,2,2,2,2,1,0,2,1,1,0,2,0,2,1,2,0,0,0,0,0,0,0,0,0, +3,3,3,1,3,2,3,2,0,2,2,2,1,3,2,0,2,1,2,0,1,2,0,0,1,0,2,2,0,0,0,2, +1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0, +3,3,3,0,3,3,1,1,2,3,1,0,3,2,3,0,3,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0, +1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,3,3,0,3,3,2,3,3,2,2,0,0,0,0,1,2,0,1,3,0,0,0,3,1,1,0,3,0,2, +2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,1,2,2,1,0,3,1,1,1,1,3,3,2,3,0,0,1,0,1,2,0,2,2,0,2,2,0,2,1, +0,2,2,1,1,1,1,0,2,1,1,0,1,1,1,1,2,1,2,1,2,0,1,0,1,0,0,0,0,0,0,0, +3,3,3,0,1,1,3,0,0,1,1,0,0,2,2,0,3,0,0,1,1,0,1,0,0,0,0,0,2,0,0,0, +0,3,1,0,1,0,1,0,2,0,0,1,0,1,0,1,1,1,2,1,1,0,2,0,0,0,0,0,0,0,0,0, +3,3,3,0,2,0,2,0,1,1,1,0,0,3,3,0,2,0,0,1,0,0,2,1,1,0,1,0,1,0,1,0, +0,2,0,1,2,0,2,0,2,1,1,0,1,0,2,1,1,0,2,1,1,0,1,0,0,0,1,1,0,0,0,0, +3,2,3,0,1,0,0,0,0,0,0,0,0,1,2,0,1,0,0,1,0,0,1,0,0,0,0,0,2,0,0,0, +0,0,1,1,0,0,1,0,1,0,0,1,0,0,0,2,1,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,0,0,2,3,0,0,1,0,1,0,2,3,2,3,0,0,1,3,0,2,1,0,0,0,0,2,0,1,0, +0,2,1,0,0,1,1,0,2,1,0,0,1,0,0,1,1,0,1,1,2,0,1,0,0,0,0,1,0,0,0,0, +3,2,2,0,0,1,1,0,0,0,0,0,0,3,1,1,1,0,0,0,0,0,1,0,0,0,0,0,2,0,1,0, +0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0, +0,0,0,3,3,0,2,3,2,2,1,2,2,1,1,2,0,1,3,2,2,2,0,0,2,2,0,0,0,1,2,1, +3,0,2,1,1,0,1,1,1,0,1,2,2,2,1,1,2,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0, +0,1,1,2,3,0,3,3,3,2,2,2,2,1,0,1,0,1,0,1,2,2,0,0,2,2,1,3,1,1,2,1, +0,0,1,1,2,0,1,1,0,0,1,2,0,2,1,1,2,0,0,1,0,0,0,1,0,1,0,1,0,0,0,0, +3,3,2,0,0,3,1,0,0,0,0,0,0,3,2,1,2,0,0,1,0,0,2,0,0,0,0,0,2,0,1,0, +0,2,1,1,0,0,1,0,1,2,0,0,1,1,0,0,2,1,1,1,1,0,2,0,0,0,0,0,0,0,0,0, +3,3,2,0,0,1,0,0,0,0,1,0,0,3,3,2,2,0,0,1,0,0,2,0,1,0,0,0,2,0,1,0, +0,0,1,1,0,0,2,0,2,1,0,0,1,1,2,1,2,0,2,1,2,1,1,1,0,0,1,1,0,0,0,0, +3,3,2,0,0,2,2,0,0,0,1,1,0,2,2,1,3,1,0,1,0,1,2,0,0,0,0,0,1,0,1,0, +0,1,1,0,0,0,0,0,1,0,0,1,0,0,0,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,2,0,0,0,1,0,0,1,0,0,2,3,1,2,0,0,1,0,0,2,0,0,0,1,0,2,0,2,0, +0,1,1,2,2,1,2,0,2,1,1,0,0,1,1,0,1,1,1,1,2,1,1,0,0,0,0,0,0,0,0,0, +3,3,3,0,2,1,2,1,0,0,1,1,0,3,3,1,2,0,0,1,0,0,2,0,2,0,1,1,2,0,0,0, +0,0,1,1,1,1,2,0,1,1,0,1,1,1,1,0,0,0,1,1,1,0,1,0,0,0,1,0,0,0,0,0, +3,3,3,0,2,2,3,2,0,0,1,0,0,2,3,1,0,0,0,0,0,0,2,0,2,0,0,0,2,0,0,0, +0,1,1,0,0,0,1,0,0,1,0,1,1,0,1,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0, +3,2,3,0,0,0,0,0,0,0,1,0,0,2,2,2,2,0,0,1,0,0,2,0,0,0,0,0,2,0,1,0, +0,0,2,1,1,0,1,0,2,1,1,0,0,1,1,2,1,0,2,0,2,0,1,0,0,0,2,0,0,0,0,0, +0,0,0,2,2,0,2,1,1,1,1,2,2,0,0,1,0,1,0,0,1,3,0,0,0,0,1,0,0,2,1,0, +0,0,1,0,1,0,0,0,0,0,2,1,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0, +2,0,0,2,3,0,2,3,1,2,2,0,2,0,0,2,0,2,1,1,1,2,1,0,0,1,2,1,1,2,1,0, +1,0,2,0,1,0,1,1,0,0,2,2,1,2,1,1,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0, +3,3,3,0,2,1,2,0,0,0,1,0,0,3,2,0,1,0,0,1,0,0,2,0,0,0,1,2,1,0,1,0, +0,0,0,0,1,0,1,0,0,1,0,0,0,0,1,0,1,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0, +0,0,0,2,2,0,2,2,1,1,0,1,1,1,1,1,0,0,1,2,1,1,1,0,1,0,0,0,1,1,1,1, +0,0,2,1,0,1,1,1,0,1,1,2,1,2,1,1,2,0,1,1,2,1,0,2,0,0,0,0,0,0,0,0, +3,2,2,0,0,2,0,0,0,0,0,0,0,2,2,0,2,0,0,1,0,0,2,0,0,0,0,0,2,0,0,0, +0,2,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0, +0,0,0,3,2,0,2,2,0,1,1,0,1,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0, +2,0,1,0,1,0,1,1,0,0,1,2,0,1,0,1,1,0,0,1,0,1,0,2,0,0,0,0,0,0,0,0, +2,2,2,0,1,1,0,0,0,1,0,0,0,1,2,0,1,0,0,1,0,0,1,0,0,0,0,1,2,0,1,0, +0,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,1,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0, +2,2,2,2,1,0,1,1,1,0,0,0,0,1,2,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0, +1,1,2,0,1,0,0,0,1,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,1, +0,0,1,2,2,0,2,1,2,1,1,2,2,0,0,0,0,1,0,0,1,1,0,0,2,0,0,0,0,1,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, +2,2,2,0,0,0,1,0,0,0,0,0,0,2,2,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, +0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +2,2,2,0,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,1,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +) + +Latin5TurkishModel = { + 'char_to_order_map': Latin5_TurkishCharToOrderMap, + 'precedence_matrix': TurkishLangModel, + 'typical_positive_ratio': 0.970290, + 'keep_english_letter': True, + 'charset_name': "ISO-8859-9", + 'language': 'Turkish', +} diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/latin1prober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/latin1prober.py new file mode 100644 index 0000000000000000000000000000000000000000..7d1e8c20fb09ddaa0254ae74cbd4425ffdc5dcdc --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/latin1prober.py @@ -0,0 +1,145 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Universal charset detector code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 2001 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# Shy Shalom - original C code +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .charsetprober import CharSetProber +from .enums import ProbingState + +FREQ_CAT_NUM = 4 + +UDF = 0 # undefined +OTH = 1 # other +ASC = 2 # ascii capital letter +ASS = 3 # ascii small letter +ACV = 4 # accent capital vowel +ACO = 5 # accent capital other +ASV = 6 # accent small vowel +ASO = 7 # accent small other +CLASS_NUM = 8 # total classes + +Latin1_CharToClass = ( + OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 00 - 07 + OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 08 - 0F + OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 10 - 17 + OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 18 - 1F + OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 20 - 27 + OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 28 - 2F + OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 30 - 37 + OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 38 - 3F + OTH, ASC, ASC, ASC, ASC, ASC, ASC, ASC, # 40 - 47 + ASC, ASC, ASC, ASC, ASC, ASC, ASC, ASC, # 48 - 4F + ASC, ASC, ASC, ASC, ASC, ASC, ASC, ASC, # 50 - 57 + ASC, ASC, ASC, OTH, OTH, OTH, OTH, OTH, # 58 - 5F + OTH, ASS, ASS, ASS, ASS, ASS, ASS, ASS, # 60 - 67 + ASS, ASS, ASS, ASS, ASS, ASS, ASS, ASS, # 68 - 6F + ASS, ASS, ASS, ASS, ASS, ASS, ASS, ASS, # 70 - 77 + ASS, ASS, ASS, OTH, OTH, OTH, OTH, OTH, # 78 - 7F + OTH, UDF, OTH, ASO, OTH, OTH, OTH, OTH, # 80 - 87 + OTH, OTH, ACO, OTH, ACO, UDF, ACO, UDF, # 88 - 8F + UDF, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 90 - 97 + OTH, OTH, ASO, OTH, ASO, UDF, ASO, ACO, # 98 - 9F + OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # A0 - A7 + OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # A8 - AF + OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # B0 - B7 + OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # B8 - BF + ACV, ACV, ACV, ACV, ACV, ACV, ACO, ACO, # C0 - C7 + ACV, ACV, ACV, ACV, ACV, ACV, ACV, ACV, # C8 - CF + ACO, ACO, ACV, ACV, ACV, ACV, ACV, OTH, # D0 - D7 + ACV, ACV, ACV, ACV, ACV, ACO, ACO, ACO, # D8 - DF + ASV, ASV, ASV, ASV, ASV, ASV, ASO, ASO, # E0 - E7 + ASV, ASV, ASV, ASV, ASV, ASV, ASV, ASV, # E8 - EF + ASO, ASO, ASV, ASV, ASV, ASV, ASV, OTH, # F0 - F7 + ASV, ASV, ASV, ASV, ASV, ASO, ASO, ASO, # F8 - FF +) + +# 0 : illegal +# 1 : very unlikely +# 2 : normal +# 3 : very likely +Latin1ClassModel = ( +# UDF OTH ASC ASS ACV ACO ASV ASO + 0, 0, 0, 0, 0, 0, 0, 0, # UDF + 0, 3, 3, 3, 3, 3, 3, 3, # OTH + 0, 3, 3, 3, 3, 3, 3, 3, # ASC + 0, 3, 3, 3, 1, 1, 3, 3, # ASS + 0, 3, 3, 3, 1, 2, 1, 2, # ACV + 0, 3, 3, 3, 3, 3, 3, 3, # ACO + 0, 3, 1, 3, 1, 1, 1, 3, # ASV + 0, 3, 1, 3, 1, 1, 3, 3, # ASO +) + + +class Latin1Prober(CharSetProber): + def __init__(self): + super(Latin1Prober, self).__init__() + self._last_char_class = None + self._freq_counter = None + self.reset() + + def reset(self): + self._last_char_class = OTH + self._freq_counter = [0] * FREQ_CAT_NUM + CharSetProber.reset(self) + + @property + def charset_name(self): + return "ISO-8859-1" + + @property + def language(self): + return "" + + def feed(self, byte_str): + byte_str = self.filter_with_english_letters(byte_str) + for c in byte_str: + char_class = Latin1_CharToClass[c] + freq = Latin1ClassModel[(self._last_char_class * CLASS_NUM) + + char_class] + if freq == 0: + self._state = ProbingState.NOT_ME + break + self._freq_counter[freq] += 1 + self._last_char_class = char_class + + return self.state + + def get_confidence(self): + if self.state == ProbingState.NOT_ME: + return 0.01 + + total = sum(self._freq_counter) + if total < 0.01: + confidence = 0.0 + else: + confidence = ((self._freq_counter[3] - self._freq_counter[1] * 20.0) + / total) + if confidence < 0.0: + confidence = 0.0 + # lower the confidence of latin1 so that other more accurate + # detector can take priority. + confidence = confidence * 0.73 + return confidence diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/mbcharsetprober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/mbcharsetprober.py new file mode 100644 index 0000000000000000000000000000000000000000..6256ecfd1e2c9ac4cfa3fac359cd12dce85b759c --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/mbcharsetprober.py @@ -0,0 +1,91 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Universal charset detector code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 2001 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# Shy Shalom - original C code +# Proofpoint, Inc. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .charsetprober import CharSetProber +from .enums import ProbingState, MachineState + + +class MultiByteCharSetProber(CharSetProber): + """ + MultiByteCharSetProber + """ + + def __init__(self, lang_filter=None): + super(MultiByteCharSetProber, self).__init__(lang_filter=lang_filter) + self.distribution_analyzer = None + self.coding_sm = None + self._last_char = [0, 0] + + def reset(self): + super(MultiByteCharSetProber, self).reset() + if self.coding_sm: + self.coding_sm.reset() + if self.distribution_analyzer: + self.distribution_analyzer.reset() + self._last_char = [0, 0] + + @property + def charset_name(self): + raise NotImplementedError + + @property + def language(self): + raise NotImplementedError + + def feed(self, byte_str): + for i in range(len(byte_str)): + coding_state = self.coding_sm.next_state(byte_str[i]) + if coding_state == MachineState.ERROR: + self.logger.debug('%s %s prober hit error at byte %s', + self.charset_name, self.language, i) + self._state = ProbingState.NOT_ME + break + elif coding_state == MachineState.ITS_ME: + self._state = ProbingState.FOUND_IT + break + elif coding_state == MachineState.START: + char_len = self.coding_sm.get_current_charlen() + if i == 0: + self._last_char[1] = byte_str[0] + self.distribution_analyzer.feed(self._last_char, char_len) + else: + self.distribution_analyzer.feed(byte_str[i - 1:i + 1], + char_len) + + self._last_char[0] = byte_str[-1] + + if self.state == ProbingState.DETECTING: + if (self.distribution_analyzer.got_enough_data() and + (self.get_confidence() > self.SHORTCUT_THRESHOLD)): + self._state = ProbingState.FOUND_IT + + return self.state + + def get_confidence(self): + return self.distribution_analyzer.get_confidence() diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/mbcsgroupprober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/mbcsgroupprober.py new file mode 100644 index 0000000000000000000000000000000000000000..530abe75e0c00cbfcb2a310d872866f320977d0a --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/mbcsgroupprober.py @@ -0,0 +1,54 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Universal charset detector code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 2001 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# Shy Shalom - original C code +# Proofpoint, Inc. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .charsetgroupprober import CharSetGroupProber +from .utf8prober import UTF8Prober +from .sjisprober import SJISProber +from .eucjpprober import EUCJPProber +from .gb2312prober import GB2312Prober +from .euckrprober import EUCKRProber +from .cp949prober import CP949Prober +from .big5prober import Big5Prober +from .euctwprober import EUCTWProber + + +class MBCSGroupProber(CharSetGroupProber): + def __init__(self, lang_filter=None): + super(MBCSGroupProber, self).__init__(lang_filter=lang_filter) + self.probers = [ + UTF8Prober(), + SJISProber(), + EUCJPProber(), + GB2312Prober(), + EUCKRProber(), + CP949Prober(), + Big5Prober(), + EUCTWProber() + ] + self.reset() diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/mbcssm.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/mbcssm.py new file mode 100644 index 0000000000000000000000000000000000000000..8360d0f284ef394f2980b5bb89548e234385cdf1 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/mbcssm.py @@ -0,0 +1,572 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .enums import MachineState + +# BIG5 + +BIG5_CLS = ( + 1,1,1,1,1,1,1,1, # 00 - 07 #allow 0x00 as legal value + 1,1,1,1,1,1,0,0, # 08 - 0f + 1,1,1,1,1,1,1,1, # 10 - 17 + 1,1,1,0,1,1,1,1, # 18 - 1f + 1,1,1,1,1,1,1,1, # 20 - 27 + 1,1,1,1,1,1,1,1, # 28 - 2f + 1,1,1,1,1,1,1,1, # 30 - 37 + 1,1,1,1,1,1,1,1, # 38 - 3f + 2,2,2,2,2,2,2,2, # 40 - 47 + 2,2,2,2,2,2,2,2, # 48 - 4f + 2,2,2,2,2,2,2,2, # 50 - 57 + 2,2,2,2,2,2,2,2, # 58 - 5f + 2,2,2,2,2,2,2,2, # 60 - 67 + 2,2,2,2,2,2,2,2, # 68 - 6f + 2,2,2,2,2,2,2,2, # 70 - 77 + 2,2,2,2,2,2,2,1, # 78 - 7f + 4,4,4,4,4,4,4,4, # 80 - 87 + 4,4,4,4,4,4,4,4, # 88 - 8f + 4,4,4,4,4,4,4,4, # 90 - 97 + 4,4,4,4,4,4,4,4, # 98 - 9f + 4,3,3,3,3,3,3,3, # a0 - a7 + 3,3,3,3,3,3,3,3, # a8 - af + 3,3,3,3,3,3,3,3, # b0 - b7 + 3,3,3,3,3,3,3,3, # b8 - bf + 3,3,3,3,3,3,3,3, # c0 - c7 + 3,3,3,3,3,3,3,3, # c8 - cf + 3,3,3,3,3,3,3,3, # d0 - d7 + 3,3,3,3,3,3,3,3, # d8 - df + 3,3,3,3,3,3,3,3, # e0 - e7 + 3,3,3,3,3,3,3,3, # e8 - ef + 3,3,3,3,3,3,3,3, # f0 - f7 + 3,3,3,3,3,3,3,0 # f8 - ff +) + +BIG5_ST = ( + MachineState.ERROR,MachineState.START,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07 + MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,#08-0f + MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START#10-17 +) + +BIG5_CHAR_LEN_TABLE = (0, 1, 1, 2, 0) + +BIG5_SM_MODEL = {'class_table': BIG5_CLS, + 'class_factor': 5, + 'state_table': BIG5_ST, + 'char_len_table': BIG5_CHAR_LEN_TABLE, + 'name': 'Big5'} + +# CP949 + +CP949_CLS = ( + 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0,0, # 00 - 0f + 1,1,1,1,1,1,1,1, 1,1,1,0,1,1,1,1, # 10 - 1f + 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, # 20 - 2f + 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, # 30 - 3f + 1,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4, # 40 - 4f + 4,4,5,5,5,5,5,5, 5,5,5,1,1,1,1,1, # 50 - 5f + 1,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5, # 60 - 6f + 5,5,5,5,5,5,5,5, 5,5,5,1,1,1,1,1, # 70 - 7f + 0,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, # 80 - 8f + 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, # 90 - 9f + 6,7,7,7,7,7,7,7, 7,7,7,7,7,8,8,8, # a0 - af + 7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7, # b0 - bf + 7,7,7,7,7,7,9,2, 2,3,2,2,2,2,2,2, # c0 - cf + 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, # d0 - df + 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, # e0 - ef + 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,0, # f0 - ff +) + +CP949_ST = ( +#cls= 0 1 2 3 4 5 6 7 8 9 # previous state = + MachineState.ERROR,MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START, 4, 5,MachineState.ERROR, 6, # MachineState.START + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, # MachineState.ERROR + MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME, # MachineState.ITS_ME + MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START, # 3 + MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, # 4 + MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, # 5 + MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START, # 6 +) + +CP949_CHAR_LEN_TABLE = (0, 1, 2, 0, 1, 1, 2, 2, 0, 2) + +CP949_SM_MODEL = {'class_table': CP949_CLS, + 'class_factor': 10, + 'state_table': CP949_ST, + 'char_len_table': CP949_CHAR_LEN_TABLE, + 'name': 'CP949'} + +# EUC-JP + +EUCJP_CLS = ( + 4,4,4,4,4,4,4,4, # 00 - 07 + 4,4,4,4,4,4,5,5, # 08 - 0f + 4,4,4,4,4,4,4,4, # 10 - 17 + 4,4,4,5,4,4,4,4, # 18 - 1f + 4,4,4,4,4,4,4,4, # 20 - 27 + 4,4,4,4,4,4,4,4, # 28 - 2f + 4,4,4,4,4,4,4,4, # 30 - 37 + 4,4,4,4,4,4,4,4, # 38 - 3f + 4,4,4,4,4,4,4,4, # 40 - 47 + 4,4,4,4,4,4,4,4, # 48 - 4f + 4,4,4,4,4,4,4,4, # 50 - 57 + 4,4,4,4,4,4,4,4, # 58 - 5f + 4,4,4,4,4,4,4,4, # 60 - 67 + 4,4,4,4,4,4,4,4, # 68 - 6f + 4,4,4,4,4,4,4,4, # 70 - 77 + 4,4,4,4,4,4,4,4, # 78 - 7f + 5,5,5,5,5,5,5,5, # 80 - 87 + 5,5,5,5,5,5,1,3, # 88 - 8f + 5,5,5,5,5,5,5,5, # 90 - 97 + 5,5,5,5,5,5,5,5, # 98 - 9f + 5,2,2,2,2,2,2,2, # a0 - a7 + 2,2,2,2,2,2,2,2, # a8 - af + 2,2,2,2,2,2,2,2, # b0 - b7 + 2,2,2,2,2,2,2,2, # b8 - bf + 2,2,2,2,2,2,2,2, # c0 - c7 + 2,2,2,2,2,2,2,2, # c8 - cf + 2,2,2,2,2,2,2,2, # d0 - d7 + 2,2,2,2,2,2,2,2, # d8 - df + 0,0,0,0,0,0,0,0, # e0 - e7 + 0,0,0,0,0,0,0,0, # e8 - ef + 0,0,0,0,0,0,0,0, # f0 - f7 + 0,0,0,0,0,0,0,5 # f8 - ff +) + +EUCJP_ST = ( + 3, 4, 3, 5,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f + MachineState.ITS_ME,MachineState.ITS_ME,MachineState.START,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#10-17 + MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 3,MachineState.ERROR,#18-1f + 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START#20-27 +) + +EUCJP_CHAR_LEN_TABLE = (2, 2, 2, 3, 1, 0) + +EUCJP_SM_MODEL = {'class_table': EUCJP_CLS, + 'class_factor': 6, + 'state_table': EUCJP_ST, + 'char_len_table': EUCJP_CHAR_LEN_TABLE, + 'name': 'EUC-JP'} + +# EUC-KR + +EUCKR_CLS = ( + 1,1,1,1,1,1,1,1, # 00 - 07 + 1,1,1,1,1,1,0,0, # 08 - 0f + 1,1,1,1,1,1,1,1, # 10 - 17 + 1,1,1,0,1,1,1,1, # 18 - 1f + 1,1,1,1,1,1,1,1, # 20 - 27 + 1,1,1,1,1,1,1,1, # 28 - 2f + 1,1,1,1,1,1,1,1, # 30 - 37 + 1,1,1,1,1,1,1,1, # 38 - 3f + 1,1,1,1,1,1,1,1, # 40 - 47 + 1,1,1,1,1,1,1,1, # 48 - 4f + 1,1,1,1,1,1,1,1, # 50 - 57 + 1,1,1,1,1,1,1,1, # 58 - 5f + 1,1,1,1,1,1,1,1, # 60 - 67 + 1,1,1,1,1,1,1,1, # 68 - 6f + 1,1,1,1,1,1,1,1, # 70 - 77 + 1,1,1,1,1,1,1,1, # 78 - 7f + 0,0,0,0,0,0,0,0, # 80 - 87 + 0,0,0,0,0,0,0,0, # 88 - 8f + 0,0,0,0,0,0,0,0, # 90 - 97 + 0,0,0,0,0,0,0,0, # 98 - 9f + 0,2,2,2,2,2,2,2, # a0 - a7 + 2,2,2,2,2,3,3,3, # a8 - af + 2,2,2,2,2,2,2,2, # b0 - b7 + 2,2,2,2,2,2,2,2, # b8 - bf + 2,2,2,2,2,2,2,2, # c0 - c7 + 2,3,2,2,2,2,2,2, # c8 - cf + 2,2,2,2,2,2,2,2, # d0 - d7 + 2,2,2,2,2,2,2,2, # d8 - df + 2,2,2,2,2,2,2,2, # e0 - e7 + 2,2,2,2,2,2,2,2, # e8 - ef + 2,2,2,2,2,2,2,2, # f0 - f7 + 2,2,2,2,2,2,2,0 # f8 - ff +) + +EUCKR_ST = ( + MachineState.ERROR,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07 + MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START #08-0f +) + +EUCKR_CHAR_LEN_TABLE = (0, 1, 2, 0) + +EUCKR_SM_MODEL = {'class_table': EUCKR_CLS, + 'class_factor': 4, + 'state_table': EUCKR_ST, + 'char_len_table': EUCKR_CHAR_LEN_TABLE, + 'name': 'EUC-KR'} + +# EUC-TW + +EUCTW_CLS = ( + 2,2,2,2,2,2,2,2, # 00 - 07 + 2,2,2,2,2,2,0,0, # 08 - 0f + 2,2,2,2,2,2,2,2, # 10 - 17 + 2,2,2,0,2,2,2,2, # 18 - 1f + 2,2,2,2,2,2,2,2, # 20 - 27 + 2,2,2,2,2,2,2,2, # 28 - 2f + 2,2,2,2,2,2,2,2, # 30 - 37 + 2,2,2,2,2,2,2,2, # 38 - 3f + 2,2,2,2,2,2,2,2, # 40 - 47 + 2,2,2,2,2,2,2,2, # 48 - 4f + 2,2,2,2,2,2,2,2, # 50 - 57 + 2,2,2,2,2,2,2,2, # 58 - 5f + 2,2,2,2,2,2,2,2, # 60 - 67 + 2,2,2,2,2,2,2,2, # 68 - 6f + 2,2,2,2,2,2,2,2, # 70 - 77 + 2,2,2,2,2,2,2,2, # 78 - 7f + 0,0,0,0,0,0,0,0, # 80 - 87 + 0,0,0,0,0,0,6,0, # 88 - 8f + 0,0,0,0,0,0,0,0, # 90 - 97 + 0,0,0,0,0,0,0,0, # 98 - 9f + 0,3,4,4,4,4,4,4, # a0 - a7 + 5,5,1,1,1,1,1,1, # a8 - af + 1,1,1,1,1,1,1,1, # b0 - b7 + 1,1,1,1,1,1,1,1, # b8 - bf + 1,1,3,1,3,3,3,3, # c0 - c7 + 3,3,3,3,3,3,3,3, # c8 - cf + 3,3,3,3,3,3,3,3, # d0 - d7 + 3,3,3,3,3,3,3,3, # d8 - df + 3,3,3,3,3,3,3,3, # e0 - e7 + 3,3,3,3,3,3,3,3, # e8 - ef + 3,3,3,3,3,3,3,3, # f0 - f7 + 3,3,3,3,3,3,3,0 # f8 - ff +) + +EUCTW_ST = ( + MachineState.ERROR,MachineState.ERROR,MachineState.START, 3, 3, 3, 4,MachineState.ERROR,#00-07 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f + MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.START,MachineState.ERROR,#10-17 + MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f + 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.START,MachineState.START,#20-27 + MachineState.START,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START #28-2f +) + +EUCTW_CHAR_LEN_TABLE = (0, 0, 1, 2, 2, 2, 3) + +EUCTW_SM_MODEL = {'class_table': EUCTW_CLS, + 'class_factor': 7, + 'state_table': EUCTW_ST, + 'char_len_table': EUCTW_CHAR_LEN_TABLE, + 'name': 'x-euc-tw'} + +# GB2312 + +GB2312_CLS = ( + 1,1,1,1,1,1,1,1, # 00 - 07 + 1,1,1,1,1,1,0,0, # 08 - 0f + 1,1,1,1,1,1,1,1, # 10 - 17 + 1,1,1,0,1,1,1,1, # 18 - 1f + 1,1,1,1,1,1,1,1, # 20 - 27 + 1,1,1,1,1,1,1,1, # 28 - 2f + 3,3,3,3,3,3,3,3, # 30 - 37 + 3,3,1,1,1,1,1,1, # 38 - 3f + 2,2,2,2,2,2,2,2, # 40 - 47 + 2,2,2,2,2,2,2,2, # 48 - 4f + 2,2,2,2,2,2,2,2, # 50 - 57 + 2,2,2,2,2,2,2,2, # 58 - 5f + 2,2,2,2,2,2,2,2, # 60 - 67 + 2,2,2,2,2,2,2,2, # 68 - 6f + 2,2,2,2,2,2,2,2, # 70 - 77 + 2,2,2,2,2,2,2,4, # 78 - 7f + 5,6,6,6,6,6,6,6, # 80 - 87 + 6,6,6,6,6,6,6,6, # 88 - 8f + 6,6,6,6,6,6,6,6, # 90 - 97 + 6,6,6,6,6,6,6,6, # 98 - 9f + 6,6,6,6,6,6,6,6, # a0 - a7 + 6,6,6,6,6,6,6,6, # a8 - af + 6,6,6,6,6,6,6,6, # b0 - b7 + 6,6,6,6,6,6,6,6, # b8 - bf + 6,6,6,6,6,6,6,6, # c0 - c7 + 6,6,6,6,6,6,6,6, # c8 - cf + 6,6,6,6,6,6,6,6, # d0 - d7 + 6,6,6,6,6,6,6,6, # d8 - df + 6,6,6,6,6,6,6,6, # e0 - e7 + 6,6,6,6,6,6,6,6, # e8 - ef + 6,6,6,6,6,6,6,6, # f0 - f7 + 6,6,6,6,6,6,6,0 # f8 - ff +) + +GB2312_ST = ( + MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, 3,MachineState.ERROR,#00-07 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f + MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,#10-17 + 4,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f + MachineState.ERROR,MachineState.ERROR, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,#20-27 + MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START #28-2f +) + +# To be accurate, the length of class 6 can be either 2 or 4. +# But it is not necessary to discriminate between the two since +# it is used for frequency analysis only, and we are validating +# each code range there as well. So it is safe to set it to be +# 2 here. +GB2312_CHAR_LEN_TABLE = (0, 1, 1, 1, 1, 1, 2) + +GB2312_SM_MODEL = {'class_table': GB2312_CLS, + 'class_factor': 7, + 'state_table': GB2312_ST, + 'char_len_table': GB2312_CHAR_LEN_TABLE, + 'name': 'GB2312'} + +# Shift_JIS + +SJIS_CLS = ( + 1,1,1,1,1,1,1,1, # 00 - 07 + 1,1,1,1,1,1,0,0, # 08 - 0f + 1,1,1,1,1,1,1,1, # 10 - 17 + 1,1,1,0,1,1,1,1, # 18 - 1f + 1,1,1,1,1,1,1,1, # 20 - 27 + 1,1,1,1,1,1,1,1, # 28 - 2f + 1,1,1,1,1,1,1,1, # 30 - 37 + 1,1,1,1,1,1,1,1, # 38 - 3f + 2,2,2,2,2,2,2,2, # 40 - 47 + 2,2,2,2,2,2,2,2, # 48 - 4f + 2,2,2,2,2,2,2,2, # 50 - 57 + 2,2,2,2,2,2,2,2, # 58 - 5f + 2,2,2,2,2,2,2,2, # 60 - 67 + 2,2,2,2,2,2,2,2, # 68 - 6f + 2,2,2,2,2,2,2,2, # 70 - 77 + 2,2,2,2,2,2,2,1, # 78 - 7f + 3,3,3,3,3,2,2,3, # 80 - 87 + 3,3,3,3,3,3,3,3, # 88 - 8f + 3,3,3,3,3,3,3,3, # 90 - 97 + 3,3,3,3,3,3,3,3, # 98 - 9f + #0xa0 is illegal in sjis encoding, but some pages does + #contain such byte. We need to be more error forgiven. + 2,2,2,2,2,2,2,2, # a0 - a7 + 2,2,2,2,2,2,2,2, # a8 - af + 2,2,2,2,2,2,2,2, # b0 - b7 + 2,2,2,2,2,2,2,2, # b8 - bf + 2,2,2,2,2,2,2,2, # c0 - c7 + 2,2,2,2,2,2,2,2, # c8 - cf + 2,2,2,2,2,2,2,2, # d0 - d7 + 2,2,2,2,2,2,2,2, # d8 - df + 3,3,3,3,3,3,3,3, # e0 - e7 + 3,3,3,3,3,4,4,4, # e8 - ef + 3,3,3,3,3,3,3,3, # f0 - f7 + 3,3,3,3,3,0,0,0) # f8 - ff + + +SJIS_ST = ( + MachineState.ERROR,MachineState.START,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f + MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START #10-17 +) + +SJIS_CHAR_LEN_TABLE = (0, 1, 1, 2, 0, 0) + +SJIS_SM_MODEL = {'class_table': SJIS_CLS, + 'class_factor': 6, + 'state_table': SJIS_ST, + 'char_len_table': SJIS_CHAR_LEN_TABLE, + 'name': 'Shift_JIS'} + +# UCS2-BE + +UCS2BE_CLS = ( + 0,0,0,0,0,0,0,0, # 00 - 07 + 0,0,1,0,0,2,0,0, # 08 - 0f + 0,0,0,0,0,0,0,0, # 10 - 17 + 0,0,0,3,0,0,0,0, # 18 - 1f + 0,0,0,0,0,0,0,0, # 20 - 27 + 0,3,3,3,3,3,0,0, # 28 - 2f + 0,0,0,0,0,0,0,0, # 30 - 37 + 0,0,0,0,0,0,0,0, # 38 - 3f + 0,0,0,0,0,0,0,0, # 40 - 47 + 0,0,0,0,0,0,0,0, # 48 - 4f + 0,0,0,0,0,0,0,0, # 50 - 57 + 0,0,0,0,0,0,0,0, # 58 - 5f + 0,0,0,0,0,0,0,0, # 60 - 67 + 0,0,0,0,0,0,0,0, # 68 - 6f + 0,0,0,0,0,0,0,0, # 70 - 77 + 0,0,0,0,0,0,0,0, # 78 - 7f + 0,0,0,0,0,0,0,0, # 80 - 87 + 0,0,0,0,0,0,0,0, # 88 - 8f + 0,0,0,0,0,0,0,0, # 90 - 97 + 0,0,0,0,0,0,0,0, # 98 - 9f + 0,0,0,0,0,0,0,0, # a0 - a7 + 0,0,0,0,0,0,0,0, # a8 - af + 0,0,0,0,0,0,0,0, # b0 - b7 + 0,0,0,0,0,0,0,0, # b8 - bf + 0,0,0,0,0,0,0,0, # c0 - c7 + 0,0,0,0,0,0,0,0, # c8 - cf + 0,0,0,0,0,0,0,0, # d0 - d7 + 0,0,0,0,0,0,0,0, # d8 - df + 0,0,0,0,0,0,0,0, # e0 - e7 + 0,0,0,0,0,0,0,0, # e8 - ef + 0,0,0,0,0,0,0,0, # f0 - f7 + 0,0,0,0,0,0,4,5 # f8 - ff +) + +UCS2BE_ST = ( + 5, 7, 7,MachineState.ERROR, 4, 3,MachineState.ERROR,MachineState.ERROR,#00-07 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f + MachineState.ITS_ME,MachineState.ITS_ME, 6, 6, 6, 6,MachineState.ERROR,MachineState.ERROR,#10-17 + 6, 6, 6, 6, 6,MachineState.ITS_ME, 6, 6,#18-1f + 6, 6, 6, 6, 5, 7, 7,MachineState.ERROR,#20-27 + 5, 8, 6, 6,MachineState.ERROR, 6, 6, 6,#28-2f + 6, 6, 6, 6,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START #30-37 +) + +UCS2BE_CHAR_LEN_TABLE = (2, 2, 2, 0, 2, 2) + +UCS2BE_SM_MODEL = {'class_table': UCS2BE_CLS, + 'class_factor': 6, + 'state_table': UCS2BE_ST, + 'char_len_table': UCS2BE_CHAR_LEN_TABLE, + 'name': 'UTF-16BE'} + +# UCS2-LE + +UCS2LE_CLS = ( + 0,0,0,0,0,0,0,0, # 00 - 07 + 0,0,1,0,0,2,0,0, # 08 - 0f + 0,0,0,0,0,0,0,0, # 10 - 17 + 0,0,0,3,0,0,0,0, # 18 - 1f + 0,0,0,0,0,0,0,0, # 20 - 27 + 0,3,3,3,3,3,0,0, # 28 - 2f + 0,0,0,0,0,0,0,0, # 30 - 37 + 0,0,0,0,0,0,0,0, # 38 - 3f + 0,0,0,0,0,0,0,0, # 40 - 47 + 0,0,0,0,0,0,0,0, # 48 - 4f + 0,0,0,0,0,0,0,0, # 50 - 57 + 0,0,0,0,0,0,0,0, # 58 - 5f + 0,0,0,0,0,0,0,0, # 60 - 67 + 0,0,0,0,0,0,0,0, # 68 - 6f + 0,0,0,0,0,0,0,0, # 70 - 77 + 0,0,0,0,0,0,0,0, # 78 - 7f + 0,0,0,0,0,0,0,0, # 80 - 87 + 0,0,0,0,0,0,0,0, # 88 - 8f + 0,0,0,0,0,0,0,0, # 90 - 97 + 0,0,0,0,0,0,0,0, # 98 - 9f + 0,0,0,0,0,0,0,0, # a0 - a7 + 0,0,0,0,0,0,0,0, # a8 - af + 0,0,0,0,0,0,0,0, # b0 - b7 + 0,0,0,0,0,0,0,0, # b8 - bf + 0,0,0,0,0,0,0,0, # c0 - c7 + 0,0,0,0,0,0,0,0, # c8 - cf + 0,0,0,0,0,0,0,0, # d0 - d7 + 0,0,0,0,0,0,0,0, # d8 - df + 0,0,0,0,0,0,0,0, # e0 - e7 + 0,0,0,0,0,0,0,0, # e8 - ef + 0,0,0,0,0,0,0,0, # f0 - f7 + 0,0,0,0,0,0,4,5 # f8 - ff +) + +UCS2LE_ST = ( + 6, 6, 7, 6, 4, 3,MachineState.ERROR,MachineState.ERROR,#00-07 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f + MachineState.ITS_ME,MachineState.ITS_ME, 5, 5, 5,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,#10-17 + 5, 5, 5,MachineState.ERROR, 5,MachineState.ERROR, 6, 6,#18-1f + 7, 6, 8, 8, 5, 5, 5,MachineState.ERROR,#20-27 + 5, 5, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 5, 5,#28-2f + 5, 5, 5,MachineState.ERROR, 5,MachineState.ERROR,MachineState.START,MachineState.START #30-37 +) + +UCS2LE_CHAR_LEN_TABLE = (2, 2, 2, 2, 2, 2) + +UCS2LE_SM_MODEL = {'class_table': UCS2LE_CLS, + 'class_factor': 6, + 'state_table': UCS2LE_ST, + 'char_len_table': UCS2LE_CHAR_LEN_TABLE, + 'name': 'UTF-16LE'} + +# UTF-8 + +UTF8_CLS = ( + 1,1,1,1,1,1,1,1, # 00 - 07 #allow 0x00 as a legal value + 1,1,1,1,1,1,0,0, # 08 - 0f + 1,1,1,1,1,1,1,1, # 10 - 17 + 1,1,1,0,1,1,1,1, # 18 - 1f + 1,1,1,1,1,1,1,1, # 20 - 27 + 1,1,1,1,1,1,1,1, # 28 - 2f + 1,1,1,1,1,1,1,1, # 30 - 37 + 1,1,1,1,1,1,1,1, # 38 - 3f + 1,1,1,1,1,1,1,1, # 40 - 47 + 1,1,1,1,1,1,1,1, # 48 - 4f + 1,1,1,1,1,1,1,1, # 50 - 57 + 1,1,1,1,1,1,1,1, # 58 - 5f + 1,1,1,1,1,1,1,1, # 60 - 67 + 1,1,1,1,1,1,1,1, # 68 - 6f + 1,1,1,1,1,1,1,1, # 70 - 77 + 1,1,1,1,1,1,1,1, # 78 - 7f + 2,2,2,2,3,3,3,3, # 80 - 87 + 4,4,4,4,4,4,4,4, # 88 - 8f + 4,4,4,4,4,4,4,4, # 90 - 97 + 4,4,4,4,4,4,4,4, # 98 - 9f + 5,5,5,5,5,5,5,5, # a0 - a7 + 5,5,5,5,5,5,5,5, # a8 - af + 5,5,5,5,5,5,5,5, # b0 - b7 + 5,5,5,5,5,5,5,5, # b8 - bf + 0,0,6,6,6,6,6,6, # c0 - c7 + 6,6,6,6,6,6,6,6, # c8 - cf + 6,6,6,6,6,6,6,6, # d0 - d7 + 6,6,6,6,6,6,6,6, # d8 - df + 7,8,8,8,8,8,8,8, # e0 - e7 + 8,8,8,8,8,9,8,8, # e8 - ef + 10,11,11,11,11,11,11,11, # f0 - f7 + 12,13,13,13,14,15,0,0 # f8 - ff +) + +UTF8_ST = ( + MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 12, 10,#00-07 + 9, 11, 8, 7, 6, 5, 4, 3,#08-0f + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#10-17 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f + MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#20-27 + MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#28-2f + MachineState.ERROR,MachineState.ERROR, 5, 5, 5, 5,MachineState.ERROR,MachineState.ERROR,#30-37 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#38-3f + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 5, 5, 5,MachineState.ERROR,MachineState.ERROR,#40-47 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#48-4f + MachineState.ERROR,MachineState.ERROR, 7, 7, 7, 7,MachineState.ERROR,MachineState.ERROR,#50-57 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#58-5f + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 7, 7,MachineState.ERROR,MachineState.ERROR,#60-67 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#68-6f + MachineState.ERROR,MachineState.ERROR, 9, 9, 9, 9,MachineState.ERROR,MachineState.ERROR,#70-77 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#78-7f + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 9,MachineState.ERROR,MachineState.ERROR,#80-87 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#88-8f + MachineState.ERROR,MachineState.ERROR, 12, 12, 12, 12,MachineState.ERROR,MachineState.ERROR,#90-97 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#98-9f + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 12,MachineState.ERROR,MachineState.ERROR,#a0-a7 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#a8-af + MachineState.ERROR,MachineState.ERROR, 12, 12, 12,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#b0-b7 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#b8-bf + MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,#c0-c7 + MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR #c8-cf +) + +UTF8_CHAR_LEN_TABLE = (0, 1, 0, 0, 0, 0, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6) + +UTF8_SM_MODEL = {'class_table': UTF8_CLS, + 'class_factor': 16, + 'state_table': UTF8_ST, + 'char_len_table': UTF8_CHAR_LEN_TABLE, + 'name': 'UTF-8'} diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/sbcharsetprober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/sbcharsetprober.py new file mode 100644 index 0000000000000000000000000000000000000000..0adb51de5a210aa36849cd149ed0f4ae424fce42 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/sbcharsetprober.py @@ -0,0 +1,132 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Universal charset detector code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 2001 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# Shy Shalom - original C code +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .charsetprober import CharSetProber +from .enums import CharacterCategory, ProbingState, SequenceLikelihood + + +class SingleByteCharSetProber(CharSetProber): + SAMPLE_SIZE = 64 + SB_ENOUGH_REL_THRESHOLD = 1024 # 0.25 * SAMPLE_SIZE^2 + POSITIVE_SHORTCUT_THRESHOLD = 0.95 + NEGATIVE_SHORTCUT_THRESHOLD = 0.05 + + def __init__(self, model, reversed=False, name_prober=None): + super(SingleByteCharSetProber, self).__init__() + self._model = model + # TRUE if we need to reverse every pair in the model lookup + self._reversed = reversed + # Optional auxiliary prober for name decision + self._name_prober = name_prober + self._last_order = None + self._seq_counters = None + self._total_seqs = None + self._total_char = None + self._freq_char = None + self.reset() + + def reset(self): + super(SingleByteCharSetProber, self).reset() + # char order of last character + self._last_order = 255 + self._seq_counters = [0] * SequenceLikelihood.get_num_categories() + self._total_seqs = 0 + self._total_char = 0 + # characters that fall in our sampling range + self._freq_char = 0 + + @property + def charset_name(self): + if self._name_prober: + return self._name_prober.charset_name + else: + return self._model['charset_name'] + + @property + def language(self): + if self._name_prober: + return self._name_prober.language + else: + return self._model.get('language') + + def feed(self, byte_str): + if not self._model['keep_english_letter']: + byte_str = self.filter_international_words(byte_str) + if not byte_str: + return self.state + char_to_order_map = self._model['char_to_order_map'] + for i, c in enumerate(byte_str): + # XXX: Order is in range 1-64, so one would think we want 0-63 here, + # but that leads to 27 more test failures than before. + order = char_to_order_map[c] + # XXX: This was SYMBOL_CAT_ORDER before, with a value of 250, but + # CharacterCategory.SYMBOL is actually 253, so we use CONTROL + # to make it closer to the original intent. The only difference + # is whether or not we count digits and control characters for + # _total_char purposes. + if order < CharacterCategory.CONTROL: + self._total_char += 1 + if order < self.SAMPLE_SIZE: + self._freq_char += 1 + if self._last_order < self.SAMPLE_SIZE: + self._total_seqs += 1 + if not self._reversed: + i = (self._last_order * self.SAMPLE_SIZE) + order + model = self._model['precedence_matrix'][i] + else: # reverse the order of the letters in the lookup + i = (order * self.SAMPLE_SIZE) + self._last_order + model = self._model['precedence_matrix'][i] + self._seq_counters[model] += 1 + self._last_order = order + + charset_name = self._model['charset_name'] + if self.state == ProbingState.DETECTING: + if self._total_seqs > self.SB_ENOUGH_REL_THRESHOLD: + confidence = self.get_confidence() + if confidence > self.POSITIVE_SHORTCUT_THRESHOLD: + self.logger.debug('%s confidence = %s, we have a winner', + charset_name, confidence) + self._state = ProbingState.FOUND_IT + elif confidence < self.NEGATIVE_SHORTCUT_THRESHOLD: + self.logger.debug('%s confidence = %s, below negative ' + 'shortcut threshhold %s', charset_name, + confidence, + self.NEGATIVE_SHORTCUT_THRESHOLD) + self._state = ProbingState.NOT_ME + + return self.state + + def get_confidence(self): + r = 0.01 + if self._total_seqs > 0: + r = ((1.0 * self._seq_counters[SequenceLikelihood.POSITIVE]) / + self._total_seqs / self._model['typical_positive_ratio']) + r = r * self._freq_char / self._total_char + if r >= 1.0: + r = 0.99 + return r diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/sbcsgroupprober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/sbcsgroupprober.py new file mode 100644 index 0000000000000000000000000000000000000000..98e95dc1a3cbc65e97bc726ab7000955132719dd --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/sbcsgroupprober.py @@ -0,0 +1,73 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Universal charset detector code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 2001 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# Shy Shalom - original C code +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .charsetgroupprober import CharSetGroupProber +from .sbcharsetprober import SingleByteCharSetProber +from .langcyrillicmodel import (Win1251CyrillicModel, Koi8rModel, + Latin5CyrillicModel, MacCyrillicModel, + Ibm866Model, Ibm855Model) +from .langgreekmodel import Latin7GreekModel, Win1253GreekModel +from .langbulgarianmodel import Latin5BulgarianModel, Win1251BulgarianModel +# from .langhungarianmodel import Latin2HungarianModel, Win1250HungarianModel +from .langthaimodel import TIS620ThaiModel +from .langhebrewmodel import Win1255HebrewModel +from .hebrewprober import HebrewProber +from .langturkishmodel import Latin5TurkishModel + + +class SBCSGroupProber(CharSetGroupProber): + def __init__(self): + super(SBCSGroupProber, self).__init__() + self.probers = [ + SingleByteCharSetProber(Win1251CyrillicModel), + SingleByteCharSetProber(Koi8rModel), + SingleByteCharSetProber(Latin5CyrillicModel), + SingleByteCharSetProber(MacCyrillicModel), + SingleByteCharSetProber(Ibm866Model), + SingleByteCharSetProber(Ibm855Model), + SingleByteCharSetProber(Latin7GreekModel), + SingleByteCharSetProber(Win1253GreekModel), + SingleByteCharSetProber(Latin5BulgarianModel), + SingleByteCharSetProber(Win1251BulgarianModel), + # TODO: Restore Hungarian encodings (iso-8859-2 and windows-1250) + # after we retrain model. + # SingleByteCharSetProber(Latin2HungarianModel), + # SingleByteCharSetProber(Win1250HungarianModel), + SingleByteCharSetProber(TIS620ThaiModel), + SingleByteCharSetProber(Latin5TurkishModel), + ] + hebrew_prober = HebrewProber() + logical_hebrew_prober = SingleByteCharSetProber(Win1255HebrewModel, + False, hebrew_prober) + visual_hebrew_prober = SingleByteCharSetProber(Win1255HebrewModel, True, + hebrew_prober) + hebrew_prober.set_model_probers(logical_hebrew_prober, visual_hebrew_prober) + self.probers.extend([hebrew_prober, logical_hebrew_prober, + visual_hebrew_prober]) + + self.reset() diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/sjisprober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/sjisprober.py new file mode 100644 index 0000000000000000000000000000000000000000..9e29623bdc54a7c6d11bcc167d71bb44cc9be39d --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/sjisprober.py @@ -0,0 +1,92 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .mbcharsetprober import MultiByteCharSetProber +from .codingstatemachine import CodingStateMachine +from .chardistribution import SJISDistributionAnalysis +from .jpcntx import SJISContextAnalysis +from .mbcssm import SJIS_SM_MODEL +from .enums import ProbingState, MachineState + + +class SJISProber(MultiByteCharSetProber): + def __init__(self): + super(SJISProber, self).__init__() + self.coding_sm = CodingStateMachine(SJIS_SM_MODEL) + self.distribution_analyzer = SJISDistributionAnalysis() + self.context_analyzer = SJISContextAnalysis() + self.reset() + + def reset(self): + super(SJISProber, self).reset() + self.context_analyzer.reset() + + @property + def charset_name(self): + return self.context_analyzer.charset_name + + @property + def language(self): + return "Japanese" + + def feed(self, byte_str): + for i in range(len(byte_str)): + coding_state = self.coding_sm.next_state(byte_str[i]) + if coding_state == MachineState.ERROR: + self.logger.debug('%s %s prober hit error at byte %s', + self.charset_name, self.language, i) + self._state = ProbingState.NOT_ME + break + elif coding_state == MachineState.ITS_ME: + self._state = ProbingState.FOUND_IT + break + elif coding_state == MachineState.START: + char_len = self.coding_sm.get_current_charlen() + if i == 0: + self._last_char[1] = byte_str[0] + self.context_analyzer.feed(self._last_char[2 - char_len:], + char_len) + self.distribution_analyzer.feed(self._last_char, char_len) + else: + self.context_analyzer.feed(byte_str[i + 1 - char_len:i + 3 + - char_len], char_len) + self.distribution_analyzer.feed(byte_str[i - 1:i + 1], + char_len) + + self._last_char[0] = byte_str[-1] + + if self.state == ProbingState.DETECTING: + if (self.context_analyzer.got_enough_data() and + (self.get_confidence() > self.SHORTCUT_THRESHOLD)): + self._state = ProbingState.FOUND_IT + + return self.state + + def get_confidence(self): + context_conf = self.context_analyzer.get_confidence() + distrib_conf = self.distribution_analyzer.get_confidence() + return max(context_conf, distrib_conf) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/universaldetector.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/universaldetector.py new file mode 100644 index 0000000000000000000000000000000000000000..7b4e92d6158527736e3d14d6f725edada8f94b00 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/universaldetector.py @@ -0,0 +1,286 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is Mozilla Universal charset detector code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 2001 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# Shy Shalom - original C code +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### +""" +Module containing the UniversalDetector detector class, which is the primary +class a user of ``chardet`` should use. + +:author: Mark Pilgrim (initial port to Python) +:author: Shy Shalom (original C code) +:author: Dan Blanchard (major refactoring for 3.0) +:author: Ian Cordasco +""" + + +import codecs +import logging +import re + +from .charsetgroupprober import CharSetGroupProber +from .enums import InputState, LanguageFilter, ProbingState +from .escprober import EscCharSetProber +from .latin1prober import Latin1Prober +from .mbcsgroupprober import MBCSGroupProber +from .sbcsgroupprober import SBCSGroupProber + + +class UniversalDetector(object): + """ + The ``UniversalDetector`` class underlies the ``chardet.detect`` function + and coordinates all of the different charset probers. + + To get a ``dict`` containing an encoding and its confidence, you can simply + run: + + .. code:: + + u = UniversalDetector() + u.feed(some_bytes) + u.close() + detected = u.result + + """ + + MINIMUM_THRESHOLD = 0.20 + HIGH_BYTE_DETECTOR = re.compile(b'[\x80-\xFF]') + ESC_DETECTOR = re.compile(b'(\033|~{)') + WIN_BYTE_DETECTOR = re.compile(b'[\x80-\x9F]') + ISO_WIN_MAP = {'iso-8859-1': 'Windows-1252', + 'iso-8859-2': 'Windows-1250', + 'iso-8859-5': 'Windows-1251', + 'iso-8859-6': 'Windows-1256', + 'iso-8859-7': 'Windows-1253', + 'iso-8859-8': 'Windows-1255', + 'iso-8859-9': 'Windows-1254', + 'iso-8859-13': 'Windows-1257'} + + def __init__(self, lang_filter=LanguageFilter.ALL): + self._esc_charset_prober = None + self._charset_probers = [] + self.result = None + self.done = None + self._got_data = None + self._input_state = None + self._last_char = None + self.lang_filter = lang_filter + self.logger = logging.getLogger(__name__) + self._has_win_bytes = None + self.reset() + + def reset(self): + """ + Reset the UniversalDetector and all of its probers back to their + initial states. This is called by ``__init__``, so you only need to + call this directly in between analyses of different documents. + """ + self.result = {'encoding': None, 'confidence': 0.0, 'language': None} + self.done = False + self._got_data = False + self._has_win_bytes = False + self._input_state = InputState.PURE_ASCII + self._last_char = b'' + if self._esc_charset_prober: + self._esc_charset_prober.reset() + for prober in self._charset_probers: + prober.reset() + + def feed(self, byte_str): + """ + Takes a chunk of a document and feeds it through all of the relevant + charset probers. + + After calling ``feed``, you can check the value of the ``done`` + attribute to see if you need to continue feeding the + ``UniversalDetector`` more data, or if it has made a prediction + (in the ``result`` attribute). + + .. note:: + You should always call ``close`` when you're done feeding in your + document if ``done`` is not already ``True``. + """ + if self.done: + return + + if not len(byte_str): + return + + if not isinstance(byte_str, bytearray): + byte_str = bytearray(byte_str) + + # First check for known BOMs, since these are guaranteed to be correct + if not self._got_data: + # If the data starts with BOM, we know it is UTF + if byte_str.startswith(codecs.BOM_UTF8): + # EF BB BF UTF-8 with BOM + self.result = {'encoding': "UTF-8-SIG", + 'confidence': 1.0, + 'language': ''} + elif byte_str.startswith((codecs.BOM_UTF32_LE, + codecs.BOM_UTF32_BE)): + # FF FE 00 00 UTF-32, little-endian BOM + # 00 00 FE FF UTF-32, big-endian BOM + self.result = {'encoding': "UTF-32", + 'confidence': 1.0, + 'language': ''} + elif byte_str.startswith(b'\xFE\xFF\x00\x00'): + # FE FF 00 00 UCS-4, unusual octet order BOM (3412) + self.result = {'encoding': "X-ISO-10646-UCS-4-3412", + 'confidence': 1.0, + 'language': ''} + elif byte_str.startswith(b'\x00\x00\xFF\xFE'): + # 00 00 FF FE UCS-4, unusual octet order BOM (2143) + self.result = {'encoding': "X-ISO-10646-UCS-4-2143", + 'confidence': 1.0, + 'language': ''} + elif byte_str.startswith((codecs.BOM_LE, codecs.BOM_BE)): + # FF FE UTF-16, little endian BOM + # FE FF UTF-16, big endian BOM + self.result = {'encoding': "UTF-16", + 'confidence': 1.0, + 'language': ''} + + self._got_data = True + if self.result['encoding'] is not None: + self.done = True + return + + # If none of those matched and we've only see ASCII so far, check + # for high bytes and escape sequences + if self._input_state == InputState.PURE_ASCII: + if self.HIGH_BYTE_DETECTOR.search(byte_str): + self._input_state = InputState.HIGH_BYTE + elif self._input_state == InputState.PURE_ASCII and \ + self.ESC_DETECTOR.search(self._last_char + byte_str): + self._input_state = InputState.ESC_ASCII + + self._last_char = byte_str[-1:] + + # If we've seen escape sequences, use the EscCharSetProber, which + # uses a simple state machine to check for known escape sequences in + # HZ and ISO-2022 encodings, since those are the only encodings that + # use such sequences. + if self._input_state == InputState.ESC_ASCII: + if not self._esc_charset_prober: + self._esc_charset_prober = EscCharSetProber(self.lang_filter) + if self._esc_charset_prober.feed(byte_str) == ProbingState.FOUND_IT: + self.result = {'encoding': + self._esc_charset_prober.charset_name, + 'confidence': + self._esc_charset_prober.get_confidence(), + 'language': + self._esc_charset_prober.language} + self.done = True + # If we've seen high bytes (i.e., those with values greater than 127), + # we need to do more complicated checks using all our multi-byte and + # single-byte probers that are left. The single-byte probers + # use character bigram distributions to determine the encoding, whereas + # the multi-byte probers use a combination of character unigram and + # bigram distributions. + elif self._input_state == InputState.HIGH_BYTE: + if not self._charset_probers: + self._charset_probers = [MBCSGroupProber(self.lang_filter)] + # If we're checking non-CJK encodings, use single-byte prober + if self.lang_filter & LanguageFilter.NON_CJK: + self._charset_probers.append(SBCSGroupProber()) + self._charset_probers.append(Latin1Prober()) + for prober in self._charset_probers: + if prober.feed(byte_str) == ProbingState.FOUND_IT: + self.result = {'encoding': prober.charset_name, + 'confidence': prober.get_confidence(), + 'language': prober.language} + self.done = True + break + if self.WIN_BYTE_DETECTOR.search(byte_str): + self._has_win_bytes = True + + def close(self): + """ + Stop analyzing the current document and come up with a final + prediction. + + :returns: The ``result`` attribute, a ``dict`` with the keys + `encoding`, `confidence`, and `language`. + """ + # Don't bother with checks if we're already done + if self.done: + return self.result + self.done = True + + if not self._got_data: + self.logger.debug('no data received!') + + # Default to ASCII if it is all we've seen so far + elif self._input_state == InputState.PURE_ASCII: + self.result = {'encoding': 'ascii', + 'confidence': 1.0, + 'language': ''} + + # If we have seen non-ASCII, return the best that met MINIMUM_THRESHOLD + elif self._input_state == InputState.HIGH_BYTE: + prober_confidence = None + max_prober_confidence = 0.0 + max_prober = None + for prober in self._charset_probers: + if not prober: + continue + prober_confidence = prober.get_confidence() + if prober_confidence > max_prober_confidence: + max_prober_confidence = prober_confidence + max_prober = prober + if max_prober and (max_prober_confidence > self.MINIMUM_THRESHOLD): + charset_name = max_prober.charset_name + lower_charset_name = max_prober.charset_name.lower() + confidence = max_prober.get_confidence() + # Use Windows encoding name instead of ISO-8859 if we saw any + # extra Windows-specific bytes + if lower_charset_name.startswith('iso-8859'): + if self._has_win_bytes: + charset_name = self.ISO_WIN_MAP.get(lower_charset_name, + charset_name) + self.result = {'encoding': charset_name, + 'confidence': confidence, + 'language': max_prober.language} + + # Log all prober confidences if none met MINIMUM_THRESHOLD + if self.logger.getEffectiveLevel() == logging.DEBUG: + if self.result['encoding'] is None: + self.logger.debug('no probers hit minimum threshold') + for group_prober in self._charset_probers: + if not group_prober: + continue + if isinstance(group_prober, CharSetGroupProber): + for prober in group_prober.probers: + self.logger.debug('%s %s confidence = %s', + prober.charset_name, + prober.language, + prober.get_confidence()) + else: + self.logger.debug('%s %s confidence = %s', + prober.charset_name, + prober.language, + prober.get_confidence()) + return self.result diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/utf8prober.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/utf8prober.py new file mode 100644 index 0000000000000000000000000000000000000000..6c3196cc2d7e46e6756580267f5643c6f7b448dd --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/utf8prober.py @@ -0,0 +1,82 @@ +######################## BEGIN LICENSE BLOCK ######################## +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1998 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mark Pilgrim - port to Python +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA +######################### END LICENSE BLOCK ######################### + +from .charsetprober import CharSetProber +from .enums import ProbingState, MachineState +from .codingstatemachine import CodingStateMachine +from .mbcssm import UTF8_SM_MODEL + + + +class UTF8Prober(CharSetProber): + ONE_CHAR_PROB = 0.5 + + def __init__(self): + super(UTF8Prober, self).__init__() + self.coding_sm = CodingStateMachine(UTF8_SM_MODEL) + self._num_mb_chars = None + self.reset() + + def reset(self): + super(UTF8Prober, self).reset() + self.coding_sm.reset() + self._num_mb_chars = 0 + + @property + def charset_name(self): + return "utf-8" + + @property + def language(self): + return "" + + def feed(self, byte_str): + for c in byte_str: + coding_state = self.coding_sm.next_state(c) + if coding_state == MachineState.ERROR: + self._state = ProbingState.NOT_ME + break + elif coding_state == MachineState.ITS_ME: + self._state = ProbingState.FOUND_IT + break + elif coding_state == MachineState.START: + if self.coding_sm.get_current_charlen() >= 2: + self._num_mb_chars += 1 + + if self.state == ProbingState.DETECTING: + if self.get_confidence() > self.SHORTCUT_THRESHOLD: + self._state = ProbingState.FOUND_IT + + return self.state + + def get_confidence(self): + unlike = 0.99 + if self._num_mb_chars < 6: + unlike *= self.ONE_CHAR_PROB ** self._num_mb_chars + return 1.0 - unlike + else: + return unlike diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/version.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/version.py new file mode 100644 index 0000000000000000000000000000000000000000..bb2a34a70ea760ad1f58979acfc8fa466e30c511 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/chardet/version.py @@ -0,0 +1,9 @@ +""" +This module exists only to simplify retrieving the version number of chardet +from within setup.py and from chardet subpackages. + +:author: Dan Blanchard (dan.blanchard@gmail.com) +""" + +__version__ = "3.0.4" +VERSION = __version__.split('.') diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..089981707e157fdcae3d1b9f8ef9d7542b5aceeb --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/__init__.py @@ -0,0 +1,97 @@ +""" +urllib3 - Thread-safe connection pooling and re-using. +""" + +from __future__ import absolute_import +import warnings + +from .connectionpool import ( + HTTPConnectionPool, + HTTPSConnectionPool, + connection_from_url +) + +from . import exceptions +from .filepost import encode_multipart_formdata +from .poolmanager import PoolManager, ProxyManager, proxy_from_url +from .response import HTTPResponse +from .util.request import make_headers +from .util.url import get_host +from .util.timeout import Timeout +from .util.retry import Retry + + +# Set default logging handler to avoid "No handler found" warnings. +import logging +try: # Python 2.7+ + from logging import NullHandler +except ImportError: + class NullHandler(logging.Handler): + def emit(self, record): + pass + +__author__ = 'Andrey Petrov (andrey.petrov@shazow.net)' +__license__ = 'MIT' +__version__ = '1.24.3' + +__all__ = ( + 'HTTPConnectionPool', + 'HTTPSConnectionPool', + 'PoolManager', + 'ProxyManager', + 'HTTPResponse', + 'Retry', + 'Timeout', + 'add_stderr_logger', + 'connection_from_url', + 'disable_warnings', + 'encode_multipart_formdata', + 'get_host', + 'make_headers', + 'proxy_from_url', +) + +logging.getLogger(__name__).addHandler(NullHandler()) + + +def add_stderr_logger(level=logging.DEBUG): + """ + Helper for quickly adding a StreamHandler to the logger. Useful for + debugging. + + Returns the handler after adding it. + """ + # This method needs to be in this __init__.py to get the __name__ correct + # even if urllib3 is vendored within another package. + logger = logging.getLogger(__name__) + handler = logging.StreamHandler() + handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s')) + logger.addHandler(handler) + logger.setLevel(level) + logger.debug('Added a stderr logging handler to logger: %s', __name__) + return handler + + +# ... Clean up. +del NullHandler + + +# All warning filters *must* be appended unless you're really certain that they +# shouldn't be: otherwise, it's very hard for users to use most Python +# mechanisms to silence them. +# SecurityWarning's always go off by default. +warnings.simplefilter('always', exceptions.SecurityWarning, append=True) +# SubjectAltNameWarning's should go off once per host +warnings.simplefilter('default', exceptions.SubjectAltNameWarning, append=True) +# InsecurePlatformWarning's don't vary between requests, so we keep it default. +warnings.simplefilter('default', exceptions.InsecurePlatformWarning, + append=True) +# SNIMissingWarnings should go off only once. +warnings.simplefilter('default', exceptions.SNIMissingWarning, append=True) + + +def disable_warnings(category=exceptions.HTTPWarning): + """ + Helper for quickly disabling all urllib3 warnings. + """ + warnings.simplefilter('ignore', category) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/_collections.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/_collections.py new file mode 100644 index 0000000000000000000000000000000000000000..6e36b84e5964c5f532561365985d6eda5b101f89 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/_collections.py @@ -0,0 +1,332 @@ +from __future__ import absolute_import +try: + from collections.abc import Mapping, MutableMapping +except ImportError: + from collections import Mapping, MutableMapping +try: + from threading import RLock +except ImportError: # Platform-specific: No threads available + class RLock: + def __enter__(self): + pass + + def __exit__(self, exc_type, exc_value, traceback): + pass + + +try: # Python 2.7+ + from collections import OrderedDict +except ImportError: + from .packages.ordered_dict import OrderedDict +from .exceptions import InvalidHeader +from .packages.six import iterkeys, itervalues, PY3 + + +__all__ = ['RecentlyUsedContainer', 'HTTPHeaderDict'] + + +_Null = object() + + +class RecentlyUsedContainer(MutableMapping): + """ + Provides a thread-safe dict-like container which maintains up to + ``maxsize`` keys while throwing away the least-recently-used keys beyond + ``maxsize``. + + :param maxsize: + Maximum number of recent elements to retain. + + :param dispose_func: + Every time an item is evicted from the container, + ``dispose_func(value)`` is called. Callback which will get called + """ + + ContainerCls = OrderedDict + + def __init__(self, maxsize=10, dispose_func=None): + self._maxsize = maxsize + self.dispose_func = dispose_func + + self._container = self.ContainerCls() + self.lock = RLock() + + def __getitem__(self, key): + # Re-insert the item, moving it to the end of the eviction line. + with self.lock: + item = self._container.pop(key) + self._container[key] = item + return item + + def __setitem__(self, key, value): + evicted_value = _Null + with self.lock: + # Possibly evict the existing value of 'key' + evicted_value = self._container.get(key, _Null) + self._container[key] = value + + # If we didn't evict an existing value, we might have to evict the + # least recently used item from the beginning of the container. + if len(self._container) > self._maxsize: + _key, evicted_value = self._container.popitem(last=False) + + if self.dispose_func and evicted_value is not _Null: + self.dispose_func(evicted_value) + + def __delitem__(self, key): + with self.lock: + value = self._container.pop(key) + + if self.dispose_func: + self.dispose_func(value) + + def __len__(self): + with self.lock: + return len(self._container) + + def __iter__(self): + raise NotImplementedError('Iteration over this class is unlikely to be threadsafe.') + + def clear(self): + with self.lock: + # Copy pointers to all values, then wipe the mapping + values = list(itervalues(self._container)) + self._container.clear() + + if self.dispose_func: + for value in values: + self.dispose_func(value) + + def keys(self): + with self.lock: + return list(iterkeys(self._container)) + + +class HTTPHeaderDict(MutableMapping): + """ + :param headers: + An iterable of field-value pairs. Must not contain multiple field names + when compared case-insensitively. + + :param kwargs: + Additional field-value pairs to pass in to ``dict.update``. + + A ``dict`` like container for storing HTTP Headers. + + Field names are stored and compared case-insensitively in compliance with + RFC 7230. Iteration provides the first case-sensitive key seen for each + case-insensitive pair. + + Using ``__setitem__`` syntax overwrites fields that compare equal + case-insensitively in order to maintain ``dict``'s api. For fields that + compare equal, instead create a new ``HTTPHeaderDict`` and use ``.add`` + in a loop. + + If multiple fields that are equal case-insensitively are passed to the + constructor or ``.update``, the behavior is undefined and some will be + lost. + + >>> headers = HTTPHeaderDict() + >>> headers.add('Set-Cookie', 'foo=bar') + >>> headers.add('set-cookie', 'baz=quxx') + >>> headers['content-length'] = '7' + >>> headers['SET-cookie'] + 'foo=bar, baz=quxx' + >>> headers['Content-Length'] + '7' + """ + + def __init__(self, headers=None, **kwargs): + super(HTTPHeaderDict, self).__init__() + self._container = OrderedDict() + if headers is not None: + if isinstance(headers, HTTPHeaderDict): + self._copy_from(headers) + else: + self.extend(headers) + if kwargs: + self.extend(kwargs) + + def __setitem__(self, key, val): + self._container[key.lower()] = [key, val] + return self._container[key.lower()] + + def __getitem__(self, key): + val = self._container[key.lower()] + return ', '.join(val[1:]) + + def __delitem__(self, key): + del self._container[key.lower()] + + def __contains__(self, key): + return key.lower() in self._container + + def __eq__(self, other): + if not isinstance(other, Mapping) and not hasattr(other, 'keys'): + return False + if not isinstance(other, type(self)): + other = type(self)(other) + return (dict((k.lower(), v) for k, v in self.itermerged()) == + dict((k.lower(), v) for k, v in other.itermerged())) + + def __ne__(self, other): + return not self.__eq__(other) + + if not PY3: # Python 2 + iterkeys = MutableMapping.iterkeys + itervalues = MutableMapping.itervalues + + __marker = object() + + def __len__(self): + return len(self._container) + + def __iter__(self): + # Only provide the originally cased names + for vals in self._container.values(): + yield vals[0] + + def pop(self, key, default=__marker): + '''D.pop(k[,d]) -> v, remove specified key and return the corresponding value. + If key is not found, d is returned if given, otherwise KeyError is raised. + ''' + # Using the MutableMapping function directly fails due to the private marker. + # Using ordinary dict.pop would expose the internal structures. + # So let's reinvent the wheel. + try: + value = self[key] + except KeyError: + if default is self.__marker: + raise + return default + else: + del self[key] + return value + + def discard(self, key): + try: + del self[key] + except KeyError: + pass + + def add(self, key, val): + """Adds a (name, value) pair, doesn't overwrite the value if it already + exists. + + >>> headers = HTTPHeaderDict(foo='bar') + >>> headers.add('Foo', 'baz') + >>> headers['foo'] + 'bar, baz' + """ + key_lower = key.lower() + new_vals = [key, val] + # Keep the common case aka no item present as fast as possible + vals = self._container.setdefault(key_lower, new_vals) + if new_vals is not vals: + vals.append(val) + + def extend(self, *args, **kwargs): + """Generic import function for any type of header-like object. + Adapted version of MutableMapping.update in order to insert items + with self.add instead of self.__setitem__ + """ + if len(args) > 1: + raise TypeError("extend() takes at most 1 positional " + "arguments ({0} given)".format(len(args))) + other = args[0] if len(args) >= 1 else () + + if isinstance(other, HTTPHeaderDict): + for key, val in other.iteritems(): + self.add(key, val) + elif isinstance(other, Mapping): + for key in other: + self.add(key, other[key]) + elif hasattr(other, "keys"): + for key in other.keys(): + self.add(key, other[key]) + else: + for key, value in other: + self.add(key, value) + + for key, value in kwargs.items(): + self.add(key, value) + + def getlist(self, key, default=__marker): + """Returns a list of all the values for the named field. Returns an + empty list if the key doesn't exist.""" + try: + vals = self._container[key.lower()] + except KeyError: + if default is self.__marker: + return [] + return default + else: + return vals[1:] + + # Backwards compatibility for httplib + getheaders = getlist + getallmatchingheaders = getlist + iget = getlist + + # Backwards compatibility for http.cookiejar + get_all = getlist + + def __repr__(self): + return "%s(%s)" % (type(self).__name__, dict(self.itermerged())) + + def _copy_from(self, other): + for key in other: + val = other.getlist(key) + if isinstance(val, list): + # Don't need to convert tuples + val = list(val) + self._container[key.lower()] = [key] + val + + def copy(self): + clone = type(self)() + clone._copy_from(self) + return clone + + def iteritems(self): + """Iterate over all header lines, including duplicate ones.""" + for key in self: + vals = self._container[key.lower()] + for val in vals[1:]: + yield vals[0], val + + def itermerged(self): + """Iterate over all headers, merging duplicate ones together.""" + for key in self: + val = self._container[key.lower()] + yield val[0], ', '.join(val[1:]) + + def items(self): + return list(self.iteritems()) + + @classmethod + def from_httplib(cls, message): # Python 2 + """Read headers from a Python 2 httplib message object.""" + # python2.7 does not expose a proper API for exporting multiheaders + # efficiently. This function re-reads raw lines from the message + # object and extracts the multiheaders properly. + obs_fold_continued_leaders = (' ', '\t') + headers = [] + + for line in message.headers: + if line.startswith(obs_fold_continued_leaders): + if not headers: + # We received a header line that starts with OWS as described + # in RFC-7230 S3.2.4. This indicates a multiline header, but + # there exists no previous header to which we can attach it. + raise InvalidHeader( + 'Header continuation with no previous header: %s' % line + ) + else: + key, value = headers[-1] + headers[-1] = (key, value + ' ' + line.strip()) + continue + + key, value = line.split(':', 1) + headers.append((key, value.strip())) + + return cls(headers) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/connection.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/connection.py new file mode 100644 index 0000000000000000000000000000000000000000..ba269b7a1366e229b5856f51ebd1605e8224350e --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/connection.py @@ -0,0 +1,391 @@ +from __future__ import absolute_import +import datetime +import logging +import os +import socket +from socket import error as SocketError, timeout as SocketTimeout +import warnings +from .packages import six +from .packages.six.moves.http_client import HTTPConnection as _HTTPConnection +from .packages.six.moves.http_client import HTTPException # noqa: F401 + +try: # Compiled with SSL? + import ssl + BaseSSLError = ssl.SSLError +except (ImportError, AttributeError): # Platform-specific: No SSL. + ssl = None + + class BaseSSLError(BaseException): + pass + + +try: # Python 3: + # Not a no-op, we're adding this to the namespace so it can be imported. + ConnectionError = ConnectionError +except NameError: # Python 2: + class ConnectionError(Exception): + pass + + +from .exceptions import ( + NewConnectionError, + ConnectTimeoutError, + SubjectAltNameWarning, + SystemTimeWarning, +) +from .packages.ssl_match_hostname import match_hostname, CertificateError + +from .util.ssl_ import ( + resolve_cert_reqs, + resolve_ssl_version, + assert_fingerprint, + create_urllib3_context, + ssl_wrap_socket +) + + +from .util import connection + +from ._collections import HTTPHeaderDict + +log = logging.getLogger(__name__) + +port_by_scheme = { + 'http': 80, + 'https': 443, +} + +# When updating RECENT_DATE, move it to within two years of the current date, +# and not less than 6 months ago. +# Example: if Today is 2018-01-01, then RECENT_DATE should be any date on or +# after 2016-01-01 (today - 2 years) AND before 2017-07-01 (today - 6 months) +RECENT_DATE = datetime.date(2017, 6, 30) + + +class DummyConnection(object): + """Used to detect a failed ConnectionCls import.""" + pass + + +class HTTPConnection(_HTTPConnection, object): + """ + Based on httplib.HTTPConnection but provides an extra constructor + backwards-compatibility layer between older and newer Pythons. + + Additional keyword parameters are used to configure attributes of the connection. + Accepted parameters include: + + - ``strict``: See the documentation on :class:`urllib3.connectionpool.HTTPConnectionPool` + - ``source_address``: Set the source address for the current connection. + - ``socket_options``: Set specific options on the underlying socket. If not specified, then + defaults are loaded from ``HTTPConnection.default_socket_options`` which includes disabling + Nagle's algorithm (sets TCP_NODELAY to 1) unless the connection is behind a proxy. + + For example, if you wish to enable TCP Keep Alive in addition to the defaults, + you might pass:: + + HTTPConnection.default_socket_options + [ + (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1), + ] + + Or you may want to disable the defaults by passing an empty list (e.g., ``[]``). + """ + + default_port = port_by_scheme['http'] + + #: Disable Nagle's algorithm by default. + #: ``[(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)]`` + default_socket_options = [(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)] + + #: Whether this connection verifies the host's certificate. + is_verified = False + + def __init__(self, *args, **kw): + if six.PY3: # Python 3 + kw.pop('strict', None) + + # Pre-set source_address. + self.source_address = kw.get('source_address') + + #: The socket options provided by the user. If no options are + #: provided, we use the default options. + self.socket_options = kw.pop('socket_options', self.default_socket_options) + + _HTTPConnection.__init__(self, *args, **kw) + + @property + def host(self): + """ + Getter method to remove any trailing dots that indicate the hostname is an FQDN. + + In general, SSL certificates don't include the trailing dot indicating a + fully-qualified domain name, and thus, they don't validate properly when + checked against a domain name that includes the dot. In addition, some + servers may not expect to receive the trailing dot when provided. + + However, the hostname with trailing dot is critical to DNS resolution; doing a + lookup with the trailing dot will properly only resolve the appropriate FQDN, + whereas a lookup without a trailing dot will search the system's search domain + list. Thus, it's important to keep the original host around for use only in + those cases where it's appropriate (i.e., when doing DNS lookup to establish the + actual TCP connection across which we're going to send HTTP requests). + """ + return self._dns_host.rstrip('.') + + @host.setter + def host(self, value): + """ + Setter for the `host` property. + + We assume that only urllib3 uses the _dns_host attribute; httplib itself + only uses `host`, and it seems reasonable that other libraries follow suit. + """ + self._dns_host = value + + def _new_conn(self): + """ Establish a socket connection and set nodelay settings on it. + + :return: New socket connection. + """ + extra_kw = {} + if self.source_address: + extra_kw['source_address'] = self.source_address + + if self.socket_options: + extra_kw['socket_options'] = self.socket_options + + try: + conn = connection.create_connection( + (self._dns_host, self.port), self.timeout, **extra_kw) + + except SocketTimeout: + raise ConnectTimeoutError( + self, "Connection to %s timed out. (connect timeout=%s)" % + (self.host, self.timeout)) + + except SocketError as e: + raise NewConnectionError( + self, "Failed to establish a new connection: %s" % e) + + return conn + + def _prepare_conn(self, conn): + self.sock = conn + if self._tunnel_host: + # TODO: Fix tunnel so it doesn't depend on self.sock state. + self._tunnel() + # Mark this connection as not reusable + self.auto_open = 0 + + def connect(self): + conn = self._new_conn() + self._prepare_conn(conn) + + def request_chunked(self, method, url, body=None, headers=None): + """ + Alternative to the common request method, which sends the + body with chunked encoding and not as one block + """ + headers = HTTPHeaderDict(headers if headers is not None else {}) + skip_accept_encoding = 'accept-encoding' in headers + skip_host = 'host' in headers + self.putrequest( + method, + url, + skip_accept_encoding=skip_accept_encoding, + skip_host=skip_host + ) + for header, value in headers.items(): + self.putheader(header, value) + if 'transfer-encoding' not in headers: + self.putheader('Transfer-Encoding', 'chunked') + self.endheaders() + + if body is not None: + stringish_types = six.string_types + (bytes,) + if isinstance(body, stringish_types): + body = (body,) + for chunk in body: + if not chunk: + continue + if not isinstance(chunk, bytes): + chunk = chunk.encode('utf8') + len_str = hex(len(chunk))[2:] + self.send(len_str.encode('utf-8')) + self.send(b'\r\n') + self.send(chunk) + self.send(b'\r\n') + + # After the if clause, to always have a closed body + self.send(b'0\r\n\r\n') + + +class HTTPSConnection(HTTPConnection): + default_port = port_by_scheme['https'] + + ssl_version = None + + def __init__(self, host, port=None, key_file=None, cert_file=None, + strict=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, + ssl_context=None, server_hostname=None, **kw): + + HTTPConnection.__init__(self, host, port, strict=strict, + timeout=timeout, **kw) + + self.key_file = key_file + self.cert_file = cert_file + self.ssl_context = ssl_context + self.server_hostname = server_hostname + + # Required property for Google AppEngine 1.9.0 which otherwise causes + # HTTPS requests to go out as HTTP. (See Issue #356) + self._protocol = 'https' + + def connect(self): + conn = self._new_conn() + self._prepare_conn(conn) + + if self.ssl_context is None: + self.ssl_context = create_urllib3_context( + ssl_version=resolve_ssl_version(None), + cert_reqs=resolve_cert_reqs(None), + ) + + self.sock = ssl_wrap_socket( + sock=conn, + keyfile=self.key_file, + certfile=self.cert_file, + ssl_context=self.ssl_context, + server_hostname=self.server_hostname + ) + + +class VerifiedHTTPSConnection(HTTPSConnection): + """ + Based on httplib.HTTPSConnection but wraps the socket with + SSL certification. + """ + cert_reqs = None + ca_certs = None + ca_cert_dir = None + ssl_version = None + assert_fingerprint = None + + def set_cert(self, key_file=None, cert_file=None, + cert_reqs=None, ca_certs=None, + assert_hostname=None, assert_fingerprint=None, + ca_cert_dir=None): + """ + This method should only be called once, before the connection is used. + """ + # If cert_reqs is not provided, we can try to guess. If the user gave + # us a cert database, we assume they want to use it: otherwise, if + # they gave us an SSL Context object we should use whatever is set for + # it. + if cert_reqs is None: + if ca_certs or ca_cert_dir: + cert_reqs = 'CERT_REQUIRED' + elif self.ssl_context is not None: + cert_reqs = self.ssl_context.verify_mode + + self.key_file = key_file + self.cert_file = cert_file + self.cert_reqs = cert_reqs + self.assert_hostname = assert_hostname + self.assert_fingerprint = assert_fingerprint + self.ca_certs = ca_certs and os.path.expanduser(ca_certs) + self.ca_cert_dir = ca_cert_dir and os.path.expanduser(ca_cert_dir) + + def connect(self): + # Add certificate verification + conn = self._new_conn() + hostname = self.host + + if self._tunnel_host: + self.sock = conn + # Calls self._set_hostport(), so self.host is + # self._tunnel_host below. + self._tunnel() + # Mark this connection as not reusable + self.auto_open = 0 + + # Override the host with the one we're requesting data from. + hostname = self._tunnel_host + + server_hostname = hostname + if self.server_hostname is not None: + server_hostname = self.server_hostname + + is_time_off = datetime.date.today() < RECENT_DATE + if is_time_off: + warnings.warn(( + 'System time is way off (before {0}). This will probably ' + 'lead to SSL verification errors').format(RECENT_DATE), + SystemTimeWarning + ) + + # Wrap socket using verification with the root certs in + # trusted_root_certs + if self.ssl_context is None: + self.ssl_context = create_urllib3_context( + ssl_version=resolve_ssl_version(self.ssl_version), + cert_reqs=resolve_cert_reqs(self.cert_reqs), + ) + + context = self.ssl_context + context.verify_mode = resolve_cert_reqs(self.cert_reqs) + self.sock = ssl_wrap_socket( + sock=conn, + keyfile=self.key_file, + certfile=self.cert_file, + ca_certs=self.ca_certs, + ca_cert_dir=self.ca_cert_dir, + server_hostname=server_hostname, + ssl_context=context) + + if self.assert_fingerprint: + assert_fingerprint(self.sock.getpeercert(binary_form=True), + self.assert_fingerprint) + elif context.verify_mode != ssl.CERT_NONE \ + and not getattr(context, 'check_hostname', False) \ + and self.assert_hostname is not False: + # While urllib3 attempts to always turn off hostname matching from + # the TLS library, this cannot always be done. So we check whether + # the TLS Library still thinks it's matching hostnames. + cert = self.sock.getpeercert() + if not cert.get('subjectAltName', ()): + warnings.warn(( + 'Certificate for {0} has no `subjectAltName`, falling back to check for a ' + '`commonName` for now. This feature is being removed by major browsers and ' + 'deprecated by RFC 2818. (See https://github.com/shazow/urllib3/issues/497 ' + 'for details.)'.format(hostname)), + SubjectAltNameWarning + ) + _match_hostname(cert, self.assert_hostname or server_hostname) + + self.is_verified = ( + context.verify_mode == ssl.CERT_REQUIRED or + self.assert_fingerprint is not None + ) + + +def _match_hostname(cert, asserted_hostname): + try: + match_hostname(cert, asserted_hostname) + except CertificateError as e: + log.error( + 'Certificate did not match expected hostname: %s. ' + 'Certificate: %s', asserted_hostname, cert + ) + # Add cert to exception and reraise so client code can inspect + # the cert when catching the exception, if they want to + e._peer_cert = cert + raise + + +if ssl: + # Make a copy for testing. + UnverifiedHTTPSConnection = HTTPSConnection + HTTPSConnection = VerifiedHTTPSConnection +else: + HTTPSConnection = DummyConnection diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/connectionpool.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/connectionpool.py new file mode 100644 index 0000000000000000000000000000000000000000..d65581ee08139dc729cbf667d0fa59313f1db38c --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/connectionpool.py @@ -0,0 +1,896 @@ +from __future__ import absolute_import +import errno +import logging +import sys +import warnings + +from socket import error as SocketError, timeout as SocketTimeout +import socket + + +from .exceptions import ( + ClosedPoolError, + ProtocolError, + EmptyPoolError, + HeaderParsingError, + HostChangedError, + LocationValueError, + MaxRetryError, + ProxyError, + ReadTimeoutError, + SSLError, + TimeoutError, + InsecureRequestWarning, + NewConnectionError, +) +from .packages.ssl_match_hostname import CertificateError +from .packages import six +from .packages.six.moves import queue +from .connection import ( + port_by_scheme, + DummyConnection, + HTTPConnection, HTTPSConnection, VerifiedHTTPSConnection, + HTTPException, BaseSSLError, +) +from .request import RequestMethods +from .response import HTTPResponse + +from .util.connection import is_connection_dropped +from .util.request import set_file_position +from .util.response import assert_header_parsing +from .util.retry import Retry +from .util.timeout import Timeout +from .util.url import get_host, Url, NORMALIZABLE_SCHEMES +from .util.queue import LifoQueue + + +xrange = six.moves.xrange + +log = logging.getLogger(__name__) + +_Default = object() + + +# Pool objects +class ConnectionPool(object): + """ + Base class for all connection pools, such as + :class:`.HTTPConnectionPool` and :class:`.HTTPSConnectionPool`. + """ + + scheme = None + QueueCls = LifoQueue + + def __init__(self, host, port=None): + if not host: + raise LocationValueError("No host specified.") + + self.host = _ipv6_host(host, self.scheme) + self._proxy_host = host.lower() + self.port = port + + def __str__(self): + return '%s(host=%r, port=%r)' % (type(self).__name__, + self.host, self.port) + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self.close() + # Return False to re-raise any potential exceptions + return False + + def close(self): + """ + Close all pooled connections and disable the pool. + """ + pass + + +# This is taken from http://hg.python.org/cpython/file/7aaba721ebc0/Lib/socket.py#l252 +_blocking_errnos = {errno.EAGAIN, errno.EWOULDBLOCK} + + +class HTTPConnectionPool(ConnectionPool, RequestMethods): + """ + Thread-safe connection pool for one host. + + :param host: + Host used for this HTTP Connection (e.g. "localhost"), passed into + :class:`httplib.HTTPConnection`. + + :param port: + Port used for this HTTP Connection (None is equivalent to 80), passed + into :class:`httplib.HTTPConnection`. + + :param strict: + Causes BadStatusLine to be raised if the status line can't be parsed + as a valid HTTP/1.0 or 1.1 status line, passed into + :class:`httplib.HTTPConnection`. + + .. note:: + Only works in Python 2. This parameter is ignored in Python 3. + + :param timeout: + Socket timeout in seconds for each individual connection. This can + be a float or integer, which sets the timeout for the HTTP request, + or an instance of :class:`urllib3.util.Timeout` which gives you more + fine-grained control over request timeouts. After the constructor has + been parsed, this is always a `urllib3.util.Timeout` object. + + :param maxsize: + Number of connections to save that can be reused. More than 1 is useful + in multithreaded situations. If ``block`` is set to False, more + connections will be created but they will not be saved once they've + been used. + + :param block: + If set to True, no more than ``maxsize`` connections will be used at + a time. When no free connections are available, the call will block + until a connection has been released. This is a useful side effect for + particular multithreaded situations where one does not want to use more + than maxsize connections per host to prevent flooding. + + :param headers: + Headers to include with all requests, unless other headers are given + explicitly. + + :param retries: + Retry configuration to use by default with requests in this pool. + + :param _proxy: + Parsed proxy URL, should not be used directly, instead, see + :class:`urllib3.connectionpool.ProxyManager`" + + :param _proxy_headers: + A dictionary with proxy headers, should not be used directly, + instead, see :class:`urllib3.connectionpool.ProxyManager`" + + :param \\**conn_kw: + Additional parameters are used to create fresh :class:`urllib3.connection.HTTPConnection`, + :class:`urllib3.connection.HTTPSConnection` instances. + """ + + scheme = 'http' + ConnectionCls = HTTPConnection + ResponseCls = HTTPResponse + + def __init__(self, host, port=None, strict=False, + timeout=Timeout.DEFAULT_TIMEOUT, maxsize=1, block=False, + headers=None, retries=None, + _proxy=None, _proxy_headers=None, + **conn_kw): + ConnectionPool.__init__(self, host, port) + RequestMethods.__init__(self, headers) + + self.strict = strict + + if not isinstance(timeout, Timeout): + timeout = Timeout.from_float(timeout) + + if retries is None: + retries = Retry.DEFAULT + + self.timeout = timeout + self.retries = retries + + self.pool = self.QueueCls(maxsize) + self.block = block + + self.proxy = _proxy + self.proxy_headers = _proxy_headers or {} + + # Fill the queue up so that doing get() on it will block properly + for _ in xrange(maxsize): + self.pool.put(None) + + # These are mostly for testing and debugging purposes. + self.num_connections = 0 + self.num_requests = 0 + self.conn_kw = conn_kw + + if self.proxy: + # Enable Nagle's algorithm for proxies, to avoid packet fragmentation. + # We cannot know if the user has added default socket options, so we cannot replace the + # list. + self.conn_kw.setdefault('socket_options', []) + + def _new_conn(self): + """ + Return a fresh :class:`HTTPConnection`. + """ + self.num_connections += 1 + log.debug("Starting new HTTP connection (%d): %s:%s", + self.num_connections, self.host, self.port or "80") + + conn = self.ConnectionCls(host=self.host, port=self.port, + timeout=self.timeout.connect_timeout, + strict=self.strict, **self.conn_kw) + return conn + + def _get_conn(self, timeout=None): + """ + Get a connection. Will return a pooled connection if one is available. + + If no connections are available and :prop:`.block` is ``False``, then a + fresh connection is returned. + + :param timeout: + Seconds to wait before giving up and raising + :class:`urllib3.exceptions.EmptyPoolError` if the pool is empty and + :prop:`.block` is ``True``. + """ + conn = None + try: + conn = self.pool.get(block=self.block, timeout=timeout) + + except AttributeError: # self.pool is None + raise ClosedPoolError(self, "Pool is closed.") + + except queue.Empty: + if self.block: + raise EmptyPoolError(self, + "Pool reached maximum size and no more " + "connections are allowed.") + pass # Oh well, we'll create a new connection then + + # If this is a persistent connection, check if it got disconnected + if conn and is_connection_dropped(conn): + log.debug("Resetting dropped connection: %s", self.host) + conn.close() + if getattr(conn, 'auto_open', 1) == 0: + # This is a proxied connection that has been mutated by + # httplib._tunnel() and cannot be reused (since it would + # attempt to bypass the proxy) + conn = None + + return conn or self._new_conn() + + def _put_conn(self, conn): + """ + Put a connection back into the pool. + + :param conn: + Connection object for the current host and port as returned by + :meth:`._new_conn` or :meth:`._get_conn`. + + If the pool is already full, the connection is closed and discarded + because we exceeded maxsize. If connections are discarded frequently, + then maxsize should be increased. + + If the pool is closed, then the connection will be closed and discarded. + """ + try: + self.pool.put(conn, block=False) + return # Everything is dandy, done. + except AttributeError: + # self.pool is None. + pass + except queue.Full: + # This should never happen if self.block == True + log.warning( + "Connection pool is full, discarding connection: %s", + self.host) + + # Connection never got put back into the pool, close it. + if conn: + conn.close() + + def _validate_conn(self, conn): + """ + Called right before a request is made, after the socket is created. + """ + pass + + def _prepare_proxy(self, conn): + # Nothing to do for HTTP connections. + pass + + def _get_timeout(self, timeout): + """ Helper that always returns a :class:`urllib3.util.Timeout` """ + if timeout is _Default: + return self.timeout.clone() + + if isinstance(timeout, Timeout): + return timeout.clone() + else: + # User passed us an int/float. This is for backwards compatibility, + # can be removed later + return Timeout.from_float(timeout) + + def _raise_timeout(self, err, url, timeout_value): + """Is the error actually a timeout? Will raise a ReadTimeout or pass""" + + if isinstance(err, SocketTimeout): + raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value) + + # See the above comment about EAGAIN in Python 3. In Python 2 we have + # to specifically catch it and throw the timeout error + if hasattr(err, 'errno') and err.errno in _blocking_errnos: + raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value) + + # Catch possible read timeouts thrown as SSL errors. If not the + # case, rethrow the original. We need to do this because of: + # http://bugs.python.org/issue10272 + if 'timed out' in str(err) or 'did not complete (read)' in str(err): # Python < 2.7.4 + raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value) + + def _make_request(self, conn, method, url, timeout=_Default, chunked=False, + **httplib_request_kw): + """ + Perform a request on a given urllib connection object taken from our + pool. + + :param conn: + a connection from one of our connection pools + + :param timeout: + Socket timeout in seconds for the request. This can be a + float or integer, which will set the same timeout value for + the socket connect and the socket read, or an instance of + :class:`urllib3.util.Timeout`, which gives you more fine-grained + control over your timeouts. + """ + self.num_requests += 1 + + timeout_obj = self._get_timeout(timeout) + timeout_obj.start_connect() + conn.timeout = timeout_obj.connect_timeout + + # Trigger any extra validation we need to do. + try: + self._validate_conn(conn) + except (SocketTimeout, BaseSSLError) as e: + # Py2 raises this as a BaseSSLError, Py3 raises it as socket timeout. + self._raise_timeout(err=e, url=url, timeout_value=conn.timeout) + raise + + # conn.request() calls httplib.*.request, not the method in + # urllib3.request. It also calls makefile (recv) on the socket. + if chunked: + conn.request_chunked(method, url, **httplib_request_kw) + else: + conn.request(method, url, **httplib_request_kw) + + # Reset the timeout for the recv() on the socket + read_timeout = timeout_obj.read_timeout + + # App Engine doesn't have a sock attr + if getattr(conn, 'sock', None): + # In Python 3 socket.py will catch EAGAIN and return None when you + # try and read into the file pointer created by http.client, which + # instead raises a BadStatusLine exception. Instead of catching + # the exception and assuming all BadStatusLine exceptions are read + # timeouts, check for a zero timeout before making the request. + if read_timeout == 0: + raise ReadTimeoutError( + self, url, "Read timed out. (read timeout=%s)" % read_timeout) + if read_timeout is Timeout.DEFAULT_TIMEOUT: + conn.sock.settimeout(socket.getdefaulttimeout()) + else: # None or a value + conn.sock.settimeout(read_timeout) + + # Receive the response from the server + try: + try: # Python 2.7, use buffering of HTTP responses + httplib_response = conn.getresponse(buffering=True) + except TypeError: # Python 3 + try: + httplib_response = conn.getresponse() + except Exception as e: + # Remove the TypeError from the exception chain in Python 3; + # otherwise it looks like a programming error was the cause. + six.raise_from(e, None) + except (SocketTimeout, BaseSSLError, SocketError) as e: + self._raise_timeout(err=e, url=url, timeout_value=read_timeout) + raise + + # AppEngine doesn't have a version attr. + http_version = getattr(conn, '_http_vsn_str', 'HTTP/?') + log.debug("%s://%s:%s \"%s %s %s\" %s %s", self.scheme, self.host, self.port, + method, url, http_version, httplib_response.status, + httplib_response.length) + + try: + assert_header_parsing(httplib_response.msg) + except (HeaderParsingError, TypeError) as hpe: # Platform-specific: Python 3 + log.warning( + 'Failed to parse headers (url=%s): %s', + self._absolute_url(url), hpe, exc_info=True) + + return httplib_response + + def _absolute_url(self, path): + return Url(scheme=self.scheme, host=self.host, port=self.port, path=path).url + + def close(self): + """ + Close all pooled connections and disable the pool. + """ + if self.pool is None: + return + # Disable access to the pool + old_pool, self.pool = self.pool, None + + try: + while True: + conn = old_pool.get(block=False) + if conn: + conn.close() + + except queue.Empty: + pass # Done. + + def is_same_host(self, url): + """ + Check if the given ``url`` is a member of the same host as this + connection pool. + """ + if url.startswith('/'): + return True + + # TODO: Add optional support for socket.gethostbyname checking. + scheme, host, port = get_host(url) + + host = _ipv6_host(host, self.scheme) + + # Use explicit default port for comparison when none is given + if self.port and not port: + port = port_by_scheme.get(scheme) + elif not self.port and port == port_by_scheme.get(scheme): + port = None + + return (scheme, host, port) == (self.scheme, self.host, self.port) + + def urlopen(self, method, url, body=None, headers=None, retries=None, + redirect=True, assert_same_host=True, timeout=_Default, + pool_timeout=None, release_conn=None, chunked=False, + body_pos=None, **response_kw): + """ + Get a connection from the pool and perform an HTTP request. This is the + lowest level call for making a request, so you'll need to specify all + the raw details. + + .. note:: + + More commonly, it's appropriate to use a convenience method provided + by :class:`.RequestMethods`, such as :meth:`request`. + + .. note:: + + `release_conn` will only behave as expected if + `preload_content=False` because we want to make + `preload_content=False` the default behaviour someday soon without + breaking backwards compatibility. + + :param method: + HTTP request method (such as GET, POST, PUT, etc.) + + :param body: + Data to send in the request body (useful for creating + POST requests, see HTTPConnectionPool.post_url for + more convenience). + + :param headers: + Dictionary of custom headers to send, such as User-Agent, + If-None-Match, etc. If None, pool headers are used. If provided, + these headers completely replace any pool-specific headers. + + :param retries: + Configure the number of retries to allow before raising a + :class:`~urllib3.exceptions.MaxRetryError` exception. + + Pass ``None`` to retry until you receive a response. Pass a + :class:`~urllib3.util.retry.Retry` object for fine-grained control + over different types of retries. + Pass an integer number to retry connection errors that many times, + but no other types of errors. Pass zero to never retry. + + If ``False``, then retries are disabled and any exception is raised + immediately. Also, instead of raising a MaxRetryError on redirects, + the redirect response will be returned. + + :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. + + :param redirect: + If True, automatically handle redirects (status codes 301, 302, + 303, 307, 308). Each redirect counts as a retry. Disabling retries + will disable redirect, too. + + :param assert_same_host: + If ``True``, will make sure that the host of the pool requests is + consistent else will raise HostChangedError. When False, you can + use the pool on an HTTP proxy and request foreign hosts. + + :param timeout: + If specified, overrides the default timeout for this one + request. It may be a float (in seconds) or an instance of + :class:`urllib3.util.Timeout`. + + :param pool_timeout: + If set and the pool is set to block=True, then this method will + block for ``pool_timeout`` seconds and raise EmptyPoolError if no + connection is available within the time period. + + :param release_conn: + If False, then the urlopen call will not release the connection + back into the pool once a response is received (but will release if + you read the entire contents of the response such as when + `preload_content=True`). This is useful if you're not preloading + the response's content immediately. You will need to call + ``r.release_conn()`` on the response ``r`` to return the connection + back into the pool. If None, it takes the value of + ``response_kw.get('preload_content', True)``. + + :param chunked: + If True, urllib3 will send the body using chunked transfer + encoding. Otherwise, urllib3 will send the body using the standard + content-length form. Defaults to False. + + :param int body_pos: + Position to seek to in file-like body in the event of a retry or + redirect. Typically this won't need to be set because urllib3 will + auto-populate the value when needed. + + :param \\**response_kw: + Additional parameters are passed to + :meth:`urllib3.response.HTTPResponse.from_httplib` + """ + if headers is None: + headers = self.headers + + if not isinstance(retries, Retry): + retries = Retry.from_int(retries, redirect=redirect, default=self.retries) + + if release_conn is None: + release_conn = response_kw.get('preload_content', True) + + # Check host + if assert_same_host and not self.is_same_host(url): + raise HostChangedError(self, url, retries) + + conn = None + + # Track whether `conn` needs to be released before + # returning/raising/recursing. Update this variable if necessary, and + # leave `release_conn` constant throughout the function. That way, if + # the function recurses, the original value of `release_conn` will be + # passed down into the recursive call, and its value will be respected. + # + # See issue #651 [1] for details. + # + # [1] + release_this_conn = release_conn + + # Merge the proxy headers. Only do this in HTTP. We have to copy the + # headers dict so we can safely change it without those changes being + # reflected in anyone else's copy. + if self.scheme == 'http': + headers = headers.copy() + headers.update(self.proxy_headers) + + # Must keep the exception bound to a separate variable or else Python 3 + # complains about UnboundLocalError. + err = None + + # Keep track of whether we cleanly exited the except block. This + # ensures we do proper cleanup in finally. + clean_exit = False + + # Rewind body position, if needed. Record current position + # for future rewinds in the event of a redirect/retry. + body_pos = set_file_position(body, body_pos) + + try: + # Request a connection from the queue. + timeout_obj = self._get_timeout(timeout) + conn = self._get_conn(timeout=pool_timeout) + + conn.timeout = timeout_obj.connect_timeout + + is_new_proxy_conn = self.proxy is not None and not getattr(conn, 'sock', None) + if is_new_proxy_conn: + self._prepare_proxy(conn) + + # Make the request on the httplib connection object. + httplib_response = self._make_request(conn, method, url, + timeout=timeout_obj, + body=body, headers=headers, + chunked=chunked) + + # If we're going to release the connection in ``finally:``, then + # the response doesn't need to know about the connection. Otherwise + # it will also try to release it and we'll have a double-release + # mess. + response_conn = conn if not release_conn else None + + # Pass method to Response for length checking + response_kw['request_method'] = method + + # Import httplib's response into our own wrapper object + response = self.ResponseCls.from_httplib(httplib_response, + pool=self, + connection=response_conn, + retries=retries, + **response_kw) + + # Everything went great! + clean_exit = True + + except queue.Empty: + # Timed out by queue. + raise EmptyPoolError(self, "No pool connections are available.") + + except (TimeoutError, HTTPException, SocketError, ProtocolError, + BaseSSLError, SSLError, CertificateError) as e: + # Discard the connection for these exceptions. It will be + # replaced during the next _get_conn() call. + clean_exit = False + if isinstance(e, (BaseSSLError, CertificateError)): + e = SSLError(e) + elif isinstance(e, (SocketError, NewConnectionError)) and self.proxy: + e = ProxyError('Cannot connect to proxy.', e) + elif isinstance(e, (SocketError, HTTPException)): + e = ProtocolError('Connection aborted.', e) + + retries = retries.increment(method, url, error=e, _pool=self, + _stacktrace=sys.exc_info()[2]) + retries.sleep() + + # Keep track of the error for the retry warning. + err = e + + finally: + if not clean_exit: + # We hit some kind of exception, handled or otherwise. We need + # to throw the connection away unless explicitly told not to. + # Close the connection, set the variable to None, and make sure + # we put the None back in the pool to avoid leaking it. + conn = conn and conn.close() + release_this_conn = True + + if release_this_conn: + # Put the connection back to be reused. If the connection is + # expired then it will be None, which will get replaced with a + # fresh connection during _get_conn. + self._put_conn(conn) + + if not conn: + # Try again + log.warning("Retrying (%r) after connection " + "broken by '%r': %s", retries, err, url) + return self.urlopen(method, url, body, headers, retries, + redirect, assert_same_host, + timeout=timeout, pool_timeout=pool_timeout, + release_conn=release_conn, body_pos=body_pos, + **response_kw) + + def drain_and_release_conn(response): + try: + # discard any remaining response body, the connection will be + # released back to the pool once the entire response is read + response.read() + except (TimeoutError, HTTPException, SocketError, ProtocolError, + BaseSSLError, SSLError): + pass + + # Handle redirect? + redirect_location = redirect and response.get_redirect_location() + if redirect_location: + if response.status == 303: + method = 'GET' + + try: + retries = retries.increment(method, url, response=response, _pool=self) + except MaxRetryError: + if retries.raise_on_redirect: + # Drain and release the connection for this response, since + # we're not returning it to be released manually. + drain_and_release_conn(response) + raise + return response + + # drain and return the connection to the pool before recursing + drain_and_release_conn(response) + + retries.sleep_for_retry(response) + log.debug("Redirecting %s -> %s", url, redirect_location) + return self.urlopen( + method, redirect_location, body, headers, + retries=retries, redirect=redirect, + assert_same_host=assert_same_host, + timeout=timeout, pool_timeout=pool_timeout, + release_conn=release_conn, body_pos=body_pos, + **response_kw) + + # Check if we should retry the HTTP response. + has_retry_after = bool(response.getheader('Retry-After')) + if retries.is_retry(method, response.status, has_retry_after): + try: + retries = retries.increment(method, url, response=response, _pool=self) + except MaxRetryError: + if retries.raise_on_status: + # Drain and release the connection for this response, since + # we're not returning it to be released manually. + drain_and_release_conn(response) + raise + return response + + # drain and return the connection to the pool before recursing + drain_and_release_conn(response) + + retries.sleep(response) + log.debug("Retry: %s", url) + return self.urlopen( + method, url, body, headers, + retries=retries, redirect=redirect, + assert_same_host=assert_same_host, + timeout=timeout, pool_timeout=pool_timeout, + release_conn=release_conn, + body_pos=body_pos, **response_kw) + + return response + + +class HTTPSConnectionPool(HTTPConnectionPool): + """ + Same as :class:`.HTTPConnectionPool`, but HTTPS. + + When Python is compiled with the :mod:`ssl` module, then + :class:`.VerifiedHTTPSConnection` is used, which *can* verify certificates, + instead of :class:`.HTTPSConnection`. + + :class:`.VerifiedHTTPSConnection` uses one of ``assert_fingerprint``, + ``assert_hostname`` and ``host`` in this order to verify connections. + If ``assert_hostname`` is False, no verification is done. + + The ``key_file``, ``cert_file``, ``cert_reqs``, ``ca_certs``, + ``ca_cert_dir``, and ``ssl_version`` are only used if :mod:`ssl` is + available and are fed into :meth:`urllib3.util.ssl_wrap_socket` to upgrade + the connection socket into an SSL socket. + """ + + scheme = 'https' + ConnectionCls = HTTPSConnection + + def __init__(self, host, port=None, + strict=False, timeout=Timeout.DEFAULT_TIMEOUT, maxsize=1, + block=False, headers=None, retries=None, + _proxy=None, _proxy_headers=None, + key_file=None, cert_file=None, cert_reqs=None, + ca_certs=None, ssl_version=None, + assert_hostname=None, assert_fingerprint=None, + ca_cert_dir=None, **conn_kw): + + HTTPConnectionPool.__init__(self, host, port, strict, timeout, maxsize, + block, headers, retries, _proxy, _proxy_headers, + **conn_kw) + + if ca_certs and cert_reqs is None: + cert_reqs = 'CERT_REQUIRED' + + self.key_file = key_file + self.cert_file = cert_file + self.cert_reqs = cert_reqs + self.ca_certs = ca_certs + self.ca_cert_dir = ca_cert_dir + self.ssl_version = ssl_version + self.assert_hostname = assert_hostname + self.assert_fingerprint = assert_fingerprint + + def _prepare_conn(self, conn): + """ + Prepare the ``connection`` for :meth:`urllib3.util.ssl_wrap_socket` + and establish the tunnel if proxy is used. + """ + + if isinstance(conn, VerifiedHTTPSConnection): + conn.set_cert(key_file=self.key_file, + cert_file=self.cert_file, + cert_reqs=self.cert_reqs, + ca_certs=self.ca_certs, + ca_cert_dir=self.ca_cert_dir, + assert_hostname=self.assert_hostname, + assert_fingerprint=self.assert_fingerprint) + conn.ssl_version = self.ssl_version + return conn + + def _prepare_proxy(self, conn): + """ + Establish tunnel connection early, because otherwise httplib + would improperly set Host: header to proxy's IP:port. + """ + conn.set_tunnel(self._proxy_host, self.port, self.proxy_headers) + conn.connect() + + def _new_conn(self): + """ + Return a fresh :class:`httplib.HTTPSConnection`. + """ + self.num_connections += 1 + log.debug("Starting new HTTPS connection (%d): %s:%s", + self.num_connections, self.host, self.port or "443") + + if not self.ConnectionCls or self.ConnectionCls is DummyConnection: + raise SSLError("Can't connect to HTTPS URL because the SSL " + "module is not available.") + + actual_host = self.host + actual_port = self.port + if self.proxy is not None: + actual_host = self.proxy.host + actual_port = self.proxy.port + + conn = self.ConnectionCls(host=actual_host, port=actual_port, + timeout=self.timeout.connect_timeout, + strict=self.strict, **self.conn_kw) + + return self._prepare_conn(conn) + + def _validate_conn(self, conn): + """ + Called right before a request is made, after the socket is created. + """ + super(HTTPSConnectionPool, self)._validate_conn(conn) + + # Force connect early to allow us to validate the connection. + if not getattr(conn, 'sock', None): # AppEngine might not have `.sock` + conn.connect() + + if not conn.is_verified: + warnings.warn(( + 'Unverified HTTPS request is being made. ' + 'Adding certificate verification is strongly advised. See: ' + 'https://urllib3.readthedocs.io/en/latest/advanced-usage.html' + '#ssl-warnings'), + InsecureRequestWarning) + + +def connection_from_url(url, **kw): + """ + Given a url, return an :class:`.ConnectionPool` instance of its host. + + This is a shortcut for not having to parse out the scheme, host, and port + of the url before creating an :class:`.ConnectionPool` instance. + + :param url: + Absolute URL string that must include the scheme. Port is optional. + + :param \\**kw: + Passes additional parameters to the constructor of the appropriate + :class:`.ConnectionPool`. Useful for specifying things like + timeout, maxsize, headers, etc. + + Example:: + + >>> conn = connection_from_url('http://google.com/') + >>> r = conn.request('GET', '/') + """ + scheme, host, port = get_host(url) + port = port or port_by_scheme.get(scheme, 80) + if scheme == 'https': + return HTTPSConnectionPool(host, port=port, **kw) + else: + return HTTPConnectionPool(host, port=port, **kw) + + +def _ipv6_host(host, scheme): + """ + Process IPv6 address literals + """ + + # httplib doesn't like it when we include brackets in IPv6 addresses + # Specifically, if we include brackets but also pass the port then + # httplib crazily doubles up the square brackets on the Host header. + # Instead, we need to make sure we never pass ``None`` as the port. + # However, for backward compatibility reasons we can't actually + # *assert* that. See http://bugs.python.org/issue28539 + # + # Also if an IPv6 address literal has a zone identifier, the + # percent sign might be URIencoded, convert it back into ASCII + if host.startswith('[') and host.endswith(']'): + host = host.replace('%25', '%').strip('[]') + if scheme in NORMALIZABLE_SCHEMES: + host = host.lower() + return host diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_appengine_environ.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_appengine_environ.py new file mode 100644 index 0000000000000000000000000000000000000000..f3e00942cb9f9d6c6a179b1b06f2df07b7b8463c --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_appengine_environ.py @@ -0,0 +1,30 @@ +""" +This module provides means to detect the App Engine environment. +""" + +import os + + +def is_appengine(): + return (is_local_appengine() or + is_prod_appengine() or + is_prod_appengine_mvms()) + + +def is_appengine_sandbox(): + return is_appengine() and not is_prod_appengine_mvms() + + +def is_local_appengine(): + return ('APPENGINE_RUNTIME' in os.environ and + 'Development/' in os.environ['SERVER_SOFTWARE']) + + +def is_prod_appengine(): + return ('APPENGINE_RUNTIME' in os.environ and + 'Google App Engine/' in os.environ['SERVER_SOFTWARE'] and + not is_prod_appengine_mvms()) + + +def is_prod_appengine_mvms(): + return os.environ.get('GAE_VM', False) == 'true' diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_securetransport/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_securetransport/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_securetransport/bindings.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_securetransport/bindings.py new file mode 100644 index 0000000000000000000000000000000000000000..bcf41c02b2a3570002f0bb48c610109bba248ab8 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_securetransport/bindings.py @@ -0,0 +1,593 @@ +""" +This module uses ctypes to bind a whole bunch of functions and constants from +SecureTransport. The goal here is to provide the low-level API to +SecureTransport. These are essentially the C-level functions and constants, and +they're pretty gross to work with. + +This code is a bastardised version of the code found in Will Bond's oscrypto +library. An enormous debt is owed to him for blazing this trail for us. For +that reason, this code should be considered to be covered both by urllib3's +license and by oscrypto's: + + Copyright (c) 2015-2016 Will Bond + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +""" +from __future__ import absolute_import + +import platform +from ctypes.util import find_library +from ctypes import ( + c_void_p, c_int32, c_char_p, c_size_t, c_byte, c_uint32, c_ulong, c_long, + c_bool +) +from ctypes import CDLL, POINTER, CFUNCTYPE + + +security_path = find_library('Security') +if not security_path: + raise ImportError('The library Security could not be found') + + +core_foundation_path = find_library('CoreFoundation') +if not core_foundation_path: + raise ImportError('The library CoreFoundation could not be found') + + +version = platform.mac_ver()[0] +version_info = tuple(map(int, version.split('.'))) +if version_info < (10, 8): + raise OSError( + 'Only OS X 10.8 and newer are supported, not %s.%s' % ( + version_info[0], version_info[1] + ) + ) + +Security = CDLL(security_path, use_errno=True) +CoreFoundation = CDLL(core_foundation_path, use_errno=True) + +Boolean = c_bool +CFIndex = c_long +CFStringEncoding = c_uint32 +CFData = c_void_p +CFString = c_void_p +CFArray = c_void_p +CFMutableArray = c_void_p +CFDictionary = c_void_p +CFError = c_void_p +CFType = c_void_p +CFTypeID = c_ulong + +CFTypeRef = POINTER(CFType) +CFAllocatorRef = c_void_p + +OSStatus = c_int32 + +CFDataRef = POINTER(CFData) +CFStringRef = POINTER(CFString) +CFArrayRef = POINTER(CFArray) +CFMutableArrayRef = POINTER(CFMutableArray) +CFDictionaryRef = POINTER(CFDictionary) +CFArrayCallBacks = c_void_p +CFDictionaryKeyCallBacks = c_void_p +CFDictionaryValueCallBacks = c_void_p + +SecCertificateRef = POINTER(c_void_p) +SecExternalFormat = c_uint32 +SecExternalItemType = c_uint32 +SecIdentityRef = POINTER(c_void_p) +SecItemImportExportFlags = c_uint32 +SecItemImportExportKeyParameters = c_void_p +SecKeychainRef = POINTER(c_void_p) +SSLProtocol = c_uint32 +SSLCipherSuite = c_uint32 +SSLContextRef = POINTER(c_void_p) +SecTrustRef = POINTER(c_void_p) +SSLConnectionRef = c_uint32 +SecTrustResultType = c_uint32 +SecTrustOptionFlags = c_uint32 +SSLProtocolSide = c_uint32 +SSLConnectionType = c_uint32 +SSLSessionOption = c_uint32 + + +try: + Security.SecItemImport.argtypes = [ + CFDataRef, + CFStringRef, + POINTER(SecExternalFormat), + POINTER(SecExternalItemType), + SecItemImportExportFlags, + POINTER(SecItemImportExportKeyParameters), + SecKeychainRef, + POINTER(CFArrayRef), + ] + Security.SecItemImport.restype = OSStatus + + Security.SecCertificateGetTypeID.argtypes = [] + Security.SecCertificateGetTypeID.restype = CFTypeID + + Security.SecIdentityGetTypeID.argtypes = [] + Security.SecIdentityGetTypeID.restype = CFTypeID + + Security.SecKeyGetTypeID.argtypes = [] + Security.SecKeyGetTypeID.restype = CFTypeID + + Security.SecCertificateCreateWithData.argtypes = [ + CFAllocatorRef, + CFDataRef + ] + Security.SecCertificateCreateWithData.restype = SecCertificateRef + + Security.SecCertificateCopyData.argtypes = [ + SecCertificateRef + ] + Security.SecCertificateCopyData.restype = CFDataRef + + Security.SecCopyErrorMessageString.argtypes = [ + OSStatus, + c_void_p + ] + Security.SecCopyErrorMessageString.restype = CFStringRef + + Security.SecIdentityCreateWithCertificate.argtypes = [ + CFTypeRef, + SecCertificateRef, + POINTER(SecIdentityRef) + ] + Security.SecIdentityCreateWithCertificate.restype = OSStatus + + Security.SecKeychainCreate.argtypes = [ + c_char_p, + c_uint32, + c_void_p, + Boolean, + c_void_p, + POINTER(SecKeychainRef) + ] + Security.SecKeychainCreate.restype = OSStatus + + Security.SecKeychainDelete.argtypes = [ + SecKeychainRef + ] + Security.SecKeychainDelete.restype = OSStatus + + Security.SecPKCS12Import.argtypes = [ + CFDataRef, + CFDictionaryRef, + POINTER(CFArrayRef) + ] + Security.SecPKCS12Import.restype = OSStatus + + SSLReadFunc = CFUNCTYPE(OSStatus, SSLConnectionRef, c_void_p, POINTER(c_size_t)) + SSLWriteFunc = CFUNCTYPE(OSStatus, SSLConnectionRef, POINTER(c_byte), POINTER(c_size_t)) + + Security.SSLSetIOFuncs.argtypes = [ + SSLContextRef, + SSLReadFunc, + SSLWriteFunc + ] + Security.SSLSetIOFuncs.restype = OSStatus + + Security.SSLSetPeerID.argtypes = [ + SSLContextRef, + c_char_p, + c_size_t + ] + Security.SSLSetPeerID.restype = OSStatus + + Security.SSLSetCertificate.argtypes = [ + SSLContextRef, + CFArrayRef + ] + Security.SSLSetCertificate.restype = OSStatus + + Security.SSLSetCertificateAuthorities.argtypes = [ + SSLContextRef, + CFTypeRef, + Boolean + ] + Security.SSLSetCertificateAuthorities.restype = OSStatus + + Security.SSLSetConnection.argtypes = [ + SSLContextRef, + SSLConnectionRef + ] + Security.SSLSetConnection.restype = OSStatus + + Security.SSLSetPeerDomainName.argtypes = [ + SSLContextRef, + c_char_p, + c_size_t + ] + Security.SSLSetPeerDomainName.restype = OSStatus + + Security.SSLHandshake.argtypes = [ + SSLContextRef + ] + Security.SSLHandshake.restype = OSStatus + + Security.SSLRead.argtypes = [ + SSLContextRef, + c_char_p, + c_size_t, + POINTER(c_size_t) + ] + Security.SSLRead.restype = OSStatus + + Security.SSLWrite.argtypes = [ + SSLContextRef, + c_char_p, + c_size_t, + POINTER(c_size_t) + ] + Security.SSLWrite.restype = OSStatus + + Security.SSLClose.argtypes = [ + SSLContextRef + ] + Security.SSLClose.restype = OSStatus + + Security.SSLGetNumberSupportedCiphers.argtypes = [ + SSLContextRef, + POINTER(c_size_t) + ] + Security.SSLGetNumberSupportedCiphers.restype = OSStatus + + Security.SSLGetSupportedCiphers.argtypes = [ + SSLContextRef, + POINTER(SSLCipherSuite), + POINTER(c_size_t) + ] + Security.SSLGetSupportedCiphers.restype = OSStatus + + Security.SSLSetEnabledCiphers.argtypes = [ + SSLContextRef, + POINTER(SSLCipherSuite), + c_size_t + ] + Security.SSLSetEnabledCiphers.restype = OSStatus + + Security.SSLGetNumberEnabledCiphers.argtype = [ + SSLContextRef, + POINTER(c_size_t) + ] + Security.SSLGetNumberEnabledCiphers.restype = OSStatus + + Security.SSLGetEnabledCiphers.argtypes = [ + SSLContextRef, + POINTER(SSLCipherSuite), + POINTER(c_size_t) + ] + Security.SSLGetEnabledCiphers.restype = OSStatus + + Security.SSLGetNegotiatedCipher.argtypes = [ + SSLContextRef, + POINTER(SSLCipherSuite) + ] + Security.SSLGetNegotiatedCipher.restype = OSStatus + + Security.SSLGetNegotiatedProtocolVersion.argtypes = [ + SSLContextRef, + POINTER(SSLProtocol) + ] + Security.SSLGetNegotiatedProtocolVersion.restype = OSStatus + + Security.SSLCopyPeerTrust.argtypes = [ + SSLContextRef, + POINTER(SecTrustRef) + ] + Security.SSLCopyPeerTrust.restype = OSStatus + + Security.SecTrustSetAnchorCertificates.argtypes = [ + SecTrustRef, + CFArrayRef + ] + Security.SecTrustSetAnchorCertificates.restype = OSStatus + + Security.SecTrustSetAnchorCertificatesOnly.argstypes = [ + SecTrustRef, + Boolean + ] + Security.SecTrustSetAnchorCertificatesOnly.restype = OSStatus + + Security.SecTrustEvaluate.argtypes = [ + SecTrustRef, + POINTER(SecTrustResultType) + ] + Security.SecTrustEvaluate.restype = OSStatus + + Security.SecTrustGetCertificateCount.argtypes = [ + SecTrustRef + ] + Security.SecTrustGetCertificateCount.restype = CFIndex + + Security.SecTrustGetCertificateAtIndex.argtypes = [ + SecTrustRef, + CFIndex + ] + Security.SecTrustGetCertificateAtIndex.restype = SecCertificateRef + + Security.SSLCreateContext.argtypes = [ + CFAllocatorRef, + SSLProtocolSide, + SSLConnectionType + ] + Security.SSLCreateContext.restype = SSLContextRef + + Security.SSLSetSessionOption.argtypes = [ + SSLContextRef, + SSLSessionOption, + Boolean + ] + Security.SSLSetSessionOption.restype = OSStatus + + Security.SSLSetProtocolVersionMin.argtypes = [ + SSLContextRef, + SSLProtocol + ] + Security.SSLSetProtocolVersionMin.restype = OSStatus + + Security.SSLSetProtocolVersionMax.argtypes = [ + SSLContextRef, + SSLProtocol + ] + Security.SSLSetProtocolVersionMax.restype = OSStatus + + Security.SecCopyErrorMessageString.argtypes = [ + OSStatus, + c_void_p + ] + Security.SecCopyErrorMessageString.restype = CFStringRef + + Security.SSLReadFunc = SSLReadFunc + Security.SSLWriteFunc = SSLWriteFunc + Security.SSLContextRef = SSLContextRef + Security.SSLProtocol = SSLProtocol + Security.SSLCipherSuite = SSLCipherSuite + Security.SecIdentityRef = SecIdentityRef + Security.SecKeychainRef = SecKeychainRef + Security.SecTrustRef = SecTrustRef + Security.SecTrustResultType = SecTrustResultType + Security.SecExternalFormat = SecExternalFormat + Security.OSStatus = OSStatus + + Security.kSecImportExportPassphrase = CFStringRef.in_dll( + Security, 'kSecImportExportPassphrase' + ) + Security.kSecImportItemIdentity = CFStringRef.in_dll( + Security, 'kSecImportItemIdentity' + ) + + # CoreFoundation time! + CoreFoundation.CFRetain.argtypes = [ + CFTypeRef + ] + CoreFoundation.CFRetain.restype = CFTypeRef + + CoreFoundation.CFRelease.argtypes = [ + CFTypeRef + ] + CoreFoundation.CFRelease.restype = None + + CoreFoundation.CFGetTypeID.argtypes = [ + CFTypeRef + ] + CoreFoundation.CFGetTypeID.restype = CFTypeID + + CoreFoundation.CFStringCreateWithCString.argtypes = [ + CFAllocatorRef, + c_char_p, + CFStringEncoding + ] + CoreFoundation.CFStringCreateWithCString.restype = CFStringRef + + CoreFoundation.CFStringGetCStringPtr.argtypes = [ + CFStringRef, + CFStringEncoding + ] + CoreFoundation.CFStringGetCStringPtr.restype = c_char_p + + CoreFoundation.CFStringGetCString.argtypes = [ + CFStringRef, + c_char_p, + CFIndex, + CFStringEncoding + ] + CoreFoundation.CFStringGetCString.restype = c_bool + + CoreFoundation.CFDataCreate.argtypes = [ + CFAllocatorRef, + c_char_p, + CFIndex + ] + CoreFoundation.CFDataCreate.restype = CFDataRef + + CoreFoundation.CFDataGetLength.argtypes = [ + CFDataRef + ] + CoreFoundation.CFDataGetLength.restype = CFIndex + + CoreFoundation.CFDataGetBytePtr.argtypes = [ + CFDataRef + ] + CoreFoundation.CFDataGetBytePtr.restype = c_void_p + + CoreFoundation.CFDictionaryCreate.argtypes = [ + CFAllocatorRef, + POINTER(CFTypeRef), + POINTER(CFTypeRef), + CFIndex, + CFDictionaryKeyCallBacks, + CFDictionaryValueCallBacks + ] + CoreFoundation.CFDictionaryCreate.restype = CFDictionaryRef + + CoreFoundation.CFDictionaryGetValue.argtypes = [ + CFDictionaryRef, + CFTypeRef + ] + CoreFoundation.CFDictionaryGetValue.restype = CFTypeRef + + CoreFoundation.CFArrayCreate.argtypes = [ + CFAllocatorRef, + POINTER(CFTypeRef), + CFIndex, + CFArrayCallBacks, + ] + CoreFoundation.CFArrayCreate.restype = CFArrayRef + + CoreFoundation.CFArrayCreateMutable.argtypes = [ + CFAllocatorRef, + CFIndex, + CFArrayCallBacks + ] + CoreFoundation.CFArrayCreateMutable.restype = CFMutableArrayRef + + CoreFoundation.CFArrayAppendValue.argtypes = [ + CFMutableArrayRef, + c_void_p + ] + CoreFoundation.CFArrayAppendValue.restype = None + + CoreFoundation.CFArrayGetCount.argtypes = [ + CFArrayRef + ] + CoreFoundation.CFArrayGetCount.restype = CFIndex + + CoreFoundation.CFArrayGetValueAtIndex.argtypes = [ + CFArrayRef, + CFIndex + ] + CoreFoundation.CFArrayGetValueAtIndex.restype = c_void_p + + CoreFoundation.kCFAllocatorDefault = CFAllocatorRef.in_dll( + CoreFoundation, 'kCFAllocatorDefault' + ) + CoreFoundation.kCFTypeArrayCallBacks = c_void_p.in_dll(CoreFoundation, 'kCFTypeArrayCallBacks') + CoreFoundation.kCFTypeDictionaryKeyCallBacks = c_void_p.in_dll( + CoreFoundation, 'kCFTypeDictionaryKeyCallBacks' + ) + CoreFoundation.kCFTypeDictionaryValueCallBacks = c_void_p.in_dll( + CoreFoundation, 'kCFTypeDictionaryValueCallBacks' + ) + + CoreFoundation.CFTypeRef = CFTypeRef + CoreFoundation.CFArrayRef = CFArrayRef + CoreFoundation.CFStringRef = CFStringRef + CoreFoundation.CFDictionaryRef = CFDictionaryRef + +except (AttributeError): + raise ImportError('Error initializing ctypes') + + +class CFConst(object): + """ + A class object that acts as essentially a namespace for CoreFoundation + constants. + """ + kCFStringEncodingUTF8 = CFStringEncoding(0x08000100) + + +class SecurityConst(object): + """ + A class object that acts as essentially a namespace for Security constants. + """ + kSSLSessionOptionBreakOnServerAuth = 0 + + kSSLProtocol2 = 1 + kSSLProtocol3 = 2 + kTLSProtocol1 = 4 + kTLSProtocol11 = 7 + kTLSProtocol12 = 8 + + kSSLClientSide = 1 + kSSLStreamType = 0 + + kSecFormatPEMSequence = 10 + + kSecTrustResultInvalid = 0 + kSecTrustResultProceed = 1 + # This gap is present on purpose: this was kSecTrustResultConfirm, which + # is deprecated. + kSecTrustResultDeny = 3 + kSecTrustResultUnspecified = 4 + kSecTrustResultRecoverableTrustFailure = 5 + kSecTrustResultFatalTrustFailure = 6 + kSecTrustResultOtherError = 7 + + errSSLProtocol = -9800 + errSSLWouldBlock = -9803 + errSSLClosedGraceful = -9805 + errSSLClosedNoNotify = -9816 + errSSLClosedAbort = -9806 + + errSSLXCertChainInvalid = -9807 + errSSLCrypto = -9809 + errSSLInternal = -9810 + errSSLCertExpired = -9814 + errSSLCertNotYetValid = -9815 + errSSLUnknownRootCert = -9812 + errSSLNoRootCert = -9813 + errSSLHostNameMismatch = -9843 + errSSLPeerHandshakeFail = -9824 + errSSLPeerUserCancelled = -9839 + errSSLWeakPeerEphemeralDHKey = -9850 + errSSLServerAuthCompleted = -9841 + errSSLRecordOverflow = -9847 + + errSecVerifyFailed = -67808 + errSecNoTrustSettings = -25263 + errSecItemNotFound = -25300 + errSecInvalidTrustSettings = -25262 + + # Cipher suites. We only pick the ones our default cipher string allows. + TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02C + TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 0xC030 + TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02B + TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 0xC02F + TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 = 0x00A3 + TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 0x009F + TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 = 0x00A2 + TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 0x009E + TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC024 + TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = 0xC028 + TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 0xC00A + TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014 + TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x006B + TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 0x006A + TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x0039 + TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x0038 + TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC023 + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 0xC027 + TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 0xC009 + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = 0xC013 + TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x0067 + TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 0x0040 + TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x0033 + TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x0032 + TLS_RSA_WITH_AES_256_GCM_SHA384 = 0x009D + TLS_RSA_WITH_AES_128_GCM_SHA256 = 0x009C + TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x003D + TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x003C + TLS_RSA_WITH_AES_256_CBC_SHA = 0x0035 + TLS_RSA_WITH_AES_128_CBC_SHA = 0x002F + TLS_AES_128_GCM_SHA256 = 0x1301 + TLS_AES_256_GCM_SHA384 = 0x1302 + TLS_CHACHA20_POLY1305_SHA256 = 0x1303 diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_securetransport/low_level.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_securetransport/low_level.py new file mode 100644 index 0000000000000000000000000000000000000000..b13cd9e72c66abdc4a3bb47ab422495e9bba82fb --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/_securetransport/low_level.py @@ -0,0 +1,346 @@ +""" +Low-level helpers for the SecureTransport bindings. + +These are Python functions that are not directly related to the high-level APIs +but are necessary to get them to work. They include a whole bunch of low-level +CoreFoundation messing about and memory management. The concerns in this module +are almost entirely about trying to avoid memory leaks and providing +appropriate and useful assistance to the higher-level code. +""" +import base64 +import ctypes +import itertools +import re +import os +import ssl +import tempfile + +from .bindings import Security, CoreFoundation, CFConst + + +# This regular expression is used to grab PEM data out of a PEM bundle. +_PEM_CERTS_RE = re.compile( + b"-----BEGIN CERTIFICATE-----\n(.*?)\n-----END CERTIFICATE-----", re.DOTALL +) + + +def _cf_data_from_bytes(bytestring): + """ + Given a bytestring, create a CFData object from it. This CFData object must + be CFReleased by the caller. + """ + return CoreFoundation.CFDataCreate( + CoreFoundation.kCFAllocatorDefault, bytestring, len(bytestring) + ) + + +def _cf_dictionary_from_tuples(tuples): + """ + Given a list of Python tuples, create an associated CFDictionary. + """ + dictionary_size = len(tuples) + + # We need to get the dictionary keys and values out in the same order. + keys = (t[0] for t in tuples) + values = (t[1] for t in tuples) + cf_keys = (CoreFoundation.CFTypeRef * dictionary_size)(*keys) + cf_values = (CoreFoundation.CFTypeRef * dictionary_size)(*values) + + return CoreFoundation.CFDictionaryCreate( + CoreFoundation.kCFAllocatorDefault, + cf_keys, + cf_values, + dictionary_size, + CoreFoundation.kCFTypeDictionaryKeyCallBacks, + CoreFoundation.kCFTypeDictionaryValueCallBacks, + ) + + +def _cf_string_to_unicode(value): + """ + Creates a Unicode string from a CFString object. Used entirely for error + reporting. + + Yes, it annoys me quite a lot that this function is this complex. + """ + value_as_void_p = ctypes.cast(value, ctypes.POINTER(ctypes.c_void_p)) + + string = CoreFoundation.CFStringGetCStringPtr( + value_as_void_p, + CFConst.kCFStringEncodingUTF8 + ) + if string is None: + buffer = ctypes.create_string_buffer(1024) + result = CoreFoundation.CFStringGetCString( + value_as_void_p, + buffer, + 1024, + CFConst.kCFStringEncodingUTF8 + ) + if not result: + raise OSError('Error copying C string from CFStringRef') + string = buffer.value + if string is not None: + string = string.decode('utf-8') + return string + + +def _assert_no_error(error, exception_class=None): + """ + Checks the return code and throws an exception if there is an error to + report + """ + if error == 0: + return + + cf_error_string = Security.SecCopyErrorMessageString(error, None) + output = _cf_string_to_unicode(cf_error_string) + CoreFoundation.CFRelease(cf_error_string) + + if output is None or output == u'': + output = u'OSStatus %s' % error + + if exception_class is None: + exception_class = ssl.SSLError + + raise exception_class(output) + + +def _cert_array_from_pem(pem_bundle): + """ + Given a bundle of certs in PEM format, turns them into a CFArray of certs + that can be used to validate a cert chain. + """ + # Normalize the PEM bundle's line endings. + pem_bundle = pem_bundle.replace(b"\r\n", b"\n") + + der_certs = [ + base64.b64decode(match.group(1)) + for match in _PEM_CERTS_RE.finditer(pem_bundle) + ] + if not der_certs: + raise ssl.SSLError("No root certificates specified") + + cert_array = CoreFoundation.CFArrayCreateMutable( + CoreFoundation.kCFAllocatorDefault, + 0, + ctypes.byref(CoreFoundation.kCFTypeArrayCallBacks) + ) + if not cert_array: + raise ssl.SSLError("Unable to allocate memory!") + + try: + for der_bytes in der_certs: + certdata = _cf_data_from_bytes(der_bytes) + if not certdata: + raise ssl.SSLError("Unable to allocate memory!") + cert = Security.SecCertificateCreateWithData( + CoreFoundation.kCFAllocatorDefault, certdata + ) + CoreFoundation.CFRelease(certdata) + if not cert: + raise ssl.SSLError("Unable to build cert object!") + + CoreFoundation.CFArrayAppendValue(cert_array, cert) + CoreFoundation.CFRelease(cert) + except Exception: + # We need to free the array before the exception bubbles further. + # We only want to do that if an error occurs: otherwise, the caller + # should free. + CoreFoundation.CFRelease(cert_array) + + return cert_array + + +def _is_cert(item): + """ + Returns True if a given CFTypeRef is a certificate. + """ + expected = Security.SecCertificateGetTypeID() + return CoreFoundation.CFGetTypeID(item) == expected + + +def _is_identity(item): + """ + Returns True if a given CFTypeRef is an identity. + """ + expected = Security.SecIdentityGetTypeID() + return CoreFoundation.CFGetTypeID(item) == expected + + +def _temporary_keychain(): + """ + This function creates a temporary Mac keychain that we can use to work with + credentials. This keychain uses a one-time password and a temporary file to + store the data. We expect to have one keychain per socket. The returned + SecKeychainRef must be freed by the caller, including calling + SecKeychainDelete. + + Returns a tuple of the SecKeychainRef and the path to the temporary + directory that contains it. + """ + # Unfortunately, SecKeychainCreate requires a path to a keychain. This + # means we cannot use mkstemp to use a generic temporary file. Instead, + # we're going to create a temporary directory and a filename to use there. + # This filename will be 8 random bytes expanded into base64. We also need + # some random bytes to password-protect the keychain we're creating, so we + # ask for 40 random bytes. + random_bytes = os.urandom(40) + filename = base64.b16encode(random_bytes[:8]).decode('utf-8') + password = base64.b16encode(random_bytes[8:]) # Must be valid UTF-8 + tempdirectory = tempfile.mkdtemp() + + keychain_path = os.path.join(tempdirectory, filename).encode('utf-8') + + # We now want to create the keychain itself. + keychain = Security.SecKeychainRef() + status = Security.SecKeychainCreate( + keychain_path, + len(password), + password, + False, + None, + ctypes.byref(keychain) + ) + _assert_no_error(status) + + # Having created the keychain, we want to pass it off to the caller. + return keychain, tempdirectory + + +def _load_items_from_file(keychain, path): + """ + Given a single file, loads all the trust objects from it into arrays and + the keychain. + Returns a tuple of lists: the first list is a list of identities, the + second a list of certs. + """ + certificates = [] + identities = [] + result_array = None + + with open(path, 'rb') as f: + raw_filedata = f.read() + + try: + filedata = CoreFoundation.CFDataCreate( + CoreFoundation.kCFAllocatorDefault, + raw_filedata, + len(raw_filedata) + ) + result_array = CoreFoundation.CFArrayRef() + result = Security.SecItemImport( + filedata, # cert data + None, # Filename, leaving it out for now + None, # What the type of the file is, we don't care + None, # what's in the file, we don't care + 0, # import flags + None, # key params, can include passphrase in the future + keychain, # The keychain to insert into + ctypes.byref(result_array) # Results + ) + _assert_no_error(result) + + # A CFArray is not very useful to us as an intermediary + # representation, so we are going to extract the objects we want + # and then free the array. We don't need to keep hold of keys: the + # keychain already has them! + result_count = CoreFoundation.CFArrayGetCount(result_array) + for index in range(result_count): + item = CoreFoundation.CFArrayGetValueAtIndex( + result_array, index + ) + item = ctypes.cast(item, CoreFoundation.CFTypeRef) + + if _is_cert(item): + CoreFoundation.CFRetain(item) + certificates.append(item) + elif _is_identity(item): + CoreFoundation.CFRetain(item) + identities.append(item) + finally: + if result_array: + CoreFoundation.CFRelease(result_array) + + CoreFoundation.CFRelease(filedata) + + return (identities, certificates) + + +def _load_client_cert_chain(keychain, *paths): + """ + Load certificates and maybe keys from a number of files. Has the end goal + of returning a CFArray containing one SecIdentityRef, and then zero or more + SecCertificateRef objects, suitable for use as a client certificate trust + chain. + """ + # Ok, the strategy. + # + # This relies on knowing that macOS will not give you a SecIdentityRef + # unless you have imported a key into a keychain. This is a somewhat + # artificial limitation of macOS (for example, it doesn't necessarily + # affect iOS), but there is nothing inside Security.framework that lets you + # get a SecIdentityRef without having a key in a keychain. + # + # So the policy here is we take all the files and iterate them in order. + # Each one will use SecItemImport to have one or more objects loaded from + # it. We will also point at a keychain that macOS can use to work with the + # private key. + # + # Once we have all the objects, we'll check what we actually have. If we + # already have a SecIdentityRef in hand, fab: we'll use that. Otherwise, + # we'll take the first certificate (which we assume to be our leaf) and + # ask the keychain to give us a SecIdentityRef with that cert's associated + # key. + # + # We'll then return a CFArray containing the trust chain: one + # SecIdentityRef and then zero-or-more SecCertificateRef objects. The + # responsibility for freeing this CFArray will be with the caller. This + # CFArray must remain alive for the entire connection, so in practice it + # will be stored with a single SSLSocket, along with the reference to the + # keychain. + certificates = [] + identities = [] + + # Filter out bad paths. + paths = (path for path in paths if path) + + try: + for file_path in paths: + new_identities, new_certs = _load_items_from_file( + keychain, file_path + ) + identities.extend(new_identities) + certificates.extend(new_certs) + + # Ok, we have everything. The question is: do we have an identity? If + # not, we want to grab one from the first cert we have. + if not identities: + new_identity = Security.SecIdentityRef() + status = Security.SecIdentityCreateWithCertificate( + keychain, + certificates[0], + ctypes.byref(new_identity) + ) + _assert_no_error(status) + identities.append(new_identity) + + # We now want to release the original certificate, as we no longer + # need it. + CoreFoundation.CFRelease(certificates.pop(0)) + + # We now need to build a new CFArray that holds the trust chain. + trust_chain = CoreFoundation.CFArrayCreateMutable( + CoreFoundation.kCFAllocatorDefault, + 0, + ctypes.byref(CoreFoundation.kCFTypeArrayCallBacks), + ) + for item in itertools.chain(identities, certificates): + # ArrayAppendValue does a CFRetain on the item. That's fine, + # because the finally block will release our other refs to them. + CoreFoundation.CFArrayAppendValue(trust_chain, item) + + return trust_chain + finally: + for obj in itertools.chain(identities, certificates): + CoreFoundation.CFRelease(obj) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/appengine.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/appengine.py new file mode 100644 index 0000000000000000000000000000000000000000..2952f114df3a1610e35d81154a50542f6828d31b --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/appengine.py @@ -0,0 +1,289 @@ +""" +This module provides a pool manager that uses Google App Engine's +`URLFetch Service `_. + +Example usage:: + + from urllib3 import PoolManager + from urllib3.contrib.appengine import AppEngineManager, is_appengine_sandbox + + if is_appengine_sandbox(): + # AppEngineManager uses AppEngine's URLFetch API behind the scenes + http = AppEngineManager() + else: + # PoolManager uses a socket-level API behind the scenes + http = PoolManager() + + r = http.request('GET', 'https://google.com/') + +There are `limitations `_ to the URLFetch service and it may not be +the best choice for your application. There are three options for using +urllib3 on Google App Engine: + +1. You can use :class:`AppEngineManager` with URLFetch. URLFetch is + cost-effective in many circumstances as long as your usage is within the + limitations. +2. You can use a normal :class:`~urllib3.PoolManager` by enabling sockets. + Sockets also have `limitations and restrictions + `_ and have a lower free quota than URLFetch. + To use sockets, be sure to specify the following in your ``app.yaml``:: + + env_variables: + GAE_USE_SOCKETS_HTTPLIB : 'true' + +3. If you are using `App Engine Flexible +`_, you can use the standard +:class:`PoolManager` without any configuration or special environment variables. +""" + +from __future__ import absolute_import +import io +import logging +import warnings +from ..packages.six.moves.urllib.parse import urljoin + +from ..exceptions import ( + HTTPError, + HTTPWarning, + MaxRetryError, + ProtocolError, + TimeoutError, + SSLError +) + +from ..request import RequestMethods +from ..response import HTTPResponse +from ..util.timeout import Timeout +from ..util.retry import Retry +from . import _appengine_environ + +try: + from google.appengine.api import urlfetch +except ImportError: + urlfetch = None + + +log = logging.getLogger(__name__) + + +class AppEnginePlatformWarning(HTTPWarning): + pass + + +class AppEnginePlatformError(HTTPError): + pass + + +class AppEngineManager(RequestMethods): + """ + Connection manager for Google App Engine sandbox applications. + + This manager uses the URLFetch service directly instead of using the + emulated httplib, and is subject to URLFetch limitations as described in + the App Engine documentation `here + `_. + + Notably it will raise an :class:`AppEnginePlatformError` if: + * URLFetch is not available. + * If you attempt to use this on App Engine Flexible, as full socket + support is available. + * If a request size is more than 10 megabytes. + * If a response size is more than 32 megabtyes. + * If you use an unsupported request method such as OPTIONS. + + Beyond those cases, it will raise normal urllib3 errors. + """ + + def __init__(self, headers=None, retries=None, validate_certificate=True, + urlfetch_retries=True): + if not urlfetch: + raise AppEnginePlatformError( + "URLFetch is not available in this environment.") + + if is_prod_appengine_mvms(): + raise AppEnginePlatformError( + "Use normal urllib3.PoolManager instead of AppEngineManager" + "on Managed VMs, as using URLFetch is not necessary in " + "this environment.") + + warnings.warn( + "urllib3 is using URLFetch on Google App Engine sandbox instead " + "of sockets. To use sockets directly instead of URLFetch see " + "https://urllib3.readthedocs.io/en/latest/reference/urllib3.contrib.html.", + AppEnginePlatformWarning) + + RequestMethods.__init__(self, headers) + self.validate_certificate = validate_certificate + self.urlfetch_retries = urlfetch_retries + + self.retries = retries or Retry.DEFAULT + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + # Return False to re-raise any potential exceptions + return False + + def urlopen(self, method, url, body=None, headers=None, + retries=None, redirect=True, timeout=Timeout.DEFAULT_TIMEOUT, + **response_kw): + + retries = self._get_retries(retries, redirect) + + try: + follow_redirects = ( + redirect and + retries.redirect != 0 and + retries.total) + response = urlfetch.fetch( + url, + payload=body, + method=method, + headers=headers or {}, + allow_truncated=False, + follow_redirects=self.urlfetch_retries and follow_redirects, + deadline=self._get_absolute_timeout(timeout), + validate_certificate=self.validate_certificate, + ) + except urlfetch.DeadlineExceededError as e: + raise TimeoutError(self, e) + + except urlfetch.InvalidURLError as e: + if 'too large' in str(e): + raise AppEnginePlatformError( + "URLFetch request too large, URLFetch only " + "supports requests up to 10mb in size.", e) + raise ProtocolError(e) + + except urlfetch.DownloadError as e: + if 'Too many redirects' in str(e): + raise MaxRetryError(self, url, reason=e) + raise ProtocolError(e) + + except urlfetch.ResponseTooLargeError as e: + raise AppEnginePlatformError( + "URLFetch response too large, URLFetch only supports" + "responses up to 32mb in size.", e) + + except urlfetch.SSLCertificateError as e: + raise SSLError(e) + + except urlfetch.InvalidMethodError as e: + raise AppEnginePlatformError( + "URLFetch does not support method: %s" % method, e) + + http_response = self._urlfetch_response_to_http_response( + response, retries=retries, **response_kw) + + # Handle redirect? + redirect_location = redirect and http_response.get_redirect_location() + if redirect_location: + # Check for redirect response + if (self.urlfetch_retries and retries.raise_on_redirect): + raise MaxRetryError(self, url, "too many redirects") + else: + if http_response.status == 303: + method = 'GET' + + try: + retries = retries.increment(method, url, response=http_response, _pool=self) + except MaxRetryError: + if retries.raise_on_redirect: + raise MaxRetryError(self, url, "too many redirects") + return http_response + + retries.sleep_for_retry(http_response) + log.debug("Redirecting %s -> %s", url, redirect_location) + redirect_url = urljoin(url, redirect_location) + return self.urlopen( + method, redirect_url, body, headers, + retries=retries, redirect=redirect, + timeout=timeout, **response_kw) + + # Check if we should retry the HTTP response. + has_retry_after = bool(http_response.getheader('Retry-After')) + if retries.is_retry(method, http_response.status, has_retry_after): + retries = retries.increment( + method, url, response=http_response, _pool=self) + log.debug("Retry: %s", url) + retries.sleep(http_response) + return self.urlopen( + method, url, + body=body, headers=headers, + retries=retries, redirect=redirect, + timeout=timeout, **response_kw) + + return http_response + + def _urlfetch_response_to_http_response(self, urlfetch_resp, **response_kw): + + if is_prod_appengine(): + # Production GAE handles deflate encoding automatically, but does + # not remove the encoding header. + content_encoding = urlfetch_resp.headers.get('content-encoding') + + if content_encoding == 'deflate': + del urlfetch_resp.headers['content-encoding'] + + transfer_encoding = urlfetch_resp.headers.get('transfer-encoding') + # We have a full response's content, + # so let's make sure we don't report ourselves as chunked data. + if transfer_encoding == 'chunked': + encodings = transfer_encoding.split(",") + encodings.remove('chunked') + urlfetch_resp.headers['transfer-encoding'] = ','.join(encodings) + + original_response = HTTPResponse( + # In order for decoding to work, we must present the content as + # a file-like object. + body=io.BytesIO(urlfetch_resp.content), + msg=urlfetch_resp.header_msg, + headers=urlfetch_resp.headers, + status=urlfetch_resp.status_code, + **response_kw + ) + + return HTTPResponse( + body=io.BytesIO(urlfetch_resp.content), + headers=urlfetch_resp.headers, + status=urlfetch_resp.status_code, + original_response=original_response, + **response_kw + ) + + def _get_absolute_timeout(self, timeout): + if timeout is Timeout.DEFAULT_TIMEOUT: + return None # Defer to URLFetch's default. + if isinstance(timeout, Timeout): + if timeout._read is not None or timeout._connect is not None: + warnings.warn( + "URLFetch does not support granular timeout settings, " + "reverting to total or default URLFetch timeout.", + AppEnginePlatformWarning) + return timeout.total + return timeout + + def _get_retries(self, retries, redirect): + if not isinstance(retries, Retry): + retries = Retry.from_int( + retries, redirect=redirect, default=self.retries) + + if retries.connect or retries.read or retries.redirect: + warnings.warn( + "URLFetch only supports total retries and does not " + "recognize connect, read, or redirect retry parameters.", + AppEnginePlatformWarning) + + return retries + + +# Alias methods from _appengine_environ to maintain public API interface. + +is_appengine = _appengine_environ.is_appengine +is_appengine_sandbox = _appengine_environ.is_appengine_sandbox +is_local_appengine = _appengine_environ.is_local_appengine +is_prod_appengine = _appengine_environ.is_prod_appengine +is_prod_appengine_mvms = _appengine_environ.is_prod_appengine_mvms diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/ntlmpool.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/ntlmpool.py new file mode 100644 index 0000000000000000000000000000000000000000..8ea127c58338217fdcedb13feab027987d280e44 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/ntlmpool.py @@ -0,0 +1,111 @@ +""" +NTLM authenticating pool, contributed by erikcederstran + +Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 +""" +from __future__ import absolute_import + +from logging import getLogger +from ntlm import ntlm + +from .. import HTTPSConnectionPool +from ..packages.six.moves.http_client import HTTPSConnection + + +log = getLogger(__name__) + + +class NTLMConnectionPool(HTTPSConnectionPool): + """ + Implements an NTLM authentication version of an urllib3 connection pool + """ + + scheme = 'https' + + def __init__(self, user, pw, authurl, *args, **kwargs): + """ + authurl is a random URL on the server that is protected by NTLM. + user is the Windows user, probably in the DOMAIN\\username format. + pw is the password for the user. + """ + super(NTLMConnectionPool, self).__init__(*args, **kwargs) + self.authurl = authurl + self.rawuser = user + user_parts = user.split('\\', 1) + self.domain = user_parts[0].upper() + self.user = user_parts[1] + self.pw = pw + + def _new_conn(self): + # Performs the NTLM handshake that secures the connection. The socket + # must be kept open while requests are performed. + self.num_connections += 1 + log.debug('Starting NTLM HTTPS connection no. %d: https://%s%s', + self.num_connections, self.host, self.authurl) + + headers = {'Connection': 'Keep-Alive'} + req_header = 'Authorization' + resp_header = 'www-authenticate' + + conn = HTTPSConnection(host=self.host, port=self.port) + + # Send negotiation message + headers[req_header] = ( + 'NTLM %s' % ntlm.create_NTLM_NEGOTIATE_MESSAGE(self.rawuser)) + log.debug('Request headers: %s', headers) + conn.request('GET', self.authurl, None, headers) + res = conn.getresponse() + reshdr = dict(res.getheaders()) + log.debug('Response status: %s %s', res.status, res.reason) + log.debug('Response headers: %s', reshdr) + log.debug('Response data: %s [...]', res.read(100)) + + # Remove the reference to the socket, so that it can not be closed by + # the response object (we want to keep the socket open) + res.fp = None + + # Server should respond with a challenge message + auth_header_values = reshdr[resp_header].split(', ') + auth_header_value = None + for s in auth_header_values: + if s[:5] == 'NTLM ': + auth_header_value = s[5:] + if auth_header_value is None: + raise Exception('Unexpected %s response header: %s' % + (resp_header, reshdr[resp_header])) + + # Send authentication message + ServerChallenge, NegotiateFlags = \ + ntlm.parse_NTLM_CHALLENGE_MESSAGE(auth_header_value) + auth_msg = ntlm.create_NTLM_AUTHENTICATE_MESSAGE(ServerChallenge, + self.user, + self.domain, + self.pw, + NegotiateFlags) + headers[req_header] = 'NTLM %s' % auth_msg + log.debug('Request headers: %s', headers) + conn.request('GET', self.authurl, None, headers) + res = conn.getresponse() + log.debug('Response status: %s %s', res.status, res.reason) + log.debug('Response headers: %s', dict(res.getheaders())) + log.debug('Response data: %s [...]', res.read()[:100]) + if res.status != 200: + if res.status == 401: + raise Exception('Server rejected request: wrong ' + 'username or password') + raise Exception('Wrong server response: %s %s' % + (res.status, res.reason)) + + res.fp = None + log.debug('Connection established') + return conn + + def urlopen(self, method, url, body=None, headers=None, retries=3, + redirect=True, assert_same_host=True): + if headers is None: + headers = {} + headers['Connection'] = 'Keep-Alive' + return super(NTLMConnectionPool, self).urlopen(method, url, body, + headers, retries, + redirect, + assert_same_host) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/pyopenssl.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/pyopenssl.py new file mode 100644 index 0000000000000000000000000000000000000000..44f091f71e2d7f3efc74945e21acf312a2893c5c --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/pyopenssl.py @@ -0,0 +1,469 @@ +""" +SSL with SNI_-support for Python 2. Follow these instructions if you would +like to verify SSL certificates in Python 2. Note, the default libraries do +*not* do certificate checking; you need to do additional work to validate +certificates yourself. + +This needs the following packages installed: + +* pyOpenSSL (tested with 16.0.0) +* cryptography (minimum 1.3.4, from pyopenssl) +* idna (minimum 2.0, from cryptography) + +However, pyopenssl depends on cryptography, which depends on idna, so while we +use all three directly here we end up having relatively few packages required. + +You can install them with the following command: + + pip install pyopenssl cryptography idna + +To activate certificate checking, call +:func:`~urllib3.contrib.pyopenssl.inject_into_urllib3` from your Python code +before you begin making HTTP requests. This can be done in a ``sitecustomize`` +module, or at any other time before your application begins using ``urllib3``, +like this:: + + try: + import urllib3.contrib.pyopenssl + urllib3.contrib.pyopenssl.inject_into_urllib3() + except ImportError: + pass + +Now you can use :mod:`urllib3` as you normally would, and it will support SNI +when the required modules are installed. + +Activating this module also has the positive side effect of disabling SSL/TLS +compression in Python 2 (see `CRIME attack`_). + +If you want to configure the default list of supported cipher suites, you can +set the ``urllib3.contrib.pyopenssl.DEFAULT_SSL_CIPHER_LIST`` variable. + +.. _sni: https://en.wikipedia.org/wiki/Server_Name_Indication +.. _crime attack: https://en.wikipedia.org/wiki/CRIME_(security_exploit) +""" +from __future__ import absolute_import + +import OpenSSL.SSL +from cryptography import x509 +from cryptography.hazmat.backends.openssl import backend as openssl_backend +from cryptography.hazmat.backends.openssl.x509 import _Certificate +try: + from cryptography.x509 import UnsupportedExtension +except ImportError: + # UnsupportedExtension is gone in cryptography >= 2.1.0 + class UnsupportedExtension(Exception): + pass + +from socket import timeout, error as SocketError +from io import BytesIO + +try: # Platform-specific: Python 2 + from socket import _fileobject +except ImportError: # Platform-specific: Python 3 + _fileobject = None + from ..packages.backports.makefile import backport_makefile + +import logging +import ssl +from ..packages import six +import sys + +from .. import util + +__all__ = ['inject_into_urllib3', 'extract_from_urllib3'] + +# SNI always works. +HAS_SNI = True + +# Map from urllib3 to PyOpenSSL compatible parameter-values. +_openssl_versions = { + ssl.PROTOCOL_SSLv23: OpenSSL.SSL.SSLv23_METHOD, + ssl.PROTOCOL_TLSv1: OpenSSL.SSL.TLSv1_METHOD, +} + +if hasattr(ssl, 'PROTOCOL_TLSv1_1') and hasattr(OpenSSL.SSL, 'TLSv1_1_METHOD'): + _openssl_versions[ssl.PROTOCOL_TLSv1_1] = OpenSSL.SSL.TLSv1_1_METHOD + +if hasattr(ssl, 'PROTOCOL_TLSv1_2') and hasattr(OpenSSL.SSL, 'TLSv1_2_METHOD'): + _openssl_versions[ssl.PROTOCOL_TLSv1_2] = OpenSSL.SSL.TLSv1_2_METHOD + +try: + _openssl_versions.update({ssl.PROTOCOL_SSLv3: OpenSSL.SSL.SSLv3_METHOD}) +except AttributeError: + pass + +_stdlib_to_openssl_verify = { + ssl.CERT_NONE: OpenSSL.SSL.VERIFY_NONE, + ssl.CERT_OPTIONAL: OpenSSL.SSL.VERIFY_PEER, + ssl.CERT_REQUIRED: + OpenSSL.SSL.VERIFY_PEER + OpenSSL.SSL.VERIFY_FAIL_IF_NO_PEER_CERT, +} +_openssl_to_stdlib_verify = dict( + (v, k) for k, v in _stdlib_to_openssl_verify.items() +) + +# OpenSSL will only write 16K at a time +SSL_WRITE_BLOCKSIZE = 16384 + +orig_util_HAS_SNI = util.HAS_SNI +orig_util_SSLContext = util.ssl_.SSLContext + + +log = logging.getLogger(__name__) + + +def inject_into_urllib3(): + 'Monkey-patch urllib3 with PyOpenSSL-backed SSL-support.' + + _validate_dependencies_met() + + util.ssl_.SSLContext = PyOpenSSLContext + util.HAS_SNI = HAS_SNI + util.ssl_.HAS_SNI = HAS_SNI + util.IS_PYOPENSSL = True + util.ssl_.IS_PYOPENSSL = True + + +def extract_from_urllib3(): + 'Undo monkey-patching by :func:`inject_into_urllib3`.' + + util.ssl_.SSLContext = orig_util_SSLContext + util.HAS_SNI = orig_util_HAS_SNI + util.ssl_.HAS_SNI = orig_util_HAS_SNI + util.IS_PYOPENSSL = False + util.ssl_.IS_PYOPENSSL = False + + +def _validate_dependencies_met(): + """ + Verifies that PyOpenSSL's package-level dependencies have been met. + Throws `ImportError` if they are not met. + """ + # Method added in `cryptography==1.1`; not available in older versions + from cryptography.x509.extensions import Extensions + if getattr(Extensions, "get_extension_for_class", None) is None: + raise ImportError("'cryptography' module missing required functionality. " + "Try upgrading to v1.3.4 or newer.") + + # pyOpenSSL 0.14 and above use cryptography for OpenSSL bindings. The _x509 + # attribute is only present on those versions. + from OpenSSL.crypto import X509 + x509 = X509() + if getattr(x509, "_x509", None) is None: + raise ImportError("'pyOpenSSL' module missing required functionality. " + "Try upgrading to v0.14 or newer.") + + +def _dnsname_to_stdlib(name): + """ + Converts a dNSName SubjectAlternativeName field to the form used by the + standard library on the given Python version. + + Cryptography produces a dNSName as a unicode string that was idna-decoded + from ASCII bytes. We need to idna-encode that string to get it back, and + then on Python 3 we also need to convert to unicode via UTF-8 (the stdlib + uses PyUnicode_FromStringAndSize on it, which decodes via UTF-8). + + If the name cannot be idna-encoded then we return None signalling that + the name given should be skipped. + """ + def idna_encode(name): + """ + Borrowed wholesale from the Python Cryptography Project. It turns out + that we can't just safely call `idna.encode`: it can explode for + wildcard names. This avoids that problem. + """ + import idna + + try: + for prefix in [u'*.', u'.']: + if name.startswith(prefix): + name = name[len(prefix):] + return prefix.encode('ascii') + idna.encode(name) + return idna.encode(name) + except idna.core.IDNAError: + return None + + if ':' in name: + return name + + name = idna_encode(name) + if name is None: + return None + elif sys.version_info >= (3, 0): + name = name.decode('utf-8') + return name + + +def get_subj_alt_name(peer_cert): + """ + Given an PyOpenSSL certificate, provides all the subject alternative names. + """ + # Pass the cert to cryptography, which has much better APIs for this. + if hasattr(peer_cert, "to_cryptography"): + cert = peer_cert.to_cryptography() + else: + # This is technically using private APIs, but should work across all + # relevant versions before PyOpenSSL got a proper API for this. + cert = _Certificate(openssl_backend, peer_cert._x509) + + # We want to find the SAN extension. Ask Cryptography to locate it (it's + # faster than looping in Python) + try: + ext = cert.extensions.get_extension_for_class( + x509.SubjectAlternativeName + ).value + except x509.ExtensionNotFound: + # No such extension, return the empty list. + return [] + except (x509.DuplicateExtension, UnsupportedExtension, + x509.UnsupportedGeneralNameType, UnicodeError) as e: + # A problem has been found with the quality of the certificate. Assume + # no SAN field is present. + log.warning( + "A problem was encountered with the certificate that prevented " + "urllib3 from finding the SubjectAlternativeName field. This can " + "affect certificate validation. The error was %s", + e, + ) + return [] + + # We want to return dNSName and iPAddress fields. We need to cast the IPs + # back to strings because the match_hostname function wants them as + # strings. + # Sadly the DNS names need to be idna encoded and then, on Python 3, UTF-8 + # decoded. This is pretty frustrating, but that's what the standard library + # does with certificates, and so we need to attempt to do the same. + # We also want to skip over names which cannot be idna encoded. + names = [ + ('DNS', name) for name in map(_dnsname_to_stdlib, ext.get_values_for_type(x509.DNSName)) + if name is not None + ] + names.extend( + ('IP Address', str(name)) + for name in ext.get_values_for_type(x509.IPAddress) + ) + + return names + + +class WrappedSocket(object): + '''API-compatibility wrapper for Python OpenSSL's Connection-class. + + Note: _makefile_refs, _drop() and _reuse() are needed for the garbage + collector of pypy. + ''' + + def __init__(self, connection, socket, suppress_ragged_eofs=True): + self.connection = connection + self.socket = socket + self.suppress_ragged_eofs = suppress_ragged_eofs + self._makefile_refs = 0 + self._closed = False + + def fileno(self): + return self.socket.fileno() + + # Copy-pasted from Python 3.5 source code + def _decref_socketios(self): + if self._makefile_refs > 0: + self._makefile_refs -= 1 + if self._closed: + self.close() + + def recv(self, *args, **kwargs): + try: + data = self.connection.recv(*args, **kwargs) + except OpenSSL.SSL.SysCallError as e: + if self.suppress_ragged_eofs and e.args == (-1, 'Unexpected EOF'): + return b'' + else: + raise SocketError(str(e)) + except OpenSSL.SSL.ZeroReturnError: + if self.connection.get_shutdown() == OpenSSL.SSL.RECEIVED_SHUTDOWN: + return b'' + else: + raise + except OpenSSL.SSL.WantReadError: + if not util.wait_for_read(self.socket, self.socket.gettimeout()): + raise timeout('The read operation timed out') + else: + return self.recv(*args, **kwargs) + else: + return data + + def recv_into(self, *args, **kwargs): + try: + return self.connection.recv_into(*args, **kwargs) + except OpenSSL.SSL.SysCallError as e: + if self.suppress_ragged_eofs and e.args == (-1, 'Unexpected EOF'): + return 0 + else: + raise SocketError(str(e)) + except OpenSSL.SSL.ZeroReturnError: + if self.connection.get_shutdown() == OpenSSL.SSL.RECEIVED_SHUTDOWN: + return 0 + else: + raise + except OpenSSL.SSL.WantReadError: + if not util.wait_for_read(self.socket, self.socket.gettimeout()): + raise timeout('The read operation timed out') + else: + return self.recv_into(*args, **kwargs) + + def settimeout(self, timeout): + return self.socket.settimeout(timeout) + + def _send_until_done(self, data): + while True: + try: + return self.connection.send(data) + except OpenSSL.SSL.WantWriteError: + if not util.wait_for_write(self.socket, self.socket.gettimeout()): + raise timeout() + continue + except OpenSSL.SSL.SysCallError as e: + raise SocketError(str(e)) + + def sendall(self, data): + total_sent = 0 + while total_sent < len(data): + sent = self._send_until_done(data[total_sent:total_sent + SSL_WRITE_BLOCKSIZE]) + total_sent += sent + + def shutdown(self): + # FIXME rethrow compatible exceptions should we ever use this + self.connection.shutdown() + + def close(self): + if self._makefile_refs < 1: + try: + self._closed = True + return self.connection.close() + except OpenSSL.SSL.Error: + return + else: + self._makefile_refs -= 1 + + def getpeercert(self, binary_form=False): + x509 = self.connection.get_peer_certificate() + + if not x509: + return x509 + + if binary_form: + return OpenSSL.crypto.dump_certificate( + OpenSSL.crypto.FILETYPE_ASN1, + x509) + + return { + 'subject': ( + (('commonName', x509.get_subject().CN),), + ), + 'subjectAltName': get_subj_alt_name(x509) + } + + def _reuse(self): + self._makefile_refs += 1 + + def _drop(self): + if self._makefile_refs < 1: + self.close() + else: + self._makefile_refs -= 1 + + +if _fileobject: # Platform-specific: Python 2 + def makefile(self, mode, bufsize=-1): + self._makefile_refs += 1 + return _fileobject(self, mode, bufsize, close=True) +else: # Platform-specific: Python 3 + makefile = backport_makefile + +WrappedSocket.makefile = makefile + + +class PyOpenSSLContext(object): + """ + I am a wrapper class for the PyOpenSSL ``Context`` object. I am responsible + for translating the interface of the standard library ``SSLContext`` object + to calls into PyOpenSSL. + """ + def __init__(self, protocol): + self.protocol = _openssl_versions[protocol] + self._ctx = OpenSSL.SSL.Context(self.protocol) + self._options = 0 + self.check_hostname = False + + @property + def options(self): + return self._options + + @options.setter + def options(self, value): + self._options = value + self._ctx.set_options(value) + + @property + def verify_mode(self): + return _openssl_to_stdlib_verify[self._ctx.get_verify_mode()] + + @verify_mode.setter + def verify_mode(self, value): + self._ctx.set_verify( + _stdlib_to_openssl_verify[value], + _verify_callback + ) + + def set_default_verify_paths(self): + self._ctx.set_default_verify_paths() + + def set_ciphers(self, ciphers): + if isinstance(ciphers, six.text_type): + ciphers = ciphers.encode('utf-8') + self._ctx.set_cipher_list(ciphers) + + def load_verify_locations(self, cafile=None, capath=None, cadata=None): + if cafile is not None: + cafile = cafile.encode('utf-8') + if capath is not None: + capath = capath.encode('utf-8') + self._ctx.load_verify_locations(cafile, capath) + if cadata is not None: + self._ctx.load_verify_locations(BytesIO(cadata)) + + def load_cert_chain(self, certfile, keyfile=None, password=None): + self._ctx.use_certificate_chain_file(certfile) + if password is not None: + self._ctx.set_passwd_cb(lambda max_length, prompt_twice, userdata: password) + self._ctx.use_privatekey_file(keyfile or certfile) + + def wrap_socket(self, sock, server_side=False, + do_handshake_on_connect=True, suppress_ragged_eofs=True, + server_hostname=None): + cnx = OpenSSL.SSL.Connection(self._ctx, sock) + + if isinstance(server_hostname, six.text_type): # Platform-specific: Python 3 + server_hostname = server_hostname.encode('utf-8') + + if server_hostname is not None: + cnx.set_tlsext_host_name(server_hostname) + + cnx.set_connect_state() + + while True: + try: + cnx.do_handshake() + except OpenSSL.SSL.WantReadError: + if not util.wait_for_read(sock, sock.gettimeout()): + raise timeout('select timed out') + continue + except OpenSSL.SSL.Error as e: + raise ssl.SSLError('bad handshake: %r' % e) + break + + return WrappedSocket(cnx, sock) + + +def _verify_callback(cnx, x509, err_no, err_depth, return_code): + return err_no == 0 diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/securetransport.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/securetransport.py new file mode 100644 index 0000000000000000000000000000000000000000..77cb59ed71460a777621e3cd0ee60c97613668e4 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/securetransport.py @@ -0,0 +1,804 @@ +""" +SecureTranport support for urllib3 via ctypes. + +This makes platform-native TLS available to urllib3 users on macOS without the +use of a compiler. This is an important feature because the Python Package +Index is moving to become a TLSv1.2-or-higher server, and the default OpenSSL +that ships with macOS is not capable of doing TLSv1.2. The only way to resolve +this is to give macOS users an alternative solution to the problem, and that +solution is to use SecureTransport. + +We use ctypes here because this solution must not require a compiler. That's +because pip is not allowed to require a compiler either. + +This is not intended to be a seriously long-term solution to this problem. +The hope is that PEP 543 will eventually solve this issue for us, at which +point we can retire this contrib module. But in the short term, we need to +solve the impending tire fire that is Python on Mac without this kind of +contrib module. So...here we are. + +To use this module, simply import and inject it:: + + import urllib3.contrib.securetransport + urllib3.contrib.securetransport.inject_into_urllib3() + +Happy TLSing! +""" +from __future__ import absolute_import + +import contextlib +import ctypes +import errno +import os.path +import shutil +import socket +import ssl +import threading +import weakref + +from .. import util +from ._securetransport.bindings import ( + Security, SecurityConst, CoreFoundation +) +from ._securetransport.low_level import ( + _assert_no_error, _cert_array_from_pem, _temporary_keychain, + _load_client_cert_chain +) + +try: # Platform-specific: Python 2 + from socket import _fileobject +except ImportError: # Platform-specific: Python 3 + _fileobject = None + from ..packages.backports.makefile import backport_makefile + +__all__ = ['inject_into_urllib3', 'extract_from_urllib3'] + +# SNI always works +HAS_SNI = True + +orig_util_HAS_SNI = util.HAS_SNI +orig_util_SSLContext = util.ssl_.SSLContext + +# This dictionary is used by the read callback to obtain a handle to the +# calling wrapped socket. This is a pretty silly approach, but for now it'll +# do. I feel like I should be able to smuggle a handle to the wrapped socket +# directly in the SSLConnectionRef, but for now this approach will work I +# guess. +# +# We need to lock around this structure for inserts, but we don't do it for +# reads/writes in the callbacks. The reasoning here goes as follows: +# +# 1. It is not possible to call into the callbacks before the dictionary is +# populated, so once in the callback the id must be in the dictionary. +# 2. The callbacks don't mutate the dictionary, they only read from it, and +# so cannot conflict with any of the insertions. +# +# This is good: if we had to lock in the callbacks we'd drastically slow down +# the performance of this code. +_connection_refs = weakref.WeakValueDictionary() +_connection_ref_lock = threading.Lock() + +# Limit writes to 16kB. This is OpenSSL's limit, but we'll cargo-cult it over +# for no better reason than we need *a* limit, and this one is right there. +SSL_WRITE_BLOCKSIZE = 16384 + +# This is our equivalent of util.ssl_.DEFAULT_CIPHERS, but expanded out to +# individual cipher suites. We need to do this because this is how +# SecureTransport wants them. +CIPHER_SUITES = [ + SecurityConst.TLS_AES_256_GCM_SHA384, + SecurityConst.TLS_CHACHA20_POLY1305_SHA256, + SecurityConst.TLS_AES_128_GCM_SHA256, + SecurityConst.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + SecurityConst.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + SecurityConst.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + SecurityConst.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + SecurityConst.TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, + SecurityConst.TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, + SecurityConst.TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, + SecurityConst.TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, + SecurityConst.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, + SecurityConst.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, + SecurityConst.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + SecurityConst.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + SecurityConst.TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, + SecurityConst.TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, + SecurityConst.TLS_DHE_RSA_WITH_AES_256_CBC_SHA, + SecurityConst.TLS_DHE_DSS_WITH_AES_256_CBC_SHA, + SecurityConst.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, + SecurityConst.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, + SecurityConst.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + SecurityConst.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + SecurityConst.TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, + SecurityConst.TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, + SecurityConst.TLS_DHE_RSA_WITH_AES_128_CBC_SHA, + SecurityConst.TLS_DHE_DSS_WITH_AES_128_CBC_SHA, + SecurityConst.TLS_RSA_WITH_AES_256_GCM_SHA384, + SecurityConst.TLS_RSA_WITH_AES_128_GCM_SHA256, + SecurityConst.TLS_RSA_WITH_AES_256_CBC_SHA256, + SecurityConst.TLS_RSA_WITH_AES_128_CBC_SHA256, + SecurityConst.TLS_RSA_WITH_AES_256_CBC_SHA, + SecurityConst.TLS_RSA_WITH_AES_128_CBC_SHA, +] + +# Basically this is simple: for PROTOCOL_SSLv23 we turn it into a low of +# TLSv1 and a high of TLSv1.2. For everything else, we pin to that version. +_protocol_to_min_max = { + ssl.PROTOCOL_SSLv23: (SecurityConst.kTLSProtocol1, SecurityConst.kTLSProtocol12), +} + +if hasattr(ssl, "PROTOCOL_SSLv2"): + _protocol_to_min_max[ssl.PROTOCOL_SSLv2] = ( + SecurityConst.kSSLProtocol2, SecurityConst.kSSLProtocol2 + ) +if hasattr(ssl, "PROTOCOL_SSLv3"): + _protocol_to_min_max[ssl.PROTOCOL_SSLv3] = ( + SecurityConst.kSSLProtocol3, SecurityConst.kSSLProtocol3 + ) +if hasattr(ssl, "PROTOCOL_TLSv1"): + _protocol_to_min_max[ssl.PROTOCOL_TLSv1] = ( + SecurityConst.kTLSProtocol1, SecurityConst.kTLSProtocol1 + ) +if hasattr(ssl, "PROTOCOL_TLSv1_1"): + _protocol_to_min_max[ssl.PROTOCOL_TLSv1_1] = ( + SecurityConst.kTLSProtocol11, SecurityConst.kTLSProtocol11 + ) +if hasattr(ssl, "PROTOCOL_TLSv1_2"): + _protocol_to_min_max[ssl.PROTOCOL_TLSv1_2] = ( + SecurityConst.kTLSProtocol12, SecurityConst.kTLSProtocol12 + ) +if hasattr(ssl, "PROTOCOL_TLS"): + _protocol_to_min_max[ssl.PROTOCOL_TLS] = _protocol_to_min_max[ssl.PROTOCOL_SSLv23] + + +def inject_into_urllib3(): + """ + Monkey-patch urllib3 with SecureTransport-backed SSL-support. + """ + util.ssl_.SSLContext = SecureTransportContext + util.HAS_SNI = HAS_SNI + util.ssl_.HAS_SNI = HAS_SNI + util.IS_SECURETRANSPORT = True + util.ssl_.IS_SECURETRANSPORT = True + + +def extract_from_urllib3(): + """ + Undo monkey-patching by :func:`inject_into_urllib3`. + """ + util.ssl_.SSLContext = orig_util_SSLContext + util.HAS_SNI = orig_util_HAS_SNI + util.ssl_.HAS_SNI = orig_util_HAS_SNI + util.IS_SECURETRANSPORT = False + util.ssl_.IS_SECURETRANSPORT = False + + +def _read_callback(connection_id, data_buffer, data_length_pointer): + """ + SecureTransport read callback. This is called by ST to request that data + be returned from the socket. + """ + wrapped_socket = None + try: + wrapped_socket = _connection_refs.get(connection_id) + if wrapped_socket is None: + return SecurityConst.errSSLInternal + base_socket = wrapped_socket.socket + + requested_length = data_length_pointer[0] + + timeout = wrapped_socket.gettimeout() + error = None + read_count = 0 + + try: + while read_count < requested_length: + if timeout is None or timeout >= 0: + if not util.wait_for_read(base_socket, timeout): + raise socket.error(errno.EAGAIN, 'timed out') + + remaining = requested_length - read_count + buffer = (ctypes.c_char * remaining).from_address( + data_buffer + read_count + ) + chunk_size = base_socket.recv_into(buffer, remaining) + read_count += chunk_size + if not chunk_size: + if not read_count: + return SecurityConst.errSSLClosedGraceful + break + except (socket.error) as e: + error = e.errno + + if error is not None and error != errno.EAGAIN: + data_length_pointer[0] = read_count + if error == errno.ECONNRESET or error == errno.EPIPE: + return SecurityConst.errSSLClosedAbort + raise + + data_length_pointer[0] = read_count + + if read_count != requested_length: + return SecurityConst.errSSLWouldBlock + + return 0 + except Exception as e: + if wrapped_socket is not None: + wrapped_socket._exception = e + return SecurityConst.errSSLInternal + + +def _write_callback(connection_id, data_buffer, data_length_pointer): + """ + SecureTransport write callback. This is called by ST to request that data + actually be sent on the network. + """ + wrapped_socket = None + try: + wrapped_socket = _connection_refs.get(connection_id) + if wrapped_socket is None: + return SecurityConst.errSSLInternal + base_socket = wrapped_socket.socket + + bytes_to_write = data_length_pointer[0] + data = ctypes.string_at(data_buffer, bytes_to_write) + + timeout = wrapped_socket.gettimeout() + error = None + sent = 0 + + try: + while sent < bytes_to_write: + if timeout is None or timeout >= 0: + if not util.wait_for_write(base_socket, timeout): + raise socket.error(errno.EAGAIN, 'timed out') + chunk_sent = base_socket.send(data) + sent += chunk_sent + + # This has some needless copying here, but I'm not sure there's + # much value in optimising this data path. + data = data[chunk_sent:] + except (socket.error) as e: + error = e.errno + + if error is not None and error != errno.EAGAIN: + data_length_pointer[0] = sent + if error == errno.ECONNRESET or error == errno.EPIPE: + return SecurityConst.errSSLClosedAbort + raise + + data_length_pointer[0] = sent + + if sent != bytes_to_write: + return SecurityConst.errSSLWouldBlock + + return 0 + except Exception as e: + if wrapped_socket is not None: + wrapped_socket._exception = e + return SecurityConst.errSSLInternal + + +# We need to keep these two objects references alive: if they get GC'd while +# in use then SecureTransport could attempt to call a function that is in freed +# memory. That would be...uh...bad. Yeah, that's the word. Bad. +_read_callback_pointer = Security.SSLReadFunc(_read_callback) +_write_callback_pointer = Security.SSLWriteFunc(_write_callback) + + +class WrappedSocket(object): + """ + API-compatibility wrapper for Python's OpenSSL wrapped socket object. + + Note: _makefile_refs, _drop(), and _reuse() are needed for the garbage + collector of PyPy. + """ + def __init__(self, socket): + self.socket = socket + self.context = None + self._makefile_refs = 0 + self._closed = False + self._exception = None + self._keychain = None + self._keychain_dir = None + self._client_cert_chain = None + + # We save off the previously-configured timeout and then set it to + # zero. This is done because we use select and friends to handle the + # timeouts, but if we leave the timeout set on the lower socket then + # Python will "kindly" call select on that socket again for us. Avoid + # that by forcing the timeout to zero. + self._timeout = self.socket.gettimeout() + self.socket.settimeout(0) + + @contextlib.contextmanager + def _raise_on_error(self): + """ + A context manager that can be used to wrap calls that do I/O from + SecureTransport. If any of the I/O callbacks hit an exception, this + context manager will correctly propagate the exception after the fact. + This avoids silently swallowing those exceptions. + + It also correctly forces the socket closed. + """ + self._exception = None + + # We explicitly don't catch around this yield because in the unlikely + # event that an exception was hit in the block we don't want to swallow + # it. + yield + if self._exception is not None: + exception, self._exception = self._exception, None + self.close() + raise exception + + def _set_ciphers(self): + """ + Sets up the allowed ciphers. By default this matches the set in + util.ssl_.DEFAULT_CIPHERS, at least as supported by macOS. This is done + custom and doesn't allow changing at this time, mostly because parsing + OpenSSL cipher strings is going to be a freaking nightmare. + """ + ciphers = (Security.SSLCipherSuite * len(CIPHER_SUITES))(*CIPHER_SUITES) + result = Security.SSLSetEnabledCiphers( + self.context, ciphers, len(CIPHER_SUITES) + ) + _assert_no_error(result) + + def _custom_validate(self, verify, trust_bundle): + """ + Called when we have set custom validation. We do this in two cases: + first, when cert validation is entirely disabled; and second, when + using a custom trust DB. + """ + # If we disabled cert validation, just say: cool. + if not verify: + return + + # We want data in memory, so load it up. + if os.path.isfile(trust_bundle): + with open(trust_bundle, 'rb') as f: + trust_bundle = f.read() + + cert_array = None + trust = Security.SecTrustRef() + + try: + # Get a CFArray that contains the certs we want. + cert_array = _cert_array_from_pem(trust_bundle) + + # Ok, now the hard part. We want to get the SecTrustRef that ST has + # created for this connection, shove our CAs into it, tell ST to + # ignore everything else it knows, and then ask if it can build a + # chain. This is a buuuunch of code. + result = Security.SSLCopyPeerTrust( + self.context, ctypes.byref(trust) + ) + _assert_no_error(result) + if not trust: + raise ssl.SSLError("Failed to copy trust reference") + + result = Security.SecTrustSetAnchorCertificates(trust, cert_array) + _assert_no_error(result) + + result = Security.SecTrustSetAnchorCertificatesOnly(trust, True) + _assert_no_error(result) + + trust_result = Security.SecTrustResultType() + result = Security.SecTrustEvaluate( + trust, ctypes.byref(trust_result) + ) + _assert_no_error(result) + finally: + if trust: + CoreFoundation.CFRelease(trust) + + if cert_array is not None: + CoreFoundation.CFRelease(cert_array) + + # Ok, now we can look at what the result was. + successes = ( + SecurityConst.kSecTrustResultUnspecified, + SecurityConst.kSecTrustResultProceed + ) + if trust_result.value not in successes: + raise ssl.SSLError( + "certificate verify failed, error code: %d" % + trust_result.value + ) + + def handshake(self, + server_hostname, + verify, + trust_bundle, + min_version, + max_version, + client_cert, + client_key, + client_key_passphrase): + """ + Actually performs the TLS handshake. This is run automatically by + wrapped socket, and shouldn't be needed in user code. + """ + # First, we do the initial bits of connection setup. We need to create + # a context, set its I/O funcs, and set the connection reference. + self.context = Security.SSLCreateContext( + None, SecurityConst.kSSLClientSide, SecurityConst.kSSLStreamType + ) + result = Security.SSLSetIOFuncs( + self.context, _read_callback_pointer, _write_callback_pointer + ) + _assert_no_error(result) + + # Here we need to compute the handle to use. We do this by taking the + # id of self modulo 2**31 - 1. If this is already in the dictionary, we + # just keep incrementing by one until we find a free space. + with _connection_ref_lock: + handle = id(self) % 2147483647 + while handle in _connection_refs: + handle = (handle + 1) % 2147483647 + _connection_refs[handle] = self + + result = Security.SSLSetConnection(self.context, handle) + _assert_no_error(result) + + # If we have a server hostname, we should set that too. + if server_hostname: + if not isinstance(server_hostname, bytes): + server_hostname = server_hostname.encode('utf-8') + + result = Security.SSLSetPeerDomainName( + self.context, server_hostname, len(server_hostname) + ) + _assert_no_error(result) + + # Setup the ciphers. + self._set_ciphers() + + # Set the minimum and maximum TLS versions. + result = Security.SSLSetProtocolVersionMin(self.context, min_version) + _assert_no_error(result) + result = Security.SSLSetProtocolVersionMax(self.context, max_version) + _assert_no_error(result) + + # If there's a trust DB, we need to use it. We do that by telling + # SecureTransport to break on server auth. We also do that if we don't + # want to validate the certs at all: we just won't actually do any + # authing in that case. + if not verify or trust_bundle is not None: + result = Security.SSLSetSessionOption( + self.context, + SecurityConst.kSSLSessionOptionBreakOnServerAuth, + True + ) + _assert_no_error(result) + + # If there's a client cert, we need to use it. + if client_cert: + self._keychain, self._keychain_dir = _temporary_keychain() + self._client_cert_chain = _load_client_cert_chain( + self._keychain, client_cert, client_key + ) + result = Security.SSLSetCertificate( + self.context, self._client_cert_chain + ) + _assert_no_error(result) + + while True: + with self._raise_on_error(): + result = Security.SSLHandshake(self.context) + + if result == SecurityConst.errSSLWouldBlock: + raise socket.timeout("handshake timed out") + elif result == SecurityConst.errSSLServerAuthCompleted: + self._custom_validate(verify, trust_bundle) + continue + else: + _assert_no_error(result) + break + + def fileno(self): + return self.socket.fileno() + + # Copy-pasted from Python 3.5 source code + def _decref_socketios(self): + if self._makefile_refs > 0: + self._makefile_refs -= 1 + if self._closed: + self.close() + + def recv(self, bufsiz): + buffer = ctypes.create_string_buffer(bufsiz) + bytes_read = self.recv_into(buffer, bufsiz) + data = buffer[:bytes_read] + return data + + def recv_into(self, buffer, nbytes=None): + # Read short on EOF. + if self._closed: + return 0 + + if nbytes is None: + nbytes = len(buffer) + + buffer = (ctypes.c_char * nbytes).from_buffer(buffer) + processed_bytes = ctypes.c_size_t(0) + + with self._raise_on_error(): + result = Security.SSLRead( + self.context, buffer, nbytes, ctypes.byref(processed_bytes) + ) + + # There are some result codes that we want to treat as "not always + # errors". Specifically, those are errSSLWouldBlock, + # errSSLClosedGraceful, and errSSLClosedNoNotify. + if (result == SecurityConst.errSSLWouldBlock): + # If we didn't process any bytes, then this was just a time out. + # However, we can get errSSLWouldBlock in situations when we *did* + # read some data, and in those cases we should just read "short" + # and return. + if processed_bytes.value == 0: + # Timed out, no data read. + raise socket.timeout("recv timed out") + elif result in (SecurityConst.errSSLClosedGraceful, SecurityConst.errSSLClosedNoNotify): + # The remote peer has closed this connection. We should do so as + # well. Note that we don't actually return here because in + # principle this could actually be fired along with return data. + # It's unlikely though. + self.close() + else: + _assert_no_error(result) + + # Ok, we read and probably succeeded. We should return whatever data + # was actually read. + return processed_bytes.value + + def settimeout(self, timeout): + self._timeout = timeout + + def gettimeout(self): + return self._timeout + + def send(self, data): + processed_bytes = ctypes.c_size_t(0) + + with self._raise_on_error(): + result = Security.SSLWrite( + self.context, data, len(data), ctypes.byref(processed_bytes) + ) + + if result == SecurityConst.errSSLWouldBlock and processed_bytes.value == 0: + # Timed out + raise socket.timeout("send timed out") + else: + _assert_no_error(result) + + # We sent, and probably succeeded. Tell them how much we sent. + return processed_bytes.value + + def sendall(self, data): + total_sent = 0 + while total_sent < len(data): + sent = self.send(data[total_sent:total_sent + SSL_WRITE_BLOCKSIZE]) + total_sent += sent + + def shutdown(self): + with self._raise_on_error(): + Security.SSLClose(self.context) + + def close(self): + # TODO: should I do clean shutdown here? Do I have to? + if self._makefile_refs < 1: + self._closed = True + if self.context: + CoreFoundation.CFRelease(self.context) + self.context = None + if self._client_cert_chain: + CoreFoundation.CFRelease(self._client_cert_chain) + self._client_cert_chain = None + if self._keychain: + Security.SecKeychainDelete(self._keychain) + CoreFoundation.CFRelease(self._keychain) + shutil.rmtree(self._keychain_dir) + self._keychain = self._keychain_dir = None + return self.socket.close() + else: + self._makefile_refs -= 1 + + def getpeercert(self, binary_form=False): + # Urgh, annoying. + # + # Here's how we do this: + # + # 1. Call SSLCopyPeerTrust to get hold of the trust object for this + # connection. + # 2. Call SecTrustGetCertificateAtIndex for index 0 to get the leaf. + # 3. To get the CN, call SecCertificateCopyCommonName and process that + # string so that it's of the appropriate type. + # 4. To get the SAN, we need to do something a bit more complex: + # a. Call SecCertificateCopyValues to get the data, requesting + # kSecOIDSubjectAltName. + # b. Mess about with this dictionary to try to get the SANs out. + # + # This is gross. Really gross. It's going to be a few hundred LoC extra + # just to repeat something that SecureTransport can *already do*. So my + # operating assumption at this time is that what we want to do is + # instead to just flag to urllib3 that it shouldn't do its own hostname + # validation when using SecureTransport. + if not binary_form: + raise ValueError( + "SecureTransport only supports dumping binary certs" + ) + trust = Security.SecTrustRef() + certdata = None + der_bytes = None + + try: + # Grab the trust store. + result = Security.SSLCopyPeerTrust( + self.context, ctypes.byref(trust) + ) + _assert_no_error(result) + if not trust: + # Probably we haven't done the handshake yet. No biggie. + return None + + cert_count = Security.SecTrustGetCertificateCount(trust) + if not cert_count: + # Also a case that might happen if we haven't handshaked. + # Handshook? Handshaken? + return None + + leaf = Security.SecTrustGetCertificateAtIndex(trust, 0) + assert leaf + + # Ok, now we want the DER bytes. + certdata = Security.SecCertificateCopyData(leaf) + assert certdata + + data_length = CoreFoundation.CFDataGetLength(certdata) + data_buffer = CoreFoundation.CFDataGetBytePtr(certdata) + der_bytes = ctypes.string_at(data_buffer, data_length) + finally: + if certdata: + CoreFoundation.CFRelease(certdata) + if trust: + CoreFoundation.CFRelease(trust) + + return der_bytes + + def _reuse(self): + self._makefile_refs += 1 + + def _drop(self): + if self._makefile_refs < 1: + self.close() + else: + self._makefile_refs -= 1 + + +if _fileobject: # Platform-specific: Python 2 + def makefile(self, mode, bufsize=-1): + self._makefile_refs += 1 + return _fileobject(self, mode, bufsize, close=True) +else: # Platform-specific: Python 3 + def makefile(self, mode="r", buffering=None, *args, **kwargs): + # We disable buffering with SecureTransport because it conflicts with + # the buffering that ST does internally (see issue #1153 for more). + buffering = 0 + return backport_makefile(self, mode, buffering, *args, **kwargs) + +WrappedSocket.makefile = makefile + + +class SecureTransportContext(object): + """ + I am a wrapper class for the SecureTransport library, to translate the + interface of the standard library ``SSLContext`` object to calls into + SecureTransport. + """ + def __init__(self, protocol): + self._min_version, self._max_version = _protocol_to_min_max[protocol] + self._options = 0 + self._verify = False + self._trust_bundle = None + self._client_cert = None + self._client_key = None + self._client_key_passphrase = None + + @property + def check_hostname(self): + """ + SecureTransport cannot have its hostname checking disabled. For more, + see the comment on getpeercert() in this file. + """ + return True + + @check_hostname.setter + def check_hostname(self, value): + """ + SecureTransport cannot have its hostname checking disabled. For more, + see the comment on getpeercert() in this file. + """ + pass + + @property + def options(self): + # TODO: Well, crap. + # + # So this is the bit of the code that is the most likely to cause us + # trouble. Essentially we need to enumerate all of the SSL options that + # users might want to use and try to see if we can sensibly translate + # them, or whether we should just ignore them. + return self._options + + @options.setter + def options(self, value): + # TODO: Update in line with above. + self._options = value + + @property + def verify_mode(self): + return ssl.CERT_REQUIRED if self._verify else ssl.CERT_NONE + + @verify_mode.setter + def verify_mode(self, value): + self._verify = True if value == ssl.CERT_REQUIRED else False + + def set_default_verify_paths(self): + # So, this has to do something a bit weird. Specifically, what it does + # is nothing. + # + # This means that, if we had previously had load_verify_locations + # called, this does not undo that. We need to do that because it turns + # out that the rest of the urllib3 code will attempt to load the + # default verify paths if it hasn't been told about any paths, even if + # the context itself was sometime earlier. We resolve that by just + # ignoring it. + pass + + def load_default_certs(self): + return self.set_default_verify_paths() + + def set_ciphers(self, ciphers): + # For now, we just require the default cipher string. + if ciphers != util.ssl_.DEFAULT_CIPHERS: + raise ValueError( + "SecureTransport doesn't support custom cipher strings" + ) + + def load_verify_locations(self, cafile=None, capath=None, cadata=None): + # OK, we only really support cadata and cafile. + if capath is not None: + raise ValueError( + "SecureTransport does not support cert directories" + ) + + self._trust_bundle = cafile or cadata + + def load_cert_chain(self, certfile, keyfile=None, password=None): + self._client_cert = certfile + self._client_key = keyfile + self._client_cert_passphrase = password + + def wrap_socket(self, sock, server_side=False, + do_handshake_on_connect=True, suppress_ragged_eofs=True, + server_hostname=None): + # So, what do we do here? Firstly, we assert some properties. This is a + # stripped down shim, so there is some functionality we don't support. + # See PEP 543 for the real deal. + assert not server_side + assert do_handshake_on_connect + assert suppress_ragged_eofs + + # Ok, we're good to go. Now we want to create the wrapped socket object + # and store it in the appropriate place. + wrapped_socket = WrappedSocket(sock) + + # Now we can handshake + wrapped_socket.handshake( + server_hostname, self._verify, self._trust_bundle, + self._min_version, self._max_version, self._client_cert, + self._client_key, self._client_key_passphrase + ) + return wrapped_socket diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/socks.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/socks.py new file mode 100644 index 0000000000000000000000000000000000000000..077ef7a981d4633c77b0968a80dae0e7bf30b6c4 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/contrib/socks.py @@ -0,0 +1,192 @@ +# -*- coding: utf-8 -*- +""" +This module contains provisional support for SOCKS proxies from within +urllib3. This module supports SOCKS4 (specifically the SOCKS4A variant) and +SOCKS5. To enable its functionality, either install PySocks or install this +module with the ``socks`` extra. + +The SOCKS implementation supports the full range of urllib3 features. It also +supports the following SOCKS features: + +- SOCKS4 +- SOCKS4a +- SOCKS5 +- Usernames and passwords for the SOCKS proxy + +Known Limitations: + +- Currently PySocks does not support contacting remote websites via literal + IPv6 addresses. Any such connection attempt will fail. You must use a domain + name. +- Currently PySocks does not support IPv6 connections to the SOCKS proxy. Any + such connection attempt will fail. +""" +from __future__ import absolute_import + +try: + from ..packages import socks +except ImportError: + import warnings + from ..exceptions import DependencyWarning + + warnings.warn(( + 'SOCKS support in urllib3 requires the installation of optional ' + 'dependencies: specifically, PySocks. For more information, see ' + 'https://urllib3.readthedocs.io/en/latest/contrib.html#socks-proxies' + ), + DependencyWarning + ) + raise + +from socket import error as SocketError, timeout as SocketTimeout + +from ..connection import ( + HTTPConnection, HTTPSConnection +) +from ..connectionpool import ( + HTTPConnectionPool, HTTPSConnectionPool +) +from ..exceptions import ConnectTimeoutError, NewConnectionError +from ..poolmanager import PoolManager +from ..util.url import parse_url + +try: + import ssl +except ImportError: + ssl = None + + +class SOCKSConnection(HTTPConnection): + """ + A plain-text HTTP connection that connects via a SOCKS proxy. + """ + def __init__(self, *args, **kwargs): + self._socks_options = kwargs.pop('_socks_options') + super(SOCKSConnection, self).__init__(*args, **kwargs) + + def _new_conn(self): + """ + Establish a new connection via the SOCKS proxy. + """ + extra_kw = {} + if self.source_address: + extra_kw['source_address'] = self.source_address + + if self.socket_options: + extra_kw['socket_options'] = self.socket_options + + try: + conn = socks.create_connection( + (self.host, self.port), + proxy_type=self._socks_options['socks_version'], + proxy_addr=self._socks_options['proxy_host'], + proxy_port=self._socks_options['proxy_port'], + proxy_username=self._socks_options['username'], + proxy_password=self._socks_options['password'], + proxy_rdns=self._socks_options['rdns'], + timeout=self.timeout, + **extra_kw + ) + + except SocketTimeout: + raise ConnectTimeoutError( + self, "Connection to %s timed out. (connect timeout=%s)" % + (self.host, self.timeout)) + + except socks.ProxyError as e: + # This is fragile as hell, but it seems to be the only way to raise + # useful errors here. + if e.socket_err: + error = e.socket_err + if isinstance(error, SocketTimeout): + raise ConnectTimeoutError( + self, + "Connection to %s timed out. (connect timeout=%s)" % + (self.host, self.timeout) + ) + else: + raise NewConnectionError( + self, + "Failed to establish a new connection: %s" % error + ) + else: + raise NewConnectionError( + self, + "Failed to establish a new connection: %s" % e + ) + + except SocketError as e: # Defensive: PySocks should catch all these. + raise NewConnectionError( + self, "Failed to establish a new connection: %s" % e) + + return conn + + +# We don't need to duplicate the Verified/Unverified distinction from +# urllib3/connection.py here because the HTTPSConnection will already have been +# correctly set to either the Verified or Unverified form by that module. This +# means the SOCKSHTTPSConnection will automatically be the correct type. +class SOCKSHTTPSConnection(SOCKSConnection, HTTPSConnection): + pass + + +class SOCKSHTTPConnectionPool(HTTPConnectionPool): + ConnectionCls = SOCKSConnection + + +class SOCKSHTTPSConnectionPool(HTTPSConnectionPool): + ConnectionCls = SOCKSHTTPSConnection + + +class SOCKSProxyManager(PoolManager): + """ + A version of the urllib3 ProxyManager that routes connections via the + defined SOCKS proxy. + """ + pool_classes_by_scheme = { + 'http': SOCKSHTTPConnectionPool, + 'https': SOCKSHTTPSConnectionPool, + } + + def __init__(self, proxy_url, username=None, password=None, + num_pools=10, headers=None, **connection_pool_kw): + parsed = parse_url(proxy_url) + + if username is None and password is None and parsed.auth is not None: + split = parsed.auth.split(':') + if len(split) == 2: + username, password = split + if parsed.scheme == 'socks5': + socks_version = socks.PROXY_TYPE_SOCKS5 + rdns = False + elif parsed.scheme == 'socks5h': + socks_version = socks.PROXY_TYPE_SOCKS5 + rdns = True + elif parsed.scheme == 'socks4': + socks_version = socks.PROXY_TYPE_SOCKS4 + rdns = False + elif parsed.scheme == 'socks4a': + socks_version = socks.PROXY_TYPE_SOCKS4 + rdns = True + else: + raise ValueError( + "Unable to determine SOCKS version from %s" % proxy_url + ) + + self.proxy_url = proxy_url + + socks_options = { + 'socks_version': socks_version, + 'proxy_host': parsed.host, + 'proxy_port': parsed.port, + 'username': username, + 'password': password, + 'rdns': rdns + } + connection_pool_kw['_socks_options'] = socks_options + + super(SOCKSProxyManager, self).__init__( + num_pools, headers, **connection_pool_kw + ) + + self.pool_classes_by_scheme = SOCKSProxyManager.pool_classes_by_scheme diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/exceptions.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..7bbaa9871f5718ea1b70d0a31ba40bc4409f630b --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/exceptions.py @@ -0,0 +1,246 @@ +from __future__ import absolute_import +from .packages.six.moves.http_client import ( + IncompleteRead as httplib_IncompleteRead +) +# Base Exceptions + + +class HTTPError(Exception): + "Base exception used by this module." + pass + + +class HTTPWarning(Warning): + "Base warning used by this module." + pass + + +class PoolError(HTTPError): + "Base exception for errors caused within a pool." + def __init__(self, pool, message): + self.pool = pool + HTTPError.__init__(self, "%s: %s" % (pool, message)) + + def __reduce__(self): + # For pickling purposes. + return self.__class__, (None, None) + + +class RequestError(PoolError): + "Base exception for PoolErrors that have associated URLs." + def __init__(self, pool, url, message): + self.url = url + PoolError.__init__(self, pool, message) + + def __reduce__(self): + # For pickling purposes. + return self.__class__, (None, self.url, None) + + +class SSLError(HTTPError): + "Raised when SSL certificate fails in an HTTPS connection." + pass + + +class ProxyError(HTTPError): + "Raised when the connection to a proxy fails." + pass + + +class DecodeError(HTTPError): + "Raised when automatic decoding based on Content-Type fails." + pass + + +class ProtocolError(HTTPError): + "Raised when something unexpected happens mid-request/response." + pass + + +#: Renamed to ProtocolError but aliased for backwards compatibility. +ConnectionError = ProtocolError + + +# Leaf Exceptions + +class MaxRetryError(RequestError): + """Raised when the maximum number of retries is exceeded. + + :param pool: The connection pool + :type pool: :class:`~urllib3.connectionpool.HTTPConnectionPool` + :param string url: The requested Url + :param exceptions.Exception reason: The underlying error + + """ + + def __init__(self, pool, url, reason=None): + self.reason = reason + + message = "Max retries exceeded with url: %s (Caused by %r)" % ( + url, reason) + + RequestError.__init__(self, pool, url, message) + + +class HostChangedError(RequestError): + "Raised when an existing pool gets a request for a foreign host." + + def __init__(self, pool, url, retries=3): + message = "Tried to open a foreign host with url: %s" % url + RequestError.__init__(self, pool, url, message) + self.retries = retries + + +class TimeoutStateError(HTTPError): + """ Raised when passing an invalid state to a timeout """ + pass + + +class TimeoutError(HTTPError): + """ Raised when a socket timeout error occurs. + + Catching this error will catch both :exc:`ReadTimeoutErrors + ` and :exc:`ConnectTimeoutErrors `. + """ + pass + + +class ReadTimeoutError(TimeoutError, RequestError): + "Raised when a socket timeout occurs while receiving data from a server" + pass + + +# This timeout error does not have a URL attached and needs to inherit from the +# base HTTPError +class ConnectTimeoutError(TimeoutError): + "Raised when a socket timeout occurs while connecting to a server" + pass + + +class NewConnectionError(ConnectTimeoutError, PoolError): + "Raised when we fail to establish a new connection. Usually ECONNREFUSED." + pass + + +class EmptyPoolError(PoolError): + "Raised when a pool runs out of connections and no more are allowed." + pass + + +class ClosedPoolError(PoolError): + "Raised when a request enters a pool after the pool has been closed." + pass + + +class LocationValueError(ValueError, HTTPError): + "Raised when there is something wrong with a given URL input." + pass + + +class LocationParseError(LocationValueError): + "Raised when get_host or similar fails to parse the URL input." + + def __init__(self, location): + message = "Failed to parse: %s" % location + HTTPError.__init__(self, message) + + self.location = location + + +class ResponseError(HTTPError): + "Used as a container for an error reason supplied in a MaxRetryError." + GENERIC_ERROR = 'too many error responses' + SPECIFIC_ERROR = 'too many {status_code} error responses' + + +class SecurityWarning(HTTPWarning): + "Warned when performing security reducing actions" + pass + + +class SubjectAltNameWarning(SecurityWarning): + "Warned when connecting to a host with a certificate missing a SAN." + pass + + +class InsecureRequestWarning(SecurityWarning): + "Warned when making an unverified HTTPS request." + pass + + +class SystemTimeWarning(SecurityWarning): + "Warned when system time is suspected to be wrong" + pass + + +class InsecurePlatformWarning(SecurityWarning): + "Warned when certain SSL configuration is not available on a platform." + pass + + +class SNIMissingWarning(HTTPWarning): + "Warned when making a HTTPS request without SNI available." + pass + + +class DependencyWarning(HTTPWarning): + """ + Warned when an attempt is made to import a module with missing optional + dependencies. + """ + pass + + +class ResponseNotChunked(ProtocolError, ValueError): + "Response needs to be chunked in order to read it as chunks." + pass + + +class BodyNotHttplibCompatible(HTTPError): + """ + Body should be httplib.HTTPResponse like (have an fp attribute which + returns raw chunks) for read_chunked(). + """ + pass + + +class IncompleteRead(HTTPError, httplib_IncompleteRead): + """ + Response length doesn't match expected Content-Length + + Subclass of http_client.IncompleteRead to allow int value + for `partial` to avoid creating large objects on streamed + reads. + """ + def __init__(self, partial, expected): + super(IncompleteRead, self).__init__(partial, expected) + + def __repr__(self): + return ('IncompleteRead(%i bytes read, ' + '%i more expected)' % (self.partial, self.expected)) + + +class InvalidHeader(HTTPError): + "The header provided was somehow invalid." + pass + + +class ProxySchemeUnknown(AssertionError, ValueError): + "ProxyManager does not support the supplied scheme" + # TODO(t-8ch): Stop inheriting from AssertionError in v2.0. + + def __init__(self, scheme): + message = "Not supported proxy scheme %s" % scheme + super(ProxySchemeUnknown, self).__init__(message) + + +class HeaderParsingError(HTTPError): + "Raised by assert_header_parsing, but we convert it to a log.warning statement." + def __init__(self, defects, unparsed_data): + message = '%s, unparsed data: %r' % (defects or 'Unknown', unparsed_data) + super(HeaderParsingError, self).__init__(message) + + +class UnrewindableBodyError(HTTPError): + "urllib3 encountered an error when trying to rewind a body" + pass diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/fields.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/fields.py new file mode 100644 index 0000000000000000000000000000000000000000..37fe64a3e86b0e2d9c4bb64c5c054279698140db --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/fields.py @@ -0,0 +1,178 @@ +from __future__ import absolute_import +import email.utils +import mimetypes + +from .packages import six + + +def guess_content_type(filename, default='application/octet-stream'): + """ + Guess the "Content-Type" of a file. + + :param filename: + The filename to guess the "Content-Type" of using :mod:`mimetypes`. + :param default: + If no "Content-Type" can be guessed, default to `default`. + """ + if filename: + return mimetypes.guess_type(filename)[0] or default + return default + + +def format_header_param(name, value): + """ + Helper function to format and quote a single header parameter. + + Particularly useful for header parameters which might contain + non-ASCII values, like file names. This follows RFC 2231, as + suggested by RFC 2388 Section 4.4. + + :param name: + The name of the parameter, a string expected to be ASCII only. + :param value: + The value of the parameter, provided as a unicode string. + """ + if not any(ch in value for ch in '"\\\r\n'): + result = '%s="%s"' % (name, value) + try: + result.encode('ascii') + except (UnicodeEncodeError, UnicodeDecodeError): + pass + else: + return result + if not six.PY3 and isinstance(value, six.text_type): # Python 2: + value = value.encode('utf-8') + value = email.utils.encode_rfc2231(value, 'utf-8') + value = '%s*=%s' % (name, value) + return value + + +class RequestField(object): + """ + A data container for request body parameters. + + :param name: + The name of this request field. + :param data: + The data/value body. + :param filename: + An optional filename of the request field. + :param headers: + An optional dict-like object of headers to initially use for the field. + """ + def __init__(self, name, data, filename=None, headers=None): + self._name = name + self._filename = filename + self.data = data + self.headers = {} + if headers: + self.headers = dict(headers) + + @classmethod + def from_tuples(cls, fieldname, value): + """ + A :class:`~urllib3.fields.RequestField` factory from old-style tuple parameters. + + Supports constructing :class:`~urllib3.fields.RequestField` from + parameter of key/value strings AND key/filetuple. A filetuple is a + (filename, data, MIME type) tuple where the MIME type is optional. + For example:: + + 'foo': 'bar', + 'fakefile': ('foofile.txt', 'contents of foofile'), + 'realfile': ('barfile.txt', open('realfile').read()), + 'typedfile': ('bazfile.bin', open('bazfile').read(), 'image/jpeg'), + 'nonamefile': 'contents of nonamefile field', + + Field names and filenames must be unicode. + """ + if isinstance(value, tuple): + if len(value) == 3: + filename, data, content_type = value + else: + filename, data = value + content_type = guess_content_type(filename) + else: + filename = None + content_type = None + data = value + + request_param = cls(fieldname, data, filename=filename) + request_param.make_multipart(content_type=content_type) + + return request_param + + def _render_part(self, name, value): + """ + Overridable helper function to format a single header parameter. + + :param name: + The name of the parameter, a string expected to be ASCII only. + :param value: + The value of the parameter, provided as a unicode string. + """ + return format_header_param(name, value) + + def _render_parts(self, header_parts): + """ + Helper function to format and quote a single header. + + Useful for single headers that are composed of multiple items. E.g., + 'Content-Disposition' fields. + + :param header_parts: + A sequence of (k, v) tuples or a :class:`dict` of (k, v) to format + as `k1="v1"; k2="v2"; ...`. + """ + parts = [] + iterable = header_parts + if isinstance(header_parts, dict): + iterable = header_parts.items() + + for name, value in iterable: + if value is not None: + parts.append(self._render_part(name, value)) + + return '; '.join(parts) + + def render_headers(self): + """ + Renders the headers for this request field. + """ + lines = [] + + sort_keys = ['Content-Disposition', 'Content-Type', 'Content-Location'] + for sort_key in sort_keys: + if self.headers.get(sort_key, False): + lines.append('%s: %s' % (sort_key, self.headers[sort_key])) + + for header_name, header_value in self.headers.items(): + if header_name not in sort_keys: + if header_value: + lines.append('%s: %s' % (header_name, header_value)) + + lines.append('\r\n') + return '\r\n'.join(lines) + + def make_multipart(self, content_disposition=None, content_type=None, + content_location=None): + """ + Makes this request field into a multipart request field. + + This method overrides "Content-Disposition", "Content-Type" and + "Content-Location" headers to the request parameter. + + :param content_type: + The 'Content-Type' of the request body. + :param content_location: + The 'Content-Location' of the request body. + + """ + self.headers['Content-Disposition'] = content_disposition or 'form-data' + self.headers['Content-Disposition'] += '; '.join([ + '', self._render_parts( + (('name', self._name), ('filename', self._filename)) + ) + ]) + self.headers['Content-Type'] = content_type + self.headers['Content-Location'] = content_location diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/filepost.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/filepost.py new file mode 100644 index 0000000000000000000000000000000000000000..78f1e19b0ed8b579bd259508ddd38c918f78a041 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/filepost.py @@ -0,0 +1,98 @@ +from __future__ import absolute_import +import binascii +import codecs +import os + +from io import BytesIO + +from .packages import six +from .packages.six import b +from .fields import RequestField + +writer = codecs.lookup('utf-8')[3] + + +def choose_boundary(): + """ + Our embarrassingly-simple replacement for mimetools.choose_boundary. + """ + boundary = binascii.hexlify(os.urandom(16)) + if six.PY3: + boundary = boundary.decode('ascii') + return boundary + + +def iter_field_objects(fields): + """ + Iterate over fields. + + Supports list of (k, v) tuples and dicts, and lists of + :class:`~urllib3.fields.RequestField`. + + """ + if isinstance(fields, dict): + i = six.iteritems(fields) + else: + i = iter(fields) + + for field in i: + if isinstance(field, RequestField): + yield field + else: + yield RequestField.from_tuples(*field) + + +def iter_fields(fields): + """ + .. deprecated:: 1.6 + + Iterate over fields. + + The addition of :class:`~urllib3.fields.RequestField` makes this function + obsolete. Instead, use :func:`iter_field_objects`, which returns + :class:`~urllib3.fields.RequestField` objects. + + Supports list of (k, v) tuples and dicts. + """ + if isinstance(fields, dict): + return ((k, v) for k, v in six.iteritems(fields)) + + return ((k, v) for k, v in fields) + + +def encode_multipart_formdata(fields, boundary=None): + """ + Encode a dictionary of ``fields`` using the multipart/form-data MIME format. + + :param fields: + Dictionary of fields or list of (key, :class:`~urllib3.fields.RequestField`). + + :param boundary: + If not specified, then a random boundary will be generated using + :func:`urllib3.filepost.choose_boundary`. + """ + body = BytesIO() + if boundary is None: + boundary = choose_boundary() + + for field in iter_field_objects(fields): + body.write(b('--%s\r\n' % (boundary))) + + writer(body).write(field.render_headers()) + data = field.data + + if isinstance(data, int): + data = str(data) # Backwards compatibility + + if isinstance(data, six.text_type): + writer(body).write(data) + else: + body.write(data) + + body.write(b'\r\n') + + body.write(b('--%s--\r\n' % (boundary))) + + content_type = str('multipart/form-data; boundary=%s' % boundary) + + return body.getvalue(), content_type diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..170e974c15746c3aa6e960d3c7a53981459a528d --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/__init__.py @@ -0,0 +1,5 @@ +from __future__ import absolute_import + +from . import ssl_match_hostname + +__all__ = ('ssl_match_hostname', ) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/backports/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/backports/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/backports/makefile.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/backports/makefile.py new file mode 100644 index 0000000000000000000000000000000000000000..740db377d99a963dafa6789e8aed6c2effa5e97d --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/backports/makefile.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +""" +backports.makefile +~~~~~~~~~~~~~~~~~~ + +Backports the Python 3 ``socket.makefile`` method for use with anything that +wants to create a "fake" socket object. +""" +import io + +from socket import SocketIO + + +def backport_makefile(self, mode="r", buffering=None, encoding=None, + errors=None, newline=None): + """ + Backport of ``socket.makefile`` from Python 3.5. + """ + if not set(mode) <= {"r", "w", "b"}: + raise ValueError( + "invalid mode %r (only r, w, b allowed)" % (mode,) + ) + writing = "w" in mode + reading = "r" in mode or not writing + assert reading or writing + binary = "b" in mode + rawmode = "" + if reading: + rawmode += "r" + if writing: + rawmode += "w" + raw = SocketIO(self, rawmode) + self._makefile_refs += 1 + if buffering is None: + buffering = -1 + if buffering < 0: + buffering = io.DEFAULT_BUFFER_SIZE + if buffering == 0: + if not binary: + raise ValueError("unbuffered streams must be binary") + return raw + if reading and writing: + buffer = io.BufferedRWPair(raw, raw, buffering) + elif reading: + buffer = io.BufferedReader(raw, buffering) + else: + assert writing + buffer = io.BufferedWriter(raw, buffering) + if binary: + return buffer + text = io.TextIOWrapper(buffer, encoding, errors, newline) + text.mode = mode + return text diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/ordered_dict.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/ordered_dict.py new file mode 100644 index 0000000000000000000000000000000000000000..4479363cc45b5c7e0588072ccc19cab03fecce28 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/ordered_dict.py @@ -0,0 +1,259 @@ +# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. +# Passes Python2.7's test suite and incorporates all the latest updates. +# Copyright 2009 Raymond Hettinger, released under the MIT License. +# http://code.activestate.com/recipes/576693/ +try: + from thread import get_ident as _get_ident +except ImportError: + from dummy_thread import get_ident as _get_ident + +try: + from _abcoll import KeysView, ValuesView, ItemsView +except ImportError: + pass + + +class OrderedDict(dict): + 'Dictionary that remembers insertion order' + # An inherited dict maps keys to values. + # The inherited dict provides __getitem__, __len__, __contains__, and get. + # The remaining methods are order-aware. + # Big-O running times for all methods are the same as for regular dictionaries. + + # The internal self.__map dictionary maps keys to links in a doubly linked list. + # The circular doubly linked list starts and ends with a sentinel element. + # The sentinel element never gets deleted (this simplifies the algorithm). + # Each link is stored as a list of length three: [PREV, NEXT, KEY]. + + def __init__(self, *args, **kwds): + '''Initialize an ordered dictionary. Signature is the same as for + regular dictionaries, but keyword arguments are not recommended + because their insertion order is arbitrary. + + ''' + if len(args) > 1: + raise TypeError('expected at most 1 arguments, got %d' % len(args)) + try: + self.__root + except AttributeError: + self.__root = root = [] # sentinel node + root[:] = [root, root, None] + self.__map = {} + self.__update(*args, **kwds) + + def __setitem__(self, key, value, dict_setitem=dict.__setitem__): + 'od.__setitem__(i, y) <==> od[i]=y' + # Setting a new item creates a new link which goes at the end of the linked + # list, and the inherited dictionary is updated with the new key/value pair. + if key not in self: + root = self.__root + last = root[0] + last[1] = root[0] = self.__map[key] = [last, root, key] + dict_setitem(self, key, value) + + def __delitem__(self, key, dict_delitem=dict.__delitem__): + 'od.__delitem__(y) <==> del od[y]' + # Deleting an existing item uses self.__map to find the link which is + # then removed by updating the links in the predecessor and successor nodes. + dict_delitem(self, key) + link_prev, link_next, key = self.__map.pop(key) + link_prev[1] = link_next + link_next[0] = link_prev + + def __iter__(self): + 'od.__iter__() <==> iter(od)' + root = self.__root + curr = root[1] + while curr is not root: + yield curr[2] + curr = curr[1] + + def __reversed__(self): + 'od.__reversed__() <==> reversed(od)' + root = self.__root + curr = root[0] + while curr is not root: + yield curr[2] + curr = curr[0] + + def clear(self): + 'od.clear() -> None. Remove all items from od.' + try: + for node in self.__map.itervalues(): + del node[:] + root = self.__root + root[:] = [root, root, None] + self.__map.clear() + except AttributeError: + pass + dict.clear(self) + + def popitem(self, last=True): + '''od.popitem() -> (k, v), return and remove a (key, value) pair. + Pairs are returned in LIFO order if last is true or FIFO order if false. + + ''' + if not self: + raise KeyError('dictionary is empty') + root = self.__root + if last: + link = root[0] + link_prev = link[0] + link_prev[1] = root + root[0] = link_prev + else: + link = root[1] + link_next = link[1] + root[1] = link_next + link_next[0] = root + key = link[2] + del self.__map[key] + value = dict.pop(self, key) + return key, value + + # -- the following methods do not depend on the internal structure -- + + def keys(self): + 'od.keys() -> list of keys in od' + return list(self) + + def values(self): + 'od.values() -> list of values in od' + return [self[key] for key in self] + + def items(self): + 'od.items() -> list of (key, value) pairs in od' + return [(key, self[key]) for key in self] + + def iterkeys(self): + 'od.iterkeys() -> an iterator over the keys in od' + return iter(self) + + def itervalues(self): + 'od.itervalues -> an iterator over the values in od' + for k in self: + yield self[k] + + def iteritems(self): + 'od.iteritems -> an iterator over the (key, value) items in od' + for k in self: + yield (k, self[k]) + + def update(*args, **kwds): + '''od.update(E, **F) -> None. Update od from dict/iterable E and F. + + If E is a dict instance, does: for k in E: od[k] = E[k] + If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] + Or if E is an iterable of items, does: for k, v in E: od[k] = v + In either case, this is followed by: for k, v in F.items(): od[k] = v + + ''' + if len(args) > 2: + raise TypeError('update() takes at most 2 positional ' + 'arguments (%d given)' % (len(args),)) + elif not args: + raise TypeError('update() takes at least 1 argument (0 given)') + self = args[0] + # Make progressively weaker assumptions about "other" + other = () + if len(args) == 2: + other = args[1] + if isinstance(other, dict): + for key in other: + self[key] = other[key] + elif hasattr(other, 'keys'): + for key in other.keys(): + self[key] = other[key] + else: + for key, value in other: + self[key] = value + for key, value in kwds.items(): + self[key] = value + + __update = update # let subclasses override update without breaking __init__ + + __marker = object() + + def pop(self, key, default=__marker): + '''od.pop(k[,d]) -> v, remove specified key and return the corresponding value. + If key is not found, d is returned if given, otherwise KeyError is raised. + + ''' + if key in self: + result = self[key] + del self[key] + return result + if default is self.__marker: + raise KeyError(key) + return default + + def setdefault(self, key, default=None): + 'od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od' + if key in self: + return self[key] + self[key] = default + return default + + def __repr__(self, _repr_running={}): + 'od.__repr__() <==> repr(od)' + call_key = id(self), _get_ident() + if call_key in _repr_running: + return '...' + _repr_running[call_key] = 1 + try: + if not self: + return '%s()' % (self.__class__.__name__,) + return '%s(%r)' % (self.__class__.__name__, self.items()) + finally: + del _repr_running[call_key] + + def __reduce__(self): + 'Return state information for pickling' + items = [[k, self[k]] for k in self] + inst_dict = vars(self).copy() + for k in vars(OrderedDict()): + inst_dict.pop(k, None) + if inst_dict: + return (self.__class__, (items,), inst_dict) + return self.__class__, (items,) + + def copy(self): + 'od.copy() -> a shallow copy of od' + return self.__class__(self) + + @classmethod + def fromkeys(cls, iterable, value=None): + '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S + and values equal to v (which defaults to None). + + ''' + d = cls() + for key in iterable: + d[key] = value + return d + + def __eq__(self, other): + '''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive + while comparison to a regular mapping is order-insensitive. + + ''' + if isinstance(other, OrderedDict): + return len(self)==len(other) and self.items() == other.items() + return dict.__eq__(self, other) + + def __ne__(self, other): + return not self == other + + # -- the following methods are only used in Python 2.7 -- + + def viewkeys(self): + "od.viewkeys() -> a set-like object providing a view on od's keys" + return KeysView(self) + + def viewvalues(self): + "od.viewvalues() -> an object providing a view on od's values" + return ValuesView(self) + + def viewitems(self): + "od.viewitems() -> a set-like object providing a view on od's items" + return ItemsView(self) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/six.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/six.py new file mode 100644 index 0000000000000000000000000000000000000000..190c0239cd7d7af82a6e0cbc8d68053fa2e3dfaf --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/six.py @@ -0,0 +1,868 @@ +"""Utilities for writing code that runs on Python 2 and 3""" + +# Copyright (c) 2010-2015 Benjamin Peterson +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +from __future__ import absolute_import + +import functools +import itertools +import operator +import sys +import types + +__author__ = "Benjamin Peterson " +__version__ = "1.10.0" + + +# Useful for very coarse version differentiation. +PY2 = sys.version_info[0] == 2 +PY3 = sys.version_info[0] == 3 +PY34 = sys.version_info[0:2] >= (3, 4) + +if PY3: + string_types = str, + integer_types = int, + class_types = type, + text_type = str + binary_type = bytes + + MAXSIZE = sys.maxsize +else: + string_types = basestring, + integer_types = (int, long) + class_types = (type, types.ClassType) + text_type = unicode + binary_type = str + + if sys.platform.startswith("java"): + # Jython always uses 32 bits. + MAXSIZE = int((1 << 31) - 1) + else: + # It's possible to have sizeof(long) != sizeof(Py_ssize_t). + class X(object): + + def __len__(self): + return 1 << 31 + try: + len(X()) + except OverflowError: + # 32-bit + MAXSIZE = int((1 << 31) - 1) + else: + # 64-bit + MAXSIZE = int((1 << 63) - 1) + del X + + +def _add_doc(func, doc): + """Add documentation to a function.""" + func.__doc__ = doc + + +def _import_module(name): + """Import module, returning the module after the last dot.""" + __import__(name) + return sys.modules[name] + + +class _LazyDescr(object): + + def __init__(self, name): + self.name = name + + def __get__(self, obj, tp): + result = self._resolve() + setattr(obj, self.name, result) # Invokes __set__. + try: + # This is a bit ugly, but it avoids running this again by + # removing this descriptor. + delattr(obj.__class__, self.name) + except AttributeError: + pass + return result + + +class MovedModule(_LazyDescr): + + def __init__(self, name, old, new=None): + super(MovedModule, self).__init__(name) + if PY3: + if new is None: + new = name + self.mod = new + else: + self.mod = old + + def _resolve(self): + return _import_module(self.mod) + + def __getattr__(self, attr): + _module = self._resolve() + value = getattr(_module, attr) + setattr(self, attr, value) + return value + + +class _LazyModule(types.ModuleType): + + def __init__(self, name): + super(_LazyModule, self).__init__(name) + self.__doc__ = self.__class__.__doc__ + + def __dir__(self): + attrs = ["__doc__", "__name__"] + attrs += [attr.name for attr in self._moved_attributes] + return attrs + + # Subclasses should override this + _moved_attributes = [] + + +class MovedAttribute(_LazyDescr): + + def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None): + super(MovedAttribute, self).__init__(name) + if PY3: + if new_mod is None: + new_mod = name + self.mod = new_mod + if new_attr is None: + if old_attr is None: + new_attr = name + else: + new_attr = old_attr + self.attr = new_attr + else: + self.mod = old_mod + if old_attr is None: + old_attr = name + self.attr = old_attr + + def _resolve(self): + module = _import_module(self.mod) + return getattr(module, self.attr) + + +class _SixMetaPathImporter(object): + + """ + A meta path importer to import six.moves and its submodules. + + This class implements a PEP302 finder and loader. It should be compatible + with Python 2.5 and all existing versions of Python3 + """ + + def __init__(self, six_module_name): + self.name = six_module_name + self.known_modules = {} + + def _add_module(self, mod, *fullnames): + for fullname in fullnames: + self.known_modules[self.name + "." + fullname] = mod + + def _get_module(self, fullname): + return self.known_modules[self.name + "." + fullname] + + def find_module(self, fullname, path=None): + if fullname in self.known_modules: + return self + return None + + def __get_module(self, fullname): + try: + return self.known_modules[fullname] + except KeyError: + raise ImportError("This loader does not know module " + fullname) + + def load_module(self, fullname): + try: + # in case of a reload + return sys.modules[fullname] + except KeyError: + pass + mod = self.__get_module(fullname) + if isinstance(mod, MovedModule): + mod = mod._resolve() + else: + mod.__loader__ = self + sys.modules[fullname] = mod + return mod + + def is_package(self, fullname): + """ + Return true, if the named module is a package. + + We need this method to get correct spec objects with + Python 3.4 (see PEP451) + """ + return hasattr(self.__get_module(fullname), "__path__") + + def get_code(self, fullname): + """Return None + + Required, if is_package is implemented""" + self.__get_module(fullname) # eventually raises ImportError + return None + get_source = get_code # same as get_code + +_importer = _SixMetaPathImporter(__name__) + + +class _MovedItems(_LazyModule): + + """Lazy loading of moved objects""" + __path__ = [] # mark as package + + +_moved_attributes = [ + MovedAttribute("cStringIO", "cStringIO", "io", "StringIO"), + MovedAttribute("filter", "itertools", "builtins", "ifilter", "filter"), + MovedAttribute("filterfalse", "itertools", "itertools", "ifilterfalse", "filterfalse"), + MovedAttribute("input", "__builtin__", "builtins", "raw_input", "input"), + MovedAttribute("intern", "__builtin__", "sys"), + MovedAttribute("map", "itertools", "builtins", "imap", "map"), + MovedAttribute("getcwd", "os", "os", "getcwdu", "getcwd"), + MovedAttribute("getcwdb", "os", "os", "getcwd", "getcwdb"), + MovedAttribute("range", "__builtin__", "builtins", "xrange", "range"), + MovedAttribute("reload_module", "__builtin__", "importlib" if PY34 else "imp", "reload"), + MovedAttribute("reduce", "__builtin__", "functools"), + MovedAttribute("shlex_quote", "pipes", "shlex", "quote"), + MovedAttribute("StringIO", "StringIO", "io"), + MovedAttribute("UserDict", "UserDict", "collections"), + MovedAttribute("UserList", "UserList", "collections"), + MovedAttribute("UserString", "UserString", "collections"), + MovedAttribute("xrange", "__builtin__", "builtins", "xrange", "range"), + MovedAttribute("zip", "itertools", "builtins", "izip", "zip"), + MovedAttribute("zip_longest", "itertools", "itertools", "izip_longest", "zip_longest"), + MovedModule("builtins", "__builtin__"), + MovedModule("configparser", "ConfigParser"), + MovedModule("copyreg", "copy_reg"), + MovedModule("dbm_gnu", "gdbm", "dbm.gnu"), + MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread"), + MovedModule("http_cookiejar", "cookielib", "http.cookiejar"), + MovedModule("http_cookies", "Cookie", "http.cookies"), + MovedModule("html_entities", "htmlentitydefs", "html.entities"), + MovedModule("html_parser", "HTMLParser", "html.parser"), + MovedModule("http_client", "httplib", "http.client"), + MovedModule("email_mime_multipart", "email.MIMEMultipart", "email.mime.multipart"), + MovedModule("email_mime_nonmultipart", "email.MIMENonMultipart", "email.mime.nonmultipart"), + MovedModule("email_mime_text", "email.MIMEText", "email.mime.text"), + MovedModule("email_mime_base", "email.MIMEBase", "email.mime.base"), + MovedModule("BaseHTTPServer", "BaseHTTPServer", "http.server"), + MovedModule("CGIHTTPServer", "CGIHTTPServer", "http.server"), + MovedModule("SimpleHTTPServer", "SimpleHTTPServer", "http.server"), + MovedModule("cPickle", "cPickle", "pickle"), + MovedModule("queue", "Queue"), + MovedModule("reprlib", "repr"), + MovedModule("socketserver", "SocketServer"), + MovedModule("_thread", "thread", "_thread"), + MovedModule("tkinter", "Tkinter"), + MovedModule("tkinter_dialog", "Dialog", "tkinter.dialog"), + MovedModule("tkinter_filedialog", "FileDialog", "tkinter.filedialog"), + MovedModule("tkinter_scrolledtext", "ScrolledText", "tkinter.scrolledtext"), + MovedModule("tkinter_simpledialog", "SimpleDialog", "tkinter.simpledialog"), + MovedModule("tkinter_tix", "Tix", "tkinter.tix"), + MovedModule("tkinter_ttk", "ttk", "tkinter.ttk"), + MovedModule("tkinter_constants", "Tkconstants", "tkinter.constants"), + MovedModule("tkinter_dnd", "Tkdnd", "tkinter.dnd"), + MovedModule("tkinter_colorchooser", "tkColorChooser", + "tkinter.colorchooser"), + MovedModule("tkinter_commondialog", "tkCommonDialog", + "tkinter.commondialog"), + MovedModule("tkinter_tkfiledialog", "tkFileDialog", "tkinter.filedialog"), + MovedModule("tkinter_font", "tkFont", "tkinter.font"), + MovedModule("tkinter_messagebox", "tkMessageBox", "tkinter.messagebox"), + MovedModule("tkinter_tksimpledialog", "tkSimpleDialog", + "tkinter.simpledialog"), + MovedModule("urllib_parse", __name__ + ".moves.urllib_parse", "urllib.parse"), + MovedModule("urllib_error", __name__ + ".moves.urllib_error", "urllib.error"), + MovedModule("urllib", __name__ + ".moves.urllib", __name__ + ".moves.urllib"), + MovedModule("urllib_robotparser", "robotparser", "urllib.robotparser"), + MovedModule("xmlrpc_client", "xmlrpclib", "xmlrpc.client"), + MovedModule("xmlrpc_server", "SimpleXMLRPCServer", "xmlrpc.server"), +] +# Add windows specific modules. +if sys.platform == "win32": + _moved_attributes += [ + MovedModule("winreg", "_winreg"), + ] + +for attr in _moved_attributes: + setattr(_MovedItems, attr.name, attr) + if isinstance(attr, MovedModule): + _importer._add_module(attr, "moves." + attr.name) +del attr + +_MovedItems._moved_attributes = _moved_attributes + +moves = _MovedItems(__name__ + ".moves") +_importer._add_module(moves, "moves") + + +class Module_six_moves_urllib_parse(_LazyModule): + + """Lazy loading of moved objects in six.moves.urllib_parse""" + + +_urllib_parse_moved_attributes = [ + MovedAttribute("ParseResult", "urlparse", "urllib.parse"), + MovedAttribute("SplitResult", "urlparse", "urllib.parse"), + MovedAttribute("parse_qs", "urlparse", "urllib.parse"), + MovedAttribute("parse_qsl", "urlparse", "urllib.parse"), + MovedAttribute("urldefrag", "urlparse", "urllib.parse"), + MovedAttribute("urljoin", "urlparse", "urllib.parse"), + MovedAttribute("urlparse", "urlparse", "urllib.parse"), + MovedAttribute("urlsplit", "urlparse", "urllib.parse"), + MovedAttribute("urlunparse", "urlparse", "urllib.parse"), + MovedAttribute("urlunsplit", "urlparse", "urllib.parse"), + MovedAttribute("quote", "urllib", "urllib.parse"), + MovedAttribute("quote_plus", "urllib", "urllib.parse"), + MovedAttribute("unquote", "urllib", "urllib.parse"), + MovedAttribute("unquote_plus", "urllib", "urllib.parse"), + MovedAttribute("urlencode", "urllib", "urllib.parse"), + MovedAttribute("splitquery", "urllib", "urllib.parse"), + MovedAttribute("splittag", "urllib", "urllib.parse"), + MovedAttribute("splituser", "urllib", "urllib.parse"), + MovedAttribute("uses_fragment", "urlparse", "urllib.parse"), + MovedAttribute("uses_netloc", "urlparse", "urllib.parse"), + MovedAttribute("uses_params", "urlparse", "urllib.parse"), + MovedAttribute("uses_query", "urlparse", "urllib.parse"), + MovedAttribute("uses_relative", "urlparse", "urllib.parse"), +] +for attr in _urllib_parse_moved_attributes: + setattr(Module_six_moves_urllib_parse, attr.name, attr) +del attr + +Module_six_moves_urllib_parse._moved_attributes = _urllib_parse_moved_attributes + +_importer._add_module(Module_six_moves_urllib_parse(__name__ + ".moves.urllib_parse"), + "moves.urllib_parse", "moves.urllib.parse") + + +class Module_six_moves_urllib_error(_LazyModule): + + """Lazy loading of moved objects in six.moves.urllib_error""" + + +_urllib_error_moved_attributes = [ + MovedAttribute("URLError", "urllib2", "urllib.error"), + MovedAttribute("HTTPError", "urllib2", "urllib.error"), + MovedAttribute("ContentTooShortError", "urllib", "urllib.error"), +] +for attr in _urllib_error_moved_attributes: + setattr(Module_six_moves_urllib_error, attr.name, attr) +del attr + +Module_six_moves_urllib_error._moved_attributes = _urllib_error_moved_attributes + +_importer._add_module(Module_six_moves_urllib_error(__name__ + ".moves.urllib.error"), + "moves.urllib_error", "moves.urllib.error") + + +class Module_six_moves_urllib_request(_LazyModule): + + """Lazy loading of moved objects in six.moves.urllib_request""" + + +_urllib_request_moved_attributes = [ + MovedAttribute("urlopen", "urllib2", "urllib.request"), + MovedAttribute("install_opener", "urllib2", "urllib.request"), + MovedAttribute("build_opener", "urllib2", "urllib.request"), + MovedAttribute("pathname2url", "urllib", "urllib.request"), + MovedAttribute("url2pathname", "urllib", "urllib.request"), + MovedAttribute("getproxies", "urllib", "urllib.request"), + MovedAttribute("Request", "urllib2", "urllib.request"), + MovedAttribute("OpenerDirector", "urllib2", "urllib.request"), + MovedAttribute("HTTPDefaultErrorHandler", "urllib2", "urllib.request"), + MovedAttribute("HTTPRedirectHandler", "urllib2", "urllib.request"), + MovedAttribute("HTTPCookieProcessor", "urllib2", "urllib.request"), + MovedAttribute("ProxyHandler", "urllib2", "urllib.request"), + MovedAttribute("BaseHandler", "urllib2", "urllib.request"), + MovedAttribute("HTTPPasswordMgr", "urllib2", "urllib.request"), + MovedAttribute("HTTPPasswordMgrWithDefaultRealm", "urllib2", "urllib.request"), + MovedAttribute("AbstractBasicAuthHandler", "urllib2", "urllib.request"), + MovedAttribute("HTTPBasicAuthHandler", "urllib2", "urllib.request"), + MovedAttribute("ProxyBasicAuthHandler", "urllib2", "urllib.request"), + MovedAttribute("AbstractDigestAuthHandler", "urllib2", "urllib.request"), + MovedAttribute("HTTPDigestAuthHandler", "urllib2", "urllib.request"), + MovedAttribute("ProxyDigestAuthHandler", "urllib2", "urllib.request"), + MovedAttribute("HTTPHandler", "urllib2", "urllib.request"), + MovedAttribute("HTTPSHandler", "urllib2", "urllib.request"), + MovedAttribute("FileHandler", "urllib2", "urllib.request"), + MovedAttribute("FTPHandler", "urllib2", "urllib.request"), + MovedAttribute("CacheFTPHandler", "urllib2", "urllib.request"), + MovedAttribute("UnknownHandler", "urllib2", "urllib.request"), + MovedAttribute("HTTPErrorProcessor", "urllib2", "urllib.request"), + MovedAttribute("urlretrieve", "urllib", "urllib.request"), + MovedAttribute("urlcleanup", "urllib", "urllib.request"), + MovedAttribute("URLopener", "urllib", "urllib.request"), + MovedAttribute("FancyURLopener", "urllib", "urllib.request"), + MovedAttribute("proxy_bypass", "urllib", "urllib.request"), +] +for attr in _urllib_request_moved_attributes: + setattr(Module_six_moves_urllib_request, attr.name, attr) +del attr + +Module_six_moves_urllib_request._moved_attributes = _urllib_request_moved_attributes + +_importer._add_module(Module_six_moves_urllib_request(__name__ + ".moves.urllib.request"), + "moves.urllib_request", "moves.urllib.request") + + +class Module_six_moves_urllib_response(_LazyModule): + + """Lazy loading of moved objects in six.moves.urllib_response""" + + +_urllib_response_moved_attributes = [ + MovedAttribute("addbase", "urllib", "urllib.response"), + MovedAttribute("addclosehook", "urllib", "urllib.response"), + MovedAttribute("addinfo", "urllib", "urllib.response"), + MovedAttribute("addinfourl", "urllib", "urllib.response"), +] +for attr in _urllib_response_moved_attributes: + setattr(Module_six_moves_urllib_response, attr.name, attr) +del attr + +Module_six_moves_urllib_response._moved_attributes = _urllib_response_moved_attributes + +_importer._add_module(Module_six_moves_urllib_response(__name__ + ".moves.urllib.response"), + "moves.urllib_response", "moves.urllib.response") + + +class Module_six_moves_urllib_robotparser(_LazyModule): + + """Lazy loading of moved objects in six.moves.urllib_robotparser""" + + +_urllib_robotparser_moved_attributes = [ + MovedAttribute("RobotFileParser", "robotparser", "urllib.robotparser"), +] +for attr in _urllib_robotparser_moved_attributes: + setattr(Module_six_moves_urllib_robotparser, attr.name, attr) +del attr + +Module_six_moves_urllib_robotparser._moved_attributes = _urllib_robotparser_moved_attributes + +_importer._add_module(Module_six_moves_urllib_robotparser(__name__ + ".moves.urllib.robotparser"), + "moves.urllib_robotparser", "moves.urllib.robotparser") + + +class Module_six_moves_urllib(types.ModuleType): + + """Create a six.moves.urllib namespace that resembles the Python 3 namespace""" + __path__ = [] # mark as package + parse = _importer._get_module("moves.urllib_parse") + error = _importer._get_module("moves.urllib_error") + request = _importer._get_module("moves.urllib_request") + response = _importer._get_module("moves.urllib_response") + robotparser = _importer._get_module("moves.urllib_robotparser") + + def __dir__(self): + return ['parse', 'error', 'request', 'response', 'robotparser'] + +_importer._add_module(Module_six_moves_urllib(__name__ + ".moves.urllib"), + "moves.urllib") + + +def add_move(move): + """Add an item to six.moves.""" + setattr(_MovedItems, move.name, move) + + +def remove_move(name): + """Remove item from six.moves.""" + try: + delattr(_MovedItems, name) + except AttributeError: + try: + del moves.__dict__[name] + except KeyError: + raise AttributeError("no such move, %r" % (name,)) + + +if PY3: + _meth_func = "__func__" + _meth_self = "__self__" + + _func_closure = "__closure__" + _func_code = "__code__" + _func_defaults = "__defaults__" + _func_globals = "__globals__" +else: + _meth_func = "im_func" + _meth_self = "im_self" + + _func_closure = "func_closure" + _func_code = "func_code" + _func_defaults = "func_defaults" + _func_globals = "func_globals" + + +try: + advance_iterator = next +except NameError: + def advance_iterator(it): + return it.next() +next = advance_iterator + + +try: + callable = callable +except NameError: + def callable(obj): + return any("__call__" in klass.__dict__ for klass in type(obj).__mro__) + + +if PY3: + def get_unbound_function(unbound): + return unbound + + create_bound_method = types.MethodType + + def create_unbound_method(func, cls): + return func + + Iterator = object +else: + def get_unbound_function(unbound): + return unbound.im_func + + def create_bound_method(func, obj): + return types.MethodType(func, obj, obj.__class__) + + def create_unbound_method(func, cls): + return types.MethodType(func, None, cls) + + class Iterator(object): + + def next(self): + return type(self).__next__(self) + + callable = callable +_add_doc(get_unbound_function, + """Get the function out of a possibly unbound function""") + + +get_method_function = operator.attrgetter(_meth_func) +get_method_self = operator.attrgetter(_meth_self) +get_function_closure = operator.attrgetter(_func_closure) +get_function_code = operator.attrgetter(_func_code) +get_function_defaults = operator.attrgetter(_func_defaults) +get_function_globals = operator.attrgetter(_func_globals) + + +if PY3: + def iterkeys(d, **kw): + return iter(d.keys(**kw)) + + def itervalues(d, **kw): + return iter(d.values(**kw)) + + def iteritems(d, **kw): + return iter(d.items(**kw)) + + def iterlists(d, **kw): + return iter(d.lists(**kw)) + + viewkeys = operator.methodcaller("keys") + + viewvalues = operator.methodcaller("values") + + viewitems = operator.methodcaller("items") +else: + def iterkeys(d, **kw): + return d.iterkeys(**kw) + + def itervalues(d, **kw): + return d.itervalues(**kw) + + def iteritems(d, **kw): + return d.iteritems(**kw) + + def iterlists(d, **kw): + return d.iterlists(**kw) + + viewkeys = operator.methodcaller("viewkeys") + + viewvalues = operator.methodcaller("viewvalues") + + viewitems = operator.methodcaller("viewitems") + +_add_doc(iterkeys, "Return an iterator over the keys of a dictionary.") +_add_doc(itervalues, "Return an iterator over the values of a dictionary.") +_add_doc(iteritems, + "Return an iterator over the (key, value) pairs of a dictionary.") +_add_doc(iterlists, + "Return an iterator over the (key, [values]) pairs of a dictionary.") + + +if PY3: + def b(s): + return s.encode("latin-1") + + def u(s): + return s + unichr = chr + import struct + int2byte = struct.Struct(">B").pack + del struct + byte2int = operator.itemgetter(0) + indexbytes = operator.getitem + iterbytes = iter + import io + StringIO = io.StringIO + BytesIO = io.BytesIO + _assertCountEqual = "assertCountEqual" + if sys.version_info[1] <= 1: + _assertRaisesRegex = "assertRaisesRegexp" + _assertRegex = "assertRegexpMatches" + else: + _assertRaisesRegex = "assertRaisesRegex" + _assertRegex = "assertRegex" +else: + def b(s): + return s + # Workaround for standalone backslash + + def u(s): + return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape") + unichr = unichr + int2byte = chr + + def byte2int(bs): + return ord(bs[0]) + + def indexbytes(buf, i): + return ord(buf[i]) + iterbytes = functools.partial(itertools.imap, ord) + import StringIO + StringIO = BytesIO = StringIO.StringIO + _assertCountEqual = "assertItemsEqual" + _assertRaisesRegex = "assertRaisesRegexp" + _assertRegex = "assertRegexpMatches" +_add_doc(b, """Byte literal""") +_add_doc(u, """Text literal""") + + +def assertCountEqual(self, *args, **kwargs): + return getattr(self, _assertCountEqual)(*args, **kwargs) + + +def assertRaisesRegex(self, *args, **kwargs): + return getattr(self, _assertRaisesRegex)(*args, **kwargs) + + +def assertRegex(self, *args, **kwargs): + return getattr(self, _assertRegex)(*args, **kwargs) + + +if PY3: + exec_ = getattr(moves.builtins, "exec") + + def reraise(tp, value, tb=None): + if value is None: + value = tp() + if value.__traceback__ is not tb: + raise value.with_traceback(tb) + raise value + +else: + def exec_(_code_, _globs_=None, _locs_=None): + """Execute code in a namespace.""" + if _globs_ is None: + frame = sys._getframe(1) + _globs_ = frame.f_globals + if _locs_ is None: + _locs_ = frame.f_locals + del frame + elif _locs_ is None: + _locs_ = _globs_ + exec("""exec _code_ in _globs_, _locs_""") + + exec_("""def reraise(tp, value, tb=None): + raise tp, value, tb +""") + + +if sys.version_info[:2] == (3, 2): + exec_("""def raise_from(value, from_value): + if from_value is None: + raise value + raise value from from_value +""") +elif sys.version_info[:2] > (3, 2): + exec_("""def raise_from(value, from_value): + raise value from from_value +""") +else: + def raise_from(value, from_value): + raise value + + +print_ = getattr(moves.builtins, "print", None) +if print_ is None: + def print_(*args, **kwargs): + """The new-style print function for Python 2.4 and 2.5.""" + fp = kwargs.pop("file", sys.stdout) + if fp is None: + return + + def write(data): + if not isinstance(data, basestring): + data = str(data) + # If the file has an encoding, encode unicode with it. + if (isinstance(fp, file) and + isinstance(data, unicode) and + fp.encoding is not None): + errors = getattr(fp, "errors", None) + if errors is None: + errors = "strict" + data = data.encode(fp.encoding, errors) + fp.write(data) + want_unicode = False + sep = kwargs.pop("sep", None) + if sep is not None: + if isinstance(sep, unicode): + want_unicode = True + elif not isinstance(sep, str): + raise TypeError("sep must be None or a string") + end = kwargs.pop("end", None) + if end is not None: + if isinstance(end, unicode): + want_unicode = True + elif not isinstance(end, str): + raise TypeError("end must be None or a string") + if kwargs: + raise TypeError("invalid keyword arguments to print()") + if not want_unicode: + for arg in args: + if isinstance(arg, unicode): + want_unicode = True + break + if want_unicode: + newline = unicode("\n") + space = unicode(" ") + else: + newline = "\n" + space = " " + if sep is None: + sep = space + if end is None: + end = newline + for i, arg in enumerate(args): + if i: + write(sep) + write(arg) + write(end) +if sys.version_info[:2] < (3, 3): + _print = print_ + + def print_(*args, **kwargs): + fp = kwargs.get("file", sys.stdout) + flush = kwargs.pop("flush", False) + _print(*args, **kwargs) + if flush and fp is not None: + fp.flush() + +_add_doc(reraise, """Reraise an exception.""") + +if sys.version_info[0:2] < (3, 4): + def wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS, + updated=functools.WRAPPER_UPDATES): + def wrapper(f): + f = functools.wraps(wrapped, assigned, updated)(f) + f.__wrapped__ = wrapped + return f + return wrapper +else: + wraps = functools.wraps + + +def with_metaclass(meta, *bases): + """Create a base class with a metaclass.""" + # This requires a bit of explanation: the basic idea is to make a dummy + # metaclass for one level of class instantiation that replaces itself with + # the actual metaclass. + class metaclass(meta): + + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + return type.__new__(metaclass, 'temporary_class', (), {}) + + +def add_metaclass(metaclass): + """Class decorator for creating a class with a metaclass.""" + def wrapper(cls): + orig_vars = cls.__dict__.copy() + slots = orig_vars.get('__slots__') + if slots is not None: + if isinstance(slots, str): + slots = [slots] + for slots_var in slots: + orig_vars.pop(slots_var) + orig_vars.pop('__dict__', None) + orig_vars.pop('__weakref__', None) + return metaclass(cls.__name__, cls.__bases__, orig_vars) + return wrapper + + +def python_2_unicode_compatible(klass): + """ + A decorator that defines __unicode__ and __str__ methods under Python 2. + Under Python 3 it does nothing. + + To support Python 2 and 3 with a single code base, define a __str__ method + returning text and apply this decorator to the class. + """ + if PY2: + if '__str__' not in klass.__dict__: + raise ValueError("@python_2_unicode_compatible cannot be applied " + "to %s because it doesn't define __str__()." % + klass.__name__) + klass.__unicode__ = klass.__str__ + klass.__str__ = lambda self: self.__unicode__().encode('utf-8') + return klass + + +# Complete the moves implementation. +# This code is at the end of this module to speed up module loading. +# Turn this module into a package. +__path__ = [] # required for PEP 302 and PEP 451 +__package__ = __name__ # see PEP 366 @ReservedAssignment +if globals().get("__spec__") is not None: + __spec__.submodule_search_locations = [] # PEP 451 @UndefinedVariable +# Remove other six meta path importers, since they cause problems. This can +# happen if six is removed from sys.modules and then reloaded. (Setuptools does +# this for some reason.) +if sys.meta_path: + for i, importer in enumerate(sys.meta_path): + # Here's some real nastiness: Another "instance" of the six module might + # be floating around. Therefore, we can't use isinstance() to check for + # the six meta path importer, since the other six instance will have + # inserted an importer with different class. + if (type(importer).__name__ == "_SixMetaPathImporter" and + importer.name == __name__): + del sys.meta_path[i] + break + del i, importer +# Finally, add the importer to the meta path import hook. +sys.meta_path.append(_importer) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/socks.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/socks.py new file mode 100644 index 0000000000000000000000000000000000000000..e14c3fc5629f9d378b0a4b63c410533b80167fa8 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/socks.py @@ -0,0 +1,873 @@ +"""SocksiPy - Python SOCKS module. + +Copyright 2006 Dan-Haim. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +3. Neither the name of Dan Haim nor the names of his contributors may be used + to endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY DAN HAIM "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +EVENT SHALL DAN HAIM OR HIS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +This module provides a standard socket-like interface for Python +for tunneling connections through SOCKS proxies. + +=============================================================================== + +Minor modifications made by Christopher Gilbert (http://motomastyle.com/) +for use in PyLoris (http://pyloris.sourceforge.net/) + +Minor modifications made by Mario Vilas (http://breakingcode.wordpress.com/) +mainly to merge bug fixes found in Sourceforge + +Modifications made by Anorov (https://github.com/Anorov) +-Forked and renamed to PySocks +-Fixed issue with HTTP proxy failure checking (same bug that was in the + old ___recvall() method) +-Included SocksiPyHandler (sockshandler.py), to be used as a urllib2 handler, + courtesy of e000 (https://github.com/e000): + https://gist.github.com/869791#file_socksipyhandler.py +-Re-styled code to make it readable + -Aliased PROXY_TYPE_SOCKS5 -> SOCKS5 etc. + -Improved exception handling and output + -Removed irritating use of sequence indexes, replaced with tuple unpacked + variables + -Fixed up Python 3 bytestring handling - chr(0x03).encode() -> b"\x03" + -Other general fixes +-Added clarification that the HTTP proxy connection method only supports + CONNECT-style tunneling HTTP proxies +-Various small bug fixes +""" + +from base64 import b64encode +try: + from collections.abc import Callable +except ImportError: + from collections import Callable +from errno import EOPNOTSUPP, EINVAL, EAGAIN +import functools +from io import BytesIO +import logging +import os +from os import SEEK_CUR +import socket +import struct +import sys + +__version__ = "1.6.7" + + +if os.name == "nt" and sys.version_info < (3, 0): + try: + import win_inet_pton + except ImportError: + raise ImportError( + "To run PySocks on Windows you must install win_inet_pton") + +log = logging.getLogger(__name__) + +PROXY_TYPE_SOCKS4 = SOCKS4 = 1 +PROXY_TYPE_SOCKS5 = SOCKS5 = 2 +PROXY_TYPE_HTTP = HTTP = 3 + +PROXY_TYPES = {"SOCKS4": SOCKS4, "SOCKS5": SOCKS5, "HTTP": HTTP} +PRINTABLE_PROXY_TYPES = dict(zip(PROXY_TYPES.values(), PROXY_TYPES.keys())) + +_orgsocket = _orig_socket = socket.socket + + +def set_self_blocking(function): + + @functools.wraps(function) + def wrapper(*args, **kwargs): + self = args[0] + try: + _is_blocking = self.gettimeout() + if _is_blocking == 0: + self.setblocking(True) + return function(*args, **kwargs) + except Exception as e: + raise + finally: + # set orgin blocking + if _is_blocking == 0: + self.setblocking(False) + return wrapper + + +class ProxyError(IOError): + """Socket_err contains original socket.error exception.""" + def __init__(self, msg, socket_err=None): + self.msg = msg + self.socket_err = socket_err + + if socket_err: + self.msg += ": {0}".format(socket_err) + + def __str__(self): + return self.msg + + +class GeneralProxyError(ProxyError): + pass + + +class ProxyConnectionError(ProxyError): + pass + + +class SOCKS5AuthError(ProxyError): + pass + + +class SOCKS5Error(ProxyError): + pass + + +class SOCKS4Error(ProxyError): + pass + + +class HTTPError(ProxyError): + pass + +SOCKS4_ERRORS = { + 0x5B: "Request rejected or failed", + 0x5C: ("Request rejected because SOCKS server cannot connect to identd on" + " the client"), + 0x5D: ("Request rejected because the client program and identd report" + " different user-ids") +} + +SOCKS5_ERRORS = { + 0x01: "General SOCKS server failure", + 0x02: "Connection not allowed by ruleset", + 0x03: "Network unreachable", + 0x04: "Host unreachable", + 0x05: "Connection refused", + 0x06: "TTL expired", + 0x07: "Command not supported, or protocol error", + 0x08: "Address type not supported" +} + +DEFAULT_PORTS = {SOCKS4: 1080, SOCKS5: 1080, HTTP: 8080} + + +def set_default_proxy(proxy_type=None, addr=None, port=None, rdns=True, + username=None, password=None): + """Sets a default proxy. + + All further socksocket objects will use the default unless explicitly + changed. All parameters are as for socket.set_proxy().""" + socksocket.default_proxy = (proxy_type, addr, port, rdns, + username.encode() if username else None, + password.encode() if password else None) + + +def setdefaultproxy(*args, **kwargs): + if "proxytype" in kwargs: + kwargs["proxy_type"] = kwargs.pop("proxytype") + return set_default_proxy(*args, **kwargs) + + +def get_default_proxy(): + """Returns the default proxy, set by set_default_proxy.""" + return socksocket.default_proxy + +getdefaultproxy = get_default_proxy + + +def wrap_module(module): + """Attempts to replace a module's socket library with a SOCKS socket. + + Must set a default proxy using set_default_proxy(...) first. This will + only work on modules that import socket directly into the namespace; + most of the Python Standard Library falls into this category.""" + if socksocket.default_proxy: + module.socket.socket = socksocket + else: + raise GeneralProxyError("No default proxy specified") + +wrapmodule = wrap_module + + +def create_connection(dest_pair, + timeout=None, source_address=None, + proxy_type=None, proxy_addr=None, + proxy_port=None, proxy_rdns=True, + proxy_username=None, proxy_password=None, + socket_options=None): + """create_connection(dest_pair, *[, timeout], **proxy_args) -> socket object + + Like socket.create_connection(), but connects to proxy + before returning the socket object. + + dest_pair - 2-tuple of (IP/hostname, port). + **proxy_args - Same args passed to socksocket.set_proxy() if present. + timeout - Optional socket timeout value, in seconds. + source_address - tuple (host, port) for the socket to bind to as its source + address before connecting (only for compatibility) + """ + # Remove IPv6 brackets on the remote address and proxy address. + remote_host, remote_port = dest_pair + if remote_host.startswith("["): + remote_host = remote_host.strip("[]") + if proxy_addr and proxy_addr.startswith("["): + proxy_addr = proxy_addr.strip("[]") + + err = None + + # Allow the SOCKS proxy to be on IPv4 or IPv6 addresses. + for r in socket.getaddrinfo(proxy_addr, proxy_port, 0, socket.SOCK_STREAM): + family, socket_type, proto, canonname, sa = r + sock = None + try: + sock = socksocket(family, socket_type, proto) + + if socket_options: + for opt in socket_options: + sock.setsockopt(*opt) + + if isinstance(timeout, (int, float)): + sock.settimeout(timeout) + + if proxy_type: + sock.set_proxy(proxy_type, proxy_addr, proxy_port, proxy_rdns, + proxy_username, proxy_password) + if source_address: + sock.bind(source_address) + + sock.connect((remote_host, remote_port)) + return sock + + except (socket.error, ProxyConnectionError) as e: + err = e + if sock: + sock.close() + sock = None + + if err: + raise err + + raise socket.error("gai returned empty list.") + + +class _BaseSocket(socket.socket): + """Allows Python 2 delegated methods such as send() to be overridden.""" + def __init__(self, *pos, **kw): + _orig_socket.__init__(self, *pos, **kw) + + self._savedmethods = dict() + for name in self._savenames: + self._savedmethods[name] = getattr(self, name) + delattr(self, name) # Allows normal overriding mechanism to work + + _savenames = list() + + +def _makemethod(name): + return lambda self, *pos, **kw: self._savedmethods[name](*pos, **kw) +for name in ("sendto", "send", "recvfrom", "recv"): + method = getattr(_BaseSocket, name, None) + + # Determine if the method is not defined the usual way + # as a function in the class. + # Python 2 uses __slots__, so there are descriptors for each method, + # but they are not functions. + if not isinstance(method, Callable): + _BaseSocket._savenames.append(name) + setattr(_BaseSocket, name, _makemethod(name)) + + +class socksocket(_BaseSocket): + """socksocket([family[, type[, proto]]]) -> socket object + + Open a SOCKS enabled socket. The parameters are the same as + those of the standard socket init. In order for SOCKS to work, + you must specify family=AF_INET and proto=0. + The "type" argument must be either SOCK_STREAM or SOCK_DGRAM. + """ + + default_proxy = None + + def __init__(self, family=socket.AF_INET, type=socket.SOCK_STREAM, + proto=0, *args, **kwargs): + if type not in (socket.SOCK_STREAM, socket.SOCK_DGRAM): + msg = "Socket type must be stream or datagram, not {!r}" + raise ValueError(msg.format(type)) + + super(socksocket, self).__init__(family, type, proto, *args, **kwargs) + self._proxyconn = None # TCP connection to keep UDP relay alive + + if self.default_proxy: + self.proxy = self.default_proxy + else: + self.proxy = (None, None, None, None, None, None) + self.proxy_sockname = None + self.proxy_peername = None + + self._timeout = None + + def _readall(self, file, count): + """Receive EXACTLY the number of bytes requested from the file object. + + Blocks until the required number of bytes have been received.""" + data = b"" + while len(data) < count: + d = file.read(count - len(data)) + if not d: + raise GeneralProxyError("Connection closed unexpectedly") + data += d + return data + + def settimeout(self, timeout): + self._timeout = timeout + try: + # test if we're connected, if so apply timeout + peer = self.get_proxy_peername() + super(socksocket, self).settimeout(self._timeout) + except socket.error: + pass + + def gettimeout(self): + return self._timeout + + def setblocking(self, v): + if v: + self.settimeout(None) + else: + self.settimeout(0.0) + + def set_proxy(self, proxy_type=None, addr=None, port=None, rdns=True, + username=None, password=None): + """ Sets the proxy to be used. + + proxy_type - The type of the proxy to be used. Three types + are supported: PROXY_TYPE_SOCKS4 (including socks4a), + PROXY_TYPE_SOCKS5 and PROXY_TYPE_HTTP + addr - The address of the server (IP or DNS). + port - The port of the server. Defaults to 1080 for SOCKS + servers and 8080 for HTTP proxy servers. + rdns - Should DNS queries be performed on the remote side + (rather than the local side). The default is True. + Note: This has no effect with SOCKS4 servers. + username - Username to authenticate with to the server. + The default is no authentication. + password - Password to authenticate with to the server. + Only relevant when username is also provided.""" + self.proxy = (proxy_type, addr, port, rdns, + username.encode() if username else None, + password.encode() if password else None) + + def setproxy(self, *args, **kwargs): + if "proxytype" in kwargs: + kwargs["proxy_type"] = kwargs.pop("proxytype") + return self.set_proxy(*args, **kwargs) + + def bind(self, *pos, **kw): + """Implements proxy connection for UDP sockets. + + Happens during the bind() phase.""" + (proxy_type, proxy_addr, proxy_port, rdns, username, + password) = self.proxy + if not proxy_type or self.type != socket.SOCK_DGRAM: + return _orig_socket.bind(self, *pos, **kw) + + if self._proxyconn: + raise socket.error(EINVAL, "Socket already bound to an address") + if proxy_type != SOCKS5: + msg = "UDP only supported by SOCKS5 proxy type" + raise socket.error(EOPNOTSUPP, msg) + super(socksocket, self).bind(*pos, **kw) + + # Need to specify actual local port because + # some relays drop packets if a port of zero is specified. + # Avoid specifying host address in case of NAT though. + _, port = self.getsockname() + dst = ("0", port) + + self._proxyconn = _orig_socket() + proxy = self._proxy_addr() + self._proxyconn.connect(proxy) + + UDP_ASSOCIATE = b"\x03" + _, relay = self._SOCKS5_request(self._proxyconn, UDP_ASSOCIATE, dst) + + # The relay is most likely on the same host as the SOCKS proxy, + # but some proxies return a private IP address (10.x.y.z) + host, _ = proxy + _, port = relay + super(socksocket, self).connect((host, port)) + super(socksocket, self).settimeout(self._timeout) + self.proxy_sockname = ("0.0.0.0", 0) # Unknown + + def sendto(self, bytes, *args, **kwargs): + if self.type != socket.SOCK_DGRAM: + return super(socksocket, self).sendto(bytes, *args, **kwargs) + if not self._proxyconn: + self.bind(("", 0)) + + address = args[-1] + flags = args[:-1] + + header = BytesIO() + RSV = b"\x00\x00" + header.write(RSV) + STANDALONE = b"\x00" + header.write(STANDALONE) + self._write_SOCKS5_address(address, header) + + sent = super(socksocket, self).send(header.getvalue() + bytes, *flags, + **kwargs) + return sent - header.tell() + + def send(self, bytes, flags=0, **kwargs): + if self.type == socket.SOCK_DGRAM: + return self.sendto(bytes, flags, self.proxy_peername, **kwargs) + else: + return super(socksocket, self).send(bytes, flags, **kwargs) + + def recvfrom(self, bufsize, flags=0): + if self.type != socket.SOCK_DGRAM: + return super(socksocket, self).recvfrom(bufsize, flags) + if not self._proxyconn: + self.bind(("", 0)) + + buf = BytesIO(super(socksocket, self).recv(bufsize + 1024, flags)) + buf.seek(2, SEEK_CUR) + frag = buf.read(1) + if ord(frag): + raise NotImplementedError("Received UDP packet fragment") + fromhost, fromport = self._read_SOCKS5_address(buf) + + if self.proxy_peername: + peerhost, peerport = self.proxy_peername + if fromhost != peerhost or peerport not in (0, fromport): + raise socket.error(EAGAIN, "Packet filtered") + + return (buf.read(bufsize), (fromhost, fromport)) + + def recv(self, *pos, **kw): + bytes, _ = self.recvfrom(*pos, **kw) + return bytes + + def close(self): + if self._proxyconn: + self._proxyconn.close() + return super(socksocket, self).close() + + def get_proxy_sockname(self): + """Returns the bound IP address and port number at the proxy.""" + return self.proxy_sockname + + getproxysockname = get_proxy_sockname + + def get_proxy_peername(self): + """ + Returns the IP and port number of the proxy. + """ + return self.getpeername() + + getproxypeername = get_proxy_peername + + def get_peername(self): + """Returns the IP address and port number of the destination machine. + + Note: get_proxy_peername returns the proxy.""" + return self.proxy_peername + + getpeername = get_peername + + def _negotiate_SOCKS5(self, *dest_addr): + """Negotiates a stream connection through a SOCKS5 server.""" + CONNECT = b"\x01" + self.proxy_peername, self.proxy_sockname = self._SOCKS5_request( + self, CONNECT, dest_addr) + + def _SOCKS5_request(self, conn, cmd, dst): + """ + Send SOCKS5 request with given command (CMD field) and + address (DST field). Returns resolved DST address that was used. + """ + proxy_type, addr, port, rdns, username, password = self.proxy + + writer = conn.makefile("wb") + reader = conn.makefile("rb", 0) # buffering=0 renamed in Python 3 + try: + # First we'll send the authentication packages we support. + if username and password: + # The username/password details were supplied to the + # set_proxy method so we support the USERNAME/PASSWORD + # authentication (in addition to the standard none). + writer.write(b"\x05\x02\x00\x02") + else: + # No username/password were entered, therefore we + # only support connections with no authentication. + writer.write(b"\x05\x01\x00") + + # We'll receive the server's response to determine which + # method was selected + writer.flush() + chosen_auth = self._readall(reader, 2) + + if chosen_auth[0:1] != b"\x05": + # Note: string[i:i+1] is used because indexing of a bytestring + # via bytestring[i] yields an integer in Python 3 + raise GeneralProxyError( + "SOCKS5 proxy server sent invalid data") + + # Check the chosen authentication method + + if chosen_auth[1:2] == b"\x02": + # Okay, we need to perform a basic username/password + # authentication. + writer.write(b"\x01" + chr(len(username)).encode() + + username + + chr(len(password)).encode() + + password) + writer.flush() + auth_status = self._readall(reader, 2) + if auth_status[0:1] != b"\x01": + # Bad response + raise GeneralProxyError( + "SOCKS5 proxy server sent invalid data") + if auth_status[1:2] != b"\x00": + # Authentication failed + raise SOCKS5AuthError("SOCKS5 authentication failed") + + # Otherwise, authentication succeeded + + # No authentication is required if 0x00 + elif chosen_auth[1:2] != b"\x00": + # Reaching here is always bad + if chosen_auth[1:2] == b"\xFF": + raise SOCKS5AuthError( + "All offered SOCKS5 authentication methods were" + " rejected") + else: + raise GeneralProxyError( + "SOCKS5 proxy server sent invalid data") + + # Now we can request the actual connection + writer.write(b"\x05" + cmd + b"\x00") + resolved = self._write_SOCKS5_address(dst, writer) + writer.flush() + + # Get the response + resp = self._readall(reader, 3) + if resp[0:1] != b"\x05": + raise GeneralProxyError( + "SOCKS5 proxy server sent invalid data") + + status = ord(resp[1:2]) + if status != 0x00: + # Connection failed: server returned an error + error = SOCKS5_ERRORS.get(status, "Unknown error") + raise SOCKS5Error("{0:#04x}: {1}".format(status, error)) + + # Get the bound address/port + bnd = self._read_SOCKS5_address(reader) + + super(socksocket, self).settimeout(self._timeout) + return (resolved, bnd) + finally: + reader.close() + writer.close() + + def _write_SOCKS5_address(self, addr, file): + """ + Return the host and port packed for the SOCKS5 protocol, + and the resolved address as a tuple object. + """ + host, port = addr + proxy_type, _, _, rdns, username, password = self.proxy + family_to_byte = {socket.AF_INET: b"\x01", socket.AF_INET6: b"\x04"} + + # If the given destination address is an IP address, we'll + # use the IP address request even if remote resolving was specified. + # Detect whether the address is IPv4/6 directly. + for family in (socket.AF_INET, socket.AF_INET6): + try: + addr_bytes = socket.inet_pton(family, host) + file.write(family_to_byte[family] + addr_bytes) + host = socket.inet_ntop(family, addr_bytes) + file.write(struct.pack(">H", port)) + return host, port + except socket.error: + continue + + # Well it's not an IP number, so it's probably a DNS name. + if rdns: + # Resolve remotely + host_bytes = host.encode("idna") + file.write(b"\x03" + chr(len(host_bytes)).encode() + host_bytes) + else: + # Resolve locally + addresses = socket.getaddrinfo(host, port, socket.AF_UNSPEC, + socket.SOCK_STREAM, + socket.IPPROTO_TCP, + socket.AI_ADDRCONFIG) + # We can't really work out what IP is reachable, so just pick the + # first. + target_addr = addresses[0] + family = target_addr[0] + host = target_addr[4][0] + + addr_bytes = socket.inet_pton(family, host) + file.write(family_to_byte[family] + addr_bytes) + host = socket.inet_ntop(family, addr_bytes) + file.write(struct.pack(">H", port)) + return host, port + + def _read_SOCKS5_address(self, file): + atyp = self._readall(file, 1) + if atyp == b"\x01": + addr = socket.inet_ntoa(self._readall(file, 4)) + elif atyp == b"\x03": + length = self._readall(file, 1) + addr = self._readall(file, ord(length)) + elif atyp == b"\x04": + addr = socket.inet_ntop(socket.AF_INET6, self._readall(file, 16)) + else: + raise GeneralProxyError("SOCKS5 proxy server sent invalid data") + + port = struct.unpack(">H", self._readall(file, 2))[0] + return addr, port + + def _negotiate_SOCKS4(self, dest_addr, dest_port): + """Negotiates a connection through a SOCKS4 server.""" + proxy_type, addr, port, rdns, username, password = self.proxy + + writer = self.makefile("wb") + reader = self.makefile("rb", 0) # buffering=0 renamed in Python 3 + try: + # Check if the destination address provided is an IP address + remote_resolve = False + try: + addr_bytes = socket.inet_aton(dest_addr) + except socket.error: + # It's a DNS name. Check where it should be resolved. + if rdns: + addr_bytes = b"\x00\x00\x00\x01" + remote_resolve = True + else: + addr_bytes = socket.inet_aton( + socket.gethostbyname(dest_addr)) + + # Construct the request packet + writer.write(struct.pack(">BBH", 0x04, 0x01, dest_port)) + writer.write(addr_bytes) + + # The username parameter is considered userid for SOCKS4 + if username: + writer.write(username) + writer.write(b"\x00") + + # DNS name if remote resolving is required + # NOTE: This is actually an extension to the SOCKS4 protocol + # called SOCKS4A and may not be supported in all cases. + if remote_resolve: + writer.write(dest_addr.encode("idna") + b"\x00") + writer.flush() + + # Get the response from the server + resp = self._readall(reader, 8) + if resp[0:1] != b"\x00": + # Bad data + raise GeneralProxyError( + "SOCKS4 proxy server sent invalid data") + + status = ord(resp[1:2]) + if status != 0x5A: + # Connection failed: server returned an error + error = SOCKS4_ERRORS.get(status, "Unknown error") + raise SOCKS4Error("{0:#04x}: {1}".format(status, error)) + + # Get the bound address/port + self.proxy_sockname = (socket.inet_ntoa(resp[4:]), + struct.unpack(">H", resp[2:4])[0]) + if remote_resolve: + self.proxy_peername = socket.inet_ntoa(addr_bytes), dest_port + else: + self.proxy_peername = dest_addr, dest_port + finally: + reader.close() + writer.close() + + def _negotiate_HTTP(self, dest_addr, dest_port): + """Negotiates a connection through an HTTP server. + + NOTE: This currently only supports HTTP CONNECT-style proxies.""" + proxy_type, addr, port, rdns, username, password = self.proxy + + # If we need to resolve locally, we do this now + addr = dest_addr if rdns else socket.gethostbyname(dest_addr) + + http_headers = [ + (b"CONNECT " + addr.encode("idna") + b":" + + str(dest_port).encode() + b" HTTP/1.1"), + b"Host: " + dest_addr.encode("idna") + ] + + if username and password: + http_headers.append(b"Proxy-Authorization: basic " + + b64encode(username + b":" + password)) + + http_headers.append(b"\r\n") + + self.sendall(b"\r\n".join(http_headers)) + + # We just need the first line to check if the connection was successful + fobj = self.makefile() + status_line = fobj.readline() + fobj.close() + + if not status_line: + raise GeneralProxyError("Connection closed unexpectedly") + + try: + proto, status_code, status_msg = status_line.split(" ", 2) + except ValueError: + raise GeneralProxyError("HTTP proxy server sent invalid response") + + if not proto.startswith("HTTP/"): + raise GeneralProxyError( + "Proxy server does not appear to be an HTTP proxy") + + try: + status_code = int(status_code) + except ValueError: + raise HTTPError( + "HTTP proxy server did not return a valid HTTP status") + + if status_code != 200: + error = "{0}: {1}".format(status_code, status_msg) + if status_code in (400, 403, 405): + # It's likely that the HTTP proxy server does not support the + # CONNECT tunneling method + error += ("\n[*] Note: The HTTP proxy server may not be" + " supported by PySocks (must be a CONNECT tunnel" + " proxy)") + raise HTTPError(error) + + self.proxy_sockname = (b"0.0.0.0", 0) + self.proxy_peername = addr, dest_port + + _proxy_negotiators = { + SOCKS4: _negotiate_SOCKS4, + SOCKS5: _negotiate_SOCKS5, + HTTP: _negotiate_HTTP + } + + @set_self_blocking + def connect(self, dest_pair): + """ + Connects to the specified destination through a proxy. + Uses the same API as socket's connect(). + To select the proxy server, use set_proxy(). + + dest_pair - 2-tuple of (IP/hostname, port). + """ + if len(dest_pair) != 2 or dest_pair[0].startswith("["): + # Probably IPv6, not supported -- raise an error, and hope + # Happy Eyeballs (RFC6555) makes sure at least the IPv4 + # connection works... + raise socket.error("PySocks doesn't support IPv6: %s" + % str(dest_pair)) + + dest_addr, dest_port = dest_pair + + if self.type == socket.SOCK_DGRAM: + if not self._proxyconn: + self.bind(("", 0)) + dest_addr = socket.gethostbyname(dest_addr) + + # If the host address is INADDR_ANY or similar, reset the peer + # address so that packets are received from any peer + if dest_addr == "0.0.0.0" and not dest_port: + self.proxy_peername = None + else: + self.proxy_peername = (dest_addr, dest_port) + return + + (proxy_type, proxy_addr, proxy_port, rdns, username, + password) = self.proxy + + # Do a minimal input check first + if (not isinstance(dest_pair, (list, tuple)) + or len(dest_pair) != 2 + or not dest_addr + or not isinstance(dest_port, int)): + # Inputs failed, raise an error + raise GeneralProxyError( + "Invalid destination-connection (host, port) pair") + + # We set the timeout here so that we don't hang in connection or during + # negotiation. + super(socksocket, self).settimeout(self._timeout) + + if proxy_type is None: + # Treat like regular socket object + self.proxy_peername = dest_pair + super(socksocket, self).settimeout(self._timeout) + super(socksocket, self).connect((dest_addr, dest_port)) + return + + proxy_addr = self._proxy_addr() + + try: + # Initial connection to proxy server. + super(socksocket, self).connect(proxy_addr) + + except socket.error as error: + # Error while connecting to proxy + self.close() + proxy_addr, proxy_port = proxy_addr + proxy_server = "{0}:{1}".format(proxy_addr, proxy_port) + printable_type = PRINTABLE_PROXY_TYPES[proxy_type] + + msg = "Error connecting to {0} proxy {1}".format(printable_type, + proxy_server) + log.debug("%s due to: %s", msg, error) + raise ProxyConnectionError(msg, error) + + else: + # Connected to proxy server, now negotiate + try: + # Calls negotiate_{SOCKS4, SOCKS5, HTTP} + negotiate = self._proxy_negotiators[proxy_type] + negotiate(self, dest_addr, dest_port) + except socket.error as error: + # Wrap socket errors + self.close() + raise GeneralProxyError("Socket error", error) + except ProxyError: + # Protocol error while negotiating with proxy + self.close() + raise + + def _proxy_addr(self): + """ + Return proxy address to connect to as tuple object + """ + (proxy_type, proxy_addr, proxy_port, rdns, username, + password) = self.proxy + proxy_port = proxy_port or DEFAULT_PORTS.get(proxy_type) + if not proxy_port: + raise GeneralProxyError("Invalid proxy type") + return proxy_addr, proxy_port diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d6594eb264d3bbe36b98209d77de55a806817751 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py @@ -0,0 +1,19 @@ +import sys + +try: + # Our match_hostname function is the same as 3.5's, so we only want to + # import the match_hostname function if it's at least that good. + if sys.version_info < (3, 5): + raise ImportError("Fallback to vendored code") + + from ssl import CertificateError, match_hostname +except ImportError: + try: + # Backport of the function from a pypi module + from backports.ssl_match_hostname import CertificateError, match_hostname + except ImportError: + # Our vendored copy + from ._implementation import CertificateError, match_hostname + +# Not needed, but documenting what we provide. +__all__ = ('CertificateError', 'match_hostname') diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py new file mode 100644 index 0000000000000000000000000000000000000000..d6e66c01960d42f76924ca956ccb7582743617e2 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py @@ -0,0 +1,156 @@ +"""The match_hostname() function from Python 3.3.3, essential when using SSL.""" + +# Note: This file is under the PSF license as the code comes from the python +# stdlib. http://docs.python.org/3/license.html + +import re +import sys + +# ipaddress has been backported to 2.6+ in pypi. If it is installed on the +# system, use it to handle IPAddress ServerAltnames (this was added in +# python-3.5) otherwise only do DNS matching. This allows +# backports.ssl_match_hostname to continue to be used in Python 2.7. +try: + import ipaddress +except ImportError: + ipaddress = None + +__version__ = '3.5.0.1' + + +class CertificateError(ValueError): + pass + + +def _dnsname_match(dn, hostname, max_wildcards=1): + """Matching according to RFC 6125, section 6.4.3 + + http://tools.ietf.org/html/rfc6125#section-6.4.3 + """ + pats = [] + if not dn: + return False + + # Ported from python3-syntax: + # leftmost, *remainder = dn.split(r'.') + parts = dn.split(r'.') + leftmost = parts[0] + remainder = parts[1:] + + wildcards = leftmost.count('*') + if wildcards > max_wildcards: + # Issue #17980: avoid denials of service by refusing more + # than one wildcard per fragment. A survey of established + # policy among SSL implementations showed it to be a + # reasonable choice. + raise CertificateError( + "too many wildcards in certificate DNS name: " + repr(dn)) + + # speed up common case w/o wildcards + if not wildcards: + return dn.lower() == hostname.lower() + + # RFC 6125, section 6.4.3, subitem 1. + # The client SHOULD NOT attempt to match a presented identifier in which + # the wildcard character comprises a label other than the left-most label. + if leftmost == '*': + # When '*' is a fragment by itself, it matches a non-empty dotless + # fragment. + pats.append('[^.]+') + elif leftmost.startswith('xn--') or hostname.startswith('xn--'): + # RFC 6125, section 6.4.3, subitem 3. + # The client SHOULD NOT attempt to match a presented identifier + # where the wildcard character is embedded within an A-label or + # U-label of an internationalized domain name. + pats.append(re.escape(leftmost)) + else: + # Otherwise, '*' matches any dotless string, e.g. www* + pats.append(re.escape(leftmost).replace(r'\*', '[^.]*')) + + # add the remaining fragments, ignore any wildcards + for frag in remainder: + pats.append(re.escape(frag)) + + pat = re.compile(r'\A' + r'\.'.join(pats) + r'\Z', re.IGNORECASE) + return pat.match(hostname) + + +def _to_unicode(obj): + if isinstance(obj, str) and sys.version_info < (3,): + obj = unicode(obj, encoding='ascii', errors='strict') + return obj + +def _ipaddress_match(ipname, host_ip): + """Exact matching of IP addresses. + + RFC 6125 explicitly doesn't define an algorithm for this + (section 1.7.2 - "Out of Scope"). + """ + # OpenSSL may add a trailing newline to a subjectAltName's IP address + # Divergence from upstream: ipaddress can't handle byte str + ip = ipaddress.ip_address(_to_unicode(ipname).rstrip()) + return ip == host_ip + + +def match_hostname(cert, hostname): + """Verify that *cert* (in decoded format as returned by + SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125 + rules are followed, but IP addresses are not accepted for *hostname*. + + CertificateError is raised on failure. On success, the function + returns nothing. + """ + if not cert: + raise ValueError("empty or no certificate, match_hostname needs a " + "SSL socket or SSL context with either " + "CERT_OPTIONAL or CERT_REQUIRED") + try: + # Divergence from upstream: ipaddress can't handle byte str + host_ip = ipaddress.ip_address(_to_unicode(hostname)) + except ValueError: + # Not an IP address (common case) + host_ip = None + except UnicodeError: + # Divergence from upstream: Have to deal with ipaddress not taking + # byte strings. addresses should be all ascii, so we consider it not + # an ipaddress in this case + host_ip = None + except AttributeError: + # Divergence from upstream: Make ipaddress library optional + if ipaddress is None: + host_ip = None + else: + raise + dnsnames = [] + san = cert.get('subjectAltName', ()) + for key, value in san: + if key == 'DNS': + if host_ip is None and _dnsname_match(value, hostname): + return + dnsnames.append(value) + elif key == 'IP Address': + if host_ip is not None and _ipaddress_match(value, host_ip): + return + dnsnames.append(value) + if not dnsnames: + # The subject is only checked when there is no dNSName entry + # in subjectAltName + for sub in cert.get('subject', ()): + for key, value in sub: + # XXX according to RFC 2818, the most specific Common Name + # must be used. + if key == 'commonName': + if _dnsname_match(value, hostname): + return + dnsnames.append(value) + if len(dnsnames) > 1: + raise CertificateError("hostname %r " + "doesn't match either of %s" + % (hostname, ', '.join(map(repr, dnsnames)))) + elif len(dnsnames) == 1: + raise CertificateError("hostname %r " + "doesn't match %r" + % (hostname, dnsnames[0])) + else: + raise CertificateError("no appropriate commonName or " + "subjectAltName fields were found") diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/poolmanager.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/poolmanager.py new file mode 100644 index 0000000000000000000000000000000000000000..a13149b1bce41d543b272789557d8c427e7bdded --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/poolmanager.py @@ -0,0 +1,453 @@ +from __future__ import absolute_import +import collections +import functools +import logging + +from ._collections import RecentlyUsedContainer +from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool +from .connectionpool import port_by_scheme +from .exceptions import LocationValueError, MaxRetryError, ProxySchemeUnknown +from .packages import six +from .packages.six.moves.urllib.parse import urljoin +from .request import RequestMethods +from .util.url import parse_url +from .util.retry import Retry + + +__all__ = ['PoolManager', 'ProxyManager', 'proxy_from_url'] + + +log = logging.getLogger(__name__) + +SSL_KEYWORDS = ('key_file', 'cert_file', 'cert_reqs', 'ca_certs', + 'ssl_version', 'ca_cert_dir', 'ssl_context') + +# All known keyword arguments that could be provided to the pool manager, its +# pools, or the underlying connections. This is used to construct a pool key. +_key_fields = ( + 'key_scheme', # str + 'key_host', # str + 'key_port', # int + 'key_timeout', # int or float or Timeout + 'key_retries', # int or Retry + 'key_strict', # bool + 'key_block', # bool + 'key_source_address', # str + 'key_key_file', # str + 'key_cert_file', # str + 'key_cert_reqs', # str + 'key_ca_certs', # str + 'key_ssl_version', # str + 'key_ca_cert_dir', # str + 'key_ssl_context', # instance of ssl.SSLContext or urllib3.util.ssl_.SSLContext + 'key_maxsize', # int + 'key_headers', # dict + 'key__proxy', # parsed proxy url + 'key__proxy_headers', # dict + 'key_socket_options', # list of (level (int), optname (int), value (int or str)) tuples + 'key__socks_options', # dict + 'key_assert_hostname', # bool or string + 'key_assert_fingerprint', # str + 'key_server_hostname', # str +) + +#: The namedtuple class used to construct keys for the connection pool. +#: All custom key schemes should include the fields in this key at a minimum. +PoolKey = collections.namedtuple('PoolKey', _key_fields) + + +def _default_key_normalizer(key_class, request_context): + """ + Create a pool key out of a request context dictionary. + + According to RFC 3986, both the scheme and host are case-insensitive. + Therefore, this function normalizes both before constructing the pool + key for an HTTPS request. If you wish to change this behaviour, provide + alternate callables to ``key_fn_by_scheme``. + + :param key_class: + The class to use when constructing the key. This should be a namedtuple + with the ``scheme`` and ``host`` keys at a minimum. + :type key_class: namedtuple + :param request_context: + A dictionary-like object that contain the context for a request. + :type request_context: dict + + :return: A namedtuple that can be used as a connection pool key. + :rtype: PoolKey + """ + # Since we mutate the dictionary, make a copy first + context = request_context.copy() + context['scheme'] = context['scheme'].lower() + context['host'] = context['host'].lower() + + # These are both dictionaries and need to be transformed into frozensets + for key in ('headers', '_proxy_headers', '_socks_options'): + if key in context and context[key] is not None: + context[key] = frozenset(context[key].items()) + + # The socket_options key may be a list and needs to be transformed into a + # tuple. + socket_opts = context.get('socket_options') + if socket_opts is not None: + context['socket_options'] = tuple(socket_opts) + + # Map the kwargs to the names in the namedtuple - this is necessary since + # namedtuples can't have fields starting with '_'. + for key in list(context.keys()): + context['key_' + key] = context.pop(key) + + # Default to ``None`` for keys missing from the context + for field in key_class._fields: + if field not in context: + context[field] = None + + return key_class(**context) + + +#: A dictionary that maps a scheme to a callable that creates a pool key. +#: This can be used to alter the way pool keys are constructed, if desired. +#: Each PoolManager makes a copy of this dictionary so they can be configured +#: globally here, or individually on the instance. +key_fn_by_scheme = { + 'http': functools.partial(_default_key_normalizer, PoolKey), + 'https': functools.partial(_default_key_normalizer, PoolKey), +} + +pool_classes_by_scheme = { + 'http': HTTPConnectionPool, + 'https': HTTPSConnectionPool, +} + + +class PoolManager(RequestMethods): + """ + Allows for arbitrary requests while transparently keeping track of + necessary connection pools for you. + + :param num_pools: + Number of connection pools to cache before discarding the least + recently used pool. + + :param headers: + Headers to include with all requests, unless other headers are given + explicitly. + + :param \\**connection_pool_kw: + Additional parameters are used to create fresh + :class:`urllib3.connectionpool.ConnectionPool` instances. + + Example:: + + >>> manager = PoolManager(num_pools=2) + >>> r = manager.request('GET', 'http://google.com/') + >>> r = manager.request('GET', 'http://google.com/mail') + >>> r = manager.request('GET', 'http://yahoo.com/') + >>> len(manager.pools) + 2 + + """ + + proxy = None + + def __init__(self, num_pools=10, headers=None, **connection_pool_kw): + RequestMethods.__init__(self, headers) + self.connection_pool_kw = connection_pool_kw + self.pools = RecentlyUsedContainer(num_pools, + dispose_func=lambda p: p.close()) + + # Locally set the pool classes and keys so other PoolManagers can + # override them. + self.pool_classes_by_scheme = pool_classes_by_scheme + self.key_fn_by_scheme = key_fn_by_scheme.copy() + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self.clear() + # Return False to re-raise any potential exceptions + return False + + def _new_pool(self, scheme, host, port, request_context=None): + """ + Create a new :class:`ConnectionPool` based on host, port, scheme, and + any additional pool keyword arguments. + + If ``request_context`` is provided, it is provided as keyword arguments + to the pool class used. This method is used to actually create the + connection pools handed out by :meth:`connection_from_url` and + companion methods. It is intended to be overridden for customization. + """ + pool_cls = self.pool_classes_by_scheme[scheme] + if request_context is None: + request_context = self.connection_pool_kw.copy() + + # Although the context has everything necessary to create the pool, + # this function has historically only used the scheme, host, and port + # in the positional args. When an API change is acceptable these can + # be removed. + for key in ('scheme', 'host', 'port'): + request_context.pop(key, None) + + if scheme == 'http': + for kw in SSL_KEYWORDS: + request_context.pop(kw, None) + + return pool_cls(host, port, **request_context) + + def clear(self): + """ + Empty our store of pools and direct them all to close. + + This will not affect in-flight connections, but they will not be + re-used after completion. + """ + self.pools.clear() + + def connection_from_host(self, host, port=None, scheme='http', pool_kwargs=None): + """ + Get a :class:`ConnectionPool` based on the host, port, and scheme. + + If ``port`` isn't given, it will be derived from the ``scheme`` using + ``urllib3.connectionpool.port_by_scheme``. If ``pool_kwargs`` is + provided, it is merged with the instance's ``connection_pool_kw`` + variable and used to create the new connection pool, if one is + needed. + """ + + if not host: + raise LocationValueError("No host specified.") + + request_context = self._merge_pool_kwargs(pool_kwargs) + request_context['scheme'] = scheme or 'http' + if not port: + port = port_by_scheme.get(request_context['scheme'].lower(), 80) + request_context['port'] = port + request_context['host'] = host + + return self.connection_from_context(request_context) + + def connection_from_context(self, request_context): + """ + Get a :class:`ConnectionPool` based on the request context. + + ``request_context`` must at least contain the ``scheme`` key and its + value must be a key in ``key_fn_by_scheme`` instance variable. + """ + scheme = request_context['scheme'].lower() + pool_key_constructor = self.key_fn_by_scheme[scheme] + pool_key = pool_key_constructor(request_context) + + return self.connection_from_pool_key(pool_key, request_context=request_context) + + def connection_from_pool_key(self, pool_key, request_context=None): + """ + Get a :class:`ConnectionPool` based on the provided pool key. + + ``pool_key`` should be a namedtuple that only contains immutable + objects. At a minimum it must have the ``scheme``, ``host``, and + ``port`` fields. + """ + with self.pools.lock: + # If the scheme, host, or port doesn't match existing open + # connections, open a new ConnectionPool. + pool = self.pools.get(pool_key) + if pool: + return pool + + # Make a fresh ConnectionPool of the desired type + scheme = request_context['scheme'] + host = request_context['host'] + port = request_context['port'] + pool = self._new_pool(scheme, host, port, request_context=request_context) + self.pools[pool_key] = pool + + return pool + + def connection_from_url(self, url, pool_kwargs=None): + """ + Similar to :func:`urllib3.connectionpool.connection_from_url`. + + If ``pool_kwargs`` is not provided and a new pool needs to be + constructed, ``self.connection_pool_kw`` is used to initialize + the :class:`urllib3.connectionpool.ConnectionPool`. If ``pool_kwargs`` + is provided, it is used instead. Note that if a new pool does not + need to be created for the request, the provided ``pool_kwargs`` are + not used. + """ + u = parse_url(url) + return self.connection_from_host(u.host, port=u.port, scheme=u.scheme, + pool_kwargs=pool_kwargs) + + def _merge_pool_kwargs(self, override): + """ + Merge a dictionary of override values for self.connection_pool_kw. + + This does not modify self.connection_pool_kw and returns a new dict. + Any keys in the override dictionary with a value of ``None`` are + removed from the merged dictionary. + """ + base_pool_kwargs = self.connection_pool_kw.copy() + if override: + for key, value in override.items(): + if value is None: + try: + del base_pool_kwargs[key] + except KeyError: + pass + else: + base_pool_kwargs[key] = value + return base_pool_kwargs + + def urlopen(self, method, url, redirect=True, **kw): + """ + Same as :meth:`urllib3.connectionpool.HTTPConnectionPool.urlopen` + with custom cross-host redirect logic and only sends the request-uri + portion of the ``url``. + + The given ``url`` parameter must be absolute, such that an appropriate + :class:`urllib3.connectionpool.ConnectionPool` can be chosen for it. + """ + u = parse_url(url) + conn = self.connection_from_host(u.host, port=u.port, scheme=u.scheme) + + kw['assert_same_host'] = False + kw['redirect'] = False + + if 'headers' not in kw: + kw['headers'] = self.headers.copy() + + if self.proxy is not None and u.scheme == "http": + response = conn.urlopen(method, url, **kw) + else: + response = conn.urlopen(method, u.request_uri, **kw) + + redirect_location = redirect and response.get_redirect_location() + if not redirect_location: + return response + + # Support relative URLs for redirecting. + redirect_location = urljoin(url, redirect_location) + + # RFC 7231, Section 6.4.4 + if response.status == 303: + method = 'GET' + + retries = kw.get('retries') + if not isinstance(retries, Retry): + retries = Retry.from_int(retries, redirect=redirect) + + # Strip headers marked as unsafe to forward to the redirected location. + # Check remove_headers_on_redirect to avoid a potential network call within + # conn.is_same_host() which may use socket.gethostbyname() in the future. + if (retries.remove_headers_on_redirect + and not conn.is_same_host(redirect_location)): + headers = list(six.iterkeys(kw['headers'])) + for header in headers: + if header.lower() in retries.remove_headers_on_redirect: + kw['headers'].pop(header, None) + + try: + retries = retries.increment(method, url, response=response, _pool=conn) + except MaxRetryError: + if retries.raise_on_redirect: + raise + return response + + kw['retries'] = retries + kw['redirect'] = redirect + + log.info("Redirecting %s -> %s", url, redirect_location) + return self.urlopen(method, redirect_location, **kw) + + +class ProxyManager(PoolManager): + """ + Behaves just like :class:`PoolManager`, but sends all requests through + the defined proxy, using the CONNECT method for HTTPS URLs. + + :param proxy_url: + The URL of the proxy to be used. + + :param proxy_headers: + A dictionary containing headers that will be sent to the proxy. In case + of HTTP they are being sent with each request, while in the + HTTPS/CONNECT case they are sent only once. Could be used for proxy + authentication. + + Example: + >>> proxy = urllib3.ProxyManager('http://localhost:3128/') + >>> r1 = proxy.request('GET', 'http://google.com/') + >>> r2 = proxy.request('GET', 'http://httpbin.org/') + >>> len(proxy.pools) + 1 + >>> r3 = proxy.request('GET', 'https://httpbin.org/') + >>> r4 = proxy.request('GET', 'https://twitter.com/') + >>> len(proxy.pools) + 3 + + """ + + def __init__(self, proxy_url, num_pools=10, headers=None, + proxy_headers=None, **connection_pool_kw): + + if isinstance(proxy_url, HTTPConnectionPool): + proxy_url = '%s://%s:%i' % (proxy_url.scheme, proxy_url.host, + proxy_url.port) + proxy = parse_url(proxy_url) + if not proxy.port: + port = port_by_scheme.get(proxy.scheme, 80) + proxy = proxy._replace(port=port) + + if proxy.scheme not in ("http", "https"): + raise ProxySchemeUnknown(proxy.scheme) + + self.proxy = proxy + self.proxy_headers = proxy_headers or {} + + connection_pool_kw['_proxy'] = self.proxy + connection_pool_kw['_proxy_headers'] = self.proxy_headers + + super(ProxyManager, self).__init__( + num_pools, headers, **connection_pool_kw) + + def connection_from_host(self, host, port=None, scheme='http', pool_kwargs=None): + if scheme == "https": + return super(ProxyManager, self).connection_from_host( + host, port, scheme, pool_kwargs=pool_kwargs) + + return super(ProxyManager, self).connection_from_host( + self.proxy.host, self.proxy.port, self.proxy.scheme, pool_kwargs=pool_kwargs) + + def _set_proxy_headers(self, url, headers=None): + """ + Sets headers needed by proxies: specifically, the Accept and Host + headers. Only sets headers not provided by the user. + """ + headers_ = {'Accept': '*/*'} + + netloc = parse_url(url).netloc + if netloc: + headers_['Host'] = netloc + + if headers: + headers_.update(headers) + return headers_ + + def urlopen(self, method, url, redirect=True, **kw): + "Same as HTTP(S)ConnectionPool.urlopen, ``url`` must be absolute." + u = parse_url(url) + + if u.scheme == "http": + # For proxied HTTPS requests, httplib sets the necessary headers + # on the CONNECT to the proxy. For HTTP, we'll definitely + # need to set 'Host' at the very least. + headers = kw.get('headers', self.headers) + kw['headers'] = self._set_proxy_headers(url, headers) + + return super(ProxyManager, self).urlopen(method, url, redirect=redirect, **kw) + + +def proxy_from_url(url, **kw): + return ProxyManager(proxy_url=url, **kw) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/request.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/request.py new file mode 100644 index 0000000000000000000000000000000000000000..8f2f44bb2110a0017a0baa10aed5d8e175b7f7db --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/request.py @@ -0,0 +1,150 @@ +from __future__ import absolute_import + +from .filepost import encode_multipart_formdata +from .packages.six.moves.urllib.parse import urlencode + + +__all__ = ['RequestMethods'] + + +class RequestMethods(object): + """ + Convenience mixin for classes who implement a :meth:`urlopen` method, such + as :class:`~urllib3.connectionpool.HTTPConnectionPool` and + :class:`~urllib3.poolmanager.PoolManager`. + + Provides behavior for making common types of HTTP request methods and + decides which type of request field encoding to use. + + Specifically, + + :meth:`.request_encode_url` is for sending requests whose fields are + encoded in the URL (such as GET, HEAD, DELETE). + + :meth:`.request_encode_body` is for sending requests whose fields are + encoded in the *body* of the request using multipart or www-form-urlencoded + (such as for POST, PUT, PATCH). + + :meth:`.request` is for making any kind of request, it will look up the + appropriate encoding format and use one of the above two methods to make + the request. + + Initializer parameters: + + :param headers: + Headers to include with all requests, unless other headers are given + explicitly. + """ + + _encode_url_methods = {'DELETE', 'GET', 'HEAD', 'OPTIONS'} + + def __init__(self, headers=None): + self.headers = headers or {} + + def urlopen(self, method, url, body=None, headers=None, + encode_multipart=True, multipart_boundary=None, + **kw): # Abstract + raise NotImplementedError("Classes extending RequestMethods must implement " + "their own ``urlopen`` method.") + + def request(self, method, url, fields=None, headers=None, **urlopen_kw): + """ + Make a request using :meth:`urlopen` with the appropriate encoding of + ``fields`` based on the ``method`` used. + + This is a convenience method that requires the least amount of manual + effort. It can be used in most situations, while still having the + option to drop down to more specific methods when necessary, such as + :meth:`request_encode_url`, :meth:`request_encode_body`, + or even the lowest level :meth:`urlopen`. + """ + method = method.upper() + + urlopen_kw['request_url'] = url + + if method in self._encode_url_methods: + return self.request_encode_url(method, url, fields=fields, + headers=headers, + **urlopen_kw) + else: + return self.request_encode_body(method, url, fields=fields, + headers=headers, + **urlopen_kw) + + def request_encode_url(self, method, url, fields=None, headers=None, + **urlopen_kw): + """ + Make a request using :meth:`urlopen` with the ``fields`` encoded in + the url. This is useful for request methods like GET, HEAD, DELETE, etc. + """ + if headers is None: + headers = self.headers + + extra_kw = {'headers': headers} + extra_kw.update(urlopen_kw) + + if fields: + url += '?' + urlencode(fields) + + return self.urlopen(method, url, **extra_kw) + + def request_encode_body(self, method, url, fields=None, headers=None, + encode_multipart=True, multipart_boundary=None, + **urlopen_kw): + """ + Make a request using :meth:`urlopen` with the ``fields`` encoded in + the body. This is useful for request methods like POST, PUT, PATCH, etc. + + When ``encode_multipart=True`` (default), then + :meth:`urllib3.filepost.encode_multipart_formdata` is used to encode + the payload with the appropriate content type. Otherwise + :meth:`urllib.urlencode` is used with the + 'application/x-www-form-urlencoded' content type. + + Multipart encoding must be used when posting files, and it's reasonably + safe to use it in other times too. However, it may break request + signing, such as with OAuth. + + Supports an optional ``fields`` parameter of key/value strings AND + key/filetuple. A filetuple is a (filename, data, MIME type) tuple where + the MIME type is optional. For example:: + + fields = { + 'foo': 'bar', + 'fakefile': ('foofile.txt', 'contents of foofile'), + 'realfile': ('barfile.txt', open('realfile').read()), + 'typedfile': ('bazfile.bin', open('bazfile').read(), + 'image/jpeg'), + 'nonamefile': 'contents of nonamefile field', + } + + When uploading a file, providing a filename (the first parameter of the + tuple) is optional but recommended to best mimic behavior of browsers. + + Note that if ``headers`` are supplied, the 'Content-Type' header will + be overwritten because it depends on the dynamic random boundary string + which is used to compose the body of the request. The random boundary + string can be explicitly set with the ``multipart_boundary`` parameter. + """ + if headers is None: + headers = self.headers + + extra_kw = {'headers': {}} + + if fields: + if 'body' in urlopen_kw: + raise TypeError( + "request got values for both 'fields' and 'body', can only specify one.") + + if encode_multipart: + body, content_type = encode_multipart_formdata(fields, boundary=multipart_boundary) + else: + body, content_type = urlencode(fields), 'application/x-www-form-urlencoded' + + extra_kw['body'] = body + extra_kw['headers'] = {'Content-Type': content_type} + + extra_kw['headers'].update(headers) + extra_kw.update(urlopen_kw) + + return self.urlopen(method, url, **extra_kw) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/response.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/response.py new file mode 100644 index 0000000000000000000000000000000000000000..97cdfd13b596fa8d9c70504f7b80f51488368cf9 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/response.py @@ -0,0 +1,707 @@ +from __future__ import absolute_import +from contextlib import contextmanager +import zlib +import io +import logging +from socket import timeout as SocketTimeout +from socket import error as SocketError + +from ._collections import HTTPHeaderDict +from .exceptions import ( + BodyNotHttplibCompatible, ProtocolError, DecodeError, ReadTimeoutError, + ResponseNotChunked, IncompleteRead, InvalidHeader +) +from .packages.six import string_types as basestring, PY3 +from .packages.six.moves import http_client as httplib +from .connection import HTTPException, BaseSSLError +from .util.response import is_fp_closed, is_response_to_head + +log = logging.getLogger(__name__) + + +class DeflateDecoder(object): + + def __init__(self): + self._first_try = True + self._data = b'' + self._obj = zlib.decompressobj() + + def __getattr__(self, name): + return getattr(self._obj, name) + + def decompress(self, data): + if not data: + return data + + if not self._first_try: + return self._obj.decompress(data) + + self._data += data + try: + decompressed = self._obj.decompress(data) + if decompressed: + self._first_try = False + self._data = None + return decompressed + except zlib.error: + self._first_try = False + self._obj = zlib.decompressobj(-zlib.MAX_WBITS) + try: + return self.decompress(self._data) + finally: + self._data = None + + +class GzipDecoderState(object): + + FIRST_MEMBER = 0 + OTHER_MEMBERS = 1 + SWALLOW_DATA = 2 + + +class GzipDecoder(object): + + def __init__(self): + self._obj = zlib.decompressobj(16 + zlib.MAX_WBITS) + self._state = GzipDecoderState.FIRST_MEMBER + + def __getattr__(self, name): + return getattr(self._obj, name) + + def decompress(self, data): + ret = bytearray() + if self._state == GzipDecoderState.SWALLOW_DATA or not data: + return bytes(ret) + while True: + try: + ret += self._obj.decompress(data) + except zlib.error: + previous_state = self._state + # Ignore data after the first error + self._state = GzipDecoderState.SWALLOW_DATA + if previous_state == GzipDecoderState.OTHER_MEMBERS: + # Allow trailing garbage acceptable in other gzip clients + return bytes(ret) + raise + data = self._obj.unused_data + if not data: + return bytes(ret) + self._state = GzipDecoderState.OTHER_MEMBERS + self._obj = zlib.decompressobj(16 + zlib.MAX_WBITS) + + +class MultiDecoder(object): + """ + From RFC7231: + If one or more encodings have been applied to a representation, the + sender that applied the encodings MUST generate a Content-Encoding + header field that lists the content codings in the order in which + they were applied. + """ + + def __init__(self, modes): + self._decoders = [_get_decoder(m.strip()) for m in modes.split(',')] + + def flush(self): + return self._decoders[0].flush() + + def decompress(self, data): + for d in reversed(self._decoders): + data = d.decompress(data) + return data + + +def _get_decoder(mode): + if ',' in mode: + return MultiDecoder(mode) + + if mode == 'gzip': + return GzipDecoder() + + return DeflateDecoder() + + +class HTTPResponse(io.IOBase): + """ + HTTP Response container. + + Backwards-compatible to httplib's HTTPResponse but the response ``body`` is + loaded and decoded on-demand when the ``data`` property is accessed. This + class is also compatible with the Python standard library's :mod:`io` + module, and can hence be treated as a readable object in the context of that + framework. + + Extra parameters for behaviour not present in httplib.HTTPResponse: + + :param preload_content: + If True, the response's body will be preloaded during construction. + + :param decode_content: + If True, will attempt to decode the body based on the + 'content-encoding' header. + + :param original_response: + When this HTTPResponse wrapper is generated from an httplib.HTTPResponse + object, it's convenient to include the original for debug purposes. It's + otherwise unused. + + :param retries: + The retries contains the last :class:`~urllib3.util.retry.Retry` that + was used during the request. + + :param enforce_content_length: + Enforce content length checking. Body returned by server must match + value of Content-Length header, if present. Otherwise, raise error. + """ + + CONTENT_DECODERS = ['gzip', 'deflate'] + REDIRECT_STATUSES = [301, 302, 303, 307, 308] + + def __init__(self, body='', headers=None, status=0, version=0, reason=None, + strict=0, preload_content=True, decode_content=True, + original_response=None, pool=None, connection=None, msg=None, + retries=None, enforce_content_length=False, + request_method=None, request_url=None): + + if isinstance(headers, HTTPHeaderDict): + self.headers = headers + else: + self.headers = HTTPHeaderDict(headers) + self.status = status + self.version = version + self.reason = reason + self.strict = strict + self.decode_content = decode_content + self.retries = retries + self.enforce_content_length = enforce_content_length + + self._decoder = None + self._body = None + self._fp = None + self._original_response = original_response + self._fp_bytes_read = 0 + self.msg = msg + self._request_url = request_url + + if body and isinstance(body, (basestring, bytes)): + self._body = body + + self._pool = pool + self._connection = connection + + if hasattr(body, 'read'): + self._fp = body + + # Are we using the chunked-style of transfer encoding? + self.chunked = False + self.chunk_left = None + tr_enc = self.headers.get('transfer-encoding', '').lower() + # Don't incur the penalty of creating a list and then discarding it + encodings = (enc.strip() for enc in tr_enc.split(",")) + if "chunked" in encodings: + self.chunked = True + + # Determine length of response + self.length_remaining = self._init_length(request_method) + + # If requested, preload the body. + if preload_content and not self._body: + self._body = self.read(decode_content=decode_content) + + def get_redirect_location(self): + """ + Should we redirect and where to? + + :returns: Truthy redirect location string if we got a redirect status + code and valid location. ``None`` if redirect status and no + location. ``False`` if not a redirect status code. + """ + if self.status in self.REDIRECT_STATUSES: + return self.headers.get('location') + + return False + + def release_conn(self): + if not self._pool or not self._connection: + return + + self._pool._put_conn(self._connection) + self._connection = None + + @property + def data(self): + # For backwords-compat with earlier urllib3 0.4 and earlier. + if self._body: + return self._body + + if self._fp: + return self.read(cache_content=True) + + @property + def connection(self): + return self._connection + + def isclosed(self): + return is_fp_closed(self._fp) + + def tell(self): + """ + Obtain the number of bytes pulled over the wire so far. May differ from + the amount of content returned by :meth:``HTTPResponse.read`` if bytes + are encoded on the wire (e.g, compressed). + """ + return self._fp_bytes_read + + def _init_length(self, request_method): + """ + Set initial length value for Response content if available. + """ + length = self.headers.get('content-length') + + if length is not None: + if self.chunked: + # This Response will fail with an IncompleteRead if it can't be + # received as chunked. This method falls back to attempt reading + # the response before raising an exception. + log.warning("Received response with both Content-Length and " + "Transfer-Encoding set. This is expressly forbidden " + "by RFC 7230 sec 3.3.2. Ignoring Content-Length and " + "attempting to process response as Transfer-Encoding: " + "chunked.") + return None + + try: + # RFC 7230 section 3.3.2 specifies multiple content lengths can + # be sent in a single Content-Length header + # (e.g. Content-Length: 42, 42). This line ensures the values + # are all valid ints and that as long as the `set` length is 1, + # all values are the same. Otherwise, the header is invalid. + lengths = set([int(val) for val in length.split(',')]) + if len(lengths) > 1: + raise InvalidHeader("Content-Length contained multiple " + "unmatching values (%s)" % length) + length = lengths.pop() + except ValueError: + length = None + else: + if length < 0: + length = None + + # Convert status to int for comparison + # In some cases, httplib returns a status of "_UNKNOWN" + try: + status = int(self.status) + except ValueError: + status = 0 + + # Check for responses that shouldn't include a body + if status in (204, 304) or 100 <= status < 200 or request_method == 'HEAD': + length = 0 + + return length + + def _init_decoder(self): + """ + Set-up the _decoder attribute if necessary. + """ + # Note: content-encoding value should be case-insensitive, per RFC 7230 + # Section 3.2 + content_encoding = self.headers.get('content-encoding', '').lower() + if self._decoder is None: + if content_encoding in self.CONTENT_DECODERS: + self._decoder = _get_decoder(content_encoding) + elif ',' in content_encoding: + encodings = [ + e.strip() for e in content_encoding.split(',') + if e.strip() in self.CONTENT_DECODERS] + if len(encodings): + self._decoder = _get_decoder(content_encoding) + + def _decode(self, data, decode_content, flush_decoder): + """ + Decode the data passed in and potentially flush the decoder. + """ + try: + if decode_content and self._decoder: + data = self._decoder.decompress(data) + except (IOError, zlib.error) as e: + content_encoding = self.headers.get('content-encoding', '').lower() + raise DecodeError( + "Received response with content-encoding: %s, but " + "failed to decode it." % content_encoding, e) + + if flush_decoder and decode_content: + data += self._flush_decoder() + + return data + + def _flush_decoder(self): + """ + Flushes the decoder. Should only be called if the decoder is actually + being used. + """ + if self._decoder: + buf = self._decoder.decompress(b'') + return buf + self._decoder.flush() + + return b'' + + @contextmanager + def _error_catcher(self): + """ + Catch low-level python exceptions, instead re-raising urllib3 + variants, so that low-level exceptions are not leaked in the + high-level api. + + On exit, release the connection back to the pool. + """ + clean_exit = False + + try: + try: + yield + + except SocketTimeout: + # FIXME: Ideally we'd like to include the url in the ReadTimeoutError but + # there is yet no clean way to get at it from this context. + raise ReadTimeoutError(self._pool, None, 'Read timed out.') + + except BaseSSLError as e: + # FIXME: Is there a better way to differentiate between SSLErrors? + if 'read operation timed out' not in str(e): # Defensive: + # This shouldn't happen but just in case we're missing an edge + # case, let's avoid swallowing SSL errors. + raise + + raise ReadTimeoutError(self._pool, None, 'Read timed out.') + + except (HTTPException, SocketError) as e: + # This includes IncompleteRead. + raise ProtocolError('Connection broken: %r' % e, e) + + # If no exception is thrown, we should avoid cleaning up + # unnecessarily. + clean_exit = True + finally: + # If we didn't terminate cleanly, we need to throw away our + # connection. + if not clean_exit: + # The response may not be closed but we're not going to use it + # anymore so close it now to ensure that the connection is + # released back to the pool. + if self._original_response: + self._original_response.close() + + # Closing the response may not actually be sufficient to close + # everything, so if we have a hold of the connection close that + # too. + if self._connection: + self._connection.close() + + # If we hold the original response but it's closed now, we should + # return the connection back to the pool. + if self._original_response and self._original_response.isclosed(): + self.release_conn() + + def read(self, amt=None, decode_content=None, cache_content=False): + """ + Similar to :meth:`httplib.HTTPResponse.read`, but with two additional + parameters: ``decode_content`` and ``cache_content``. + + :param amt: + How much of the content to read. If specified, caching is skipped + because it doesn't make sense to cache partial content as the full + response. + + :param decode_content: + If True, will attempt to decode the body based on the + 'content-encoding' header. + + :param cache_content: + If True, will save the returned data such that the same result is + returned despite of the state of the underlying file object. This + is useful if you want the ``.data`` property to continue working + after having ``.read()`` the file object. (Overridden if ``amt`` is + set.) + """ + self._init_decoder() + if decode_content is None: + decode_content = self.decode_content + + if self._fp is None: + return + + flush_decoder = False + data = None + + with self._error_catcher(): + if amt is None: + # cStringIO doesn't like amt=None + data = self._fp.read() + flush_decoder = True + else: + cache_content = False + data = self._fp.read(amt) + if amt != 0 and not data: # Platform-specific: Buggy versions of Python. + # Close the connection when no data is returned + # + # This is redundant to what httplib/http.client _should_ + # already do. However, versions of python released before + # December 15, 2012 (http://bugs.python.org/issue16298) do + # not properly close the connection in all cases. There is + # no harm in redundantly calling close. + self._fp.close() + flush_decoder = True + if self.enforce_content_length and self.length_remaining not in (0, None): + # This is an edge case that httplib failed to cover due + # to concerns of backward compatibility. We're + # addressing it here to make sure IncompleteRead is + # raised during streaming, so all calls with incorrect + # Content-Length are caught. + raise IncompleteRead(self._fp_bytes_read, self.length_remaining) + + if data: + self._fp_bytes_read += len(data) + if self.length_remaining is not None: + self.length_remaining -= len(data) + + data = self._decode(data, decode_content, flush_decoder) + + if cache_content: + self._body = data + + return data + + def stream(self, amt=2**16, decode_content=None): + """ + A generator wrapper for the read() method. A call will block until + ``amt`` bytes have been read from the connection or until the + connection is closed. + + :param amt: + How much of the content to read. The generator will return up to + much data per iteration, but may return less. This is particularly + likely when using compressed data. However, the empty string will + never be returned. + + :param decode_content: + If True, will attempt to decode the body based on the + 'content-encoding' header. + """ + if self.chunked and self.supports_chunked_reads(): + for line in self.read_chunked(amt, decode_content=decode_content): + yield line + else: + while not is_fp_closed(self._fp): + data = self.read(amt=amt, decode_content=decode_content) + + if data: + yield data + + @classmethod + def from_httplib(ResponseCls, r, **response_kw): + """ + Given an :class:`httplib.HTTPResponse` instance ``r``, return a + corresponding :class:`urllib3.response.HTTPResponse` object. + + Remaining parameters are passed to the HTTPResponse constructor, along + with ``original_response=r``. + """ + headers = r.msg + + if not isinstance(headers, HTTPHeaderDict): + if PY3: # Python 3 + headers = HTTPHeaderDict(headers.items()) + else: # Python 2 + headers = HTTPHeaderDict.from_httplib(headers) + + # HTTPResponse objects in Python 3 don't have a .strict attribute + strict = getattr(r, 'strict', 0) + resp = ResponseCls(body=r, + headers=headers, + status=r.status, + version=r.version, + reason=r.reason, + strict=strict, + original_response=r, + **response_kw) + return resp + + # Backwards-compatibility methods for httplib.HTTPResponse + def getheaders(self): + return self.headers + + def getheader(self, name, default=None): + return self.headers.get(name, default) + + # Backwards compatibility for http.cookiejar + def info(self): + return self.headers + + # Overrides from io.IOBase + def close(self): + if not self.closed: + self._fp.close() + + if self._connection: + self._connection.close() + + @property + def closed(self): + if self._fp is None: + return True + elif hasattr(self._fp, 'isclosed'): + return self._fp.isclosed() + elif hasattr(self._fp, 'closed'): + return self._fp.closed + else: + return True + + def fileno(self): + if self._fp is None: + raise IOError("HTTPResponse has no file to get a fileno from") + elif hasattr(self._fp, "fileno"): + return self._fp.fileno() + else: + raise IOError("The file-like object this HTTPResponse is wrapped " + "around has no file descriptor") + + def flush(self): + if self._fp is not None and hasattr(self._fp, 'flush'): + return self._fp.flush() + + def readable(self): + # This method is required for `io` module compatibility. + return True + + def readinto(self, b): + # This method is required for `io` module compatibility. + temp = self.read(len(b)) + if len(temp) == 0: + return 0 + else: + b[:len(temp)] = temp + return len(temp) + + def supports_chunked_reads(self): + """ + Checks if the underlying file-like object looks like a + httplib.HTTPResponse object. We do this by testing for the fp + attribute. If it is present we assume it returns raw chunks as + processed by read_chunked(). + """ + return hasattr(self._fp, 'fp') + + def _update_chunk_length(self): + # First, we'll figure out length of a chunk and then + # we'll try to read it from socket. + if self.chunk_left is not None: + return + line = self._fp.fp.readline() + line = line.split(b';', 1)[0] + try: + self.chunk_left = int(line, 16) + except ValueError: + # Invalid chunked protocol response, abort. + self.close() + raise httplib.IncompleteRead(line) + + def _handle_chunk(self, amt): + returned_chunk = None + if amt is None: + chunk = self._fp._safe_read(self.chunk_left) + returned_chunk = chunk + self._fp._safe_read(2) # Toss the CRLF at the end of the chunk. + self.chunk_left = None + elif amt < self.chunk_left: + value = self._fp._safe_read(amt) + self.chunk_left = self.chunk_left - amt + returned_chunk = value + elif amt == self.chunk_left: + value = self._fp._safe_read(amt) + self._fp._safe_read(2) # Toss the CRLF at the end of the chunk. + self.chunk_left = None + returned_chunk = value + else: # amt > self.chunk_left + returned_chunk = self._fp._safe_read(self.chunk_left) + self._fp._safe_read(2) # Toss the CRLF at the end of the chunk. + self.chunk_left = None + return returned_chunk + + def read_chunked(self, amt=None, decode_content=None): + """ + Similar to :meth:`HTTPResponse.read`, but with an additional + parameter: ``decode_content``. + + :param amt: + How much of the content to read. If specified, caching is skipped + because it doesn't make sense to cache partial content as the full + response. + + :param decode_content: + If True, will attempt to decode the body based on the + 'content-encoding' header. + """ + self._init_decoder() + # FIXME: Rewrite this method and make it a class with a better structured logic. + if not self.chunked: + raise ResponseNotChunked( + "Response is not chunked. " + "Header 'transfer-encoding: chunked' is missing.") + if not self.supports_chunked_reads(): + raise BodyNotHttplibCompatible( + "Body should be httplib.HTTPResponse like. " + "It should have have an fp attribute which returns raw chunks.") + + with self._error_catcher(): + # Don't bother reading the body of a HEAD request. + if self._original_response and is_response_to_head(self._original_response): + self._original_response.close() + return + + # If a response is already read and closed + # then return immediately. + if self._fp.fp is None: + return + + while True: + self._update_chunk_length() + if self.chunk_left == 0: + break + chunk = self._handle_chunk(amt) + decoded = self._decode(chunk, decode_content=decode_content, + flush_decoder=False) + if decoded: + yield decoded + + if decode_content: + # On CPython and PyPy, we should never need to flush the + # decoder. However, on Jython we *might* need to, so + # lets defensively do it anyway. + decoded = self._flush_decoder() + if decoded: # Platform-specific: Jython. + yield decoded + + # Chunk content ends with \r\n: discard it. + while True: + line = self._fp.fp.readline() + if not line: + # Some sites may not end with '\r\n'. + break + if line == b'\r\n': + break + + # We read everything; close the "file". + if self._original_response: + self._original_response.close() + + def geturl(self): + """ + Returns the URL that was the source of this response. + If the request that generated this response redirected, this method + will return the final redirect location. + """ + if self.retries is not None and len(self.retries.history): + return self.retries.history[-1].redirect_location + else: + return self._request_url diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/__init__.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2f2770b62277d59e83a0e696df370759e05a7b5c --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/__init__.py @@ -0,0 +1,54 @@ +from __future__ import absolute_import +# For backwards compatibility, provide imports that used to be here. +from .connection import is_connection_dropped +from .request import make_headers +from .response import is_fp_closed +from .ssl_ import ( + SSLContext, + HAS_SNI, + IS_PYOPENSSL, + IS_SECURETRANSPORT, + assert_fingerprint, + resolve_cert_reqs, + resolve_ssl_version, + ssl_wrap_socket, +) +from .timeout import ( + current_time, + Timeout, +) + +from .retry import Retry +from .url import ( + get_host, + parse_url, + split_first, + Url, +) +from .wait import ( + wait_for_read, + wait_for_write +) + +__all__ = ( + 'HAS_SNI', + 'IS_PYOPENSSL', + 'IS_SECURETRANSPORT', + 'SSLContext', + 'Retry', + 'Timeout', + 'Url', + 'assert_fingerprint', + 'current_time', + 'is_connection_dropped', + 'is_fp_closed', + 'get_host', + 'parse_url', + 'make_headers', + 'resolve_cert_reqs', + 'resolve_ssl_version', + 'split_first', + 'ssl_wrap_socket', + 'wait_for_read', + 'wait_for_write' +) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/connection.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/connection.py new file mode 100644 index 0000000000000000000000000000000000000000..5ad70b2f1ca8e575088626a345fd66fc3746f99c --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/connection.py @@ -0,0 +1,134 @@ +from __future__ import absolute_import +import socket +from .wait import NoWayToWaitForSocketError, wait_for_read +from ..contrib import _appengine_environ + + +def is_connection_dropped(conn): # Platform-specific + """ + Returns True if the connection is dropped and should be closed. + + :param conn: + :class:`httplib.HTTPConnection` object. + + Note: For platforms like AppEngine, this will always return ``False`` to + let the platform handle connection recycling transparently for us. + """ + sock = getattr(conn, 'sock', False) + if sock is False: # Platform-specific: AppEngine + return False + if sock is None: # Connection already closed (such as by httplib). + return True + try: + # Returns True if readable, which here means it's been dropped + return wait_for_read(sock, timeout=0.0) + except NoWayToWaitForSocketError: # Platform-specific: AppEngine + return False + + +# This function is copied from socket.py in the Python 2.7 standard +# library test suite. Added to its signature is only `socket_options`. +# One additional modification is that we avoid binding to IPv6 servers +# discovered in DNS if the system doesn't have IPv6 functionality. +def create_connection(address, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, + source_address=None, socket_options=None): + """Connect to *address* and return the socket object. + + Convenience function. Connect to *address* (a 2-tuple ``(host, + port)``) and return the socket object. Passing the optional + *timeout* parameter will set the timeout on the socket instance + before attempting to connect. If no *timeout* is supplied, the + global default timeout setting returned by :func:`getdefaulttimeout` + is used. If *source_address* is set it must be a tuple of (host, port) + for the socket to bind as a source address before making the connection. + An host of '' or port 0 tells the OS to use the default. + """ + + host, port = address + if host.startswith('['): + host = host.strip('[]') + err = None + + # Using the value from allowed_gai_family() in the context of getaddrinfo lets + # us select whether to work with IPv4 DNS records, IPv6 records, or both. + # The original create_connection function always returns all records. + family = allowed_gai_family() + + for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): + af, socktype, proto, canonname, sa = res + sock = None + try: + sock = socket.socket(af, socktype, proto) + + # If provided, set socket level options before connecting. + _set_socket_options(sock, socket_options) + + if timeout is not socket._GLOBAL_DEFAULT_TIMEOUT: + sock.settimeout(timeout) + if source_address: + sock.bind(source_address) + sock.connect(sa) + return sock + + except socket.error as e: + err = e + if sock is not None: + sock.close() + sock = None + + if err is not None: + raise err + + raise socket.error("getaddrinfo returns an empty list") + + +def _set_socket_options(sock, options): + if options is None: + return + + for opt in options: + sock.setsockopt(*opt) + + +def allowed_gai_family(): + """This function is designed to work in the context of + getaddrinfo, where family=socket.AF_UNSPEC is the default and + will perform a DNS search for both IPv6 and IPv4 records.""" + + family = socket.AF_INET + if HAS_IPV6: + family = socket.AF_UNSPEC + return family + + +def _has_ipv6(host): + """ Returns True if the system can bind an IPv6 address. """ + sock = None + has_ipv6 = False + + # App Engine doesn't support IPV6 sockets and actually has a quota on the + # number of sockets that can be used, so just early out here instead of + # creating a socket needlessly. + # See https://github.com/urllib3/urllib3/issues/1446 + if _appengine_environ.is_appengine_sandbox(): + return False + + if socket.has_ipv6: + # has_ipv6 returns true if cPython was compiled with IPv6 support. + # It does not tell us if the system has IPv6 support enabled. To + # determine that we must bind to an IPv6 address. + # https://github.com/shazow/urllib3/pull/611 + # https://bugs.python.org/issue658327 + try: + sock = socket.socket(socket.AF_INET6) + sock.bind((host, 0)) + has_ipv6 = True + except Exception: + pass + + if sock: + sock.close() + return has_ipv6 + + +HAS_IPV6 = _has_ipv6('::1') diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/queue.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/queue.py new file mode 100644 index 0000000000000000000000000000000000000000..d3d379a19997b0c76c820a82e10b8fd36db9bea4 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/queue.py @@ -0,0 +1,21 @@ +import collections +from ..packages import six +from ..packages.six.moves import queue + +if six.PY2: + # Queue is imported for side effects on MS Windows. See issue #229. + import Queue as _unused_module_Queue # noqa: F401 + + +class LifoQueue(queue.Queue): + def _init(self, _): + self.queue = collections.deque() + + def _qsize(self, len=len): + return len(self.queue) + + def _put(self, item): + self.queue.append(item) + + def _get(self): + return self.queue.pop() diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/request.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/request.py new file mode 100644 index 0000000000000000000000000000000000000000..3ddfcd559476bacf7d2471ee6f7b20a4b5e4dc0f --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/request.py @@ -0,0 +1,118 @@ +from __future__ import absolute_import +from base64 import b64encode + +from ..packages.six import b, integer_types +from ..exceptions import UnrewindableBodyError + +ACCEPT_ENCODING = 'gzip,deflate' +_FAILEDTELL = object() + + +def make_headers(keep_alive=None, accept_encoding=None, user_agent=None, + basic_auth=None, proxy_basic_auth=None, disable_cache=None): + """ + Shortcuts for generating request headers. + + :param keep_alive: + If ``True``, adds 'connection: keep-alive' header. + + :param accept_encoding: + Can be a boolean, list, or string. + ``True`` translates to 'gzip,deflate'. + List will get joined by comma. + String will be used as provided. + + :param user_agent: + String representing the user-agent you want, such as + "python-urllib3/0.6" + + :param basic_auth: + Colon-separated username:password string for 'authorization: basic ...' + auth header. + + :param proxy_basic_auth: + Colon-separated username:password string for 'proxy-authorization: basic ...' + auth header. + + :param disable_cache: + If ``True``, adds 'cache-control: no-cache' header. + + Example:: + + >>> make_headers(keep_alive=True, user_agent="Batman/1.0") + {'connection': 'keep-alive', 'user-agent': 'Batman/1.0'} + >>> make_headers(accept_encoding=True) + {'accept-encoding': 'gzip,deflate'} + """ + headers = {} + if accept_encoding: + if isinstance(accept_encoding, str): + pass + elif isinstance(accept_encoding, list): + accept_encoding = ','.join(accept_encoding) + else: + accept_encoding = ACCEPT_ENCODING + headers['accept-encoding'] = accept_encoding + + if user_agent: + headers['user-agent'] = user_agent + + if keep_alive: + headers['connection'] = 'keep-alive' + + if basic_auth: + headers['authorization'] = 'Basic ' + \ + b64encode(b(basic_auth)).decode('utf-8') + + if proxy_basic_auth: + headers['proxy-authorization'] = 'Basic ' + \ + b64encode(b(proxy_basic_auth)).decode('utf-8') + + if disable_cache: + headers['cache-control'] = 'no-cache' + + return headers + + +def set_file_position(body, pos): + """ + If a position is provided, move file to that point. + Otherwise, we'll attempt to record a position for future use. + """ + if pos is not None: + rewind_body(body, pos) + elif getattr(body, 'tell', None) is not None: + try: + pos = body.tell() + except (IOError, OSError): + # This differentiates from None, allowing us to catch + # a failed `tell()` later when trying to rewind the body. + pos = _FAILEDTELL + + return pos + + +def rewind_body(body, body_pos): + """ + Attempt to rewind body to a certain position. + Primarily used for request redirects and retries. + + :param body: + File-like object that supports seek. + + :param int pos: + Position to seek to in file. + """ + body_seek = getattr(body, 'seek', None) + if body_seek is not None and isinstance(body_pos, integer_types): + try: + body_seek(body_pos) + except (IOError, OSError): + raise UnrewindableBodyError("An error occurred when rewinding request " + "body for redirect/retry.") + elif body_pos is _FAILEDTELL: + raise UnrewindableBodyError("Unable to record file position for rewinding " + "request body during a redirect/retry.") + else: + raise ValueError("body_pos must be of type integer, " + "instead it was %s." % type(body_pos)) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/response.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/response.py new file mode 100644 index 0000000000000000000000000000000000000000..3d5486485a647bc7f3ed75a184117abdbe55d733 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/response.py @@ -0,0 +1,87 @@ +from __future__ import absolute_import +from ..packages.six.moves import http_client as httplib + +from ..exceptions import HeaderParsingError + + +def is_fp_closed(obj): + """ + Checks whether a given file-like object is closed. + + :param obj: + The file-like object to check. + """ + + try: + # Check `isclosed()` first, in case Python3 doesn't set `closed`. + # GH Issue #928 + return obj.isclosed() + except AttributeError: + pass + + try: + # Check via the official file-like-object way. + return obj.closed + except AttributeError: + pass + + try: + # Check if the object is a container for another file-like object that + # gets released on exhaustion (e.g. HTTPResponse). + return obj.fp is None + except AttributeError: + pass + + raise ValueError("Unable to determine whether fp is closed.") + + +def assert_header_parsing(headers): + """ + Asserts whether all headers have been successfully parsed. + Extracts encountered errors from the result of parsing headers. + + Only works on Python 3. + + :param headers: Headers to verify. + :type headers: `httplib.HTTPMessage`. + + :raises urllib3.exceptions.HeaderParsingError: + If parsing errors are found. + """ + + # This will fail silently if we pass in the wrong kind of parameter. + # To make debugging easier add an explicit check. + if not isinstance(headers, httplib.HTTPMessage): + raise TypeError('expected httplib.Message, got {0}.'.format( + type(headers))) + + defects = getattr(headers, 'defects', None) + get_payload = getattr(headers, 'get_payload', None) + + unparsed_data = None + if get_payload: + # get_payload is actually email.message.Message.get_payload; + # we're only interested in the result if it's not a multipart message + if not headers.is_multipart(): + payload = get_payload() + + if isinstance(payload, (bytes, str)): + unparsed_data = payload + + if defects or unparsed_data: + raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data) + + +def is_response_to_head(response): + """ + Checks whether the request of a response has been a HEAD-request. + Handles the quirks of AppEngine. + + :param conn: + :type conn: :class:`httplib.HTTPResponse` + """ + # FIXME: Can we do this somehow without accessing private httplib _method? + method = response._method + if isinstance(method, int): # Platform-specific: Appengine + return method == 3 + return method.upper() == 'HEAD' diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/retry.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/retry.py new file mode 100644 index 0000000000000000000000000000000000000000..02429ee8e481e724e6473fd9179a49f7f9d85367 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/retry.py @@ -0,0 +1,412 @@ +from __future__ import absolute_import +import time +import logging +from collections import namedtuple +from itertools import takewhile +import email +import re + +from ..exceptions import ( + ConnectTimeoutError, + MaxRetryError, + ProtocolError, + ReadTimeoutError, + ResponseError, + InvalidHeader, +) +from ..packages import six + + +log = logging.getLogger(__name__) + + +# Data structure for representing the metadata of requests that result in a retry. +RequestHistory = namedtuple('RequestHistory', ["method", "url", "error", + "status", "redirect_location"]) + + +class Retry(object): + """ Retry configuration. + + Each retry attempt will create a new Retry object with updated values, so + they can be safely reused. + + Retries can be defined as a default for a pool:: + + retries = Retry(connect=5, read=2, redirect=5) + http = PoolManager(retries=retries) + response = http.request('GET', 'http://example.com/') + + Or per-request (which overrides the default for the pool):: + + response = http.request('GET', 'http://example.com/', retries=Retry(10)) + + Retries can be disabled by passing ``False``:: + + response = http.request('GET', 'http://example.com/', retries=False) + + Errors will be wrapped in :class:`~urllib3.exceptions.MaxRetryError` unless + retries are disabled, in which case the causing exception will be raised. + + :param int total: + Total number of retries to allow. Takes precedence over other counts. + + Set to ``None`` to remove this constraint and fall back on other + counts. It's a good idea to set this to some sensibly-high value to + account for unexpected edge cases and avoid infinite retry loops. + + Set to ``0`` to fail on the first retry. + + Set to ``False`` to disable and imply ``raise_on_redirect=False``. + + :param int connect: + How many connection-related errors to retry on. + + These are errors raised before the request is sent to the remote server, + which we assume has not triggered the server to process the request. + + Set to ``0`` to fail on the first retry of this type. + + :param int read: + How many times to retry on read errors. + + These errors are raised after the request was sent to the server, so the + request may have side-effects. + + Set to ``0`` to fail on the first retry of this type. + + :param int redirect: + How many redirects to perform. Limit this to avoid infinite redirect + loops. + + A redirect is a HTTP response with a status code 301, 302, 303, 307 or + 308. + + Set to ``0`` to fail on the first retry of this type. + + Set to ``False`` to disable and imply ``raise_on_redirect=False``. + + :param int status: + How many times to retry on bad status codes. + + These are retries made on responses, where status code matches + ``status_forcelist``. + + Set to ``0`` to fail on the first retry of this type. + + :param iterable method_whitelist: + Set of uppercased HTTP method verbs that we should retry on. + + By default, we only retry on methods which are considered to be + idempotent (multiple requests with the same parameters end with the + same state). See :attr:`Retry.DEFAULT_METHOD_WHITELIST`. + + Set to a ``False`` value to retry on any verb. + + :param iterable status_forcelist: + A set of integer HTTP status codes that we should force a retry on. + A retry is initiated if the request method is in ``method_whitelist`` + and the response status code is in ``status_forcelist``. + + By default, this is disabled with ``None``. + + :param float backoff_factor: + A backoff factor to apply between attempts after the second try + (most errors are resolved immediately by a second try without a + delay). urllib3 will sleep for:: + + {backoff factor} * (2 ** ({number of total retries} - 1)) + + seconds. If the backoff_factor is 0.1, then :func:`.sleep` will sleep + for [0.0s, 0.2s, 0.4s, ...] between retries. It will never be longer + than :attr:`Retry.BACKOFF_MAX`. + + By default, backoff is disabled (set to 0). + + :param bool raise_on_redirect: Whether, if the number of redirects is + exhausted, to raise a MaxRetryError, or to return a response with a + response code in the 3xx range. + + :param bool raise_on_status: Similar meaning to ``raise_on_redirect``: + whether we should raise an exception, or return a response, + if status falls in ``status_forcelist`` range and retries have + been exhausted. + + :param tuple history: The history of the request encountered during + each call to :meth:`~Retry.increment`. The list is in the order + the requests occurred. Each list item is of class :class:`RequestHistory`. + + :param bool respect_retry_after_header: + Whether to respect Retry-After header on status codes defined as + :attr:`Retry.RETRY_AFTER_STATUS_CODES` or not. + + :param iterable remove_headers_on_redirect: + Sequence of headers to remove from the request when a response + indicating a redirect is returned before firing off the redirected + request. + """ + + DEFAULT_METHOD_WHITELIST = frozenset([ + 'HEAD', 'GET', 'PUT', 'DELETE', 'OPTIONS', 'TRACE']) + + RETRY_AFTER_STATUS_CODES = frozenset([413, 429, 503]) + + DEFAULT_REDIRECT_HEADERS_BLACKLIST = frozenset(['Authorization']) + + #: Maximum backoff time. + BACKOFF_MAX = 120 + + def __init__(self, total=10, connect=None, read=None, redirect=None, status=None, + method_whitelist=DEFAULT_METHOD_WHITELIST, status_forcelist=None, + backoff_factor=0, raise_on_redirect=True, raise_on_status=True, + history=None, respect_retry_after_header=True, + remove_headers_on_redirect=DEFAULT_REDIRECT_HEADERS_BLACKLIST): + + self.total = total + self.connect = connect + self.read = read + self.status = status + + if redirect is False or total is False: + redirect = 0 + raise_on_redirect = False + + self.redirect = redirect + self.status_forcelist = status_forcelist or set() + self.method_whitelist = method_whitelist + self.backoff_factor = backoff_factor + self.raise_on_redirect = raise_on_redirect + self.raise_on_status = raise_on_status + self.history = history or tuple() + self.respect_retry_after_header = respect_retry_after_header + self.remove_headers_on_redirect = frozenset([ + h.lower() for h in remove_headers_on_redirect]) + + def new(self, **kw): + params = dict( + total=self.total, + connect=self.connect, read=self.read, redirect=self.redirect, status=self.status, + method_whitelist=self.method_whitelist, + status_forcelist=self.status_forcelist, + backoff_factor=self.backoff_factor, + raise_on_redirect=self.raise_on_redirect, + raise_on_status=self.raise_on_status, + history=self.history, + remove_headers_on_redirect=self.remove_headers_on_redirect + ) + params.update(kw) + return type(self)(**params) + + @classmethod + def from_int(cls, retries, redirect=True, default=None): + """ Backwards-compatibility for the old retries format.""" + if retries is None: + retries = default if default is not None else cls.DEFAULT + + if isinstance(retries, Retry): + return retries + + redirect = bool(redirect) and None + new_retries = cls(retries, redirect=redirect) + log.debug("Converted retries value: %r -> %r", retries, new_retries) + return new_retries + + def get_backoff_time(self): + """ Formula for computing the current backoff + + :rtype: float + """ + # We want to consider only the last consecutive errors sequence (Ignore redirects). + consecutive_errors_len = len(list(takewhile(lambda x: x.redirect_location is None, + reversed(self.history)))) + if consecutive_errors_len <= 1: + return 0 + + backoff_value = self.backoff_factor * (2 ** (consecutive_errors_len - 1)) + return min(self.BACKOFF_MAX, backoff_value) + + def parse_retry_after(self, retry_after): + # Whitespace: https://tools.ietf.org/html/rfc7230#section-3.2.4 + if re.match(r"^\s*[0-9]+\s*$", retry_after): + seconds = int(retry_after) + else: + retry_date_tuple = email.utils.parsedate(retry_after) + if retry_date_tuple is None: + raise InvalidHeader("Invalid Retry-After header: %s" % retry_after) + retry_date = time.mktime(retry_date_tuple) + seconds = retry_date - time.time() + + if seconds < 0: + seconds = 0 + + return seconds + + def get_retry_after(self, response): + """ Get the value of Retry-After in seconds. """ + + retry_after = response.getheader("Retry-After") + + if retry_after is None: + return None + + return self.parse_retry_after(retry_after) + + def sleep_for_retry(self, response=None): + retry_after = self.get_retry_after(response) + if retry_after: + time.sleep(retry_after) + return True + + return False + + def _sleep_backoff(self): + backoff = self.get_backoff_time() + if backoff <= 0: + return + time.sleep(backoff) + + def sleep(self, response=None): + """ Sleep between retry attempts. + + This method will respect a server's ``Retry-After`` response header + and sleep the duration of the time requested. If that is not present, it + will use an exponential backoff. By default, the backoff factor is 0 and + this method will return immediately. + """ + + if response: + slept = self.sleep_for_retry(response) + if slept: + return + + self._sleep_backoff() + + def _is_connection_error(self, err): + """ Errors when we're fairly sure that the server did not receive the + request, so it should be safe to retry. + """ + return isinstance(err, ConnectTimeoutError) + + def _is_read_error(self, err): + """ Errors that occur after the request has been started, so we should + assume that the server began processing it. + """ + return isinstance(err, (ReadTimeoutError, ProtocolError)) + + def _is_method_retryable(self, method): + """ Checks if a given HTTP method should be retried upon, depending if + it is included on the method whitelist. + """ + if self.method_whitelist and method.upper() not in self.method_whitelist: + return False + + return True + + def is_retry(self, method, status_code, has_retry_after=False): + """ Is this method/status code retryable? (Based on whitelists and control + variables such as the number of total retries to allow, whether to + respect the Retry-After header, whether this header is present, and + whether the returned status code is on the list of status codes to + be retried upon on the presence of the aforementioned header) + """ + if not self._is_method_retryable(method): + return False + + if self.status_forcelist and status_code in self.status_forcelist: + return True + + return (self.total and self.respect_retry_after_header and + has_retry_after and (status_code in self.RETRY_AFTER_STATUS_CODES)) + + def is_exhausted(self): + """ Are we out of retries? """ + retry_counts = (self.total, self.connect, self.read, self.redirect, self.status) + retry_counts = list(filter(None, retry_counts)) + if not retry_counts: + return False + + return min(retry_counts) < 0 + + def increment(self, method=None, url=None, response=None, error=None, + _pool=None, _stacktrace=None): + """ Return a new Retry object with incremented retry counters. + + :param response: A response object, or None, if the server did not + return a response. + :type response: :class:`~urllib3.response.HTTPResponse` + :param Exception error: An error encountered during the request, or + None if the response was received successfully. + + :return: A new ``Retry`` object. + """ + if self.total is False and error: + # Disabled, indicate to re-raise the error. + raise six.reraise(type(error), error, _stacktrace) + + total = self.total + if total is not None: + total -= 1 + + connect = self.connect + read = self.read + redirect = self.redirect + status_count = self.status + cause = 'unknown' + status = None + redirect_location = None + + if error and self._is_connection_error(error): + # Connect retry? + if connect is False: + raise six.reraise(type(error), error, _stacktrace) + elif connect is not None: + connect -= 1 + + elif error and self._is_read_error(error): + # Read retry? + if read is False or not self._is_method_retryable(method): + raise six.reraise(type(error), error, _stacktrace) + elif read is not None: + read -= 1 + + elif response and response.get_redirect_location(): + # Redirect retry? + if redirect is not None: + redirect -= 1 + cause = 'too many redirects' + redirect_location = response.get_redirect_location() + status = response.status + + else: + # Incrementing because of a server error like a 500 in + # status_forcelist and a the given method is in the whitelist + cause = ResponseError.GENERIC_ERROR + if response and response.status: + if status_count is not None: + status_count -= 1 + cause = ResponseError.SPECIFIC_ERROR.format( + status_code=response.status) + status = response.status + + history = self.history + (RequestHistory(method, url, error, status, redirect_location),) + + new_retry = self.new( + total=total, + connect=connect, read=read, redirect=redirect, status=status_count, + history=history) + + if new_retry.is_exhausted(): + raise MaxRetryError(_pool, url, error or ResponseError(cause)) + + log.debug("Incremented Retry for (url='%s'): %r", url, new_retry) + + return new_retry + + def __repr__(self): + return ('{cls.__name__}(total={self.total}, connect={self.connect}, ' + 'read={self.read}, redirect={self.redirect}, status={self.status})').format( + cls=type(self), self=self) + + +# For backwards compatibility (equivalent to pre-v1.9): +Retry.DEFAULT = Retry(3) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/selectors.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/selectors.py new file mode 100644 index 0000000000000000000000000000000000000000..63787e71de306a5fa40f402d9011ae13c460b05c --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/selectors.py @@ -0,0 +1,587 @@ +# Backport of selectors.py from Python 3.5+ to support Python < 3.4 +# Also has the behavior specified in PEP 475 which is to retry syscalls +# in the case of an EINTR error. This module is required because selectors34 +# does not follow this behavior and instead returns that no dile descriptor +# events have occurred rather than retry the syscall. The decision to drop +# support for select.devpoll is made to maintain 100% test coverage. + +import errno +import math +import select +import socket +import sys +import time +from collections import namedtuple + +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping + + +try: + monotonic = time.monotonic +except (AttributeError, ImportError): # Python 3.3< + monotonic = time.time + +EVENT_READ = (1 << 0) +EVENT_WRITE = (1 << 1) + +HAS_SELECT = True # Variable that shows whether the platform has a selector. +_SYSCALL_SENTINEL = object() # Sentinel in case a system call returns None. +_DEFAULT_SELECTOR = None + + +class SelectorError(Exception): + def __init__(self, errcode): + super(SelectorError, self).__init__() + self.errno = errcode + + def __repr__(self): + return "".format(self.errno) + + def __str__(self): + return self.__repr__() + + +def _fileobj_to_fd(fileobj): + """ Return a file descriptor from a file object. If + given an integer will simply return that integer back. """ + if isinstance(fileobj, int): + fd = fileobj + else: + try: + fd = int(fileobj.fileno()) + except (AttributeError, TypeError, ValueError): + raise ValueError("Invalid file object: {0!r}".format(fileobj)) + if fd < 0: + raise ValueError("Invalid file descriptor: {0}".format(fd)) + return fd + + +# Determine which function to use to wrap system calls because Python 3.5+ +# already handles the case when system calls are interrupted. +if sys.version_info >= (3, 5): + def _syscall_wrapper(func, _, *args, **kwargs): + """ This is the short-circuit version of the below logic + because in Python 3.5+ all system calls automatically restart + and recalculate their timeouts. """ + try: + return func(*args, **kwargs) + except (OSError, IOError, select.error) as e: + errcode = None + if hasattr(e, "errno"): + errcode = e.errno + raise SelectorError(errcode) +else: + def _syscall_wrapper(func, recalc_timeout, *args, **kwargs): + """ Wrapper function for syscalls that could fail due to EINTR. + All functions should be retried if there is time left in the timeout + in accordance with PEP 475. """ + timeout = kwargs.get("timeout", None) + if timeout is None: + expires = None + recalc_timeout = False + else: + timeout = float(timeout) + if timeout < 0.0: # Timeout less than 0 treated as no timeout. + expires = None + else: + expires = monotonic() + timeout + + args = list(args) + if recalc_timeout and "timeout" not in kwargs: + raise ValueError( + "Timeout must be in args or kwargs to be recalculated") + + result = _SYSCALL_SENTINEL + while result is _SYSCALL_SENTINEL: + try: + result = func(*args, **kwargs) + # OSError is thrown by select.select + # IOError is thrown by select.epoll.poll + # select.error is thrown by select.poll.poll + # Aren't we thankful for Python 3.x rework for exceptions? + except (OSError, IOError, select.error) as e: + # select.error wasn't a subclass of OSError in the past. + errcode = None + if hasattr(e, "errno"): + errcode = e.errno + elif hasattr(e, "args"): + errcode = e.args[0] + + # Also test for the Windows equivalent of EINTR. + is_interrupt = (errcode == errno.EINTR or (hasattr(errno, "WSAEINTR") and + errcode == errno.WSAEINTR)) + + if is_interrupt: + if expires is not None: + current_time = monotonic() + if current_time > expires: + raise OSError(errno=errno.ETIMEDOUT) + if recalc_timeout: + if "timeout" in kwargs: + kwargs["timeout"] = expires - current_time + continue + if errcode: + raise SelectorError(errcode) + else: + raise + return result + + +SelectorKey = namedtuple('SelectorKey', ['fileobj', 'fd', 'events', 'data']) + + +class _SelectorMapping(Mapping): + """ Mapping of file objects to selector keys """ + + def __init__(self, selector): + self._selector = selector + + def __len__(self): + return len(self._selector._fd_to_key) + + def __getitem__(self, fileobj): + try: + fd = self._selector._fileobj_lookup(fileobj) + return self._selector._fd_to_key[fd] + except KeyError: + raise KeyError("{0!r} is not registered.".format(fileobj)) + + def __iter__(self): + return iter(self._selector._fd_to_key) + + +class BaseSelector(object): + """ Abstract Selector class + + A selector supports registering file objects to be monitored + for specific I/O events. + + A file object is a file descriptor or any object with a + `fileno()` method. An arbitrary object can be attached to the + file object which can be used for example to store context info, + a callback, etc. + + A selector can use various implementations (select(), poll(), epoll(), + and kqueue()) depending on the platform. The 'DefaultSelector' class uses + the most efficient implementation for the current platform. + """ + def __init__(self): + # Maps file descriptors to keys. + self._fd_to_key = {} + + # Read-only mapping returned by get_map() + self._map = _SelectorMapping(self) + + def _fileobj_lookup(self, fileobj): + """ Return a file descriptor from a file object. + This wraps _fileobj_to_fd() to do an exhaustive + search in case the object is invalid but we still + have it in our map. Used by unregister() so we can + unregister an object that was previously registered + even if it is closed. It is also used by _SelectorMapping + """ + try: + return _fileobj_to_fd(fileobj) + except ValueError: + + # Search through all our mapped keys. + for key in self._fd_to_key.values(): + if key.fileobj is fileobj: + return key.fd + + # Raise ValueError after all. + raise + + def register(self, fileobj, events, data=None): + """ Register a file object for a set of events to monitor. """ + if (not events) or (events & ~(EVENT_READ | EVENT_WRITE)): + raise ValueError("Invalid events: {0!r}".format(events)) + + key = SelectorKey(fileobj, self._fileobj_lookup(fileobj), events, data) + + if key.fd in self._fd_to_key: + raise KeyError("{0!r} (FD {1}) is already registered" + .format(fileobj, key.fd)) + + self._fd_to_key[key.fd] = key + return key + + def unregister(self, fileobj): + """ Unregister a file object from being monitored. """ + try: + key = self._fd_to_key.pop(self._fileobj_lookup(fileobj)) + except KeyError: + raise KeyError("{0!r} is not registered".format(fileobj)) + + # Getting the fileno of a closed socket on Windows errors with EBADF. + except socket.error as e: # Platform-specific: Windows. + if e.errno != errno.EBADF: + raise + else: + for key in self._fd_to_key.values(): + if key.fileobj is fileobj: + self._fd_to_key.pop(key.fd) + break + else: + raise KeyError("{0!r} is not registered".format(fileobj)) + return key + + def modify(self, fileobj, events, data=None): + """ Change a registered file object monitored events and data. """ + # NOTE: Some subclasses optimize this operation even further. + try: + key = self._fd_to_key[self._fileobj_lookup(fileobj)] + except KeyError: + raise KeyError("{0!r} is not registered".format(fileobj)) + + if events != key.events: + self.unregister(fileobj) + key = self.register(fileobj, events, data) + + elif data != key.data: + # Use a shortcut to update the data. + key = key._replace(data=data) + self._fd_to_key[key.fd] = key + + return key + + def select(self, timeout=None): + """ Perform the actual selection until some monitored file objects + are ready or the timeout expires. """ + raise NotImplementedError() + + def close(self): + """ Close the selector. This must be called to ensure that all + underlying resources are freed. """ + self._fd_to_key.clear() + self._map = None + + def get_key(self, fileobj): + """ Return the key associated with a registered file object. """ + mapping = self.get_map() + if mapping is None: + raise RuntimeError("Selector is closed") + try: + return mapping[fileobj] + except KeyError: + raise KeyError("{0!r} is not registered".format(fileobj)) + + def get_map(self): + """ Return a mapping of file objects to selector keys """ + return self._map + + def _key_from_fd(self, fd): + """ Return the key associated to a given file descriptor + Return None if it is not found. """ + try: + return self._fd_to_key[fd] + except KeyError: + return None + + def __enter__(self): + return self + + def __exit__(self, *args): + self.close() + + +# Almost all platforms have select.select() +if hasattr(select, "select"): + class SelectSelector(BaseSelector): + """ Select-based selector. """ + def __init__(self): + super(SelectSelector, self).__init__() + self._readers = set() + self._writers = set() + + def register(self, fileobj, events, data=None): + key = super(SelectSelector, self).register(fileobj, events, data) + if events & EVENT_READ: + self._readers.add(key.fd) + if events & EVENT_WRITE: + self._writers.add(key.fd) + return key + + def unregister(self, fileobj): + key = super(SelectSelector, self).unregister(fileobj) + self._readers.discard(key.fd) + self._writers.discard(key.fd) + return key + + def _select(self, r, w, timeout=None): + """ Wrapper for select.select because timeout is a positional arg """ + return select.select(r, w, [], timeout) + + def select(self, timeout=None): + # Selecting on empty lists on Windows errors out. + if not len(self._readers) and not len(self._writers): + return [] + + timeout = None if timeout is None else max(timeout, 0.0) + ready = [] + r, w, _ = _syscall_wrapper(self._select, True, self._readers, + self._writers, timeout) + r = set(r) + w = set(w) + for fd in r | w: + events = 0 + if fd in r: + events |= EVENT_READ + if fd in w: + events |= EVENT_WRITE + + key = self._key_from_fd(fd) + if key: + ready.append((key, events & key.events)) + return ready + + +if hasattr(select, "poll"): + class PollSelector(BaseSelector): + """ Poll-based selector """ + def __init__(self): + super(PollSelector, self).__init__() + self._poll = select.poll() + + def register(self, fileobj, events, data=None): + key = super(PollSelector, self).register(fileobj, events, data) + event_mask = 0 + if events & EVENT_READ: + event_mask |= select.POLLIN + if events & EVENT_WRITE: + event_mask |= select.POLLOUT + self._poll.register(key.fd, event_mask) + return key + + def unregister(self, fileobj): + key = super(PollSelector, self).unregister(fileobj) + self._poll.unregister(key.fd) + return key + + def _wrap_poll(self, timeout=None): + """ Wrapper function for select.poll.poll() so that + _syscall_wrapper can work with only seconds. """ + if timeout is not None: + if timeout <= 0: + timeout = 0 + else: + # select.poll.poll() has a resolution of 1 millisecond, + # round away from zero to wait *at least* timeout seconds. + timeout = math.ceil(timeout * 1e3) + + result = self._poll.poll(timeout) + return result + + def select(self, timeout=None): + ready = [] + fd_events = _syscall_wrapper(self._wrap_poll, True, timeout=timeout) + for fd, event_mask in fd_events: + events = 0 + if event_mask & ~select.POLLIN: + events |= EVENT_WRITE + if event_mask & ~select.POLLOUT: + events |= EVENT_READ + + key = self._key_from_fd(fd) + if key: + ready.append((key, events & key.events)) + + return ready + + +if hasattr(select, "epoll"): + class EpollSelector(BaseSelector): + """ Epoll-based selector """ + def __init__(self): + super(EpollSelector, self).__init__() + self._epoll = select.epoll() + + def fileno(self): + return self._epoll.fileno() + + def register(self, fileobj, events, data=None): + key = super(EpollSelector, self).register(fileobj, events, data) + events_mask = 0 + if events & EVENT_READ: + events_mask |= select.EPOLLIN + if events & EVENT_WRITE: + events_mask |= select.EPOLLOUT + _syscall_wrapper(self._epoll.register, False, key.fd, events_mask) + return key + + def unregister(self, fileobj): + key = super(EpollSelector, self).unregister(fileobj) + try: + _syscall_wrapper(self._epoll.unregister, False, key.fd) + except SelectorError: + # This can occur when the fd was closed since registry. + pass + return key + + def select(self, timeout=None): + if timeout is not None: + if timeout <= 0: + timeout = 0.0 + else: + # select.epoll.poll() has a resolution of 1 millisecond + # but luckily takes seconds so we don't need a wrapper + # like PollSelector. Just for better rounding. + timeout = math.ceil(timeout * 1e3) * 1e-3 + timeout = float(timeout) + else: + timeout = -1.0 # epoll.poll() must have a float. + + # We always want at least 1 to ensure that select can be called + # with no file descriptors registered. Otherwise will fail. + max_events = max(len(self._fd_to_key), 1) + + ready = [] + fd_events = _syscall_wrapper(self._epoll.poll, True, + timeout=timeout, + maxevents=max_events) + for fd, event_mask in fd_events: + events = 0 + if event_mask & ~select.EPOLLIN: + events |= EVENT_WRITE + if event_mask & ~select.EPOLLOUT: + events |= EVENT_READ + + key = self._key_from_fd(fd) + if key: + ready.append((key, events & key.events)) + return ready + + def close(self): + self._epoll.close() + super(EpollSelector, self).close() + + +if hasattr(select, "kqueue"): + class KqueueSelector(BaseSelector): + """ Kqueue / Kevent-based selector """ + def __init__(self): + super(KqueueSelector, self).__init__() + self._kqueue = select.kqueue() + + def fileno(self): + return self._kqueue.fileno() + + def register(self, fileobj, events, data=None): + key = super(KqueueSelector, self).register(fileobj, events, data) + if events & EVENT_READ: + kevent = select.kevent(key.fd, + select.KQ_FILTER_READ, + select.KQ_EV_ADD) + + _syscall_wrapper(self._kqueue.control, False, [kevent], 0, 0) + + if events & EVENT_WRITE: + kevent = select.kevent(key.fd, + select.KQ_FILTER_WRITE, + select.KQ_EV_ADD) + + _syscall_wrapper(self._kqueue.control, False, [kevent], 0, 0) + + return key + + def unregister(self, fileobj): + key = super(KqueueSelector, self).unregister(fileobj) + if key.events & EVENT_READ: + kevent = select.kevent(key.fd, + select.KQ_FILTER_READ, + select.KQ_EV_DELETE) + try: + _syscall_wrapper(self._kqueue.control, False, [kevent], 0, 0) + except SelectorError: + pass + if key.events & EVENT_WRITE: + kevent = select.kevent(key.fd, + select.KQ_FILTER_WRITE, + select.KQ_EV_DELETE) + try: + _syscall_wrapper(self._kqueue.control, False, [kevent], 0, 0) + except SelectorError: + pass + + return key + + def select(self, timeout=None): + if timeout is not None: + timeout = max(timeout, 0) + + max_events = len(self._fd_to_key) * 2 + ready_fds = {} + + kevent_list = _syscall_wrapper(self._kqueue.control, True, + None, max_events, timeout) + + for kevent in kevent_list: + fd = kevent.ident + event_mask = kevent.filter + events = 0 + if event_mask == select.KQ_FILTER_READ: + events |= EVENT_READ + if event_mask == select.KQ_FILTER_WRITE: + events |= EVENT_WRITE + + key = self._key_from_fd(fd) + if key: + if key.fd not in ready_fds: + ready_fds[key.fd] = (key, events & key.events) + else: + old_events = ready_fds[key.fd][1] + ready_fds[key.fd] = (key, (events | old_events) & key.events) + + return list(ready_fds.values()) + + def close(self): + self._kqueue.close() + super(KqueueSelector, self).close() + + +if not hasattr(select, 'select'): # Platform-specific: AppEngine + HAS_SELECT = False + + +def _can_allocate(struct): + """ Checks that select structs can be allocated by the underlying + operating system, not just advertised by the select module. We don't + check select() because we'll be hopeful that most platforms that + don't have it available will not advertise it. (ie: GAE) """ + try: + # select.poll() objects won't fail until used. + if struct == 'poll': + p = select.poll() + p.poll(0) + + # All others will fail on allocation. + else: + getattr(select, struct)().close() + return True + except (OSError, AttributeError) as e: + return False + + +# Choose the best implementation, roughly: +# kqueue == epoll > poll > select. Devpoll not supported. (See above) +# select() also can't accept a FD > FD_SETSIZE (usually around 1024) +def DefaultSelector(): + """ This function serves as a first call for DefaultSelector to + detect if the select module is being monkey-patched incorrectly + by eventlet, greenlet, and preserve proper behavior. """ + global _DEFAULT_SELECTOR + if _DEFAULT_SELECTOR is None: + if _can_allocate('kqueue'): + _DEFAULT_SELECTOR = KqueueSelector + elif _can_allocate('epoll'): + _DEFAULT_SELECTOR = EpollSelector + elif _can_allocate('poll'): + _DEFAULT_SELECTOR = PollSelector + elif hasattr(select, 'select'): + _DEFAULT_SELECTOR = SelectSelector + else: # Platform-specific: AppEngine + raise ValueError('Platform does not have a selector') + return _DEFAULT_SELECTOR() diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/ssl_.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/ssl_.py new file mode 100644 index 0000000000000000000000000000000000000000..d9b206079a293602da9480ebb29429f126a4f084 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/ssl_.py @@ -0,0 +1,382 @@ +from __future__ import absolute_import +import errno +import warnings +import hmac +import socket + +from binascii import hexlify, unhexlify +from hashlib import md5, sha1, sha256 + +from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning +from ..packages import six + + +SSLContext = None +HAS_SNI = False +IS_PYOPENSSL = False +IS_SECURETRANSPORT = False + +# Maps the length of a digest to a possible hash function producing this digest +HASHFUNC_MAP = { + 32: md5, + 40: sha1, + 64: sha256, +} + + +def _const_compare_digest_backport(a, b): + """ + Compare two digests of equal length in constant time. + + The digests must be of type str/bytes. + Returns True if the digests match, and False otherwise. + """ + result = abs(len(a) - len(b)) + for l, r in zip(bytearray(a), bytearray(b)): + result |= l ^ r + return result == 0 + + +_const_compare_digest = getattr(hmac, 'compare_digest', + _const_compare_digest_backport) + + +try: # Test for SSL features + import ssl + from ssl import wrap_socket, CERT_NONE, PROTOCOL_SSLv23 + from ssl import HAS_SNI # Has SNI? +except ImportError: + pass + + +try: + from ssl import OP_NO_SSLv2, OP_NO_SSLv3, OP_NO_COMPRESSION +except ImportError: + OP_NO_SSLv2, OP_NO_SSLv3 = 0x1000000, 0x2000000 + OP_NO_COMPRESSION = 0x20000 + + +# Python 2.7 doesn't have inet_pton on non-Linux so we fallback on inet_aton in +# those cases. This means that we can only detect IPv4 addresses in this case. +if hasattr(socket, 'inet_pton'): + inet_pton = socket.inet_pton +else: + # Maybe we can use ipaddress if the user has urllib3[secure]? + try: + import ipaddress + + def inet_pton(_, host): + if isinstance(host, bytes): + host = host.decode('ascii') + return ipaddress.ip_address(host) + + except ImportError: # Platform-specific: Non-Linux + def inet_pton(_, host): + return socket.inet_aton(host) + + +# A secure default. +# Sources for more information on TLS ciphers: +# +# - https://wiki.mozilla.org/Security/Server_Side_TLS +# - https://www.ssllabs.com/projects/best-practices/index.html +# - https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/ +# +# The general intent is: +# - Prefer TLS 1.3 cipher suites +# - prefer cipher suites that offer perfect forward secrecy (DHE/ECDHE), +# - prefer ECDHE over DHE for better performance, +# - prefer any AES-GCM and ChaCha20 over any AES-CBC for better performance and +# security, +# - prefer AES-GCM over ChaCha20 because hardware-accelerated AES is common, +# - disable NULL authentication, MD5 MACs and DSS for security reasons. +DEFAULT_CIPHERS = ':'.join([ + 'TLS13-AES-256-GCM-SHA384', + 'TLS13-CHACHA20-POLY1305-SHA256', + 'TLS13-AES-128-GCM-SHA256', + 'ECDH+AESGCM', + 'ECDH+CHACHA20', + 'DH+AESGCM', + 'DH+CHACHA20', + 'ECDH+AES256', + 'DH+AES256', + 'ECDH+AES128', + 'DH+AES', + 'RSA+AESGCM', + 'RSA+AES', + '!aNULL', + '!eNULL', + '!MD5', +]) + +try: + from ssl import SSLContext # Modern SSL? +except ImportError: + class SSLContext(object): # Platform-specific: Python 2 + def __init__(self, protocol_version): + self.protocol = protocol_version + # Use default values from a real SSLContext + self.check_hostname = False + self.verify_mode = ssl.CERT_NONE + self.ca_certs = None + self.options = 0 + self.certfile = None + self.keyfile = None + self.ciphers = None + + def load_cert_chain(self, certfile, keyfile): + self.certfile = certfile + self.keyfile = keyfile + + def load_verify_locations(self, cafile=None, capath=None): + self.ca_certs = cafile + + if capath is not None: + raise SSLError("CA directories not supported in older Pythons") + + def set_ciphers(self, cipher_suite): + self.ciphers = cipher_suite + + def wrap_socket(self, socket, server_hostname=None, server_side=False): + warnings.warn( + 'A true SSLContext object is not available. This prevents ' + 'urllib3 from configuring SSL appropriately and may cause ' + 'certain SSL connections to fail. You can upgrade to a newer ' + 'version of Python to solve this. For more information, see ' + 'https://urllib3.readthedocs.io/en/latest/advanced-usage.html' + '#ssl-warnings', + InsecurePlatformWarning + ) + kwargs = { + 'keyfile': self.keyfile, + 'certfile': self.certfile, + 'ca_certs': self.ca_certs, + 'cert_reqs': self.verify_mode, + 'ssl_version': self.protocol, + 'server_side': server_side, + } + return wrap_socket(socket, ciphers=self.ciphers, **kwargs) + + +def assert_fingerprint(cert, fingerprint): + """ + Checks if given fingerprint matches the supplied certificate. + + :param cert: + Certificate as bytes object. + :param fingerprint: + Fingerprint as string of hexdigits, can be interspersed by colons. + """ + + fingerprint = fingerprint.replace(':', '').lower() + digest_length = len(fingerprint) + hashfunc = HASHFUNC_MAP.get(digest_length) + if not hashfunc: + raise SSLError( + 'Fingerprint of invalid length: {0}'.format(fingerprint)) + + # We need encode() here for py32; works on py2 and p33. + fingerprint_bytes = unhexlify(fingerprint.encode()) + + cert_digest = hashfunc(cert).digest() + + if not _const_compare_digest(cert_digest, fingerprint_bytes): + raise SSLError('Fingerprints did not match. Expected "{0}", got "{1}".' + .format(fingerprint, hexlify(cert_digest))) + + +def resolve_cert_reqs(candidate): + """ + Resolves the argument to a numeric constant, which can be passed to + the wrap_socket function/method from the ssl module. + Defaults to :data:`ssl.CERT_NONE`. + If given a string it is assumed to be the name of the constant in the + :mod:`ssl` module or its abbreviation. + (So you can specify `REQUIRED` instead of `CERT_REQUIRED`. + If it's neither `None` nor a string we assume it is already the numeric + constant which can directly be passed to wrap_socket. + """ + if candidate is None: + return CERT_NONE + + if isinstance(candidate, str): + res = getattr(ssl, candidate, None) + if res is None: + res = getattr(ssl, 'CERT_' + candidate) + return res + + return candidate + + +def resolve_ssl_version(candidate): + """ + like resolve_cert_reqs + """ + if candidate is None: + return PROTOCOL_SSLv23 + + if isinstance(candidate, str): + res = getattr(ssl, candidate, None) + if res is None: + res = getattr(ssl, 'PROTOCOL_' + candidate) + return res + + return candidate + + +def create_urllib3_context(ssl_version=None, cert_reqs=None, + options=None, ciphers=None): + """All arguments have the same meaning as ``ssl_wrap_socket``. + + By default, this function does a lot of the same work that + ``ssl.create_default_context`` does on Python 3.4+. It: + + - Disables SSLv2, SSLv3, and compression + - Sets a restricted set of server ciphers + + If you wish to enable SSLv3, you can do:: + + from urllib3.util import ssl_ + context = ssl_.create_urllib3_context() + context.options &= ~ssl_.OP_NO_SSLv3 + + You can do the same to enable compression (substituting ``COMPRESSION`` + for ``SSLv3`` in the last line above). + + :param ssl_version: + The desired protocol version to use. This will default to + PROTOCOL_SSLv23 which will negotiate the highest protocol that both + the server and your installation of OpenSSL support. + :param cert_reqs: + Whether to require the certificate verification. This defaults to + ``ssl.CERT_REQUIRED``. + :param options: + Specific OpenSSL options. These default to ``ssl.OP_NO_SSLv2``, + ``ssl.OP_NO_SSLv3``, ``ssl.OP_NO_COMPRESSION``. + :param ciphers: + Which cipher suites to allow the server to select. + :returns: + Constructed SSLContext object with specified options + :rtype: SSLContext + """ + context = SSLContext(ssl_version or ssl.PROTOCOL_SSLv23) + + context.set_ciphers(ciphers or DEFAULT_CIPHERS) + + # Setting the default here, as we may have no ssl module on import + cert_reqs = ssl.CERT_REQUIRED if cert_reqs is None else cert_reqs + + if options is None: + options = 0 + # SSLv2 is easily broken and is considered harmful and dangerous + options |= OP_NO_SSLv2 + # SSLv3 has several problems and is now dangerous + options |= OP_NO_SSLv3 + # Disable compression to prevent CRIME attacks for OpenSSL 1.0+ + # (issue #309) + options |= OP_NO_COMPRESSION + + context.options |= options + + context.verify_mode = cert_reqs + if getattr(context, 'check_hostname', None) is not None: # Platform-specific: Python 3.2 + # We do our own verification, including fingerprints and alternative + # hostnames. So disable it here + context.check_hostname = False + return context + + +def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None, + ca_certs=None, server_hostname=None, + ssl_version=None, ciphers=None, ssl_context=None, + ca_cert_dir=None): + """ + All arguments except for server_hostname, ssl_context, and ca_cert_dir have + the same meaning as they do when using :func:`ssl.wrap_socket`. + + :param server_hostname: + When SNI is supported, the expected hostname of the certificate + :param ssl_context: + A pre-made :class:`SSLContext` object. If none is provided, one will + be created using :func:`create_urllib3_context`. + :param ciphers: + A string of ciphers we wish the client to support. + :param ca_cert_dir: + A directory containing CA certificates in multiple separate files, as + supported by OpenSSL's -CApath flag or the capath argument to + SSLContext.load_verify_locations(). + """ + context = ssl_context + if context is None: + # Note: This branch of code and all the variables in it are no longer + # used by urllib3 itself. We should consider deprecating and removing + # this code. + context = create_urllib3_context(ssl_version, cert_reqs, + ciphers=ciphers) + + if ca_certs or ca_cert_dir: + try: + context.load_verify_locations(ca_certs, ca_cert_dir) + except IOError as e: # Platform-specific: Python 2.7 + raise SSLError(e) + # Py33 raises FileNotFoundError which subclasses OSError + # These are not equivalent unless we check the errno attribute + except OSError as e: # Platform-specific: Python 3.3 and beyond + if e.errno == errno.ENOENT: + raise SSLError(e) + raise + + # Don't load system certs unless there were no CA certs or + # SSLContext object specified manually. + elif ssl_context is None and hasattr(context, 'load_default_certs'): + # try to load OS default certs; works well on Windows (require Python3.4+) + context.load_default_certs() + + if certfile: + context.load_cert_chain(certfile, keyfile) + + # If we detect server_hostname is an IP address then the SNI + # extension should not be used according to RFC3546 Section 3.1 + # We shouldn't warn the user if SNI isn't available but we would + # not be using SNI anyways due to IP address for server_hostname. + if ((server_hostname is not None and not is_ipaddress(server_hostname)) + or IS_SECURETRANSPORT): + if HAS_SNI and server_hostname is not None: + return context.wrap_socket(sock, server_hostname=server_hostname) + + warnings.warn( + 'An HTTPS request has been made, but the SNI (Server Name ' + 'Indication) extension to TLS is not available on this platform. ' + 'This may cause the server to present an incorrect TLS ' + 'certificate, which can cause validation failures. You can upgrade to ' + 'a newer version of Python to solve this. For more information, see ' + 'https://urllib3.readthedocs.io/en/latest/advanced-usage.html' + '#ssl-warnings', + SNIMissingWarning + ) + + return context.wrap_socket(sock) + + +def is_ipaddress(hostname): + """Detects whether the hostname given is an IP address. + + :param str hostname: Hostname to examine. + :return: True if the hostname is an IP address, False otherwise. + """ + if six.PY3 and isinstance(hostname, bytes): + # IDN A-label bytes are ASCII compatible. + hostname = hostname.decode('ascii') + + families = [socket.AF_INET] + if hasattr(socket, 'AF_INET6'): + families.append(socket.AF_INET6) + + for af in families: + try: + inet_pton(af, hostname) + except (socket.error, ValueError, OSError): + pass + else: + return True + return False diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/timeout.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/timeout.py new file mode 100644 index 0000000000000000000000000000000000000000..cec817e6efa53e830cb2b5877faa42013743d5db --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/timeout.py @@ -0,0 +1,242 @@ +from __future__ import absolute_import +# The default socket timeout, used by httplib to indicate that no timeout was +# specified by the user +from socket import _GLOBAL_DEFAULT_TIMEOUT +import time + +from ..exceptions import TimeoutStateError + +# A sentinel value to indicate that no timeout was specified by the user in +# urllib3 +_Default = object() + + +# Use time.monotonic if available. +current_time = getattr(time, "monotonic", time.time) + + +class Timeout(object): + """ Timeout configuration. + + Timeouts can be defined as a default for a pool:: + + timeout = Timeout(connect=2.0, read=7.0) + http = PoolManager(timeout=timeout) + response = http.request('GET', 'http://example.com/') + + Or per-request (which overrides the default for the pool):: + + response = http.request('GET', 'http://example.com/', timeout=Timeout(10)) + + Timeouts can be disabled by setting all the parameters to ``None``:: + + no_timeout = Timeout(connect=None, read=None) + response = http.request('GET', 'http://example.com/, timeout=no_timeout) + + + :param total: + This combines the connect and read timeouts into one; the read timeout + will be set to the time leftover from the connect attempt. In the + event that both a connect timeout and a total are specified, or a read + timeout and a total are specified, the shorter timeout will be applied. + + Defaults to None. + + :type total: integer, float, or None + + :param connect: + The maximum amount of time to wait for a connection attempt to a server + to succeed. Omitting the parameter will default the connect timeout to + the system default, probably `the global default timeout in socket.py + `_. + None will set an infinite timeout for connection attempts. + + :type connect: integer, float, or None + + :param read: + The maximum amount of time to wait between consecutive + read operations for a response from the server. Omitting + the parameter will default the read timeout to the system + default, probably `the global default timeout in socket.py + `_. + None will set an infinite timeout. + + :type read: integer, float, or None + + .. note:: + + Many factors can affect the total amount of time for urllib3 to return + an HTTP response. + + For example, Python's DNS resolver does not obey the timeout specified + on the socket. Other factors that can affect total request time include + high CPU load, high swap, the program running at a low priority level, + or other behaviors. + + In addition, the read and total timeouts only measure the time between + read operations on the socket connecting the client and the server, + not the total amount of time for the request to return a complete + response. For most requests, the timeout is raised because the server + has not sent the first byte in the specified time. This is not always + the case; if a server streams one byte every fifteen seconds, a timeout + of 20 seconds will not trigger, even though the request will take + several minutes to complete. + + If your goal is to cut off any request after a set amount of wall clock + time, consider having a second "watcher" thread to cut off a slow + request. + """ + + #: A sentinel object representing the default timeout value + DEFAULT_TIMEOUT = _GLOBAL_DEFAULT_TIMEOUT + + def __init__(self, total=None, connect=_Default, read=_Default): + self._connect = self._validate_timeout(connect, 'connect') + self._read = self._validate_timeout(read, 'read') + self.total = self._validate_timeout(total, 'total') + self._start_connect = None + + def __str__(self): + return '%s(connect=%r, read=%r, total=%r)' % ( + type(self).__name__, self._connect, self._read, self.total) + + @classmethod + def _validate_timeout(cls, value, name): + """ Check that a timeout attribute is valid. + + :param value: The timeout value to validate + :param name: The name of the timeout attribute to validate. This is + used to specify in error messages. + :return: The validated and casted version of the given value. + :raises ValueError: If it is a numeric value less than or equal to + zero, or the type is not an integer, float, or None. + """ + if value is _Default: + return cls.DEFAULT_TIMEOUT + + if value is None or value is cls.DEFAULT_TIMEOUT: + return value + + if isinstance(value, bool): + raise ValueError("Timeout cannot be a boolean value. It must " + "be an int, float or None.") + try: + float(value) + except (TypeError, ValueError): + raise ValueError("Timeout value %s was %s, but it must be an " + "int, float or None." % (name, value)) + + try: + if value <= 0: + raise ValueError("Attempted to set %s timeout to %s, but the " + "timeout cannot be set to a value less " + "than or equal to 0." % (name, value)) + except TypeError: # Python 3 + raise ValueError("Timeout value %s was %s, but it must be an " + "int, float or None." % (name, value)) + + return value + + @classmethod + def from_float(cls, timeout): + """ Create a new Timeout from a legacy timeout value. + + The timeout value used by httplib.py sets the same timeout on the + connect(), and recv() socket requests. This creates a :class:`Timeout` + object that sets the individual timeouts to the ``timeout`` value + passed to this function. + + :param timeout: The legacy timeout value. + :type timeout: integer, float, sentinel default object, or None + :return: Timeout object + :rtype: :class:`Timeout` + """ + return Timeout(read=timeout, connect=timeout) + + def clone(self): + """ Create a copy of the timeout object + + Timeout properties are stored per-pool but each request needs a fresh + Timeout object to ensure each one has its own start/stop configured. + + :return: a copy of the timeout object + :rtype: :class:`Timeout` + """ + # We can't use copy.deepcopy because that will also create a new object + # for _GLOBAL_DEFAULT_TIMEOUT, which socket.py uses as a sentinel to + # detect the user default. + return Timeout(connect=self._connect, read=self._read, + total=self.total) + + def start_connect(self): + """ Start the timeout clock, used during a connect() attempt + + :raises urllib3.exceptions.TimeoutStateError: if you attempt + to start a timer that has been started already. + """ + if self._start_connect is not None: + raise TimeoutStateError("Timeout timer has already been started.") + self._start_connect = current_time() + return self._start_connect + + def get_connect_duration(self): + """ Gets the time elapsed since the call to :meth:`start_connect`. + + :return: Elapsed time. + :rtype: float + :raises urllib3.exceptions.TimeoutStateError: if you attempt + to get duration for a timer that hasn't been started. + """ + if self._start_connect is None: + raise TimeoutStateError("Can't get connect duration for timer " + "that has not started.") + return current_time() - self._start_connect + + @property + def connect_timeout(self): + """ Get the value to use when setting a connection timeout. + + This will be a positive float or integer, the value None + (never timeout), or the default system timeout. + + :return: Connect timeout. + :rtype: int, float, :attr:`Timeout.DEFAULT_TIMEOUT` or None + """ + if self.total is None: + return self._connect + + if self._connect is None or self._connect is self.DEFAULT_TIMEOUT: + return self.total + + return min(self._connect, self.total) + + @property + def read_timeout(self): + """ Get the value for the read timeout. + + This assumes some time has elapsed in the connection timeout and + computes the read timeout appropriately. + + If self.total is set, the read timeout is dependent on the amount of + time taken by the connect timeout. If the connection time has not been + established, a :exc:`~urllib3.exceptions.TimeoutStateError` will be + raised. + + :return: Value to use for the read timeout. + :rtype: int, float, :attr:`Timeout.DEFAULT_TIMEOUT` or None + :raises urllib3.exceptions.TimeoutStateError: If :meth:`start_connect` + has not yet been called on this object. + """ + if (self.total is not None and + self.total is not self.DEFAULT_TIMEOUT and + self._read is not None and + self._read is not self.DEFAULT_TIMEOUT): + # In case the connect timeout has not yet been established. + if self._start_connect is None: + return self._read + return max(0, min(self.total - self.get_connect_duration(), + self._read)) + elif self.total is not None and self.total is not self.DEFAULT_TIMEOUT: + return max(0, self.total - self.get_connect_duration()) + else: + return self._read diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/url.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/url.py new file mode 100644 index 0000000000000000000000000000000000000000..12b8d5555e4ebc0cc107990d6f15eaf6a07bd402 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/url.py @@ -0,0 +1,238 @@ +from __future__ import absolute_import +from collections import namedtuple +import re + +from ..exceptions import LocationParseError +from ..packages.six.moves.urllib.parse import quote + + +url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] + +# We only want to normalize urls with an HTTP(S) scheme. +# urllib3 infers URLs without a scheme (None) to be http. +NORMALIZABLE_SCHEMES = ('http', 'https', None) + +_contains_disallowed_url_pchar_re = re.compile('[\x00-\x20\x7f]') + + +class Url(namedtuple('Url', url_attrs)): + """ + Datastructure for representing an HTTP URL. Used as a return value for + :func:`parse_url`. Both the scheme and host are normalized as they are + both case-insensitive according to RFC 3986. + """ + __slots__ = () + + def __new__(cls, scheme=None, auth=None, host=None, port=None, path=None, + query=None, fragment=None): + if path and not path.startswith('/'): + path = '/' + path + if scheme: + scheme = scheme.lower() + if host and scheme in NORMALIZABLE_SCHEMES: + host = host.lower() + return super(Url, cls).__new__(cls, scheme, auth, host, port, path, + query, fragment) + + @property + def hostname(self): + """For backwards-compatibility with urlparse. We're nice like that.""" + return self.host + + @property + def request_uri(self): + """Absolute path including the query string.""" + uri = self.path or '/' + + if self.query is not None: + uri += '?' + self.query + + return uri + + @property + def netloc(self): + """Network location including host and port""" + if self.port: + return '%s:%d' % (self.host, self.port) + return self.host + + @property + def url(self): + """ + Convert self into a url + + This function should more or less round-trip with :func:`.parse_url`. The + returned url may not be exactly the same as the url inputted to + :func:`.parse_url`, but it should be equivalent by the RFC (e.g., urls + with a blank port will have : removed). + + Example: :: + + >>> U = parse_url('http://google.com/mail/') + >>> U.url + 'http://google.com/mail/' + >>> Url('http', 'username:password', 'host.com', 80, + ... '/path', 'query', 'fragment').url + 'http://username:password@host.com:80/path?query#fragment' + """ + scheme, auth, host, port, path, query, fragment = self + url = '' + + # We use "is not None" we want things to happen with empty strings (or 0 port) + if scheme is not None: + url += scheme + '://' + if auth is not None: + url += auth + '@' + if host is not None: + url += host + if port is not None: + url += ':' + str(port) + if path is not None: + url += path + if query is not None: + url += '?' + query + if fragment is not None: + url += '#' + fragment + + return url + + def __str__(self): + return self.url + + +def split_first(s, delims): + """ + Given a string and an iterable of delimiters, split on the first found + delimiter. Return two split parts and the matched delimiter. + + If not found, then the first part is the full input string. + + Example:: + + >>> split_first('foo/bar?baz', '?/=') + ('foo', 'bar?baz', '/') + >>> split_first('foo/bar?baz', '123') + ('foo/bar?baz', '', None) + + Scales linearly with number of delims. Not ideal for large number of delims. + """ + min_idx = None + min_delim = None + for d in delims: + idx = s.find(d) + if idx < 0: + continue + + if min_idx is None or idx < min_idx: + min_idx = idx + min_delim = d + + if min_idx is None or min_idx < 0: + return s, '', None + + return s[:min_idx], s[min_idx + 1:], min_delim + + +def parse_url(url): + """ + Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is + performed to parse incomplete urls. Fields not provided will be None. + + Partly backwards-compatible with :mod:`urlparse`. + + Example:: + + >>> parse_url('http://google.com/mail/') + Url(scheme='http', host='google.com', port=None, path='/mail/', ...) + >>> parse_url('google.com:80') + Url(scheme=None, host='google.com', port=80, path=None, ...) + >>> parse_url('/foo?bar') + Url(scheme=None, host=None, port=None, path='/foo', query='bar', ...) + """ + + # While this code has overlap with stdlib's urlparse, it is much + # simplified for our needs and less annoying. + # Additionally, this implementations does silly things to be optimal + # on CPython. + + if not url: + # Empty + return Url() + + # Prevent CVE-2019-9740. + # adapted from https://github.com/python/cpython/pull/12755 + url = _contains_disallowed_url_pchar_re.sub(lambda match: quote(match.group()), url) + + scheme = None + auth = None + host = None + port = None + path = None + fragment = None + query = None + + # Scheme + if '://' in url: + scheme, url = url.split('://', 1) + + # Find the earliest Authority Terminator + # (http://tools.ietf.org/html/rfc3986#section-3.2) + url, path_, delim = split_first(url, ['/', '?', '#']) + + if delim: + # Reassemble the path + path = delim + path_ + + # Auth + if '@' in url: + # Last '@' denotes end of auth part + auth, url = url.rsplit('@', 1) + + # IPv6 + if url and url[0] == '[': + host, url = url.split(']', 1) + host += ']' + + # Port + if ':' in url: + _host, port = url.split(':', 1) + + if not host: + host = _host + + if port: + # If given, ports must be integers. No whitespace, no plus or + # minus prefixes, no non-integer digits such as ^2 (superscript). + if not port.isdigit(): + raise LocationParseError(url) + try: + port = int(port) + except ValueError: + raise LocationParseError(url) + else: + # Blank ports are cool, too. (rfc3986#section-3.2.3) + port = None + + elif not host and url: + host = url + + if not path: + return Url(scheme, auth, host, port, path, query, fragment) + + # Fragment + if '#' in path: + path, fragment = path.split('#', 1) + + # Query + if '?' in path: + path, query = path.split('?', 1) + + return Url(scheme, auth, host, port, path, query, fragment) + + +def get_host(url): + """ + Deprecated. Use :func:`parse_url` instead. + """ + p = parse_url(url) + return p.scheme or 'http', p.hostname, p.port diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/wait.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/wait.py new file mode 100644 index 0000000000000000000000000000000000000000..4db71bafd87b742f98683011df2fac2c73358d23 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/wait.py @@ -0,0 +1,150 @@ +import errno +from functools import partial +import select +import sys +try: + from time import monotonic +except ImportError: + from time import time as monotonic + +__all__ = ["NoWayToWaitForSocketError", "wait_for_read", "wait_for_write"] + + +class NoWayToWaitForSocketError(Exception): + pass + + +# How should we wait on sockets? +# +# There are two types of APIs you can use for waiting on sockets: the fancy +# modern stateful APIs like epoll/kqueue, and the older stateless APIs like +# select/poll. The stateful APIs are more efficient when you have a lots of +# sockets to keep track of, because you can set them up once and then use them +# lots of times. But we only ever want to wait on a single socket at a time +# and don't want to keep track of state, so the stateless APIs are actually +# more efficient. So we want to use select() or poll(). +# +# Now, how do we choose between select() and poll()? On traditional Unixes, +# select() has a strange calling convention that makes it slow, or fail +# altogether, for high-numbered file descriptors. The point of poll() is to fix +# that, so on Unixes, we prefer poll(). +# +# On Windows, there is no poll() (or at least Python doesn't provide a wrapper +# for it), but that's OK, because on Windows, select() doesn't have this +# strange calling convention; plain select() works fine. +# +# So: on Windows we use select(), and everywhere else we use poll(). We also +# fall back to select() in case poll() is somehow broken or missing. + +if sys.version_info >= (3, 5): + # Modern Python, that retries syscalls by default + def _retry_on_intr(fn, timeout): + return fn(timeout) +else: + # Old and broken Pythons. + def _retry_on_intr(fn, timeout): + if timeout is None: + deadline = float("inf") + else: + deadline = monotonic() + timeout + + while True: + try: + return fn(timeout) + # OSError for 3 <= pyver < 3.5, select.error for pyver <= 2.7 + except (OSError, select.error) as e: + # 'e.args[0]' incantation works for both OSError and select.error + if e.args[0] != errno.EINTR: + raise + else: + timeout = deadline - monotonic() + if timeout < 0: + timeout = 0 + if timeout == float("inf"): + timeout = None + continue + + +def select_wait_for_socket(sock, read=False, write=False, timeout=None): + if not read and not write: + raise RuntimeError("must specify at least one of read=True, write=True") + rcheck = [] + wcheck = [] + if read: + rcheck.append(sock) + if write: + wcheck.append(sock) + # When doing a non-blocking connect, most systems signal success by + # marking the socket writable. Windows, though, signals success by marked + # it as "exceptional". We paper over the difference by checking the write + # sockets for both conditions. (The stdlib selectors module does the same + # thing.) + fn = partial(select.select, rcheck, wcheck, wcheck) + rready, wready, xready = _retry_on_intr(fn, timeout) + return bool(rready or wready or xready) + + +def poll_wait_for_socket(sock, read=False, write=False, timeout=None): + if not read and not write: + raise RuntimeError("must specify at least one of read=True, write=True") + mask = 0 + if read: + mask |= select.POLLIN + if write: + mask |= select.POLLOUT + poll_obj = select.poll() + poll_obj.register(sock, mask) + + # For some reason, poll() takes timeout in milliseconds + def do_poll(t): + if t is not None: + t *= 1000 + return poll_obj.poll(t) + + return bool(_retry_on_intr(do_poll, timeout)) + + +def null_wait_for_socket(*args, **kwargs): + raise NoWayToWaitForSocketError("no select-equivalent available") + + +def _have_working_poll(): + # Apparently some systems have a select.poll that fails as soon as you try + # to use it, either due to strange configuration or broken monkeypatching + # from libraries like eventlet/greenlet. + try: + poll_obj = select.poll() + _retry_on_intr(poll_obj.poll, 0) + except (AttributeError, OSError): + return False + else: + return True + + +def wait_for_socket(*args, **kwargs): + # We delay choosing which implementation to use until the first time we're + # called. We could do it at import time, but then we might make the wrong + # decision if someone goes wild with monkeypatching select.poll after + # we're imported. + global wait_for_socket + if _have_working_poll(): + wait_for_socket = poll_wait_for_socket + elif hasattr(select, "select"): + wait_for_socket = select_wait_for_socket + else: # Platform-specific: Appengine. + wait_for_socket = null_wait_for_socket + return wait_for_socket(*args, **kwargs) + + +def wait_for_read(sock, timeout=None): + """ Waits for reading to be available on a given socket. + Returns True if the socket is readable, or False if the timeout expired. + """ + return wait_for_socket(sock, read=True, timeout=timeout) + + +def wait_for_write(sock, timeout=None): + """ Waits for writing to be available on a given socket. + Returns True if the socket is readable, or False if the timeout expired. + """ + return wait_for_socket(sock, write=True, timeout=timeout) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/sessions.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/sessions.py new file mode 100644 index 0000000000000000000000000000000000000000..2137e5c488f4d3853a8821a0f0aac6b5042d962f --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/sessions.py @@ -0,0 +1,736 @@ +# -*- coding: utf-8 -*- + +""" +requests.session +~~~~~~~~~~~~~~~~ + +This module provides a Session object to manage and persist settings across +requests (cookies, auth, proxies). +""" +import os +import platform +import time +from datetime import timedelta + +from .auth import _basic_auth_str +from .compat import cookielib, is_py3, OrderedDict, urljoin, urlparse, Mapping +from .cookies import ( + cookiejar_from_dict, extract_cookies_to_jar, RequestsCookieJar, merge_cookies) +from .models import Request, PreparedRequest, DEFAULT_REDIRECT_LIMIT +from .hooks import default_hooks, dispatch_hook +from ._internal_utils import to_native_string +from .utils import to_key_val_list, default_headers +from .exceptions import ( + TooManyRedirects, InvalidSchema, ChunkedEncodingError, ContentDecodingError) + +from .structures import CaseInsensitiveDict +from .adapters import HTTPAdapter + +from .utils import ( + requote_uri, get_environ_proxies, get_netrc_auth, should_bypass_proxies, + get_auth_from_url, rewind_body +) + +from .status_codes import codes + +# formerly defined here, reexposed here for backward compatibility +from .models import REDIRECT_STATI + +# Preferred clock, based on which one is more accurate on a given system. +if platform.system() == 'Windows': + try: # Python 3.3+ + preferred_clock = time.perf_counter + except AttributeError: # Earlier than Python 3. + preferred_clock = time.clock +else: + preferred_clock = time.time + + +def merge_setting(request_setting, session_setting, dict_class=OrderedDict): + """Determines appropriate setting for a given request, taking into account + the explicit setting on that request, and the setting in the session. If a + setting is a dictionary, they will be merged together using `dict_class` + """ + + if session_setting is None: + return request_setting + + if request_setting is None: + return session_setting + + # Bypass if not a dictionary (e.g. verify) + if not ( + isinstance(session_setting, Mapping) and + isinstance(request_setting, Mapping) + ): + return request_setting + + merged_setting = dict_class(to_key_val_list(session_setting)) + merged_setting.update(to_key_val_list(request_setting)) + + # Remove keys that are set to None. Extract keys first to avoid altering + # the dictionary during iteration. + none_keys = [k for (k, v) in merged_setting.items() if v is None] + for key in none_keys: + del merged_setting[key] + + return merged_setting + + +def merge_hooks(request_hooks, session_hooks, dict_class=OrderedDict): + """Properly merges both requests and session hooks. + + This is necessary because when request_hooks == {'response': []}, the + merge breaks Session hooks entirely. + """ + if session_hooks is None or session_hooks.get('response') == []: + return request_hooks + + if request_hooks is None or request_hooks.get('response') == []: + return session_hooks + + return merge_setting(request_hooks, session_hooks, dict_class) + + +class SessionRedirectMixin(object): + + def get_redirect_target(self, resp): + """Receives a Response. Returns a redirect URI or ``None``""" + # Due to the nature of how requests processes redirects this method will + # be called at least once upon the original response and at least twice + # on each subsequent redirect response (if any). + # If a custom mixin is used to handle this logic, it may be advantageous + # to cache the redirect location onto the response object as a private + # attribute. + if resp.is_redirect: + location = resp.headers['location'] + # Currently the underlying http module on py3 decode headers + # in latin1, but empirical evidence suggests that latin1 is very + # rarely used with non-ASCII characters in HTTP headers. + # It is more likely to get UTF8 header rather than latin1. + # This causes incorrect handling of UTF8 encoded location headers. + # To solve this, we re-encode the location in latin1. + if is_py3: + location = location.encode('latin1') + return to_native_string(location, 'utf8') + return None + + def resolve_redirects(self, resp, req, stream=False, timeout=None, + verify=True, cert=None, proxies=None, yield_requests=False, **adapter_kwargs): + """Receives a Response. Returns a generator of Responses or Requests.""" + + hist = [] # keep track of history + + url = self.get_redirect_target(resp) + while url: + prepared_request = req.copy() + + # Update history and keep track of redirects. + # resp.history must ignore the original request in this loop + hist.append(resp) + resp.history = hist[1:] + + try: + resp.content # Consume socket so it can be released + except (ChunkedEncodingError, ContentDecodingError, RuntimeError): + resp.raw.read(decode_content=False) + + if len(resp.history) >= self.max_redirects: + raise TooManyRedirects('Exceeded %s redirects.' % self.max_redirects, response=resp) + + # Release the connection back into the pool. + resp.close() + + # Handle redirection without scheme (see: RFC 1808 Section 4) + if url.startswith('//'): + parsed_rurl = urlparse(resp.url) + url = '%s:%s' % (to_native_string(parsed_rurl.scheme), url) + + # The scheme should be lower case... + parsed = urlparse(url) + url = parsed.geturl() + + # Facilitate relative 'location' headers, as allowed by RFC 7231. + # (e.g. '/path/to/resource' instead of 'http://domain.tld/path/to/resource') + # Compliant with RFC3986, we percent encode the url. + if not parsed.netloc: + url = urljoin(resp.url, requote_uri(url)) + else: + url = requote_uri(url) + + prepared_request.url = to_native_string(url) + + self.rebuild_method(prepared_request, resp) + + # https://github.com/requests/requests/issues/1084 + if resp.status_code not in (codes.temporary_redirect, codes.permanent_redirect): + # https://github.com/requests/requests/issues/3490 + purged_headers = ('Content-Length', 'Content-Type', 'Transfer-Encoding') + for header in purged_headers: + prepared_request.headers.pop(header, None) + prepared_request.body = None + + headers = prepared_request.headers + try: + del headers['Cookie'] + except KeyError: + pass + + # Extract any cookies sent on the response to the cookiejar + # in the new request. Because we've mutated our copied prepared + # request, use the old one that we haven't yet touched. + extract_cookies_to_jar(prepared_request._cookies, req, resp.raw) + merge_cookies(prepared_request._cookies, self.cookies) + prepared_request.prepare_cookies(prepared_request._cookies) + + # Rebuild auth and proxy information. + proxies = self.rebuild_proxies(prepared_request, proxies) + self.rebuild_auth(prepared_request, resp) + + # A failed tell() sets `_body_position` to `object()`. This non-None + # value ensures `rewindable` will be True, allowing us to raise an + # UnrewindableBodyError, instead of hanging the connection. + rewindable = ( + prepared_request._body_position is not None and + ('Content-Length' in headers or 'Transfer-Encoding' in headers) + ) + + # Attempt to rewind consumed file-like object. + if rewindable: + rewind_body(prepared_request) + + # Override the original request. + req = prepared_request + + if yield_requests: + yield req + else: + + resp = self.send( + req, + stream=stream, + timeout=timeout, + verify=verify, + cert=cert, + proxies=proxies, + allow_redirects=False, + **adapter_kwargs + ) + + extract_cookies_to_jar(self.cookies, prepared_request, resp.raw) + + # extract redirect url, if any, for the next loop + url = self.get_redirect_target(resp) + yield resp + + def rebuild_auth(self, prepared_request, response): + """When being redirected we may want to strip authentication from the + request to avoid leaking credentials. This method intelligently removes + and reapplies authentication where possible to avoid credential loss. + """ + headers = prepared_request.headers + url = prepared_request.url + + if 'Authorization' in headers: + # If we get redirected to a new host, we should strip out any + # authentication headers. + original_parsed = urlparse(response.request.url) + redirect_parsed = urlparse(url) + + if (original_parsed.hostname != redirect_parsed.hostname): + del headers['Authorization'] + + # .netrc might have more auth for us on our new host. + new_auth = get_netrc_auth(url) if self.trust_env else None + if new_auth is not None: + prepared_request.prepare_auth(new_auth) + + return + + def rebuild_proxies(self, prepared_request, proxies): + """This method re-evaluates the proxy configuration by considering the + environment variables. If we are redirected to a URL covered by + NO_PROXY, we strip the proxy configuration. Otherwise, we set missing + proxy keys for this URL (in case they were stripped by a previous + redirect). + + This method also replaces the Proxy-Authorization header where + necessary. + + :rtype: dict + """ + proxies = proxies if proxies is not None else {} + headers = prepared_request.headers + url = prepared_request.url + scheme = urlparse(url).scheme + new_proxies = proxies.copy() + no_proxy = proxies.get('no_proxy') + + bypass_proxy = should_bypass_proxies(url, no_proxy=no_proxy) + if self.trust_env and not bypass_proxy: + environ_proxies = get_environ_proxies(url, no_proxy=no_proxy) + + proxy = environ_proxies.get(scheme, environ_proxies.get('all')) + + if proxy: + new_proxies.setdefault(scheme, proxy) + + if 'Proxy-Authorization' in headers: + del headers['Proxy-Authorization'] + + try: + username, password = get_auth_from_url(new_proxies[scheme]) + except KeyError: + username, password = None, None + + if username and password: + headers['Proxy-Authorization'] = _basic_auth_str(username, password) + + return new_proxies + + def rebuild_method(self, prepared_request, response): + """When being redirected we may want to change the method of the request + based on certain specs or browser behavior. + """ + method = prepared_request.method + + # http://tools.ietf.org/html/rfc7231#section-6.4.4 + if response.status_code == codes.see_other and method != 'HEAD': + method = 'GET' + + # Do what the browsers do, despite standards... + # First, turn 302s into GETs. + if response.status_code == codes.found and method != 'HEAD': + method = 'GET' + + # Second, if a POST is responded to with a 301, turn it into a GET. + # This bizarre behaviour is explained in Issue 1704. + if response.status_code == codes.moved and method == 'POST': + method = 'GET' + + prepared_request.method = method + + +class Session(SessionRedirectMixin): + """A Requests session. + + Provides cookie persistence, connection-pooling, and configuration. + + Basic Usage:: + + >>> import requests + >>> s = requests.Session() + >>> s.get('http://httpbin.org/get') + + + Or as a context manager:: + + >>> with requests.Session() as s: + >>> s.get('http://httpbin.org/get') + + """ + + __attrs__ = [ + 'headers', 'cookies', 'auth', 'proxies', 'hooks', 'params', 'verify', + 'cert', 'prefetch', 'adapters', 'stream', 'trust_env', + 'max_redirects', + ] + + def __init__(self): + + #: A case-insensitive dictionary of headers to be sent on each + #: :class:`Request ` sent from this + #: :class:`Session `. + self.headers = default_headers() + + #: Default Authentication tuple or object to attach to + #: :class:`Request `. + self.auth = None + + #: Dictionary mapping protocol or protocol and host to the URL of the proxy + #: (e.g. {'http': 'foo.bar:3128', 'http://host.name': 'foo.bar:4012'}) to + #: be used on each :class:`Request `. + self.proxies = {} + + #: Event-handling hooks. + self.hooks = default_hooks() + + #: Dictionary of querystring data to attach to each + #: :class:`Request `. The dictionary values may be lists for + #: representing multivalued query parameters. + self.params = {} + + #: Stream response content default. + self.stream = False + + #: SSL Verification default. + self.verify = True + + #: SSL client certificate default, if String, path to ssl client + #: cert file (.pem). If Tuple, ('cert', 'key') pair. + self.cert = None + + #: Maximum number of redirects allowed. If the request exceeds this + #: limit, a :class:`TooManyRedirects` exception is raised. + #: This defaults to requests.models.DEFAULT_REDIRECT_LIMIT, which is + #: 30. + self.max_redirects = DEFAULT_REDIRECT_LIMIT + + #: Trust environment settings for proxy configuration, default + #: authentication and similar. + self.trust_env = True + + #: A CookieJar containing all currently outstanding cookies set on this + #: session. By default it is a + #: :class:`RequestsCookieJar `, but + #: may be any other ``cookielib.CookieJar`` compatible object. + self.cookies = cookiejar_from_dict({}) + + # Default connection adapters. + self.adapters = OrderedDict() + self.mount('https://', HTTPAdapter()) + self.mount('http://', HTTPAdapter()) + + def __enter__(self): + return self + + def __exit__(self, *args): + self.close() + + def prepare_request(self, request): + """Constructs a :class:`PreparedRequest ` for + transmission and returns it. The :class:`PreparedRequest` has settings + merged from the :class:`Request ` instance and those of the + :class:`Session`. + + :param request: :class:`Request` instance to prepare with this + session's settings. + :rtype: requests.PreparedRequest + """ + cookies = request.cookies or {} + + # Bootstrap CookieJar. + if not isinstance(cookies, cookielib.CookieJar): + cookies = cookiejar_from_dict(cookies) + + # Merge with session cookies + merged_cookies = merge_cookies( + merge_cookies(RequestsCookieJar(), self.cookies), cookies) + + # Set environment's basic authentication if not explicitly set. + auth = request.auth + if self.trust_env and not auth and not self.auth: + auth = get_netrc_auth(request.url) + + p = PreparedRequest() + p.prepare( + method=request.method.upper(), + url=request.url, + files=request.files, + data=request.data, + json=request.json, + headers=merge_setting(request.headers, self.headers, dict_class=CaseInsensitiveDict), + params=merge_setting(request.params, self.params), + auth=merge_setting(auth, self.auth), + cookies=merged_cookies, + hooks=merge_hooks(request.hooks, self.hooks), + ) + return p + + def request(self, method, url, + params=None, data=None, headers=None, cookies=None, files=None, + auth=None, timeout=None, allow_redirects=True, proxies=None, + hooks=None, stream=None, verify=None, cert=None, json=None): + """Constructs a :class:`Request `, prepares it and sends it. + Returns :class:`Response ` object. + + :param method: method for the new :class:`Request` object. + :param url: URL for the new :class:`Request` object. + :param params: (optional) Dictionary or bytes to be sent in the query + string for the :class:`Request`. + :param data: (optional) Dictionary, bytes, or file-like object to send + in the body of the :class:`Request`. + :param json: (optional) json to send in the body of the + :class:`Request`. + :param headers: (optional) Dictionary of HTTP Headers to send with the + :class:`Request`. + :param cookies: (optional) Dict or CookieJar object to send with the + :class:`Request`. + :param files: (optional) Dictionary of ``'filename': file-like-objects`` + for multipart encoding upload. + :param auth: (optional) Auth tuple or callable to enable + Basic/Digest/Custom HTTP Auth. + :param timeout: (optional) How long to wait for the server to send + data before giving up, as a float, or a :ref:`(connect timeout, + read timeout) ` tuple. + :type timeout: float or tuple + :param allow_redirects: (optional) Set to True by default. + :type allow_redirects: bool + :param proxies: (optional) Dictionary mapping protocol or protocol and + hostname to the URL of the proxy. + :param stream: (optional) whether to immediately download the response + content. Defaults to ``False``. + :param verify: (optional) Either a boolean, in which case it controls whether we verify + the server's TLS certificate, or a string, in which case it must be a path + to a CA bundle to use. Defaults to ``True``. + :param cert: (optional) if String, path to ssl client cert file (.pem). + If Tuple, ('cert', 'key') pair. + :rtype: requests.Response + """ + # Create the Request. + req = Request( + method=method.upper(), + url=url, + headers=headers, + files=files, + data=data or {}, + json=json, + params=params or {}, + auth=auth, + cookies=cookies, + hooks=hooks, + ) + prep = self.prepare_request(req) + + proxies = proxies or {} + + settings = self.merge_environment_settings( + prep.url, proxies, stream, verify, cert + ) + + # Send the request. + send_kwargs = { + 'timeout': timeout, + 'allow_redirects': allow_redirects, + } + send_kwargs.update(settings) + resp = self.send(prep, **send_kwargs) + + return resp + + def get(self, url, **kwargs): + r"""Sends a GET request. Returns :class:`Response` object. + + :param url: URL for the new :class:`Request` object. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :rtype: requests.Response + """ + + kwargs.setdefault('allow_redirects', True) + return self.request('GET', url, **kwargs) + + def options(self, url, **kwargs): + r"""Sends a OPTIONS request. Returns :class:`Response` object. + + :param url: URL for the new :class:`Request` object. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :rtype: requests.Response + """ + + kwargs.setdefault('allow_redirects', True) + return self.request('OPTIONS', url, **kwargs) + + def head(self, url, **kwargs): + r"""Sends a HEAD request. Returns :class:`Response` object. + + :param url: URL for the new :class:`Request` object. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :rtype: requests.Response + """ + + kwargs.setdefault('allow_redirects', False) + return self.request('HEAD', url, **kwargs) + + def post(self, url, data=None, json=None, **kwargs): + r"""Sends a POST request. Returns :class:`Response` object. + + :param url: URL for the new :class:`Request` object. + :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. + :param json: (optional) json to send in the body of the :class:`Request`. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :rtype: requests.Response + """ + + return self.request('POST', url, data=data, json=json, **kwargs) + + def put(self, url, data=None, **kwargs): + r"""Sends a PUT request. Returns :class:`Response` object. + + :param url: URL for the new :class:`Request` object. + :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :rtype: requests.Response + """ + + return self.request('PUT', url, data=data, **kwargs) + + def patch(self, url, data=None, **kwargs): + r"""Sends a PATCH request. Returns :class:`Response` object. + + :param url: URL for the new :class:`Request` object. + :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :rtype: requests.Response + """ + + return self.request('PATCH', url, data=data, **kwargs) + + def delete(self, url, **kwargs): + r"""Sends a DELETE request. Returns :class:`Response` object. + + :param url: URL for the new :class:`Request` object. + :param \*\*kwargs: Optional arguments that ``request`` takes. + :rtype: requests.Response + """ + + return self.request('DELETE', url, **kwargs) + + def send(self, request, **kwargs): + """Send a given PreparedRequest. + + :rtype: requests.Response + """ + # Set defaults that the hooks can utilize to ensure they always have + # the correct parameters to reproduce the previous request. + kwargs.setdefault('stream', self.stream) + kwargs.setdefault('verify', self.verify) + kwargs.setdefault('cert', self.cert) + kwargs.setdefault('proxies', self.proxies) + + # It's possible that users might accidentally send a Request object. + # Guard against that specific failure case. + if isinstance(request, Request): + raise ValueError('You can only send PreparedRequests.') + + # Set up variables needed for resolve_redirects and dispatching of hooks + allow_redirects = kwargs.pop('allow_redirects', True) + stream = kwargs.get('stream') + hooks = request.hooks + + # Get the appropriate adapter to use + adapter = self.get_adapter(url=request.url) + + # Start time (approximately) of the request + start = preferred_clock() + + # Send the request + r = adapter.send(request, **kwargs) + + # Total elapsed time of the request (approximately) + elapsed = preferred_clock() - start + r.elapsed = timedelta(seconds=elapsed) + + # Response manipulation hooks + r = dispatch_hook('response', hooks, r, **kwargs) + + # Persist cookies + if r.history: + + # If the hooks create history then we want those cookies too + for resp in r.history: + extract_cookies_to_jar(self.cookies, resp.request, resp.raw) + + extract_cookies_to_jar(self.cookies, request, r.raw) + + # Redirect resolving generator. + gen = self.resolve_redirects(r, request, **kwargs) + + # Resolve redirects if allowed. + history = [resp for resp in gen] if allow_redirects else [] + + # Shuffle things around if there's history. + if history: + # Insert the first (original) request at the start + history.insert(0, r) + # Get the last request made + r = history.pop() + r.history = history + + # If redirects aren't being followed, store the response on the Request for Response.next(). + if not allow_redirects: + try: + r._next = next(self.resolve_redirects(r, request, yield_requests=True, **kwargs)) + except StopIteration: + pass + + if not stream: + r.content + + return r + + def merge_environment_settings(self, url, proxies, stream, verify, cert): + """ + Check the environment and merge it with some settings. + + :rtype: dict + """ + # Gather clues from the surrounding environment. + if self.trust_env: + # Set environment's proxies. + no_proxy = proxies.get('no_proxy') if proxies is not None else None + env_proxies = get_environ_proxies(url, no_proxy=no_proxy) + for (k, v) in env_proxies.items(): + proxies.setdefault(k, v) + + # Look for requests environment configuration and be compatible + # with cURL. + if verify is True or verify is None: + verify = (os.environ.get('REQUESTS_CA_BUNDLE') or + os.environ.get('CURL_CA_BUNDLE')) + + # Merge all the kwargs. + proxies = merge_setting(proxies, self.proxies) + stream = merge_setting(stream, self.stream) + verify = merge_setting(verify, self.verify) + cert = merge_setting(cert, self.cert) + + return {'verify': verify, 'proxies': proxies, 'stream': stream, + 'cert': cert} + + def get_adapter(self, url): + """ + Returns the appropriate connection adapter for the given URL. + + :rtype: requests.adapters.BaseAdapter + """ + for (prefix, adapter) in self.adapters.items(): + + if url.lower().startswith(prefix): + return adapter + + # Nothing matches :-/ + raise InvalidSchema("No connection adapters were found for '%s'" % url) + + def close(self): + """Closes all adapters and as such the session""" + for v in self.adapters.values(): + v.close() + + def mount(self, prefix, adapter): + """Registers a connection adapter to a prefix. + + Adapters are sorted in descending order by prefix length. + """ + self.adapters[prefix] = adapter + keys_to_move = [k for k in self.adapters if len(k) < len(prefix)] + + for key in keys_to_move: + self.adapters[key] = self.adapters.pop(key) + + def __getstate__(self): + state = dict((attr, getattr(self, attr, None)) for attr in self.__attrs__) + return state + + def __setstate__(self, state): + for attr, value in state.items(): + setattr(self, attr, value) + + +def session(): + """ + Returns a :class:`Session` for context-management. + + :rtype: Session + """ + + return Session() diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/status_codes.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/status_codes.py new file mode 100644 index 0000000000000000000000000000000000000000..dee89190c06f5fd7ec70ba804eb357ba20acf828 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/status_codes.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- + +from .structures import LookupDict + +_codes = { + + # Informational. + 100: ('continue',), + 101: ('switching_protocols',), + 102: ('processing',), + 103: ('checkpoint',), + 122: ('uri_too_long', 'request_uri_too_long'), + 200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/', '✓'), + 201: ('created',), + 202: ('accepted',), + 203: ('non_authoritative_info', 'non_authoritative_information'), + 204: ('no_content',), + 205: ('reset_content', 'reset'), + 206: ('partial_content', 'partial'), + 207: ('multi_status', 'multiple_status', 'multi_stati', 'multiple_stati'), + 208: ('already_reported',), + 226: ('im_used',), + + # Redirection. + 300: ('multiple_choices',), + 301: ('moved_permanently', 'moved', '\\o-'), + 302: ('found',), + 303: ('see_other', 'other'), + 304: ('not_modified',), + 305: ('use_proxy',), + 306: ('switch_proxy',), + 307: ('temporary_redirect', 'temporary_moved', 'temporary'), + 308: ('permanent_redirect', + 'resume_incomplete', 'resume',), # These 2 to be removed in 3.0 + + # Client Error. + 400: ('bad_request', 'bad'), + 401: ('unauthorized',), + 402: ('payment_required', 'payment'), + 403: ('forbidden',), + 404: ('not_found', '-o-'), + 405: ('method_not_allowed', 'not_allowed'), + 406: ('not_acceptable',), + 407: ('proxy_authentication_required', 'proxy_auth', 'proxy_authentication'), + 408: ('request_timeout', 'timeout'), + 409: ('conflict',), + 410: ('gone',), + 411: ('length_required',), + 412: ('precondition_failed', 'precondition'), + 413: ('request_entity_too_large',), + 414: ('request_uri_too_large',), + 415: ('unsupported_media_type', 'unsupported_media', 'media_type'), + 416: ('requested_range_not_satisfiable', 'requested_range', 'range_not_satisfiable'), + 417: ('expectation_failed',), + 418: ('im_a_teapot', 'teapot', 'i_am_a_teapot'), + 421: ('misdirected_request',), + 422: ('unprocessable_entity', 'unprocessable'), + 423: ('locked',), + 424: ('failed_dependency', 'dependency'), + 425: ('unordered_collection', 'unordered'), + 426: ('upgrade_required', 'upgrade'), + 428: ('precondition_required', 'precondition'), + 429: ('too_many_requests', 'too_many'), + 431: ('header_fields_too_large', 'fields_too_large'), + 444: ('no_response', 'none'), + 449: ('retry_with', 'retry'), + 450: ('blocked_by_windows_parental_controls', 'parental_controls'), + 451: ('unavailable_for_legal_reasons', 'legal_reasons'), + 499: ('client_closed_request',), + + # Server Error. + 500: ('internal_server_error', 'server_error', '/o\\', '✗'), + 501: ('not_implemented',), + 502: ('bad_gateway',), + 503: ('service_unavailable', 'unavailable'), + 504: ('gateway_timeout',), + 505: ('http_version_not_supported', 'http_version'), + 506: ('variant_also_negotiates',), + 507: ('insufficient_storage',), + 509: ('bandwidth_limit_exceeded', 'bandwidth'), + 510: ('not_extended',), + 511: ('network_authentication_required', 'network_auth', 'network_authentication'), +} + +codes = LookupDict(name='status_codes') + +for code, titles in _codes.items(): + for title in titles: + setattr(codes, title, code) + if not title.startswith(('\\', '/')): + setattr(codes, title.upper(), code) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/structures.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/structures.py new file mode 100644 index 0000000000000000000000000000000000000000..8609a69e2c69d3e448f04120a69d880b14ec556a --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/structures.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- + +""" +requests.structures +~~~~~~~~~~~~~~~~~~~ + +Data structures that power Requests. +""" + +from .compat import OrderedDict, Mapping, MutableMapping + +from .compat import OrderedDict + + +class CaseInsensitiveDict(MutableMapping): + """A case-insensitive ``dict``-like object. + + Implements all methods and operations of + ``MutableMapping`` as well as dict's ``copy``. Also + provides ``lower_items``. + + All keys are expected to be strings. The structure remembers the + case of the last key to be set, and ``iter(instance)``, + ``keys()``, ``items()``, ``iterkeys()``, and ``iteritems()`` + will contain case-sensitive keys. However, querying and contains + testing is case insensitive:: + + cid = CaseInsensitiveDict() + cid['Accept'] = 'application/json' + cid['aCCEPT'] == 'application/json' # True + list(cid) == ['Accept'] # True + + For example, ``headers['content-encoding']`` will return the + value of a ``'Content-Encoding'`` response header, regardless + of how the header name was originally stored. + + If the constructor, ``.update``, or equality comparison + operations are given keys that have equal ``.lower()``s, the + behavior is undefined. + """ + + def __init__(self, data=None, **kwargs): + self._store = OrderedDict() + if data is None: + data = {} + self.update(data, **kwargs) + + def __setitem__(self, key, value): + # Use the lowercased key for lookups, but store the actual + # key alongside the value. + self._store[key.lower()] = (key, value) + + def __getitem__(self, key): + return self._store[key.lower()][1] + + def __delitem__(self, key): + del self._store[key.lower()] + + def __iter__(self): + return (casedkey for casedkey, mappedvalue in self._store.values()) + + def __len__(self): + return len(self._store) + + def lower_items(self): + """Like iteritems(), but with all lowercase keys.""" + return ( + (lowerkey, keyval[1]) + for (lowerkey, keyval) + in self._store.items() + ) + + def __eq__(self, other): + if isinstance(other, Mapping): + other = CaseInsensitiveDict(other) + else: + return NotImplemented + # Compare insensitively + return dict(self.lower_items()) == dict(other.lower_items()) + + # Copy is required + def copy(self): + return CaseInsensitiveDict(self._store.values()) + + def __repr__(self): + return str(dict(self.items())) + + +class LookupDict(dict): + """Dictionary lookup object.""" + + def __init__(self, name=None): + self.name = name + super(LookupDict, self).__init__() + + def __repr__(self): + return '' % (self.name) + + def __getitem__(self, key): + # We allow fall-through here, so values default to None + + return self.__dict__.get(key, None) + + def get(self, key, default=None): + return self.__dict__.get(key, default) diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/utils.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..ddad9da53c77853d37820373528a572a1c5633aa --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/requests/utils.py @@ -0,0 +1,903 @@ +# -*- coding: utf-8 -*- + +""" +requests.utils +~~~~~~~~~~~~~~ + +This module provides utility functions that are used within Requests +that are also useful for external consumption. +""" + +import cgi +import codecs +import contextlib +import io +import os +import platform +import re +import socket +import struct +import warnings + +from .__version__ import __version__ +from . import certs +# to_native_string is unused here, but imported here for backwards compatibility +from ._internal_utils import to_native_string +from .compat import parse_http_list as _parse_list_header +from .compat import ( + quote, urlparse, bytes, str, OrderedDict, unquote, getproxies, + proxy_bypass, urlunparse, basestring, integer_types, is_py3, + proxy_bypass_environment, getproxies_environment, Mapping) +from .cookies import cookiejar_from_dict +from .structures import CaseInsensitiveDict +from .exceptions import ( + InvalidURL, InvalidHeader, FileModeWarning, UnrewindableBodyError) + +NETRC_FILES = ('.netrc', '_netrc') + +DEFAULT_CA_BUNDLE_PATH = certs.where() + + +if platform.system() == 'Windows': + # provide a proxy_bypass version on Windows without DNS lookups + + def proxy_bypass_registry(host): + if is_py3: + import winreg + else: + import _winreg as winreg + try: + internetSettings = winreg.OpenKey(winreg.HKEY_CURRENT_USER, + r'Software\Microsoft\Windows\CurrentVersion\Internet Settings') + proxyEnable = winreg.QueryValueEx(internetSettings, + 'ProxyEnable')[0] + proxyOverride = winreg.QueryValueEx(internetSettings, + 'ProxyOverride')[0] + except OSError: + return False + if not proxyEnable or not proxyOverride: + return False + + # make a check value list from the registry entry: replace the + # '' string by the localhost entry and the corresponding + # canonical entry. + proxyOverride = proxyOverride.split(';') + # now check if we match one of the registry values. + for test in proxyOverride: + if test == '': + if '.' not in host: + return True + test = test.replace(".", r"\.") # mask dots + test = test.replace("*", r".*") # change glob sequence + test = test.replace("?", r".") # change glob char + if re.match(test, host, re.I): + return True + return False + + def proxy_bypass(host): # noqa + """Return True, if the host should be bypassed. + + Checks proxy settings gathered from the environment, if specified, + or the registry. + """ + if getproxies_environment(): + return proxy_bypass_environment(host) + else: + return proxy_bypass_registry(host) + + +def dict_to_sequence(d): + """Returns an internal sequence dictionary update.""" + + if hasattr(d, 'items'): + d = d.items() + + return d + + +def super_len(o): + total_length = None + current_position = 0 + + if hasattr(o, '__len__'): + total_length = len(o) + + elif hasattr(o, 'len'): + total_length = o.len + + elif hasattr(o, 'fileno'): + try: + fileno = o.fileno() + except io.UnsupportedOperation: + pass + else: + total_length = os.fstat(fileno).st_size + + # Having used fstat to determine the file length, we need to + # confirm that this file was opened up in binary mode. + if 'b' not in o.mode: + warnings.warn(( + "Requests has determined the content-length for this " + "request using the binary size of the file: however, the " + "file has been opened in text mode (i.e. without the 'b' " + "flag in the mode). This may lead to an incorrect " + "content-length. In Requests 3.0, support will be removed " + "for files in text mode."), + FileModeWarning + ) + + if hasattr(o, 'tell'): + try: + current_position = o.tell() + except (OSError, IOError): + # This can happen in some weird situations, such as when the file + # is actually a special file descriptor like stdin. In this + # instance, we don't know what the length is, so set it to zero and + # let requests chunk it instead. + if total_length is not None: + current_position = total_length + else: + if hasattr(o, 'seek') and total_length is None: + # StringIO and BytesIO have seek but no useable fileno + try: + # seek to end of file + o.seek(0, 2) + total_length = o.tell() + + # seek back to current position to support + # partially read file-like objects + o.seek(current_position or 0) + except (OSError, IOError): + total_length = 0 + + if total_length is None: + total_length = 0 + + return max(0, total_length - current_position) + + +def get_netrc_auth(url, raise_errors=False): + """Returns the Requests tuple auth for a given url from netrc.""" + + try: + from netrc import netrc, NetrcParseError + + netrc_path = None + + for f in NETRC_FILES: + try: + loc = os.path.expanduser('~/{0}'.format(f)) + except KeyError: + # os.path.expanduser can fail when $HOME is undefined and + # getpwuid fails. See http://bugs.python.org/issue20164 & + # https://github.com/requests/requests/issues/1846 + return + + if os.path.exists(loc): + netrc_path = loc + break + + # Abort early if there isn't one. + if netrc_path is None: + return + + ri = urlparse(url) + + # Strip port numbers from netloc. This weird `if...encode`` dance is + # used for Python 3.2, which doesn't support unicode literals. + splitstr = b':' + if isinstance(url, str): + splitstr = splitstr.decode('ascii') + host = ri.netloc.split(splitstr)[0] + + try: + _netrc = netrc(netrc_path).authenticators(host) + if _netrc: + # Return with login / password + login_i = (0 if _netrc[0] else 1) + return (_netrc[login_i], _netrc[2]) + except (NetrcParseError, IOError): + # If there was a parsing error or a permissions issue reading the file, + # we'll just skip netrc auth unless explicitly asked to raise errors. + if raise_errors: + raise + + # AppEngine hackiness. + except (ImportError, AttributeError): + pass + + +def guess_filename(obj): + """Tries to guess the filename of the given object.""" + name = getattr(obj, 'name', None) + if (name and isinstance(name, basestring) and name[0] != '<' and + name[-1] != '>'): + return os.path.basename(name) + + +def from_key_val_list(value): + """Take an object and test to see if it can be represented as a + dictionary. Unless it can not be represented as such, return an + OrderedDict, e.g., + + :: + + >>> from_key_val_list([('key', 'val')]) + OrderedDict([('key', 'val')]) + >>> from_key_val_list('string') + ValueError: need more than 1 value to unpack + >>> from_key_val_list({'key': 'val'}) + OrderedDict([('key', 'val')]) + + :rtype: OrderedDict + """ + if value is None: + return None + + if isinstance(value, (str, bytes, bool, int)): + raise ValueError('cannot encode objects that are not 2-tuples') + + return OrderedDict(value) + + +def to_key_val_list(value): + """Take an object and test to see if it can be represented as a + dictionary. If it can be, return a list of tuples, e.g., + + :: + + >>> to_key_val_list([('key', 'val')]) + [('key', 'val')] + >>> to_key_val_list({'key': 'val'}) + [('key', 'val')] + >>> to_key_val_list('string') + ValueError: cannot encode objects that are not 2-tuples. + + :rtype: list + """ + if value is None: + return None + + if isinstance(value, (str, bytes, bool, int)): + raise ValueError('cannot encode objects that are not 2-tuples') + + if isinstance(value, Mapping): + value = value.items() + + return list(value) + + +# From mitsuhiko/werkzeug (used with permission). +def parse_list_header(value): + """Parse lists as described by RFC 2068 Section 2. + + In particular, parse comma-separated lists where the elements of + the list may include quoted-strings. A quoted-string could + contain a comma. A non-quoted string could have quotes in the + middle. Quotes are removed automatically after parsing. + + It basically works like :func:`parse_set_header` just that items + may appear multiple times and case sensitivity is preserved. + + The return value is a standard :class:`list`: + + >>> parse_list_header('token, "quoted value"') + ['token', 'quoted value'] + + To create a header from the :class:`list` again, use the + :func:`dump_header` function. + + :param value: a string with a list header. + :return: :class:`list` + :rtype: list + """ + result = [] + for item in _parse_list_header(value): + if item[:1] == item[-1:] == '"': + item = unquote_header_value(item[1:-1]) + result.append(item) + return result + + +# From mitsuhiko/werkzeug (used with permission). +def parse_dict_header(value): + """Parse lists of key, value pairs as described by RFC 2068 Section 2 and + convert them into a python dict: + + >>> d = parse_dict_header('foo="is a fish", bar="as well"') + >>> type(d) is dict + True + >>> sorted(d.items()) + [('bar', 'as well'), ('foo', 'is a fish')] + + If there is no value for a key it will be `None`: + + >>> parse_dict_header('key_without_value') + {'key_without_value': None} + + To create a header from the :class:`dict` again, use the + :func:`dump_header` function. + + :param value: a string with a dict header. + :return: :class:`dict` + :rtype: dict + """ + result = {} + for item in _parse_list_header(value): + if '=' not in item: + result[item] = None + continue + name, value = item.split('=', 1) + if value[:1] == value[-1:] == '"': + value = unquote_header_value(value[1:-1]) + result[name] = value + return result + + +# From mitsuhiko/werkzeug (used with permission). +def unquote_header_value(value, is_filename=False): + r"""Unquotes a header value. (Reversal of :func:`quote_header_value`). + This does not use the real unquoting but what browsers are actually + using for quoting. + + :param value: the header value to unquote. + :rtype: str + """ + if value and value[0] == value[-1] == '"': + # this is not the real unquoting, but fixing this so that the + # RFC is met will result in bugs with internet explorer and + # probably some other browsers as well. IE for example is + # uploading files with "C:\foo\bar.txt" as filename + value = value[1:-1] + + # if this is a filename and the starting characters look like + # a UNC path, then just return the value without quotes. Using the + # replace sequence below on a UNC path has the effect of turning + # the leading double slash into a single slash and then + # _fix_ie_filename() doesn't work correctly. See #458. + if not is_filename or value[:2] != '\\\\': + return value.replace('\\\\', '\\').replace('\\"', '"') + return value + + +def dict_from_cookiejar(cj): + """Returns a key/value dictionary from a CookieJar. + + :param cj: CookieJar object to extract cookies from. + :rtype: dict + """ + + cookie_dict = {} + + for cookie in cj: + cookie_dict[cookie.name] = cookie.value + + return cookie_dict + + +def add_dict_to_cookiejar(cj, cookie_dict): + """Returns a CookieJar from a key/value dictionary. + + :param cj: CookieJar to insert cookies into. + :param cookie_dict: Dict of key/values to insert into CookieJar. + :rtype: CookieJar + """ + + return cookiejar_from_dict(cookie_dict, cj) + + +def get_encodings_from_content(content): + """Returns encodings from given content string. + + :param content: bytestring to extract encodings from. + """ + warnings.warn(( + 'In requests 3.0, get_encodings_from_content will be removed. For ' + 'more information, please see the discussion on issue #2266. (This' + ' warning should only appear once.)'), + DeprecationWarning) + + charset_re = re.compile(r']', flags=re.I) + pragma_re = re.compile(r']', flags=re.I) + xml_re = re.compile(r'^<\?xml.*?encoding=["\']*(.+?)["\'>]') + + return (charset_re.findall(content) + + pragma_re.findall(content) + + xml_re.findall(content)) + + +def get_encoding_from_headers(headers): + """Returns encodings from given HTTP Header Dict. + + :param headers: dictionary to extract encoding from. + :rtype: str + """ + + content_type = headers.get('content-type') + + if not content_type: + return None + + content_type, params = cgi.parse_header(content_type) + + if 'charset' in params: + return params['charset'].strip("'\"") + + if 'text' in content_type: + return 'ISO-8859-1' + + +def stream_decode_response_unicode(iterator, r): + """Stream decodes a iterator.""" + + if r.encoding is None: + for item in iterator: + yield item + return + + decoder = codecs.getincrementaldecoder(r.encoding)(errors='replace') + for chunk in iterator: + rv = decoder.decode(chunk) + if rv: + yield rv + rv = decoder.decode(b'', final=True) + if rv: + yield rv + + +def iter_slices(string, slice_length): + """Iterate over slices of a string.""" + pos = 0 + if slice_length is None or slice_length <= 0: + slice_length = len(string) + while pos < len(string): + yield string[pos:pos + slice_length] + pos += slice_length + + +def get_unicode_from_response(r): + """Returns the requested content back in unicode. + + :param r: Response object to get unicode content from. + + Tried: + + 1. charset from content-type + 2. fall back and replace all unicode characters + + :rtype: str + """ + warnings.warn(( + 'In requests 3.0, get_unicode_from_response will be removed. For ' + 'more information, please see the discussion on issue #2266. (This' + ' warning should only appear once.)'), + DeprecationWarning) + + tried_encodings = [] + + # Try charset from content-type + encoding = get_encoding_from_headers(r.headers) + + if encoding: + try: + return str(r.content, encoding) + except UnicodeError: + tried_encodings.append(encoding) + + # Fall back: + try: + return str(r.content, encoding, errors='replace') + except TypeError: + return r.content + + +# The unreserved URI characters (RFC 3986) +UNRESERVED_SET = frozenset( + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + "0123456789-._~") + + +def unquote_unreserved(uri): + """Un-escape any percent-escape sequences in a URI that are unreserved + characters. This leaves all reserved, illegal and non-ASCII bytes encoded. + + :rtype: str + """ + parts = uri.split('%') + for i in range(1, len(parts)): + h = parts[i][0:2] + if len(h) == 2 and h.isalnum(): + try: + c = chr(int(h, 16)) + except ValueError: + raise InvalidURL("Invalid percent-escape sequence: '%s'" % h) + + if c in UNRESERVED_SET: + parts[i] = c + parts[i][2:] + else: + parts[i] = '%' + parts[i] + else: + parts[i] = '%' + parts[i] + return ''.join(parts) + + +def requote_uri(uri): + """Re-quote the given URI. + + This function passes the given URI through an unquote/quote cycle to + ensure that it is fully and consistently quoted. + + :rtype: str + """ + safe_with_percent = "!#$%&'()*+,/:;=?@[]~" + safe_without_percent = "!#$&'()*+,/:;=?@[]~" + try: + # Unquote only the unreserved characters + # Then quote only illegal characters (do not quote reserved, + # unreserved, or '%') + return quote(unquote_unreserved(uri), safe=safe_with_percent) + except InvalidURL: + # We couldn't unquote the given URI, so let's try quoting it, but + # there may be unquoted '%'s in the URI. We need to make sure they're + # properly quoted so they do not cause issues elsewhere. + return quote(uri, safe=safe_without_percent) + + +def address_in_network(ip, net): + """This function allows you to check if an IP belongs to a network subnet + + Example: returns True if ip = 192.168.1.1 and net = 192.168.1.0/24 + returns False if ip = 192.168.1.1 and net = 192.168.100.0/24 + + :rtype: bool + """ + ipaddr = struct.unpack('=L', socket.inet_aton(ip))[0] + netaddr, bits = net.split('/') + netmask = struct.unpack('=L', socket.inet_aton(dotted_netmask(int(bits))))[0] + network = struct.unpack('=L', socket.inet_aton(netaddr))[0] & netmask + return (ipaddr & netmask) == (network & netmask) + + +def dotted_netmask(mask): + """Converts mask from /xx format to xxx.xxx.xxx.xxx + + Example: if mask is 24 function returns 255.255.255.0 + + :rtype: str + """ + bits = 0xffffffff ^ (1 << 32 - mask) - 1 + return socket.inet_ntoa(struct.pack('>I', bits)) + + +def is_ipv4_address(string_ip): + """ + :rtype: bool + """ + try: + socket.inet_aton(string_ip) + except socket.error: + return False + return True + + +def is_valid_cidr(string_network): + """ + Very simple check of the cidr format in no_proxy variable. + + :rtype: bool + """ + if string_network.count('/') == 1: + try: + mask = int(string_network.split('/')[1]) + except ValueError: + return False + + if mask < 1 or mask > 32: + return False + + try: + socket.inet_aton(string_network.split('/')[0]) + except socket.error: + return False + else: + return False + return True + + +@contextlib.contextmanager +def set_environ(env_name, value): + """Set the environment variable 'env_name' to 'value' + + Save previous value, yield, and then restore the previous value stored in + the environment variable 'env_name'. + + If 'value' is None, do nothing""" + value_changed = value is not None + if value_changed: + old_value = os.environ.get(env_name) + os.environ[env_name] = value + try: + yield + finally: + if value_changed: + if old_value is None: + del os.environ[env_name] + else: + os.environ[env_name] = old_value + + +def should_bypass_proxies(url, no_proxy): + """ + Returns whether we should bypass proxies or not. + + :rtype: bool + """ + get_proxy = lambda k: os.environ.get(k) or os.environ.get(k.upper()) + + # First check whether no_proxy is defined. If it is, check that the URL + # we're getting isn't in the no_proxy list. + no_proxy_arg = no_proxy + if no_proxy is None: + no_proxy = get_proxy('no_proxy') + netloc = urlparse(url).netloc + + if no_proxy: + # We need to check whether we match here. We need to see if we match + # the end of the netloc, both with and without the port. + no_proxy = ( + host for host in no_proxy.replace(' ', '').split(',') if host + ) + + ip = netloc.split(':')[0] + if is_ipv4_address(ip): + for proxy_ip in no_proxy: + if is_valid_cidr(proxy_ip): + if address_in_network(ip, proxy_ip): + return True + elif ip == proxy_ip: + # If no_proxy ip was defined in plain IP notation instead of cidr notation & + # matches the IP of the index + return True + else: + for host in no_proxy: + if netloc.endswith(host) or netloc.split(':')[0].endswith(host): + # The URL does match something in no_proxy, so we don't want + # to apply the proxies on this URL. + return True + + # If the system proxy settings indicate that this URL should be bypassed, + # don't proxy. + # The proxy_bypass function is incredibly buggy on OS X in early versions + # of Python 2.6, so allow this call to fail. Only catch the specific + # exceptions we've seen, though: this call failing in other ways can reveal + # legitimate problems. + with set_environ('no_proxy', no_proxy_arg): + try: + bypass = proxy_bypass(netloc) + except (TypeError, socket.gaierror): + bypass = False + + if bypass: + return True + + return False + + +def get_environ_proxies(url, no_proxy=None): + """ + Return a dict of environment proxies. + + :rtype: dict + """ + if should_bypass_proxies(url, no_proxy=no_proxy): + return {} + else: + return getproxies() + + +def select_proxy(url, proxies): + """Select a proxy for the url, if applicable. + + :param url: The url being for the request + :param proxies: A dictionary of schemes or schemes and hosts to proxy URLs + """ + proxies = proxies or {} + urlparts = urlparse(url) + if urlparts.hostname is None: + return proxies.get(urlparts.scheme, proxies.get('all')) + + proxy_keys = [ + urlparts.scheme + '://' + urlparts.hostname, + urlparts.scheme, + 'all://' + urlparts.hostname, + 'all', + ] + proxy = None + for proxy_key in proxy_keys: + if proxy_key in proxies: + proxy = proxies[proxy_key] + break + + return proxy + + +def default_user_agent(name="python-requests"): + """ + Return a string representing the default user agent. + + :rtype: str + """ + return '%s/%s' % (name, __version__) + + +def default_headers(): + """ + :rtype: requests.structures.CaseInsensitiveDict + """ + return CaseInsensitiveDict({ + 'User-Agent': default_user_agent(), + 'Accept-Encoding': ', '.join(('gzip', 'deflate')), + 'Accept': '*/*', + 'Connection': 'keep-alive', + }) + + +def parse_header_links(value): + """Return a dict of parsed link headers proxies. + + i.e. Link: ; rel=front; type="image/jpeg",; rel=back;type="image/jpeg" + + :rtype: list + """ + + links = [] + + replace_chars = ' \'"' + + for val in re.split(', *<', value): + try: + url, params = val.split(';', 1) + except ValueError: + url, params = val, '' + + link = {'url': url.strip('<> \'"')} + + for param in params.split(';'): + try: + key, value = param.split('=') + except ValueError: + break + + link[key.strip(replace_chars)] = value.strip(replace_chars) + + links.append(link) + + return links + + +# Null bytes; no need to recreate these on each call to guess_json_utf +_null = '\x00'.encode('ascii') # encoding to ASCII for Python 3 +_null2 = _null * 2 +_null3 = _null * 3 + + +def guess_json_utf(data): + """ + :rtype: str + """ + # JSON always starts with two ASCII characters, so detection is as + # easy as counting the nulls and from their location and count + # determine the encoding. Also detect a BOM, if present. + sample = data[:4] + if sample in (codecs.BOM_UTF32_LE, codecs.BOM_UTF32_BE): + return 'utf-32' # BOM included + if sample[:3] == codecs.BOM_UTF8: + return 'utf-8-sig' # BOM included, MS style (discouraged) + if sample[:2] in (codecs.BOM_UTF16_LE, codecs.BOM_UTF16_BE): + return 'utf-16' # BOM included + nullcount = sample.count(_null) + if nullcount == 0: + return 'utf-8' + if nullcount == 2: + if sample[::2] == _null2: # 1st and 3rd are null + return 'utf-16-be' + if sample[1::2] == _null2: # 2nd and 4th are null + return 'utf-16-le' + # Did not detect 2 valid UTF-16 ascii-range characters + if nullcount == 3: + if sample[:3] == _null3: + return 'utf-32-be' + if sample[1:] == _null3: + return 'utf-32-le' + # Did not detect a valid UTF-32 ascii-range character + return None + + +def prepend_scheme_if_needed(url, new_scheme): + """Given a URL that may or may not have a scheme, prepend the given scheme. + Does not replace a present scheme with the one provided as an argument. + + :rtype: str + """ + scheme, netloc, path, params, query, fragment = urlparse(url, new_scheme) + + # urlparse is a finicky beast, and sometimes decides that there isn't a + # netloc present. Assume that it's being over-cautious, and switch netloc + # and path if urlparse decided there was no netloc. + if not netloc: + netloc, path = path, netloc + + return urlunparse((scheme, netloc, path, params, query, fragment)) + + +def get_auth_from_url(url): + """Given a url with authentication components, extract them into a tuple of + username,password. + + :rtype: (str,str) + """ + parsed = urlparse(url) + + try: + auth = (unquote(parsed.username), unquote(parsed.password)) + except (AttributeError, TypeError): + auth = ('', '') + + return auth + + +# Moved outside of function to avoid recompile every call +_CLEAN_HEADER_REGEX_BYTE = re.compile(b'^\\S[^\\r\\n]*$|^$') +_CLEAN_HEADER_REGEX_STR = re.compile(r'^\S[^\r\n]*$|^$') + + +def check_header_validity(header): + """Verifies that header value is a string which doesn't contain + leading whitespace or return characters. This prevents unintended + header injection. + + :param header: tuple, in the format (name, value). + """ + name, value = header + + if isinstance(value, bytes): + pat = _CLEAN_HEADER_REGEX_BYTE + else: + pat = _CLEAN_HEADER_REGEX_STR + try: + if not pat.match(value): + raise InvalidHeader("Invalid return character or leading space in header: %s" % name) + except TypeError: + raise InvalidHeader("Header value %s must be of type str or bytes, " + "not %s" % (value, type(value))) + + +def urldefragauth(url): + """ + Given a url remove the fragment and the authentication part. + + :rtype: str + """ + scheme, netloc, path, params, query, fragment = urlparse(url) + + # see func:`prepend_scheme_if_needed` + if not netloc: + netloc, path = path, netloc + + netloc = netloc.rsplit('@', 1)[-1] + + return urlunparse((scheme, netloc, path, params, query, '')) + + +def rewind_body(prepared_request): + """Move file pointer back to its recorded starting position + so it can be read again on redirect. + """ + body_seek = getattr(prepared_request.body, 'seek', None) + if body_seek is not None and isinstance(prepared_request._body_position, integer_types): + try: + body_seek(prepared_request._body_position) + except (IOError, OSError): + raise UnrewindableBodyError("An error occurred when rewinding request " + "body for redirect.") + else: + raise UnrewindableBodyError("Unable to rewind request body for redirect.") diff --git a/runtime/Lib/site-packages/aliyunsdkcore/vendored/six.py b/runtime/Lib/site-packages/aliyunsdkcore/vendored/six.py new file mode 100644 index 0000000000000000000000000000000000000000..6bf4fd381046207a4794aee17be6d22db237f30a --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkcore/vendored/six.py @@ -0,0 +1,891 @@ +# Copyright (c) 2010-2017 Benjamin Peterson +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +"""Utilities for writing code that runs on Python 2 and 3""" + +from __future__ import absolute_import + +import functools +import itertools +import operator +import sys +import types + +__author__ = "Benjamin Peterson " +__version__ = "1.11.0" + + +# Useful for very coarse version differentiation. +PY2 = sys.version_info[0] == 2 +PY3 = sys.version_info[0] == 3 +PY34 = sys.version_info[0:2] >= (3, 4) + +if PY3: + string_types = str, + integer_types = int, + class_types = type, + text_type = str + binary_type = bytes + + MAXSIZE = sys.maxsize +else: + string_types = basestring, + integer_types = (int, long) + class_types = (type, types.ClassType) + text_type = unicode + binary_type = str + + if sys.platform.startswith("java"): + # Jython always uses 32 bits. + MAXSIZE = int((1 << 31) - 1) + else: + # It's possible to have sizeof(long) != sizeof(Py_ssize_t). + class X(object): + + def __len__(self): + return 1 << 31 + try: + len(X()) + except OverflowError: + # 32-bit + MAXSIZE = int((1 << 31) - 1) + else: + # 64-bit + MAXSIZE = int((1 << 63) - 1) + del X + + +def _add_doc(func, doc): + """Add documentation to a function.""" + func.__doc__ = doc + + +def _import_module(name): + """Import module, returning the module after the last dot.""" + __import__(name) + return sys.modules[name] + + +class _LazyDescr(object): + + def __init__(self, name): + self.name = name + + def __get__(self, obj, tp): + result = self._resolve() + setattr(obj, self.name, result) # Invokes __set__. + try: + # This is a bit ugly, but it avoids running this again by + # removing this descriptor. + delattr(obj.__class__, self.name) + except AttributeError: + pass + return result + + +class MovedModule(_LazyDescr): + + def __init__(self, name, old, new=None): + super(MovedModule, self).__init__(name) + if PY3: + if new is None: + new = name + self.mod = new + else: + self.mod = old + + def _resolve(self): + return _import_module(self.mod) + + def __getattr__(self, attr): + _module = self._resolve() + value = getattr(_module, attr) + setattr(self, attr, value) + return value + + +class _LazyModule(types.ModuleType): + + def __init__(self, name): + super(_LazyModule, self).__init__(name) + self.__doc__ = self.__class__.__doc__ + + def __dir__(self): + attrs = ["__doc__", "__name__"] + attrs += [attr.name for attr in self._moved_attributes] + return attrs + + # Subclasses should override this + _moved_attributes = [] + + +class MovedAttribute(_LazyDescr): + + def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None): + super(MovedAttribute, self).__init__(name) + if PY3: + if new_mod is None: + new_mod = name + self.mod = new_mod + if new_attr is None: + if old_attr is None: + new_attr = name + else: + new_attr = old_attr + self.attr = new_attr + else: + self.mod = old_mod + if old_attr is None: + old_attr = name + self.attr = old_attr + + def _resolve(self): + module = _import_module(self.mod) + return getattr(module, self.attr) + + +class _SixMetaPathImporter(object): + + """ + A meta path importer to import six.moves and its submodules. + + This class implements a PEP302 finder and loader. It should be compatible + with Python 2.5 and all existing versions of Python3 + """ + + def __init__(self, six_module_name): + self.name = six_module_name + self.known_modules = {} + + def _add_module(self, mod, *fullnames): + for fullname in fullnames: + self.known_modules[self.name + "." + fullname] = mod + + def _get_module(self, fullname): + return self.known_modules[self.name + "." + fullname] + + def find_module(self, fullname, path=None): + if fullname in self.known_modules: + return self + return None + + def __get_module(self, fullname): + try: + return self.known_modules[fullname] + except KeyError: + raise ImportError("This loader does not know module " + fullname) + + def load_module(self, fullname): + try: + # in case of a reload + return sys.modules[fullname] + except KeyError: + pass + mod = self.__get_module(fullname) + if isinstance(mod, MovedModule): + mod = mod._resolve() + else: + mod.__loader__ = self + sys.modules[fullname] = mod + return mod + + def is_package(self, fullname): + """ + Return true, if the named module is a package. + + We need this method to get correct spec objects with + Python 3.4 (see PEP451) + """ + return hasattr(self.__get_module(fullname), "__path__") + + def get_code(self, fullname): + """Return None + + Required, if is_package is implemented""" + self.__get_module(fullname) # eventually raises ImportError + return None + get_source = get_code # same as get_code + +_importer = _SixMetaPathImporter(__name__) + + +class _MovedItems(_LazyModule): + + """Lazy loading of moved objects""" + __path__ = [] # mark as package + + +_moved_attributes = [ + MovedAttribute("cStringIO", "cStringIO", "io", "StringIO"), + MovedAttribute("filter", "itertools", "builtins", "ifilter", "filter"), + MovedAttribute("filterfalse", "itertools", "itertools", "ifilterfalse", "filterfalse"), + MovedAttribute("input", "__builtin__", "builtins", "raw_input", "input"), + MovedAttribute("intern", "__builtin__", "sys"), + MovedAttribute("map", "itertools", "builtins", "imap", "map"), + MovedAttribute("getcwd", "os", "os", "getcwdu", "getcwd"), + MovedAttribute("getcwdb", "os", "os", "getcwd", "getcwdb"), + MovedAttribute("getoutput", "commands", "subprocess"), + MovedAttribute("range", "__builtin__", "builtins", "xrange", "range"), + MovedAttribute("reload_module", "__builtin__", "importlib" if PY34 else "imp", "reload"), + MovedAttribute("reduce", "__builtin__", "functools"), + MovedAttribute("shlex_quote", "pipes", "shlex", "quote"), + MovedAttribute("StringIO", "StringIO", "io"), + MovedAttribute("UserDict", "UserDict", "collections"), + MovedAttribute("UserList", "UserList", "collections"), + MovedAttribute("UserString", "UserString", "collections"), + MovedAttribute("xrange", "__builtin__", "builtins", "xrange", "range"), + MovedAttribute("zip", "itertools", "builtins", "izip", "zip"), + MovedAttribute("zip_longest", "itertools", "itertools", "izip_longest", "zip_longest"), + MovedModule("builtins", "__builtin__"), + MovedModule("configparser", "ConfigParser"), + MovedModule("copyreg", "copy_reg"), + MovedModule("dbm_gnu", "gdbm", "dbm.gnu"), + MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread"), + MovedModule("http_cookiejar", "cookielib", "http.cookiejar"), + MovedModule("http_cookies", "Cookie", "http.cookies"), + MovedModule("html_entities", "htmlentitydefs", "html.entities"), + MovedModule("html_parser", "HTMLParser", "html.parser"), + MovedModule("http_client", "httplib", "http.client"), + MovedModule("email_mime_base", "email.MIMEBase", "email.mime.base"), + MovedModule("email_mime_image", "email.MIMEImage", "email.mime.image"), + MovedModule("email_mime_multipart", "email.MIMEMultipart", "email.mime.multipart"), + MovedModule("email_mime_nonmultipart", "email.MIMENonMultipart", "email.mime.nonmultipart"), + MovedModule("email_mime_text", "email.MIMEText", "email.mime.text"), + MovedModule("BaseHTTPServer", "BaseHTTPServer", "http.server"), + MovedModule("CGIHTTPServer", "CGIHTTPServer", "http.server"), + MovedModule("SimpleHTTPServer", "SimpleHTTPServer", "http.server"), + MovedModule("cPickle", "cPickle", "pickle"), + MovedModule("queue", "Queue"), + MovedModule("reprlib", "repr"), + MovedModule("socketserver", "SocketServer"), + MovedModule("_thread", "thread", "_thread"), + MovedModule("tkinter", "Tkinter"), + MovedModule("tkinter_dialog", "Dialog", "tkinter.dialog"), + MovedModule("tkinter_filedialog", "FileDialog", "tkinter.filedialog"), + MovedModule("tkinter_scrolledtext", "ScrolledText", "tkinter.scrolledtext"), + MovedModule("tkinter_simpledialog", "SimpleDialog", "tkinter.simpledialog"), + MovedModule("tkinter_tix", "Tix", "tkinter.tix"), + MovedModule("tkinter_ttk", "ttk", "tkinter.ttk"), + MovedModule("tkinter_constants", "Tkconstants", "tkinter.constants"), + MovedModule("tkinter_dnd", "Tkdnd", "tkinter.dnd"), + MovedModule("tkinter_colorchooser", "tkColorChooser", + "tkinter.colorchooser"), + MovedModule("tkinter_commondialog", "tkCommonDialog", + "tkinter.commondialog"), + MovedModule("tkinter_tkfiledialog", "tkFileDialog", "tkinter.filedialog"), + MovedModule("tkinter_font", "tkFont", "tkinter.font"), + MovedModule("tkinter_messagebox", "tkMessageBox", "tkinter.messagebox"), + MovedModule("tkinter_tksimpledialog", "tkSimpleDialog", + "tkinter.simpledialog"), + MovedModule("urllib_parse", __name__ + ".moves.urllib_parse", "urllib.parse"), + MovedModule("urllib_error", __name__ + ".moves.urllib_error", "urllib.error"), + MovedModule("urllib", __name__ + ".moves.urllib", __name__ + ".moves.urllib"), + MovedModule("urllib_robotparser", "robotparser", "urllib.robotparser"), + MovedModule("xmlrpc_client", "xmlrpclib", "xmlrpc.client"), + MovedModule("xmlrpc_server", "SimpleXMLRPCServer", "xmlrpc.server"), +] +# Add windows specific modules. +if sys.platform == "win32": + _moved_attributes += [ + MovedModule("winreg", "_winreg"), + ] + +for attr in _moved_attributes: + setattr(_MovedItems, attr.name, attr) + if isinstance(attr, MovedModule): + _importer._add_module(attr, "moves." + attr.name) +del attr + +_MovedItems._moved_attributes = _moved_attributes + +moves = _MovedItems(__name__ + ".moves") +_importer._add_module(moves, "moves") + + +class Module_six_moves_urllib_parse(_LazyModule): + + """Lazy loading of moved objects in six.moves.urllib_parse""" + + +_urllib_parse_moved_attributes = [ + MovedAttribute("ParseResult", "urlparse", "urllib.parse"), + MovedAttribute("SplitResult", "urlparse", "urllib.parse"), + MovedAttribute("parse_qs", "urlparse", "urllib.parse"), + MovedAttribute("parse_qsl", "urlparse", "urllib.parse"), + MovedAttribute("urldefrag", "urlparse", "urllib.parse"), + MovedAttribute("urljoin", "urlparse", "urllib.parse"), + MovedAttribute("urlparse", "urlparse", "urllib.parse"), + MovedAttribute("urlsplit", "urlparse", "urllib.parse"), + MovedAttribute("urlunparse", "urlparse", "urllib.parse"), + MovedAttribute("urlunsplit", "urlparse", "urllib.parse"), + MovedAttribute("quote", "urllib", "urllib.parse"), + MovedAttribute("quote_plus", "urllib", "urllib.parse"), + MovedAttribute("unquote", "urllib", "urllib.parse"), + MovedAttribute("unquote_plus", "urllib", "urllib.parse"), + MovedAttribute("unquote_to_bytes", "urllib", "urllib.parse", "unquote", "unquote_to_bytes"), + MovedAttribute("urlencode", "urllib", "urllib.parse"), + MovedAttribute("splitquery", "urllib", "urllib.parse"), + MovedAttribute("splittag", "urllib", "urllib.parse"), + MovedAttribute("splituser", "urllib", "urllib.parse"), + MovedAttribute("splitvalue", "urllib", "urllib.parse"), + MovedAttribute("uses_fragment", "urlparse", "urllib.parse"), + MovedAttribute("uses_netloc", "urlparse", "urllib.parse"), + MovedAttribute("uses_params", "urlparse", "urllib.parse"), + MovedAttribute("uses_query", "urlparse", "urllib.parse"), + MovedAttribute("uses_relative", "urlparse", "urllib.parse"), +] +for attr in _urllib_parse_moved_attributes: + setattr(Module_six_moves_urllib_parse, attr.name, attr) +del attr + +Module_six_moves_urllib_parse._moved_attributes = _urllib_parse_moved_attributes + +_importer._add_module(Module_six_moves_urllib_parse(__name__ + ".moves.urllib_parse"), + "moves.urllib_parse", "moves.urllib.parse") + + +class Module_six_moves_urllib_error(_LazyModule): + + """Lazy loading of moved objects in six.moves.urllib_error""" + + +_urllib_error_moved_attributes = [ + MovedAttribute("URLError", "urllib2", "urllib.error"), + MovedAttribute("HTTPError", "urllib2", "urllib.error"), + MovedAttribute("ContentTooShortError", "urllib", "urllib.error"), +] +for attr in _urllib_error_moved_attributes: + setattr(Module_six_moves_urllib_error, attr.name, attr) +del attr + +Module_six_moves_urllib_error._moved_attributes = _urllib_error_moved_attributes + +_importer._add_module(Module_six_moves_urllib_error(__name__ + ".moves.urllib.error"), + "moves.urllib_error", "moves.urllib.error") + + +class Module_six_moves_urllib_request(_LazyModule): + + """Lazy loading of moved objects in six.moves.urllib_request""" + + +_urllib_request_moved_attributes = [ + MovedAttribute("urlopen", "urllib2", "urllib.request"), + MovedAttribute("install_opener", "urllib2", "urllib.request"), + MovedAttribute("build_opener", "urllib2", "urllib.request"), + MovedAttribute("pathname2url", "urllib", "urllib.request"), + MovedAttribute("url2pathname", "urllib", "urllib.request"), + MovedAttribute("getproxies", "urllib", "urllib.request"), + MovedAttribute("Request", "urllib2", "urllib.request"), + MovedAttribute("OpenerDirector", "urllib2", "urllib.request"), + MovedAttribute("HTTPDefaultErrorHandler", "urllib2", "urllib.request"), + MovedAttribute("HTTPRedirectHandler", "urllib2", "urllib.request"), + MovedAttribute("HTTPCookieProcessor", "urllib2", "urllib.request"), + MovedAttribute("ProxyHandler", "urllib2", "urllib.request"), + MovedAttribute("BaseHandler", "urllib2", "urllib.request"), + MovedAttribute("HTTPPasswordMgr", "urllib2", "urllib.request"), + MovedAttribute("HTTPPasswordMgrWithDefaultRealm", "urllib2", "urllib.request"), + MovedAttribute("AbstractBasicAuthHandler", "urllib2", "urllib.request"), + MovedAttribute("HTTPBasicAuthHandler", "urllib2", "urllib.request"), + MovedAttribute("ProxyBasicAuthHandler", "urllib2", "urllib.request"), + MovedAttribute("AbstractDigestAuthHandler", "urllib2", "urllib.request"), + MovedAttribute("HTTPDigestAuthHandler", "urllib2", "urllib.request"), + MovedAttribute("ProxyDigestAuthHandler", "urllib2", "urllib.request"), + MovedAttribute("HTTPHandler", "urllib2", "urllib.request"), + MovedAttribute("HTTPSHandler", "urllib2", "urllib.request"), + MovedAttribute("FileHandler", "urllib2", "urllib.request"), + MovedAttribute("FTPHandler", "urllib2", "urllib.request"), + MovedAttribute("CacheFTPHandler", "urllib2", "urllib.request"), + MovedAttribute("UnknownHandler", "urllib2", "urllib.request"), + MovedAttribute("HTTPErrorProcessor", "urllib2", "urllib.request"), + MovedAttribute("urlretrieve", "urllib", "urllib.request"), + MovedAttribute("urlcleanup", "urllib", "urllib.request"), + MovedAttribute("URLopener", "urllib", "urllib.request"), + MovedAttribute("FancyURLopener", "urllib", "urllib.request"), + MovedAttribute("proxy_bypass", "urllib", "urllib.request"), + MovedAttribute("parse_http_list", "urllib2", "urllib.request"), + MovedAttribute("parse_keqv_list", "urllib2", "urllib.request"), +] +for attr in _urllib_request_moved_attributes: + setattr(Module_six_moves_urllib_request, attr.name, attr) +del attr + +Module_six_moves_urllib_request._moved_attributes = _urllib_request_moved_attributes + +_importer._add_module(Module_six_moves_urllib_request(__name__ + ".moves.urllib.request"), + "moves.urllib_request", "moves.urllib.request") + + +class Module_six_moves_urllib_response(_LazyModule): + + """Lazy loading of moved objects in six.moves.urllib_response""" + + +_urllib_response_moved_attributes = [ + MovedAttribute("addbase", "urllib", "urllib.response"), + MovedAttribute("addclosehook", "urllib", "urllib.response"), + MovedAttribute("addinfo", "urllib", "urllib.response"), + MovedAttribute("addinfourl", "urllib", "urllib.response"), +] +for attr in _urllib_response_moved_attributes: + setattr(Module_six_moves_urllib_response, attr.name, attr) +del attr + +Module_six_moves_urllib_response._moved_attributes = _urllib_response_moved_attributes + +_importer._add_module(Module_six_moves_urllib_response(__name__ + ".moves.urllib.response"), + "moves.urllib_response", "moves.urllib.response") + + +class Module_six_moves_urllib_robotparser(_LazyModule): + + """Lazy loading of moved objects in six.moves.urllib_robotparser""" + + +_urllib_robotparser_moved_attributes = [ + MovedAttribute("RobotFileParser", "robotparser", "urllib.robotparser"), +] +for attr in _urllib_robotparser_moved_attributes: + setattr(Module_six_moves_urllib_robotparser, attr.name, attr) +del attr + +Module_six_moves_urllib_robotparser._moved_attributes = _urllib_robotparser_moved_attributes + +_importer._add_module(Module_six_moves_urllib_robotparser(__name__ + ".moves.urllib.robotparser"), + "moves.urllib_robotparser", "moves.urllib.robotparser") + + +class Module_six_moves_urllib(types.ModuleType): + + """Create a six.moves.urllib namespace that resembles the Python 3 namespace""" + __path__ = [] # mark as package + parse = _importer._get_module("moves.urllib_parse") + error = _importer._get_module("moves.urllib_error") + request = _importer._get_module("moves.urllib_request") + response = _importer._get_module("moves.urllib_response") + robotparser = _importer._get_module("moves.urllib_robotparser") + + def __dir__(self): + return ['parse', 'error', 'request', 'response', 'robotparser'] + +_importer._add_module(Module_six_moves_urllib(__name__ + ".moves.urllib"), + "moves.urllib") + + +def add_move(move): + """Add an item to six.moves.""" + setattr(_MovedItems, move.name, move) + + +def remove_move(name): + """Remove item from six.moves.""" + try: + delattr(_MovedItems, name) + except AttributeError: + try: + del moves.__dict__[name] + except KeyError: + raise AttributeError("no such move, %r" % (name,)) + + +if PY3: + _meth_func = "__func__" + _meth_self = "__self__" + + _func_closure = "__closure__" + _func_code = "__code__" + _func_defaults = "__defaults__" + _func_globals = "__globals__" +else: + _meth_func = "im_func" + _meth_self = "im_self" + + _func_closure = "func_closure" + _func_code = "func_code" + _func_defaults = "func_defaults" + _func_globals = "func_globals" + + +try: + advance_iterator = next +except NameError: + def advance_iterator(it): + return it.next() +next = advance_iterator + + +try: + callable = callable +except NameError: + def callable(obj): + return any("__call__" in klass.__dict__ for klass in type(obj).__mro__) + + +if PY3: + def get_unbound_function(unbound): + return unbound + + create_bound_method = types.MethodType + + def create_unbound_method(func, cls): + return func + + Iterator = object +else: + def get_unbound_function(unbound): + return unbound.im_func + + def create_bound_method(func, obj): + return types.MethodType(func, obj, obj.__class__) + + def create_unbound_method(func, cls): + return types.MethodType(func, None, cls) + + class Iterator(object): + + def next(self): + return type(self).__next__(self) + + callable = callable +_add_doc(get_unbound_function, + """Get the function out of a possibly unbound function""") + + +get_method_function = operator.attrgetter(_meth_func) +get_method_self = operator.attrgetter(_meth_self) +get_function_closure = operator.attrgetter(_func_closure) +get_function_code = operator.attrgetter(_func_code) +get_function_defaults = operator.attrgetter(_func_defaults) +get_function_globals = operator.attrgetter(_func_globals) + + +if PY3: + def iterkeys(d, **kw): + return iter(d.keys(**kw)) + + def itervalues(d, **kw): + return iter(d.values(**kw)) + + def iteritems(d, **kw): + return iter(d.items(**kw)) + + def iterlists(d, **kw): + return iter(d.lists(**kw)) + + viewkeys = operator.methodcaller("keys") + + viewvalues = operator.methodcaller("values") + + viewitems = operator.methodcaller("items") +else: + def iterkeys(d, **kw): + return d.iterkeys(**kw) + + def itervalues(d, **kw): + return d.itervalues(**kw) + + def iteritems(d, **kw): + return d.iteritems(**kw) + + def iterlists(d, **kw): + return d.iterlists(**kw) + + viewkeys = operator.methodcaller("viewkeys") + + viewvalues = operator.methodcaller("viewvalues") + + viewitems = operator.methodcaller("viewitems") + +_add_doc(iterkeys, "Return an iterator over the keys of a dictionary.") +_add_doc(itervalues, "Return an iterator over the values of a dictionary.") +_add_doc(iteritems, + "Return an iterator over the (key, value) pairs of a dictionary.") +_add_doc(iterlists, + "Return an iterator over the (key, [values]) pairs of a dictionary.") + + +if PY3: + def b(s): + return s.encode("latin-1") + + def u(s): + return s + unichr = chr + import struct + int2byte = struct.Struct(">B").pack + del struct + byte2int = operator.itemgetter(0) + indexbytes = operator.getitem + iterbytes = iter + import io + StringIO = io.StringIO + BytesIO = io.BytesIO + _assertCountEqual = "assertCountEqual" + if sys.version_info[1] <= 1: + _assertRaisesRegex = "assertRaisesRegexp" + _assertRegex = "assertRegexpMatches" + else: + _assertRaisesRegex = "assertRaisesRegex" + _assertRegex = "assertRegex" +else: + def b(s): + return s + # Workaround for standalone backslash + + def u(s): + return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape") + unichr = unichr + int2byte = chr + + def byte2int(bs): + return ord(bs[0]) + + def indexbytes(buf, i): + return ord(buf[i]) + iterbytes = functools.partial(itertools.imap, ord) + import StringIO + StringIO = BytesIO = StringIO.StringIO + _assertCountEqual = "assertItemsEqual" + _assertRaisesRegex = "assertRaisesRegexp" + _assertRegex = "assertRegexpMatches" +_add_doc(b, """Byte literal""") +_add_doc(u, """Text literal""") + + +def assertCountEqual(self, *args, **kwargs): + return getattr(self, _assertCountEqual)(*args, **kwargs) + + +def assertRaisesRegex(self, *args, **kwargs): + return getattr(self, _assertRaisesRegex)(*args, **kwargs) + + +def assertRegex(self, *args, **kwargs): + return getattr(self, _assertRegex)(*args, **kwargs) + + +if PY3: + exec_ = getattr(moves.builtins, "exec") + + def reraise(tp, value, tb=None): + try: + if value is None: + value = tp() + if value.__traceback__ is not tb: + raise value.with_traceback(tb) + raise value + finally: + value = None + tb = None + +else: + def exec_(_code_, _globs_=None, _locs_=None): + """Execute code in a namespace.""" + if _globs_ is None: + frame = sys._getframe(1) + _globs_ = frame.f_globals + if _locs_ is None: + _locs_ = frame.f_locals + del frame + elif _locs_ is None: + _locs_ = _globs_ + exec("""exec _code_ in _globs_, _locs_""") + + exec_("""def reraise(tp, value, tb=None): + try: + raise tp, value, tb + finally: + tb = None +""") + + +if sys.version_info[:2] == (3, 2): + exec_("""def raise_from(value, from_value): + try: + if from_value is None: + raise value + raise value from from_value + finally: + value = None +""") +elif sys.version_info[:2] > (3, 2): + exec_("""def raise_from(value, from_value): + try: + raise value from from_value + finally: + value = None +""") +else: + def raise_from(value, from_value): + raise value + + +print_ = getattr(moves.builtins, "print", None) +if print_ is None: + def print_(*args, **kwargs): + """The new-style print function for Python 2.4 and 2.5.""" + fp = kwargs.pop("file", sys.stdout) + if fp is None: + return + + def write(data): + if not isinstance(data, basestring): + data = str(data) + # If the file has an encoding, encode unicode with it. + if (isinstance(fp, file) and + isinstance(data, unicode) and + fp.encoding is not None): + errors = getattr(fp, "errors", None) + if errors is None: + errors = "strict" + data = data.encode(fp.encoding, errors) + fp.write(data) + want_unicode = False + sep = kwargs.pop("sep", None) + if sep is not None: + if isinstance(sep, unicode): + want_unicode = True + elif not isinstance(sep, str): + raise TypeError("sep must be None or a string") + end = kwargs.pop("end", None) + if end is not None: + if isinstance(end, unicode): + want_unicode = True + elif not isinstance(end, str): + raise TypeError("end must be None or a string") + if kwargs: + raise TypeError("invalid keyword arguments to print()") + if not want_unicode: + for arg in args: + if isinstance(arg, unicode): + want_unicode = True + break + if want_unicode: + newline = unicode("\n") + space = unicode(" ") + else: + newline = "\n" + space = " " + if sep is None: + sep = space + if end is None: + end = newline + for i, arg in enumerate(args): + if i: + write(sep) + write(arg) + write(end) +if sys.version_info[:2] < (3, 3): + _print = print_ + + def print_(*args, **kwargs): + fp = kwargs.get("file", sys.stdout) + flush = kwargs.pop("flush", False) + _print(*args, **kwargs) + if flush and fp is not None: + fp.flush() + +_add_doc(reraise, """Reraise an exception.""") + +if sys.version_info[0:2] < (3, 4): + def wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS, + updated=functools.WRAPPER_UPDATES): + def wrapper(f): + f = functools.wraps(wrapped, assigned, updated)(f) + f.__wrapped__ = wrapped + return f + return wrapper +else: + wraps = functools.wraps + + +def with_metaclass(meta, *bases): + """Create a base class with a metaclass.""" + # This requires a bit of explanation: the basic idea is to make a dummy + # metaclass for one level of class instantiation that replaces itself with + # the actual metaclass. + class metaclass(type): + + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + + @classmethod + def __prepare__(cls, name, this_bases): + return meta.__prepare__(name, bases) + return type.__new__(metaclass, 'temporary_class', (), {}) + + +def add_metaclass(metaclass): + """Class decorator for creating a class with a metaclass.""" + def wrapper(cls): + orig_vars = cls.__dict__.copy() + slots = orig_vars.get('__slots__') + if slots is not None: + if isinstance(slots, str): + slots = [slots] + for slots_var in slots: + orig_vars.pop(slots_var) + orig_vars.pop('__dict__', None) + orig_vars.pop('__weakref__', None) + return metaclass(cls.__name__, cls.__bases__, orig_vars) + return wrapper + + +def python_2_unicode_compatible(klass): + """ + A decorator that defines __unicode__ and __str__ methods under Python 2. + Under Python 3 it does nothing. + + To support Python 2 and 3 with a single code base, define a __str__ method + returning text and apply this decorator to the class. + """ + if PY2: + if '__str__' not in klass.__dict__: + raise ValueError("@python_2_unicode_compatible cannot be applied " + "to %s because it doesn't define __str__()." % + klass.__name__) + klass.__unicode__ = klass.__str__ + klass.__str__ = lambda self: self.__unicode__().encode('utf-8') + return klass + + +# Complete the moves implementation. +# This code is at the end of this module to speed up module loading. +# Turn this module into a package. +__path__ = [] # required for PEP 302 and PEP 451 +__package__ = __name__ # see PEP 366 @ReservedAssignment +if globals().get("__spec__") is not None: + __spec__.submodule_search_locations = [] # PEP 451 @UndefinedVariable +# Remove other six meta path importers, since they cause problems. This can +# happen if six is removed from sys.modules and then reloaded. (Setuptools does +# this for some reason.) +if sys.meta_path: + for i, importer in enumerate(sys.meta_path): + # Here's some real nastiness: Another "instance" of the six module might + # be floating around. Therefore, we can't use isinstance() to check for + # the six meta path importer, since the other six instance will have + # inserted an importer with different class. + if (type(importer).__name__ == "_SixMetaPathImporter" and + importer.name == __name__): + del sys.meta_path[i] + break + del i, importer +# Finally, add the importer to the meta path import hook. +sys.meta_path.append(_importer) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/__init__.py b/runtime/Lib/site-packages/aliyunsdkkms/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9402ba9aac98e168c0de67b563ae9ae858f61bba --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/__init__.py @@ -0,0 +1 @@ +__version__ = '2.16.2' \ No newline at end of file diff --git a/runtime/Lib/site-packages/aliyunsdkkms/endpoint.py b/runtime/Lib/site-packages/aliyunsdkkms/endpoint.py new file mode 100644 index 0000000000000000000000000000000000000000..b2cd608315c1479b84f8775875f28f24ffaea589 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/endpoint.py @@ -0,0 +1,33 @@ +# # Licensed to the Apache Software Foundation (ASF) under one +# # or more contributor license agreements. See the NOTICE file +# # distributed with this work for additional information +# # regarding copyright ownership. The ASF licenses this file +# # to you under the Apache License, Version 2.0 (the +# # "License"); you may not use this file except in compliance +# # with the License. You may obtain a copy of the License at +# # +# # +# # http://www.apache.org/licenses/LICENSE-2.0 +# # +# # +# # Unless required by applicable law or agreed to in writing, +# # software distributed under the License is distributed on an +# # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# # KIND, either express or implied. See the License for the +# # specific language governing permissions and limitations +# # under the License. + + +class EndpointData(): + def __init__(self): + self.endpoint_map = {} + self.endpoint_regional = "regional" + + def getEndpointMap(self): + return self.endpoint_map + + def getEndpointRegional(self): + return self.endpoint_regional + + +endpoint_data = EndpointData() diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/__init__.py b/runtime/Lib/site-packages/aliyunsdkkms/request/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/AsymmetricDecryptRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/AsymmetricDecryptRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..72f36f80115761d9e0303d9b3d80e40388597c67 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/AsymmetricDecryptRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class AsymmetricDecryptRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'AsymmetricDecrypt','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyVersionId(self): # String + return self.get_query_params().get('KeyVersionId') + + def set_KeyVersionId(self, KeyVersionId): # String + self.add_query_param('KeyVersionId', KeyVersionId) + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) + def get_CiphertextBlob(self): # String + return self.get_query_params().get('CiphertextBlob') + + def set_CiphertextBlob(self, CiphertextBlob): # String + self.add_query_param('CiphertextBlob', CiphertextBlob) + def get_Algorithm(self): # String + return self.get_query_params().get('Algorithm') + + def set_Algorithm(self, Algorithm): # String + self.add_query_param('Algorithm', Algorithm) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/AsymmetricEncryptRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/AsymmetricEncryptRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..55f7d0bad9cc6ea2de5a8026f28e999661d6a82d --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/AsymmetricEncryptRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class AsymmetricEncryptRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'AsymmetricEncrypt','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyVersionId(self): # String + return self.get_query_params().get('KeyVersionId') + + def set_KeyVersionId(self, KeyVersionId): # String + self.add_query_param('KeyVersionId', KeyVersionId) + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) + def get_Plaintext(self): # String + return self.get_query_params().get('Plaintext') + + def set_Plaintext(self, Plaintext): # String + self.add_query_param('Plaintext', Plaintext) + def get_Algorithm(self): # String + return self.get_query_params().get('Algorithm') + + def set_Algorithm(self, Algorithm): # String + self.add_query_param('Algorithm', Algorithm) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/AsymmetricSignRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/AsymmetricSignRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..4d6a66957b296ba61371ce30abff02cf6d2c7ed8 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/AsymmetricSignRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class AsymmetricSignRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'AsymmetricSign','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyVersionId(self): # String + return self.get_query_params().get('KeyVersionId') + + def set_KeyVersionId(self, KeyVersionId): # String + self.add_query_param('KeyVersionId', KeyVersionId) + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) + def get_Digest(self): # String + return self.get_query_params().get('Digest') + + def set_Digest(self, Digest): # String + self.add_query_param('Digest', Digest) + def get_Algorithm(self): # String + return self.get_query_params().get('Algorithm') + + def set_Algorithm(self, Algorithm): # String + self.add_query_param('Algorithm', Algorithm) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/AsymmetricVerifyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/AsymmetricVerifyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..1bbe92c6d1a28c19258eb3808f109c42b152f595 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/AsymmetricVerifyRequest.py @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class AsymmetricVerifyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'AsymmetricVerify','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyVersionId(self): # String + return self.get_query_params().get('KeyVersionId') + + def set_KeyVersionId(self, KeyVersionId): # String + self.add_query_param('KeyVersionId', KeyVersionId) + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) + def get_Digest(self): # String + return self.get_query_params().get('Digest') + + def set_Digest(self, Digest): # String + self.add_query_param('Digest', Digest) + def get_Value(self): # String + return self.get_query_params().get('Value') + + def set_Value(self, Value): # String + self.add_query_param('Value', Value) + def get_Algorithm(self): # String + return self.get_query_params().get('Algorithm') + + def set_Algorithm(self, Algorithm): # String + self.add_query_param('Algorithm', Algorithm) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CancelKeyDeletionRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CancelKeyDeletionRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..1ae839b2a3b0cdd1e3b3e059b7a74f1277576206 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CancelKeyDeletionRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class CancelKeyDeletionRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'CancelKeyDeletion','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CertificatePrivateKeyDecryptRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CertificatePrivateKeyDecryptRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..93a5f103d604d463ccf39a222357910da73c156e --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CertificatePrivateKeyDecryptRequest.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class CertificatePrivateKeyDecryptRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'CertificatePrivateKeyDecrypt','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_CertificateId(self): # String + return self.get_query_params().get('CertificateId') + + def set_CertificateId(self, CertificateId): # String + self.add_query_param('CertificateId', CertificateId) + def get_Algorithm(self): # String + return self.get_query_params().get('Algorithm') + + def set_Algorithm(self, Algorithm): # String + self.add_query_param('Algorithm', Algorithm) + def get_CiphertextBlob(self): # String + return self.get_query_params().get('CiphertextBlob') + + def set_CiphertextBlob(self, CiphertextBlob): # String + self.add_query_param('CiphertextBlob', CiphertextBlob) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CertificatePrivateKeySignRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CertificatePrivateKeySignRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..5be98a26dc0ffc37858a658dd558eaeef58eb5a1 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CertificatePrivateKeySignRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class CertificatePrivateKeySignRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'CertificatePrivateKeySign','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_MessageType(self): # String + return self.get_query_params().get('MessageType') + + def set_MessageType(self, MessageType): # String + self.add_query_param('MessageType', MessageType) + def get_CertificateId(self): # String + return self.get_query_params().get('CertificateId') + + def set_CertificateId(self, CertificateId): # String + self.add_query_param('CertificateId', CertificateId) + def get_Message(self): # String + return self.get_query_params().get('Message') + + def set_Message(self, Message): # String + self.add_query_param('Message', Message) + def get_Algorithm(self): # String + return self.get_query_params().get('Algorithm') + + def set_Algorithm(self, Algorithm): # String + self.add_query_param('Algorithm', Algorithm) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CertificatePublicKeyEncryptRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CertificatePublicKeyEncryptRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..342aaded30c84159019c1c490fa33af36ac1ba58 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CertificatePublicKeyEncryptRequest.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class CertificatePublicKeyEncryptRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'CertificatePublicKeyEncrypt','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_CertificateId(self): # String + return self.get_query_params().get('CertificateId') + + def set_CertificateId(self, CertificateId): # String + self.add_query_param('CertificateId', CertificateId) + def get_Plaintext(self): # String + return self.get_query_params().get('Plaintext') + + def set_Plaintext(self, Plaintext): # String + self.add_query_param('Plaintext', Plaintext) + def get_Algorithm(self): # String + return self.get_query_params().get('Algorithm') + + def set_Algorithm(self, Algorithm): # String + self.add_query_param('Algorithm', Algorithm) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CertificatePublicKeyVerifyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CertificatePublicKeyVerifyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..fe0bf1ead994639ef43265f8ee56d91a2507878e --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CertificatePublicKeyVerifyRequest.py @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class CertificatePublicKeyVerifyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'CertificatePublicKeyVerify','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_MessageType(self): # String + return self.get_query_params().get('MessageType') + + def set_MessageType(self, MessageType): # String + self.add_query_param('MessageType', MessageType) + def get_CertificateId(self): # String + return self.get_query_params().get('CertificateId') + + def set_CertificateId(self, CertificateId): # String + self.add_query_param('CertificateId', CertificateId) + def get_Message(self): # String + return self.get_query_params().get('Message') + + def set_Message(self, Message): # String + self.add_query_param('Message', Message) + def get_SignatureValue(self): # String + return self.get_query_params().get('SignatureValue') + + def set_SignatureValue(self, SignatureValue): # String + self.add_query_param('SignatureValue', SignatureValue) + def get_Algorithm(self): # String + return self.get_query_params().get('Algorithm') + + def set_Algorithm(self, Algorithm): # String + self.add_query_param('Algorithm', Algorithm) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ConnectKmsInstanceRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ConnectKmsInstanceRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..b6aec009a9d078d649cb0ecd7d6d840fd122509a --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ConnectKmsInstanceRequest.py @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ConnectKmsInstanceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ConnectKmsInstance','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KmsInstanceId(self): # String + return self.get_query_params().get('KmsInstanceId') + + def set_KmsInstanceId(self, KmsInstanceId): # String + self.add_query_param('KmsInstanceId', KmsInstanceId) + def get_VSwitchIds(self): # String + return self.get_query_params().get('VSwitchIds') + + def set_VSwitchIds(self, VSwitchIds): # String + self.add_query_param('VSwitchIds', VSwitchIds) + def get_KMProvider(self): # String + return self.get_query_params().get('KMProvider') + + def set_KMProvider(self, KMProvider): # String + self.add_query_param('KMProvider', KMProvider) + def get_ZoneIds(self): # String + return self.get_query_params().get('ZoneIds') + + def set_ZoneIds(self, ZoneIds): # String + self.add_query_param('ZoneIds', ZoneIds) + def get_VpcId(self): # String + return self.get_query_params().get('VpcId') + + def set_VpcId(self, VpcId): # String + self.add_query_param('VpcId', VpcId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateAliasRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateAliasRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..fa99e7a3341fcc2ac467daa591282eb02945dd25 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateAliasRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class CreateAliasRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'CreateAlias','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_AliasName(self): # String + return self.get_query_params().get('AliasName') + + def set_AliasName(self, AliasName): # String + self.add_query_param('AliasName', AliasName) + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateApplicationAccessPointRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateApplicationAccessPointRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..0fbcdf97de2ce8aaadb1f617ea1535aca5dda92d --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateApplicationAccessPointRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class CreateApplicationAccessPointRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'CreateApplicationAccessPoint','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_Policies(self): # String + return self.get_query_params().get('Policies') + + def set_Policies(self, Policies): # String + self.add_query_param('Policies', Policies) + def get_Description(self): # String + return self.get_query_params().get('Description') + + def set_Description(self, Description): # String + self.add_query_param('Description', Description) + def get_Name(self): # String + return self.get_query_params().get('Name') + + def set_Name(self, Name): # String + self.add_query_param('Name', Name) + def get_AuthenticationMethod(self): # String + return self.get_query_params().get('AuthenticationMethod') + + def set_AuthenticationMethod(self, AuthenticationMethod): # String + self.add_query_param('AuthenticationMethod', AuthenticationMethod) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateCertificateRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateCertificateRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..e40c6a06631b9a99934daaa6213f229adba89807 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateCertificateRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class CreateCertificateRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'CreateCertificate','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_Subject(self): # String + return self.get_query_params().get('Subject') + + def set_Subject(self, Subject): # String + self.add_query_param('Subject', Subject) + def get_KeySpec(self): # String + return self.get_query_params().get('KeySpec') + + def set_KeySpec(self, KeySpec): # String + self.add_query_param('KeySpec', KeySpec) + def get_ExportablePrivateKey(self): # Boolean + return self.get_query_params().get('ExportablePrivateKey') + + def set_ExportablePrivateKey(self, ExportablePrivateKey): # Boolean + self.add_query_param('ExportablePrivateKey', ExportablePrivateKey) + def get_SubjectAlternativeNames(self): # Json + return self.get_query_params().get('SubjectAlternativeNames') + + def set_SubjectAlternativeNames(self, SubjectAlternativeNames): # Json + self.add_query_param('SubjectAlternativeNames', SubjectAlternativeNames) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateClientKeyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateClientKeyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..c8aaa9593544aecb6801f20cdfbb4975c112aa43 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateClientKeyRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class CreateClientKeyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'CreateClientKey','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_NotBefore(self): # String + return self.get_query_params().get('NotBefore') + + def set_NotBefore(self, NotBefore): # String + self.add_query_param('NotBefore', NotBefore) + def get_NotAfter(self): # String + return self.get_query_params().get('NotAfter') + + def set_NotAfter(self, NotAfter): # String + self.add_query_param('NotAfter', NotAfter) + def get_Password(self): # String + return self.get_query_params().get('Password') + + def set_Password(self, Password): # String + self.add_query_param('Password', Password) + def get_AapName(self): # String + return self.get_query_params().get('AapName') + + def set_AapName(self, AapName): # String + self.add_query_param('AapName', AapName) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateKeyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateKeyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..94c0b7ba468803a73e468cfa0d8a4d8786418450 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateKeyRequest.py @@ -0,0 +1,79 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class CreateKeyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'CreateKey','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_Origin(self): # String + return self.get_query_params().get('Origin') + + def set_Origin(self, Origin): # String + self.add_query_param('Origin', Origin) + def get_Description(self): # String + return self.get_query_params().get('Description') + + def set_Description(self, Description): # String + self.add_query_param('Description', Description) + def get_KeySpec(self): # String + return self.get_query_params().get('KeySpec') + + def set_KeySpec(self, KeySpec): # String + self.add_query_param('KeySpec', KeySpec) + def get_RotationInterval(self): # String + return self.get_query_params().get('RotationInterval') + + def set_RotationInterval(self, RotationInterval): # String + self.add_query_param('RotationInterval', RotationInterval) + def get_EnableAutomaticRotation(self): # Boolean + return self.get_query_params().get('EnableAutomaticRotation') + + def set_EnableAutomaticRotation(self, EnableAutomaticRotation): # Boolean + self.add_query_param('EnableAutomaticRotation', EnableAutomaticRotation) + def get_Tags(self): # String + return self.get_query_params().get('Tags') + + def set_Tags(self, Tags): # String + self.add_query_param('Tags', Tags) + def get_ProtectionLevel(self): # String + return self.get_query_params().get('ProtectionLevel') + + def set_ProtectionLevel(self, ProtectionLevel): # String + self.add_query_param('ProtectionLevel', ProtectionLevel) + def get_KeyUsage(self): # String + return self.get_query_params().get('KeyUsage') + + def set_KeyUsage(self, KeyUsage): # String + self.add_query_param('KeyUsage', KeyUsage) + def get_DKMSInstanceId(self): # String + return self.get_query_params().get('DKMSInstanceId') + + def set_DKMSInstanceId(self, DKMSInstanceId): # String + self.add_query_param('DKMSInstanceId', DKMSInstanceId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateKeyVersionRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateKeyVersionRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..b97486edfd1ebe66811385bc20bb5f5e4e916224 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateKeyVersionRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class CreateKeyVersionRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'CreateKeyVersion','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateNetworkRuleRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateNetworkRuleRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..7495ebb65868d00f1b0c808edae55437d8f563b0 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateNetworkRuleRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class CreateNetworkRuleRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'CreateNetworkRule','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_Description(self): # String + return self.get_query_params().get('Description') + + def set_Description(self, Description): # String + self.add_query_param('Description', Description) + def get_Type(self): # String + return self.get_query_params().get('Type') + + def set_Type(self, Type): # String + self.add_query_param('Type', Type) + def get_Name(self): # String + return self.get_query_params().get('Name') + + def set_Name(self, Name): # String + self.add_query_param('Name', Name) + def get_SourcePrivateIp(self): # String + return self.get_query_params().get('SourcePrivateIp') + + def set_SourcePrivateIp(self, SourcePrivateIp): # String + self.add_query_param('SourcePrivateIp', SourcePrivateIp) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreatePolicyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreatePolicyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..cfff733c05ccd4896b30b706e20f238e6bcb155f --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreatePolicyRequest.py @@ -0,0 +1,64 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class CreatePolicyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'CreatePolicy','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_AccessControlRules(self): # String + return self.get_query_params().get('AccessControlRules') + + def set_AccessControlRules(self, AccessControlRules): # String + self.add_query_param('AccessControlRules', AccessControlRules) + def get_Description(self): # String + return self.get_query_params().get('Description') + + def set_Description(self, Description): # String + self.add_query_param('Description', Description) + def get_Resources(self): # String + return self.get_query_params().get('Resources') + + def set_Resources(self, Resources): # String + self.add_query_param('Resources', Resources) + def get_KmsInstance(self): # String + return self.get_query_params().get('KmsInstance') + + def set_KmsInstance(self, KmsInstance): # String + self.add_query_param('KmsInstance', KmsInstance) + def get_Permissions(self): # String + return self.get_query_params().get('Permissions') + + def set_Permissions(self, Permissions): # String + self.add_query_param('Permissions', Permissions) + def get_Name(self): # String + return self.get_query_params().get('Name') + + def set_Name(self, Name): # String + self.add_query_param('Name', Name) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateSecretRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateSecretRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..0e8ba7860e52028bdb313ce40b2c13a80e818fb3 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/CreateSecretRequest.py @@ -0,0 +1,94 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class CreateSecretRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'CreateSecret','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_SecretType(self): # String + return self.get_query_params().get('SecretType') + + def set_SecretType(self, SecretType): # String + self.add_query_param('SecretType', SecretType) + def get_Description(self): # String + return self.get_query_params().get('Description') + + def set_Description(self, Description): # String + self.add_query_param('Description', Description) + def get_RotationInterval(self): # String + return self.get_query_params().get('RotationInterval') + + def set_RotationInterval(self, RotationInterval): # String + self.add_query_param('RotationInterval', RotationInterval) + def get_EnableAutomaticRotation(self): # Boolean + return self.get_query_params().get('EnableAutomaticRotation') + + def set_EnableAutomaticRotation(self, EnableAutomaticRotation): # Boolean + self.add_query_param('EnableAutomaticRotation', EnableAutomaticRotation) + def get_EncryptionKeyId(self): # String + return self.get_query_params().get('EncryptionKeyId') + + def set_EncryptionKeyId(self, EncryptionKeyId): # String + self.add_query_param('EncryptionKeyId', EncryptionKeyId) + def get_Tags(self): # String + return self.get_query_params().get('Tags') + + def set_Tags(self, Tags): # String + self.add_query_param('Tags', Tags) + def get_ExtendedConfig(self): # String + return self.get_query_params().get('ExtendedConfig') + + def set_ExtendedConfig(self, ExtendedConfig): # String + self.add_query_param('ExtendedConfig', ExtendedConfig) + def get_VersionId(self): # String + return self.get_query_params().get('VersionId') + + def set_VersionId(self, VersionId): # String + self.add_query_param('VersionId', VersionId) + def get_DKMSInstanceId(self): # String + return self.get_query_params().get('DKMSInstanceId') + + def set_DKMSInstanceId(self, DKMSInstanceId): # String + self.add_query_param('DKMSInstanceId', DKMSInstanceId) + def get_SecretData(self): # String + return self.get_query_params().get('SecretData') + + def set_SecretData(self, SecretData): # String + self.add_query_param('SecretData', SecretData) + def get_SecretName(self): # String + return self.get_query_params().get('SecretName') + + def set_SecretName(self, SecretName): # String + self.add_query_param('SecretName', SecretName) + def get_SecretDataType(self): # String + return self.get_query_params().get('SecretDataType') + + def set_SecretDataType(self, SecretDataType): # String + self.add_query_param('SecretDataType', SecretDataType) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DecryptRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DecryptRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..bcce732341663e05cd9e8f05b230116bc417f27c --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DecryptRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DecryptRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'Decrypt','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_EncryptionContext(self): # String + return self.get_query_params().get('EncryptionContext') + + def set_EncryptionContext(self, EncryptionContext): # String + self.add_query_param('EncryptionContext', EncryptionContext) + def get_CiphertextBlob(self): # String + return self.get_query_params().get('CiphertextBlob') + + def set_CiphertextBlob(self, CiphertextBlob): # String + self.add_query_param('CiphertextBlob', CiphertextBlob) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteAliasRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteAliasRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..f399a925f4f64e5f558c758c0f807887e429e983 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteAliasRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DeleteAliasRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DeleteAlias','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_AliasName(self): # String + return self.get_query_params().get('AliasName') + + def set_AliasName(self, AliasName): # String + self.add_query_param('AliasName', AliasName) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteApplicationAccessPointRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteApplicationAccessPointRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..e71e6c2239afe89e18d25e40899701f3c66efa96 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteApplicationAccessPointRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DeleteApplicationAccessPointRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DeleteApplicationAccessPoint','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_Name(self): # String + return self.get_query_params().get('Name') + + def set_Name(self, Name): # String + self.add_query_param('Name', Name) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteCertificateRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteCertificateRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..e4dbae1e5002ca93a226b3ac66f43fee823393d3 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteCertificateRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DeleteCertificateRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DeleteCertificate','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_CertificateId(self): # String + return self.get_query_params().get('CertificateId') + + def set_CertificateId(self, CertificateId): # String + self.add_query_param('CertificateId', CertificateId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteClientKeyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteClientKeyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..567f9c135f0cfce80bda436e8619a699a31a8b6a --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteClientKeyRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DeleteClientKeyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DeleteClientKey','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_ClientKeyId(self): # String + return self.get_query_params().get('ClientKeyId') + + def set_ClientKeyId(self, ClientKeyId): # String + self.add_query_param('ClientKeyId', ClientKeyId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteKeyMaterialRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteKeyMaterialRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..3c986913213455c4ad86056e914472989ca0add5 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteKeyMaterialRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DeleteKeyMaterialRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DeleteKeyMaterial','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteNetworkRuleRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteNetworkRuleRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..3563e62a00f1411708dcdc1d36648603c0b37253 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteNetworkRuleRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DeleteNetworkRuleRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DeleteNetworkRule','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_Name(self): # String + return self.get_query_params().get('Name') + + def set_Name(self, Name): # String + self.add_query_param('Name', Name) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeletePolicyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeletePolicyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..b83e883948e8ffabc3f2a75eede3dc3112033c01 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeletePolicyRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DeletePolicyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DeletePolicy','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_Name(self): # String + return self.get_query_params().get('Name') + + def set_Name(self, Name): # String + self.add_query_param('Name', Name) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteSecretRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteSecretRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..d1d8032bc2315cf8cdefbf028340fd874c13507d --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DeleteSecretRequest.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DeleteSecretRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DeleteSecret','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_ForceDeleteWithoutRecovery(self): # String + return self.get_query_params().get('ForceDeleteWithoutRecovery') + + def set_ForceDeleteWithoutRecovery(self, ForceDeleteWithoutRecovery): # String + self.add_query_param('ForceDeleteWithoutRecovery', ForceDeleteWithoutRecovery) + def get_RecoveryWindowInDays(self): # String + return self.get_query_params().get('RecoveryWindowInDays') + + def set_RecoveryWindowInDays(self, RecoveryWindowInDays): # String + self.add_query_param('RecoveryWindowInDays', RecoveryWindowInDays) + def get_SecretName(self): # String + return self.get_query_params().get('SecretName') + + def set_SecretName(self, SecretName): # String + self.add_query_param('SecretName', SecretName) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeAccountKmsStatusRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeAccountKmsStatusRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..a24bccce94d40d233138e73196765326c50a769f --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeAccountKmsStatusRequest.py @@ -0,0 +1,34 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DescribeAccountKmsStatusRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DescribeAccountKmsStatus','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeApplicationAccessPointRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeApplicationAccessPointRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..ca6d0a43a1b5e63842103915cf0e460b20bb203b --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeApplicationAccessPointRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DescribeApplicationAccessPointRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DescribeApplicationAccessPoint','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_Name(self): # String + return self.get_query_params().get('Name') + + def set_Name(self, Name): # String + self.add_query_param('Name', Name) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeCertificateRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeCertificateRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..184f36342956fd24041fc6f760bf1ecd5a2b74cd --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeCertificateRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DescribeCertificateRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DescribeCertificate','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_CertificateId(self): # String + return self.get_query_params().get('CertificateId') + + def set_CertificateId(self, CertificateId): # String + self.add_query_param('CertificateId', CertificateId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeKeyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeKeyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..43d7eef327cc3f5f2e9cab20a49f470db914f37c --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeKeyRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DescribeKeyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DescribeKey','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeKeyVersionRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeKeyVersionRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..7db13749529ade9087d0bd179e6a6c70c2e965f8 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeKeyVersionRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DescribeKeyVersionRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DescribeKeyVersion','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyVersionId(self): # String + return self.get_query_params().get('KeyVersionId') + + def set_KeyVersionId(self, KeyVersionId): # String + self.add_query_param('KeyVersionId', KeyVersionId) + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeNetworkRuleRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeNetworkRuleRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..af61a5041b64aa6ae55cbd8a847282286d6d0b9c --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeNetworkRuleRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DescribeNetworkRuleRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DescribeNetworkRule','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_Name(self): # String + return self.get_query_params().get('Name') + + def set_Name(self, Name): # String + self.add_query_param('Name', Name) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribePolicyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribePolicyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..0b5ae4b3861a5c85e4bb972120ee1c690b92d778 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribePolicyRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DescribePolicyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DescribePolicy','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_Name(self): # String + return self.get_query_params().get('Name') + + def set_Name(self, Name): # String + self.add_query_param('Name', Name) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeRegionsRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeRegionsRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..d9938082de10b0a10e6bd8504a754adf6dc7acff --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeRegionsRequest.py @@ -0,0 +1,34 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DescribeRegionsRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DescribeRegions','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeSecretRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeSecretRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..102fd73bc3dfeefdaf55f9666e200708bedbd440 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DescribeSecretRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DescribeSecretRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DescribeSecret','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_SecretName(self): # String + return self.get_query_params().get('SecretName') + + def set_SecretName(self, SecretName): # String + self.add_query_param('SecretName', SecretName) + def get_FetchTags(self): # String + return self.get_query_params().get('FetchTags') + + def set_FetchTags(self, FetchTags): # String + self.add_query_param('FetchTags', FetchTags) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DisableKeyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DisableKeyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..e3c8c8f556b21a7b9915ab5ad4ba8b95206378b4 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/DisableKeyRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class DisableKeyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'DisableKey','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/EnableKeyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/EnableKeyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..92632cf040f609e02bcc6add79875cf9fb8f44ac --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/EnableKeyRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class EnableKeyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'EnableKey','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/EncryptRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/EncryptRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..af07c0d99f5939ad3ccb6aed2046827492e68ad0 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/EncryptRequest.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class EncryptRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'Encrypt','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) + def get_Plaintext(self): # String + return self.get_query_params().get('Plaintext') + + def set_Plaintext(self, Plaintext): # String + self.add_query_param('Plaintext', Plaintext) + def get_EncryptionContext(self): # String + return self.get_query_params().get('EncryptionContext') + + def set_EncryptionContext(self, EncryptionContext): # String + self.add_query_param('EncryptionContext', EncryptionContext) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ExportDataKeyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ExportDataKeyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..8656c2aaff01c96ced321a099717167adc3ee757 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ExportDataKeyRequest.py @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ExportDataKeyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ExportDataKey','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_PublicKeyBlob(self): # String + return self.get_query_params().get('PublicKeyBlob') + + def set_PublicKeyBlob(self, PublicKeyBlob): # String + self.add_query_param('PublicKeyBlob', PublicKeyBlob) + def get_EncryptionContext(self): # String + return self.get_query_params().get('EncryptionContext') + + def set_EncryptionContext(self, EncryptionContext): # String + self.add_query_param('EncryptionContext', EncryptionContext) + def get_WrappingAlgorithm(self): # String + return self.get_query_params().get('WrappingAlgorithm') + + def set_WrappingAlgorithm(self, WrappingAlgorithm): # String + self.add_query_param('WrappingAlgorithm', WrappingAlgorithm) + def get_CiphertextBlob(self): # String + return self.get_query_params().get('CiphertextBlob') + + def set_CiphertextBlob(self, CiphertextBlob): # String + self.add_query_param('CiphertextBlob', CiphertextBlob) + def get_WrappingKeySpec(self): # String + return self.get_query_params().get('WrappingKeySpec') + + def set_WrappingKeySpec(self, WrappingKeySpec): # String + self.add_query_param('WrappingKeySpec', WrappingKeySpec) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GenerateAndExportDataKeyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GenerateAndExportDataKeyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..84f4b7b9aaab95a69eee031944b70210a053c39c --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GenerateAndExportDataKeyRequest.py @@ -0,0 +1,69 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class GenerateAndExportDataKeyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'GenerateAndExportDataKey','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) + def get_KeySpec(self): # String + return self.get_query_params().get('KeySpec') + + def set_KeySpec(self, KeySpec): # String + self.add_query_param('KeySpec', KeySpec) + def get_NumberOfBytes(self): # Integer + return self.get_query_params().get('NumberOfBytes') + + def set_NumberOfBytes(self, NumberOfBytes): # Integer + self.add_query_param('NumberOfBytes', NumberOfBytes) + def get_PublicKeyBlob(self): # String + return self.get_query_params().get('PublicKeyBlob') + + def set_PublicKeyBlob(self, PublicKeyBlob): # String + self.add_query_param('PublicKeyBlob', PublicKeyBlob) + def get_EncryptionContext(self): # String + return self.get_query_params().get('EncryptionContext') + + def set_EncryptionContext(self, EncryptionContext): # String + self.add_query_param('EncryptionContext', EncryptionContext) + def get_WrappingAlgorithm(self): # String + return self.get_query_params().get('WrappingAlgorithm') + + def set_WrappingAlgorithm(self, WrappingAlgorithm): # String + self.add_query_param('WrappingAlgorithm', WrappingAlgorithm) + def get_WrappingKeySpec(self): # String + return self.get_query_params().get('WrappingKeySpec') + + def set_WrappingKeySpec(self, WrappingKeySpec): # String + self.add_query_param('WrappingKeySpec', WrappingKeySpec) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GenerateDataKeyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GenerateDataKeyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..729b2d93a2323e352ec65905f4f6fe67c718020c --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GenerateDataKeyRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class GenerateDataKeyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'GenerateDataKey','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) + def get_KeySpec(self): # String + return self.get_query_params().get('KeySpec') + + def set_KeySpec(self, KeySpec): # String + self.add_query_param('KeySpec', KeySpec) + def get_NumberOfBytes(self): # Integer + return self.get_query_params().get('NumberOfBytes') + + def set_NumberOfBytes(self, NumberOfBytes): # Integer + self.add_query_param('NumberOfBytes', NumberOfBytes) + def get_EncryptionContext(self): # String + return self.get_query_params().get('EncryptionContext') + + def set_EncryptionContext(self, EncryptionContext): # String + self.add_query_param('EncryptionContext', EncryptionContext) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GenerateDataKeyWithoutPlaintextRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GenerateDataKeyWithoutPlaintextRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..2ca4f6ff76061c38be696eaf1aa7401378a9b37f --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GenerateDataKeyWithoutPlaintextRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class GenerateDataKeyWithoutPlaintextRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'GenerateDataKeyWithoutPlaintext','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) + def get_KeySpec(self): # String + return self.get_query_params().get('KeySpec') + + def set_KeySpec(self, KeySpec): # String + self.add_query_param('KeySpec', KeySpec) + def get_NumberOfBytes(self): # Integer + return self.get_query_params().get('NumberOfBytes') + + def set_NumberOfBytes(self, NumberOfBytes): # Integer + self.add_query_param('NumberOfBytes', NumberOfBytes) + def get_EncryptionContext(self): # String + return self.get_query_params().get('EncryptionContext') + + def set_EncryptionContext(self, EncryptionContext): # String + self.add_query_param('EncryptionContext', EncryptionContext) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetCertificateRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetCertificateRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..7fde4ca8ff2a6028ccae19bfd5a7ca6402c65bff --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetCertificateRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class GetCertificateRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'GetCertificate','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_CertificateId(self): # String + return self.get_query_params().get('CertificateId') + + def set_CertificateId(self, CertificateId): # String + self.add_query_param('CertificateId', CertificateId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetClientKeyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetClientKeyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..d76668fbf7e5fe28b035bd1fd2650c0354214266 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetClientKeyRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class GetClientKeyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'GetClientKey','kms') + self.set_protocol_type('https') + self.set_method('GET') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_ClientKeyId(self): # String + return self.get_query_params().get('ClientKeyId') + + def set_ClientKeyId(self, ClientKeyId): # String + self.add_query_param('ClientKeyId', ClientKeyId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetKmsInstanceRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetKmsInstanceRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..0e97deb9277f10186593f56e7c396df5e8b8e53d --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetKmsInstanceRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class GetKmsInstanceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'GetKmsInstance','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KmsInstanceId(self): # String + return self.get_query_params().get('KmsInstanceId') + + def set_KmsInstanceId(self, KmsInstanceId): # String + self.add_query_param('KmsInstanceId', KmsInstanceId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetParametersForImportRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetParametersForImportRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..f9a08bee0969d5e5ebdcda37556fd104691f8ae2 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetParametersForImportRequest.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class GetParametersForImportRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'GetParametersForImport','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) + def get_WrappingAlgorithm(self): # String + return self.get_query_params().get('WrappingAlgorithm') + + def set_WrappingAlgorithm(self, WrappingAlgorithm): # String + self.add_query_param('WrappingAlgorithm', WrappingAlgorithm) + def get_WrappingKeySpec(self): # String + return self.get_query_params().get('WrappingKeySpec') + + def set_WrappingKeySpec(self, WrappingKeySpec): # String + self.add_query_param('WrappingKeySpec', WrappingKeySpec) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetPublicKeyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetPublicKeyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..0e1feaa6d45eb1611851577138d0d8b80e2a2e8e --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetPublicKeyRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class GetPublicKeyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'GetPublicKey','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyVersionId(self): # String + return self.get_query_params().get('KeyVersionId') + + def set_KeyVersionId(self, KeyVersionId): # String + self.add_query_param('KeyVersionId', KeyVersionId) + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetRandomPasswordRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetRandomPasswordRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..27efc74d994302d87dfdbdd8f2db9239e7058a1b --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetRandomPasswordRequest.py @@ -0,0 +1,69 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class GetRandomPasswordRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'GetRandomPassword','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_ExcludeCharacters(self): # String + return self.get_query_params().get('ExcludeCharacters') + + def set_ExcludeCharacters(self, ExcludeCharacters): # String + self.add_query_param('ExcludeCharacters', ExcludeCharacters) + def get_PasswordLength(self): # String + return self.get_query_params().get('PasswordLength') + + def set_PasswordLength(self, PasswordLength): # String + self.add_query_param('PasswordLength', PasswordLength) + def get_ExcludePunctuation(self): # String + return self.get_query_params().get('ExcludePunctuation') + + def set_ExcludePunctuation(self, ExcludePunctuation): # String + self.add_query_param('ExcludePunctuation', ExcludePunctuation) + def get_RequireEachIncludedType(self): # String + return self.get_query_params().get('RequireEachIncludedType') + + def set_RequireEachIncludedType(self, RequireEachIncludedType): # String + self.add_query_param('RequireEachIncludedType', RequireEachIncludedType) + def get_ExcludeNumbers(self): # String + return self.get_query_params().get('ExcludeNumbers') + + def set_ExcludeNumbers(self, ExcludeNumbers): # String + self.add_query_param('ExcludeNumbers', ExcludeNumbers) + def get_ExcludeLowercase(self): # String + return self.get_query_params().get('ExcludeLowercase') + + def set_ExcludeLowercase(self, ExcludeLowercase): # String + self.add_query_param('ExcludeLowercase', ExcludeLowercase) + def get_ExcludeUppercase(self): # String + return self.get_query_params().get('ExcludeUppercase') + + def set_ExcludeUppercase(self, ExcludeUppercase): # String + self.add_query_param('ExcludeUppercase', ExcludeUppercase) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetSecretValueRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetSecretValueRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..8811ae10daf68b90865c849efabcfaf660a9a81d --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/GetSecretValueRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class GetSecretValueRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'GetSecretValue','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_VersionId(self): # String + return self.get_query_params().get('VersionId') + + def set_VersionId(self, VersionId): # String + self.add_query_param('VersionId', VersionId) + def get_VersionStage(self): # String + return self.get_query_params().get('VersionStage') + + def set_VersionStage(self, VersionStage): # String + self.add_query_param('VersionStage', VersionStage) + def get_SecretName(self): # String + return self.get_query_params().get('SecretName') + + def set_SecretName(self, SecretName): # String + self.add_query_param('SecretName', SecretName) + def get_FetchExtendedConfig(self): # Boolean + return self.get_query_params().get('FetchExtendedConfig') + + def set_FetchExtendedConfig(self, FetchExtendedConfig): # Boolean + self.add_query_param('FetchExtendedConfig', FetchExtendedConfig) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ImportKeyMaterialRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ImportKeyMaterialRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..d0d9b87d1173df8d97d508d247c43568a89403ce --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ImportKeyMaterialRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ImportKeyMaterialRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ImportKeyMaterial','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_ImportToken(self): # String + return self.get_query_params().get('ImportToken') + + def set_ImportToken(self, ImportToken): # String + self.add_query_param('ImportToken', ImportToken) + def get_EncryptedKeyMaterial(self): # String + return self.get_query_params().get('EncryptedKeyMaterial') + + def set_EncryptedKeyMaterial(self, EncryptedKeyMaterial): # String + self.add_query_param('EncryptedKeyMaterial', EncryptedKeyMaterial) + def get_KeyMaterialExpireUnix(self): # Long + return self.get_query_params().get('KeyMaterialExpireUnix') + + def set_KeyMaterialExpireUnix(self, KeyMaterialExpireUnix): # Long + self.add_query_param('KeyMaterialExpireUnix', KeyMaterialExpireUnix) + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListAliasesByKeyIdRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListAliasesByKeyIdRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..8dd8f521e49fab58c1670ee16d78a0d08be15227 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListAliasesByKeyIdRequest.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ListAliasesByKeyIdRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ListAliasesByKeyId','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) + def get_PageNumber(self): # Integer + return self.get_query_params().get('PageNumber') + + def set_PageNumber(self, PageNumber): # Integer + self.add_query_param('PageNumber', PageNumber) + def get_PageSize(self): # Integer + return self.get_query_params().get('PageSize') + + def set_PageSize(self, PageSize): # Integer + self.add_query_param('PageSize', PageSize) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListAliasesRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListAliasesRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..9f8c84c5791976db6b735291113d3d408554b4a3 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListAliasesRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ListAliasesRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ListAliases','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_PageSize(self): # Integer + return self.get_query_params().get('PageSize') + + def set_PageSize(self, PageSize): # Integer + self.add_query_param('PageSize', PageSize) + def get_PageNumber(self): # Integer + return self.get_query_params().get('PageNumber') + + def set_PageNumber(self, PageNumber): # Integer + self.add_query_param('PageNumber', PageNumber) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListApplicationAccessPointsRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListApplicationAccessPointsRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..f01e84822a9f263e795330c047031a589dd02d65 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListApplicationAccessPointsRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ListApplicationAccessPointsRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ListApplicationAccessPoints','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_PageSize(self): # Integer + return self.get_query_params().get('PageSize') + + def set_PageSize(self, PageSize): # Integer + self.add_query_param('PageSize', PageSize) + def get_PageNumber(self): # Integer + return self.get_query_params().get('PageNumber') + + def set_PageNumber(self, PageNumber): # Integer + self.add_query_param('PageNumber', PageNumber) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListClientKeysRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListClientKeysRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..6c7708613e351cbc6d0c76df10f5b6736737bd3e --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListClientKeysRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ListClientKeysRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ListClientKeys','kms') + self.set_protocol_type('https') + self.set_method('GET') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_AapName(self): # String + return self.get_query_params().get('AapName') + + def set_AapName(self, AapName): # String + self.add_query_param('AapName', AapName) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListKeyVersionsRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListKeyVersionsRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..fc2acee61ffa2f04eb9f11c15a95f74bdcac80af --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListKeyVersionsRequest.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ListKeyVersionsRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ListKeyVersions','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) + def get_PageNumber(self): # Integer + return self.get_query_params().get('PageNumber') + + def set_PageNumber(self, PageNumber): # Integer + self.add_query_param('PageNumber', PageNumber) + def get_PageSize(self): # Integer + return self.get_query_params().get('PageSize') + + def set_PageSize(self, PageSize): # Integer + self.add_query_param('PageSize', PageSize) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListKeysRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListKeysRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..41908eb153b128d0b0931c0e8e1d95abea20620f --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListKeysRequest.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ListKeysRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ListKeys','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_Filters(self): # String + return self.get_query_params().get('Filters') + + def set_Filters(self, Filters): # String + self.add_query_param('Filters', Filters) + def get_PageNumber(self): # Integer + return self.get_query_params().get('PageNumber') + + def set_PageNumber(self, PageNumber): # Integer + self.add_query_param('PageNumber', PageNumber) + def get_PageSize(self): # Integer + return self.get_query_params().get('PageSize') + + def set_PageSize(self, PageSize): # Integer + self.add_query_param('PageSize', PageSize) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListKmsInstancesRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListKmsInstancesRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..10df2d25fb2894fb8512f5aaaad709f8389299a2 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListKmsInstancesRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ListKmsInstancesRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ListKmsInstances','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_PageSize(self): # Integer + return self.get_query_params().get('PageSize') + + def set_PageSize(self, PageSize): # Integer + self.add_query_param('PageSize', PageSize) + def get_PageNumber(self): # Integer + return self.get_query_params().get('PageNumber') + + def set_PageNumber(self, PageNumber): # Integer + self.add_query_param('PageNumber', PageNumber) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListNetworkRulesRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListNetworkRulesRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..41cbf4be4726375edf29fe6f280e50880e45a37b --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListNetworkRulesRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ListNetworkRulesRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ListNetworkRules','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_PageSize(self): # Integer + return self.get_query_params().get('PageSize') + + def set_PageSize(self, PageSize): # Integer + self.add_query_param('PageSize', PageSize) + def get_PageNumber(self): # Integer + return self.get_query_params().get('PageNumber') + + def set_PageNumber(self, PageNumber): # Integer + self.add_query_param('PageNumber', PageNumber) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListPoliciesRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListPoliciesRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..b938c60a99d50fe844bb974c7c24475ca9bf5aca --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListPoliciesRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ListPoliciesRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ListPolicies','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_PageSize(self): # Integer + return self.get_query_params().get('PageSize') + + def set_PageSize(self, PageSize): # Integer + self.add_query_param('PageSize', PageSize) + def get_PageNumber(self): # Integer + return self.get_query_params().get('PageNumber') + + def set_PageNumber(self, PageNumber): # Integer + self.add_query_param('PageNumber', PageNumber) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListResourceTagsRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListResourceTagsRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..bc299b70513dc873e8cfeb10272b069e23db63cf --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListResourceTagsRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ListResourceTagsRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ListResourceTags','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListSecretVersionIdsRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListSecretVersionIdsRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..df80bae5a195d08ab5b4fdd9357a24b999d34956 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListSecretVersionIdsRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ListSecretVersionIdsRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ListSecretVersionIds','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_IncludeDeprecated(self): # String + return self.get_query_params().get('IncludeDeprecated') + + def set_IncludeDeprecated(self, IncludeDeprecated): # String + self.add_query_param('IncludeDeprecated', IncludeDeprecated) + def get_PageNumber(self): # Integer + return self.get_query_params().get('PageNumber') + + def set_PageNumber(self, PageNumber): # Integer + self.add_query_param('PageNumber', PageNumber) + def get_PageSize(self): # Integer + return self.get_query_params().get('PageSize') + + def set_PageSize(self, PageSize): # Integer + self.add_query_param('PageSize', PageSize) + def get_SecretName(self): # String + return self.get_query_params().get('SecretName') + + def set_SecretName(self, SecretName): # String + self.add_query_param('SecretName', SecretName) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListSecretsRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListSecretsRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..ef67277183de9ae299ce6894780370314c013609 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListSecretsRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ListSecretsRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ListSecrets','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_Filters(self): # String + return self.get_query_params().get('Filters') + + def set_Filters(self, Filters): # String + self.add_query_param('Filters', Filters) + def get_PageNumber(self): # Integer + return self.get_query_params().get('PageNumber') + + def set_PageNumber(self, PageNumber): # Integer + self.add_query_param('PageNumber', PageNumber) + def get_PageSize(self): # Integer + return self.get_query_params().get('PageSize') + + def set_PageSize(self, PageSize): # Integer + self.add_query_param('PageSize', PageSize) + def get_FetchTags(self): # String + return self.get_query_params().get('FetchTags') + + def set_FetchTags(self, FetchTags): # String + self.add_query_param('FetchTags', FetchTags) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListTagResourcesRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListTagResourcesRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..759d70972da8254e1fd607a7863b8c0c34733a66 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ListTagResourcesRequest.py @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ListTagResourcesRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ListTagResources','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_ResourceIds(self): # RepeatList + return self.get_query_params().get('ResourceId') + + def set_ResourceIds(self, ResourceId): # RepeatList + for depth1 in range(len(ResourceId)): + self.add_query_param('ResourceId.' + str(depth1 + 1), ResourceId[depth1]) + def get_ResourceType(self): # String + return self.get_query_params().get('ResourceType') + + def set_ResourceType(self, ResourceType): # String + self.add_query_param('ResourceType', ResourceType) + def get_NextToken(self): # String + return self.get_query_params().get('NextToken') + + def set_NextToken(self, NextToken): # String + self.add_query_param('NextToken', NextToken) + def get_Tags(self): # RepeatList + return self.get_query_params().get('Tag') + + def set_Tags(self, Tag): # RepeatList + for depth1 in range(len(Tag)): + if Tag[depth1].get('Value') is not None: + self.add_query_param('Tag.' + str(depth1 + 1) + '.Value', Tag[depth1].get('Value')) + if Tag[depth1].get('Key') is not None: + self.add_query_param('Tag.' + str(depth1 + 1) + '.Key', Tag[depth1].get('Key')) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/OpenKmsServiceRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/OpenKmsServiceRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..dfa91176daed890dee5f5452be7249de06e703bb --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/OpenKmsServiceRequest.py @@ -0,0 +1,34 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class OpenKmsServiceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'OpenKmsService','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/PutSecretValueRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/PutSecretValueRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..cc2f08d8f6b48376b9d2a1d2afc6a42b9ddf008e --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/PutSecretValueRequest.py @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class PutSecretValueRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'PutSecretValue','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_VersionId(self): # String + return self.get_query_params().get('VersionId') + + def set_VersionId(self, VersionId): # String + self.add_query_param('VersionId', VersionId) + def get_VersionStages(self): # String + return self.get_query_params().get('VersionStages') + + def set_VersionStages(self, VersionStages): # String + self.add_query_param('VersionStages', VersionStages) + def get_SecretData(self): # String + return self.get_query_params().get('SecretData') + + def set_SecretData(self, SecretData): # String + self.add_query_param('SecretData', SecretData) + def get_SecretName(self): # String + return self.get_query_params().get('SecretName') + + def set_SecretName(self, SecretName): # String + self.add_query_param('SecretName', SecretName) + def get_SecretDataType(self): # String + return self.get_query_params().get('SecretDataType') + + def set_SecretDataType(self, SecretDataType): # String + self.add_query_param('SecretDataType', SecretDataType) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ReEncryptRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ReEncryptRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..1858bb1a059604bc71352e96537ddfd070e90020 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ReEncryptRequest.py @@ -0,0 +1,69 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ReEncryptRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ReEncrypt','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_DestinationEncryptionContext(self): # String + return self.get_query_params().get('DestinationEncryptionContext') + + def set_DestinationEncryptionContext(self, DestinationEncryptionContext): # String + self.add_query_param('DestinationEncryptionContext', DestinationEncryptionContext) + def get_SourceKeyId(self): # String + return self.get_query_params().get('SourceKeyId') + + def set_SourceKeyId(self, SourceKeyId): # String + self.add_query_param('SourceKeyId', SourceKeyId) + def get_SourceEncryptionAlgorithm(self): # String + return self.get_query_params().get('SourceEncryptionAlgorithm') + + def set_SourceEncryptionAlgorithm(self, SourceEncryptionAlgorithm): # String + self.add_query_param('SourceEncryptionAlgorithm', SourceEncryptionAlgorithm) + def get_SourceKeyVersionId(self): # String + return self.get_query_params().get('SourceKeyVersionId') + + def set_SourceKeyVersionId(self, SourceKeyVersionId): # String + self.add_query_param('SourceKeyVersionId', SourceKeyVersionId) + def get_DestinationKeyId(self): # String + return self.get_query_params().get('DestinationKeyId') + + def set_DestinationKeyId(self, DestinationKeyId): # String + self.add_query_param('DestinationKeyId', DestinationKeyId) + def get_SourceEncryptionContext(self): # String + return self.get_query_params().get('SourceEncryptionContext') + + def set_SourceEncryptionContext(self, SourceEncryptionContext): # String + self.add_query_param('SourceEncryptionContext', SourceEncryptionContext) + def get_CiphertextBlob(self): # String + return self.get_query_params().get('CiphertextBlob') + + def set_CiphertextBlob(self, CiphertextBlob): # String + self.add_query_param('CiphertextBlob', CiphertextBlob) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/RestoreSecretRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/RestoreSecretRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..a0e8a7fef5b37be45d7aba0836276547f8d227a6 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/RestoreSecretRequest.py @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class RestoreSecretRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'RestoreSecret','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_SecretName(self): # String + return self.get_query_params().get('SecretName') + + def set_SecretName(self, SecretName): # String + self.add_query_param('SecretName', SecretName) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/RotateSecretRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/RotateSecretRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..830f8b2e809779aa0aac7511ab96533691494970 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/RotateSecretRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class RotateSecretRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'RotateSecret','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_VersionId(self): # String + return self.get_query_params().get('VersionId') + + def set_VersionId(self, VersionId): # String + self.add_query_param('VersionId', VersionId) + def get_SecretName(self): # String + return self.get_query_params().get('SecretName') + + def set_SecretName(self, SecretName): # String + self.add_query_param('SecretName', SecretName) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ScheduleKeyDeletionRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ScheduleKeyDeletionRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..5f49bac618c4464b5806eff0c2a9ae35a41a1dcc --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/ScheduleKeyDeletionRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class ScheduleKeyDeletionRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'ScheduleKeyDeletion','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_PendingWindowInDays(self): # Integer + return self.get_query_params().get('PendingWindowInDays') + + def set_PendingWindowInDays(self, PendingWindowInDays): # Integer + self.add_query_param('PendingWindowInDays', PendingWindowInDays) + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/SetDeletionProtectionRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/SetDeletionProtectionRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..20a24399314750de53dd9c412b0ef1668518e487 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/SetDeletionProtectionRequest.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class SetDeletionProtectionRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'SetDeletionProtection','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_DeletionProtectionDescription(self): # String + return self.get_query_params().get('DeletionProtectionDescription') + + def set_DeletionProtectionDescription(self, DeletionProtectionDescription): # String + self.add_query_param('DeletionProtectionDescription', DeletionProtectionDescription) + def get_EnableDeletionProtection(self): # Boolean + return self.get_query_params().get('EnableDeletionProtection') + + def set_EnableDeletionProtection(self, EnableDeletionProtection): # Boolean + self.add_query_param('EnableDeletionProtection', EnableDeletionProtection) + def get_ProtectedResourceArn(self): # String + return self.get_query_params().get('ProtectedResourceArn') + + def set_ProtectedResourceArn(self, ProtectedResourceArn): # String + self.add_query_param('ProtectedResourceArn', ProtectedResourceArn) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/TagResourceRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/TagResourceRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..16e3f3b5de4be54f1ae986513c5e928d7e299b38 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/TagResourceRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class TagResourceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'TagResource','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_CertificateId(self): # String + return self.get_query_params().get('CertificateId') + + def set_CertificateId(self, CertificateId): # String + self.add_query_param('CertificateId', CertificateId) + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) + def get_Tags(self): # String + return self.get_query_params().get('Tags') + + def set_Tags(self, Tags): # String + self.add_query_param('Tags', Tags) + def get_SecretName(self): # String + return self.get_query_params().get('SecretName') + + def set_SecretName(self, SecretName): # String + self.add_query_param('SecretName', SecretName) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/TagResourcesRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/TagResourcesRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..b396f563e17fa63b44120516a6fc83a2e232a47a --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/TagResourcesRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class TagResourcesRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'TagResources','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_ResourceIds(self): # RepeatList + return self.get_query_params().get('ResourceId') + + def set_ResourceIds(self, ResourceId): # RepeatList + for depth1 in range(len(ResourceId)): + self.add_query_param('ResourceId.' + str(depth1 + 1), ResourceId[depth1]) + def get_ResourceType(self): # String + return self.get_query_params().get('ResourceType') + + def set_ResourceType(self, ResourceType): # String + self.add_query_param('ResourceType', ResourceType) + def get_Tags(self): # RepeatList + return self.get_query_params().get('Tag') + + def set_Tags(self, Tag): # RepeatList + for depth1 in range(len(Tag)): + if Tag[depth1].get('Value') is not None: + self.add_query_param('Tag.' + str(depth1 + 1) + '.Value', Tag[depth1].get('Value')) + if Tag[depth1].get('Key') is not None: + self.add_query_param('Tag.' + str(depth1 + 1) + '.Key', Tag[depth1].get('Key')) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UntagResourceRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UntagResourceRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..8dcbcd4640a7be3d659149bdb17db3d44dd3587e --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UntagResourceRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class UntagResourceRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'UntagResource','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_CertificateId(self): # String + return self.get_query_params().get('CertificateId') + + def set_CertificateId(self, CertificateId): # String + self.add_query_param('CertificateId', CertificateId) + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) + def get_TagKeys(self): # String + return self.get_query_params().get('TagKeys') + + def set_TagKeys(self, TagKeys): # String + self.add_query_param('TagKeys', TagKeys) + def get_SecretName(self): # String + return self.get_query_params().get('SecretName') + + def set_SecretName(self, SecretName): # String + self.add_query_param('SecretName', SecretName) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UntagResourcesRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UntagResourcesRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..2382429c4bd5d8759a0b9e9858c527326c5398ec --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UntagResourcesRequest.py @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class UntagResourcesRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'UntagResources','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_All(self): # Boolean + return self.get_query_params().get('All') + + def set_All(self, All): # Boolean + self.add_query_param('All', All) + def get_ResourceIds(self): # RepeatList + return self.get_query_params().get('ResourceId') + + def set_ResourceIds(self, ResourceId): # RepeatList + for depth1 in range(len(ResourceId)): + self.add_query_param('ResourceId.' + str(depth1 + 1), ResourceId[depth1]) + def get_ResourceType(self): # String + return self.get_query_params().get('ResourceType') + + def set_ResourceType(self, ResourceType): # String + self.add_query_param('ResourceType', ResourceType) + def get_TagKeys(self): # RepeatList + return self.get_query_params().get('TagKey') + + def set_TagKeys(self, TagKey): # RepeatList + for depth1 in range(len(TagKey)): + self.add_query_param('TagKey.' + str(depth1 + 1), TagKey[depth1]) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateAliasRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateAliasRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..4e6308cd16e3f051dc793a645986f2c303825f70 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateAliasRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class UpdateAliasRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'UpdateAlias','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_AliasName(self): # String + return self.get_query_params().get('AliasName') + + def set_AliasName(self, AliasName): # String + self.add_query_param('AliasName', AliasName) + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateApplicationAccessPointRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateApplicationAccessPointRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..9e60ce27d351288709a898736134eefdc899357a --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateApplicationAccessPointRequest.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class UpdateApplicationAccessPointRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'UpdateApplicationAccessPoint','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_Policies(self): # String + return self.get_query_params().get('Policies') + + def set_Policies(self, Policies): # String + self.add_query_param('Policies', Policies) + def get_Description(self): # String + return self.get_query_params().get('Description') + + def set_Description(self, Description): # String + self.add_query_param('Description', Description) + def get_Name(self): # String + return self.get_query_params().get('Name') + + def set_Name(self, Name): # String + self.add_query_param('Name', Name) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateCertificateStatusRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateCertificateStatusRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..6b5c43db613b6d47546a76ce6263826afd8c52b1 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateCertificateStatusRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class UpdateCertificateStatusRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'UpdateCertificateStatus','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_CertificateId(self): # String + return self.get_query_params().get('CertificateId') + + def set_CertificateId(self, CertificateId): # String + self.add_query_param('CertificateId', CertificateId) + def get_Status(self): # String + return self.get_query_params().get('Status') + + def set_Status(self, Status): # String + self.add_query_param('Status', Status) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateKeyDescriptionRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateKeyDescriptionRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..c3ccc26e8566dcc21b33e1fa53aef7f65788b793 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateKeyDescriptionRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class UpdateKeyDescriptionRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'UpdateKeyDescription','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) + def get_Description(self): # String + return self.get_query_params().get('Description') + + def set_Description(self, Description): # String + self.add_query_param('Description', Description) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateKmsInstanceBindVpcRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateKmsInstanceBindVpcRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..c53715da107dbfccfd70488815c01190261b5994 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateKmsInstanceBindVpcRequest.py @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class UpdateKmsInstanceBindVpcRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'UpdateKmsInstanceBindVpc','kms') + self.set_protocol_type('https') + self.set_method('GET') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KmsInstanceId(self): # String + return self.get_query_params().get('KmsInstanceId') + + def set_KmsInstanceId(self, KmsInstanceId): # String + self.add_query_param('KmsInstanceId', KmsInstanceId) + def get_BindVpcs(self): # String + return self.get_query_params().get('BindVpcs') + + def set_BindVpcs(self, BindVpcs): # String + self.add_query_param('BindVpcs', BindVpcs) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateNetworkRuleRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateNetworkRuleRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..897c7457ce948e972cfd17f197813a8658640a0d --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateNetworkRuleRequest.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class UpdateNetworkRuleRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'UpdateNetworkRule','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_Description(self): # String + return self.get_query_params().get('Description') + + def set_Description(self, Description): # String + self.add_query_param('Description', Description) + def get_Name(self): # String + return self.get_query_params().get('Name') + + def set_Name(self, Name): # String + self.add_query_param('Name', Name) + def get_SourcePrivateIp(self): # String + return self.get_query_params().get('SourcePrivateIp') + + def set_SourcePrivateIp(self, SourcePrivateIp): # String + self.add_query_param('SourcePrivateIp', SourcePrivateIp) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdatePolicyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdatePolicyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..cf45b8615a4232a7bd42a19eda56804658fe00b9 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdatePolicyRequest.py @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class UpdatePolicyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'UpdatePolicy','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_AccessControlRules(self): # String + return self.get_query_params().get('AccessControlRules') + + def set_AccessControlRules(self, AccessControlRules): # String + self.add_query_param('AccessControlRules', AccessControlRules) + def get_Resources(self): # String + return self.get_query_params().get('Resources') + + def set_Resources(self, Resources): # String + self.add_query_param('Resources', Resources) + def get_Description(self): # String + return self.get_query_params().get('Description') + + def set_Description(self, Description): # String + self.add_query_param('Description', Description) + def get_Permissions(self): # String + return self.get_query_params().get('Permissions') + + def set_Permissions(self, Permissions): # String + self.add_query_param('Permissions', Permissions) + def get_Name(self): # String + return self.get_query_params().get('Name') + + def set_Name(self, Name): # String + self.add_query_param('Name', Name) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateRotationPolicyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateRotationPolicyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..3c97aa2b6b49ad67344dd7d0ab0dc352de2b736c --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateRotationPolicyRequest.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class UpdateRotationPolicyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'UpdateRotationPolicy','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_KeyId(self): # String + return self.get_query_params().get('KeyId') + + def set_KeyId(self, KeyId): # String + self.add_query_param('KeyId', KeyId) + def get_RotationInterval(self): # String + return self.get_query_params().get('RotationInterval') + + def set_RotationInterval(self, RotationInterval): # String + self.add_query_param('RotationInterval', RotationInterval) + def get_EnableAutomaticRotation(self): # Boolean + return self.get_query_params().get('EnableAutomaticRotation') + + def set_EnableAutomaticRotation(self, EnableAutomaticRotation): # Boolean + self.add_query_param('EnableAutomaticRotation', EnableAutomaticRotation) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateSecretRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateSecretRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..094577f29a2a99d26a74cfacf797a886a534c827 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateSecretRequest.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class UpdateSecretRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'UpdateSecret','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_Description(self): # String + return self.get_query_params().get('Description') + + def set_Description(self, Description): # String + self.add_query_param('Description', Description) + def get_SecretName(self): # String + return self.get_query_params().get('SecretName') + + def set_SecretName(self, SecretName): # String + self.add_query_param('SecretName', SecretName) + def get_ExtendedConfigCustomData(self): # String + return self.get_query_params().get('ExtendedConfig.CustomData') + + def set_ExtendedConfigCustomData(self, ExtendedConfigCustomData): # String + self.add_query_param('ExtendedConfig.CustomData', ExtendedConfigCustomData) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateSecretRotationPolicyRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateSecretRotationPolicyRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..83a590c40330c42e8e2578b15fbfbca1556b4fec --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateSecretRotationPolicyRequest.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class UpdateSecretRotationPolicyRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'UpdateSecretRotationPolicy','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_RotationInterval(self): # String + return self.get_query_params().get('RotationInterval') + + def set_RotationInterval(self, RotationInterval): # String + self.add_query_param('RotationInterval', RotationInterval) + def get_EnableAutomaticRotation(self): # Boolean + return self.get_query_params().get('EnableAutomaticRotation') + + def set_EnableAutomaticRotation(self, EnableAutomaticRotation): # Boolean + self.add_query_param('EnableAutomaticRotation', EnableAutomaticRotation) + def get_SecretName(self): # String + return self.get_query_params().get('SecretName') + + def set_SecretName(self, SecretName): # String + self.add_query_param('SecretName', SecretName) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateSecretVersionStageRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateSecretVersionStageRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..b8906f7bc9d32d7b8555450a8ba6ac843e85ace1 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UpdateSecretVersionStageRequest.py @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class UpdateSecretVersionStageRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'UpdateSecretVersionStage','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_MoveToVersion(self): # String + return self.get_query_params().get('MoveToVersion') + + def set_MoveToVersion(self, MoveToVersion): # String + self.add_query_param('MoveToVersion', MoveToVersion) + def get_RemoveFromVersion(self): # String + return self.get_query_params().get('RemoveFromVersion') + + def set_RemoveFromVersion(self, RemoveFromVersion): # String + self.add_query_param('RemoveFromVersion', RemoveFromVersion) + def get_VersionStage(self): # String + return self.get_query_params().get('VersionStage') + + def set_VersionStage(self, VersionStage): # String + self.add_query_param('VersionStage', VersionStage) + def get_SecretName(self): # String + return self.get_query_params().get('SecretName') + + def set_SecretName(self, SecretName): # String + self.add_query_param('SecretName', SecretName) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UploadCertificateRequest.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UploadCertificateRequest.py new file mode 100644 index 0000000000000000000000000000000000000000..df494e28ab0036638bee2c5a3d8bc1c6d3f43d74 --- /dev/null +++ b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/UploadCertificateRequest.py @@ -0,0 +1,49 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from aliyunsdkcore.request import RpcRequest +from aliyunsdkkms.endpoint import endpoint_data + +class UploadCertificateRequest(RpcRequest): + + def __init__(self): + RpcRequest.__init__(self, 'Kms', '2016-01-20', 'UploadCertificate','kms') + self.set_protocol_type('https') + self.set_method('POST') + + if hasattr(self, "endpoint_map"): + setattr(self, "endpoint_map", endpoint_data.getEndpointMap()) + if hasattr(self, "endpoint_regional"): + setattr(self, "endpoint_regional", endpoint_data.getEndpointRegional()) + + def get_CertificateId(self): # String + return self.get_query_params().get('CertificateId') + + def set_CertificateId(self, CertificateId): # String + self.add_query_param('CertificateId', CertificateId) + def get_Certificate(self): # String + return self.get_query_params().get('Certificate') + + def set_Certificate(self, Certificate): # String + self.add_query_param('Certificate', Certificate) + def get_CertificateChain(self): # String + return self.get_query_params().get('CertificateChain') + + def set_CertificateChain(self, CertificateChain): # String + self.add_query_param('CertificateChain', CertificateChain) diff --git a/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/__init__.py b/runtime/Lib/site-packages/aliyunsdkkms/request/v20160120/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/altair/__init__.py b/runtime/Lib/site-packages/altair/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7079e8cccb0c97a97504b794668b46c64fa953d6 --- /dev/null +++ b/runtime/Lib/site-packages/altair/__init__.py @@ -0,0 +1,12 @@ +# flake8: noqa +__version__ = "4.2.0" + +from .vegalite import * +from . import examples + + +def load_ipython_extension(ipython): + from ._magics import vega, vegalite + + ipython.register_magic_function(vega, "cell") + ipython.register_magic_function(vegalite, "cell") diff --git a/runtime/Lib/site-packages/altair/_magics.py b/runtime/Lib/site-packages/altair/_magics.py new file mode 100644 index 0000000000000000000000000000000000000000..13b8370ab1e850063bfbebb139d2a0357a9e435b --- /dev/null +++ b/runtime/Lib/site-packages/altair/_magics.py @@ -0,0 +1,177 @@ +""" +Magic functions for rendering vega/vega-lite specifications +""" +__all__ = ["vega", "vegalite"] + +import json +import warnings + +import IPython +from IPython.core import magic_arguments +import pandas as pd +from toolz import curried + +from altair.vegalite import v3 as vegalite_v3 +from altair.vegalite import v4 as vegalite_v4 +from altair.vega import v5 as vega_v5 + +try: + import yaml + + YAML_AVAILABLE = True +except ImportError: + YAML_AVAILABLE = False + + +RENDERERS = { + "vega": {"5": vega_v5.Vega}, + "vega-lite": {"3": vegalite_v3.VegaLite, "4": vegalite_v4.VegaLite}, +} + + +TRANSFORMERS = { + "vega": { + # Vega doesn't yet have specific data transformers; use vegalite + "5": vegalite_v4.data_transformers, + }, + "vega-lite": { + "3": vegalite_v3.data_transformers, + "4": vegalite_v4.data_transformers, + }, +} + + +def _prepare_data(data, data_transformers): + """Convert input data to data for use within schema""" + if data is None or isinstance(data, dict): + return data + elif isinstance(data, pd.DataFrame): + return curried.pipe(data, data_transformers.get()) + elif isinstance(data, str): + return {"url": data} + else: + warnings.warn("data of type {} not recognized".format(type(data))) + return data + + +def _get_variable(name): + """Get a variable from the notebook namespace.""" + ip = IPython.get_ipython() + if ip is None: + raise ValueError( + "Magic command must be run within an IPython " + "environemnt, in which get_ipython() is defined." + ) + if name not in ip.user_ns: + raise NameError( + "argument '{}' does not match the " + "name of any defined variable".format(name) + ) + return ip.user_ns[name] + + +@magic_arguments.magic_arguments() +@magic_arguments.argument( + "data", + nargs="*", + help="local variable name of a pandas DataFrame to be used as the dataset", +) +@magic_arguments.argument("-v", "--version", dest="version", default="5") +@magic_arguments.argument("-j", "--json", dest="json", action="store_true") +def vega(line, cell): + """Cell magic for displaying Vega visualizations in CoLab. + + %%vega [name1:variable1 name2:variable2 ...] [--json] [--version='5'] + + Visualize the contents of the cell using Vega, optionally specifying + one or more pandas DataFrame objects to be used as the datasets. + + If --json is passed, then input is parsed as json rather than yaml. + """ + args = magic_arguments.parse_argstring(vega, line) + + version = args.version + assert version in RENDERERS["vega"] + Vega = RENDERERS["vega"][version] + data_transformers = TRANSFORMERS["vega"][version] + + def namevar(s): + s = s.split(":") + if len(s) == 1: + return s[0], s[0] + elif len(s) == 2: + return s[0], s[1] + else: + raise ValueError("invalid identifier: '{}'".format(s)) + + try: + data = list(map(namevar, args.data)) + except ValueError: + raise ValueError("Could not parse arguments: '{}'".format(line)) + + if args.json: + spec = json.loads(cell) + elif not YAML_AVAILABLE: + try: + spec = json.loads(cell) + except json.JSONDecodeError: + raise ValueError( + "%%vega: spec is not valid JSON. " + "Install pyyaml to parse spec as yaml" + ) + else: + spec = yaml.load(cell, Loader=yaml.FullLoader) + + if data: + spec["data"] = [] + for name, val in data: + val = _get_variable(val) + prepped = _prepare_data(val, data_transformers) + prepped["name"] = name + spec["data"].append(prepped) + + return Vega(spec) + + +@magic_arguments.magic_arguments() +@magic_arguments.argument( + "data", + nargs="?", + help="local variablename of a pandas DataFrame to be used as the dataset", +) +@magic_arguments.argument("-v", "--version", dest="version", default="4") +@magic_arguments.argument("-j", "--json", dest="json", action="store_true") +def vegalite(line, cell): + """Cell magic for displaying vega-lite visualizations in CoLab. + + %%vegalite [dataframe] [--json] [--version=3] + + Visualize the contents of the cell using Vega-Lite, optionally + specifying a pandas DataFrame object to be used as the dataset. + + if --json is passed, then input is parsed as json rather than yaml. + """ + args = magic_arguments.parse_argstring(vegalite, line) + version = args.version + assert version in RENDERERS["vega-lite"] + VegaLite = RENDERERS["vega-lite"][version] + data_transformers = TRANSFORMERS["vega-lite"][version] + + if args.json: + spec = json.loads(cell) + elif not YAML_AVAILABLE: + try: + spec = json.loads(cell) + except json.JSONDecodeError: + raise ValueError( + "%%vegalite: spec is not valid JSON. " + "Install pyyaml to parse spec as yaml" + ) + else: + spec = yaml.load(cell, Loader=yaml.FullLoader) + + if args.data is not None: + data = _get_variable(args.data) + spec["data"] = _prepare_data(data, data_transformers) + + return VegaLite(spec) diff --git a/runtime/Lib/site-packages/altair/datasets.py b/runtime/Lib/site-packages/altair/datasets.py new file mode 100644 index 0000000000000000000000000000000000000000..7a526b293d979d26f70d2eea3de2fe0c7e8a231c --- /dev/null +++ b/runtime/Lib/site-packages/altair/datasets.py @@ -0,0 +1,22 @@ +"""Datasets for use with Altair (deprecated) + +The functions here are merely thin wrappers for data access routines in the +vega_datasets package. +""" +from altair.utils.deprecation import deprecated + + +@deprecated("load_dataset is deprecated. " "Use the vega_datasets package instead.") +def load_dataset(name): + """Load a dataset by name as a pandas.DataFrame.""" + import vega_datasets + + return vega_datasets.data(name) + + +@deprecated("load_dataset is deprecated. " "Use the vega_datasets package instead.") +def list_datasets(): + """List the available datasets.""" + import vega_datasets + + return vega_datasets.data.list_datasets() diff --git a/runtime/Lib/site-packages/altair/examples/airport_connections.py b/runtime/Lib/site-packages/altair/examples/airport_connections.py new file mode 100644 index 0000000000000000000000000000000000000000..bfd2198bc9436a3acee219a3b940764fb6f4f97e --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/airport_connections.py @@ -0,0 +1,70 @@ +""" +Connections Among U.S. Airports Interactive +------------------------------------------- +This example shows all the connections between major U.S. airports. Lookup transformations +are used to find the coordinates of each airport and connecting airports. Connections +are displayed on mouseover via a single selection. +""" +# category: case studies +import altair as alt +from vega_datasets import data + +# Since these data are each more than 5,000 rows we'll import from the URLs +airports = data.airports.url +flights_airport = data.flights_airport.url + +states = alt.topo_feature(data.us_10m.url, feature="states") + +# Create mouseover selection +select_city = alt.selection_single( + on="mouseover", nearest=True, fields=["origin"], empty="none" +) + +# Define which attributes to lookup from airports.csv +lookup_data = alt.LookupData( + airports, key="iata", fields=["state", "latitude", "longitude"] +) + +background = alt.Chart(states).mark_geoshape( + fill="lightgray", + stroke="white" +).properties( + width=750, + height=500 +).project("albersUsa") + +connections = alt.Chart(flights_airport).mark_rule(opacity=0.35).encode( + latitude="latitude:Q", + longitude="longitude:Q", + latitude2="lat2:Q", + longitude2="lon2:Q" +).transform_lookup( + lookup="origin", + from_=lookup_data +).transform_lookup( + lookup="destination", + from_=lookup_data, + as_=["state", "lat2", "lon2"] +).transform_filter( + select_city +) + +points = alt.Chart(flights_airport).mark_circle().encode( + latitude="latitude:Q", + longitude="longitude:Q", + size=alt.Size("routes:Q", scale=alt.Scale(range=[0, 1000]), legend=None), + order=alt.Order("routes:Q", sort="descending"), + tooltip=["origin:N", "routes:Q"] +).transform_aggregate( + routes="count()", + groupby=["origin"] +).transform_lookup( + lookup="origin", + from_=lookup_data +).transform_filter( + (alt.datum.state != "PR") & (alt.datum.state != "VI") +).add_selection( + select_city +) + +(background + connections + points).configure_view(stroke=None) diff --git a/runtime/Lib/site-packages/altair/examples/airports.py b/runtime/Lib/site-packages/altair/examples/airports.py new file mode 100644 index 0000000000000000000000000000000000000000..8efa4980f69778447a6c648f4f5ea94bf75c0bb8 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/airports.py @@ -0,0 +1,33 @@ +""" +Locations of US Airports +======================== +This is a layered geographic visualization that shows the positions of US +airports on a background of US states. +""" +# category: case studies +import altair as alt +from vega_datasets import data + +airports = data.airports() +states = alt.topo_feature(data.us_10m.url, feature='states') + +# US states background +background = alt.Chart(states).mark_geoshape( + fill='lightgray', + stroke='white' +).properties( + width=500, + height=300 +).project('albersUsa') + +# airport positions on background +points = alt.Chart(airports).mark_circle( + size=10, + color='steelblue' +).encode( + longitude='longitude:Q', + latitude='latitude:Q', + tooltip=['name', 'city', 'state'] +) + +background + points diff --git a/runtime/Lib/site-packages/altair/examples/airports_count.py b/runtime/Lib/site-packages/altair/examples/airports_count.py new file mode 100644 index 0000000000000000000000000000000000000000..be4c6b9c2905a60aa67870d97de81e50f77a89f6 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/airports_count.py @@ -0,0 +1,39 @@ +""" +Locations of US Airports +======================== +This is a layered geographic visualization that shows the positions of US +airports on a background of US states. +""" +# category: maps +import altair as alt +from vega_datasets import data + +airports = data.airports.url +states = alt.topo_feature(data.us_10m.url, feature='states') + +# US states background +background = alt.Chart(states).mark_geoshape( + fill='lightgray', + stroke='white' +).properties( + width=500, + height=300 +).project('albersUsa') + +# airport positions on background +points = alt.Chart(airports).transform_aggregate( + latitude='mean(latitude)', + longitude='mean(longitude)', + count='count()', + groupby=['state'] +).mark_circle().encode( + longitude='longitude:Q', + latitude='latitude:Q', + size=alt.Size('count:Q', title='Number of Airports'), + color=alt.value('steelblue'), + tooltip=['state:N','count:Q'] +).properties( + title='Number of airports in US' +) + +background + points diff --git a/runtime/Lib/site-packages/altair/examples/anscombe_plot.py b/runtime/Lib/site-packages/altair/examples/anscombe_plot.py new file mode 100644 index 0000000000000000000000000000000000000000..9e200748533871f26f7e27c98a9fe82da1c0a47c --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/anscombe_plot.py @@ -0,0 +1,20 @@ +""" +Anscombe's Quartet +------------------ + +This example shows how to use the column channel to make a trellis plot. Anscombe's Quartet is a famous dataset constructed by Francis Anscombe. Common summary statistics are identical for each subset of the data, despite the subsets having vastly different characteristics. +""" +# category: case studies +import altair as alt +from vega_datasets import data + +source = data.anscombe() + +alt.Chart(source).mark_circle().encode( + alt.X('X', scale=alt.Scale(zero=False)), + alt.Y('Y', scale=alt.Scale(zero=False)), + alt.Facet('Series', columns=2), +).properties( + width=180, + height=180, +) diff --git a/runtime/Lib/site-packages/altair/examples/area_chart_gradient.py b/runtime/Lib/site-packages/altair/examples/area_chart_gradient.py new file mode 100644 index 0000000000000000000000000000000000000000..4e2babf3f4d10f50897b80729c08809fa0215356 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/area_chart_gradient.py @@ -0,0 +1,30 @@ +""" +Area Chart with Gradient +------------------------ +This example shows how to make an area chart with a gradient fill. +For more information about gradient options see the Vega-Lite `Gradient documentation `_. +""" +# category: area charts + +import altair as alt +from vega_datasets import data + +source = data.stocks() + +alt.Chart(source).transform_filter( + 'datum.symbol==="GOOG"' +).mark_area( + line={'color':'darkgreen'}, + color=alt.Gradient( + gradient='linear', + stops=[alt.GradientStop(color='white', offset=0), + alt.GradientStop(color='darkgreen', offset=1)], + x1=1, + x2=1, + y1=1, + y2=0 + ) +).encode( + alt.X('date:T'), + alt.Y('price:Q') +) \ No newline at end of file diff --git a/runtime/Lib/site-packages/altair/examples/bar_and_line_with_dual_axis.py b/runtime/Lib/site-packages/altair/examples/bar_and_line_with_dual_axis.py new file mode 100644 index 0000000000000000000000000000000000000000..78e3010ecc582468a3977dcf6aec64e4de142a3d --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/bar_and_line_with_dual_axis.py @@ -0,0 +1,22 @@ +""" +Bar Chart with Line on Dual Axis +-------------------------------- +This example shows how to combine two plots and keep their axes. + +For a more polished version of this chart, see :ref:`gallery_wheat_wages`. +""" +# category: bar charts +import altair as alt +from vega_datasets import data + +source = data.wheat() + +base = alt.Chart(source).encode(x='year:O') + +bar = base.mark_bar().encode(y='wheat:Q') + +line = base.mark_line(color='red').encode( + y='wages:Q' +) + +(bar + line).properties(width=600) diff --git a/runtime/Lib/site-packages/altair/examples/bar_chart_horizontal.py b/runtime/Lib/site-packages/altair/examples/bar_chart_horizontal.py new file mode 100644 index 0000000000000000000000000000000000000000..9d145f7fd908df48f54fd5b5860590849e802871 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/bar_chart_horizontal.py @@ -0,0 +1,15 @@ +""" +Horizontal Bar Chart +-------------------- +This example is a bar chart drawn horizontally by putting the quantitative value on the x axis. +""" +# category: bar charts +import altair as alt +from vega_datasets import data + +source = data.wheat() + +alt.Chart(source).mark_bar().encode( + x='wheat:Q', + y="year:O" +).properties(height=700) diff --git a/runtime/Lib/site-packages/altair/examples/bar_chart_sorted.py b/runtime/Lib/site-packages/altair/examples/bar_chart_sorted.py new file mode 100644 index 0000000000000000000000000000000000000000..1a88deb85e02428b6800e896f76ab776d8d417b1 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/bar_chart_sorted.py @@ -0,0 +1,15 @@ +""" +Sorted Bar Chart +================ +This example shows a bar chart sorted by a calculated value. +""" +# category: bar charts +import altair as alt +from vega_datasets import data + +source = data.barley() + +alt.Chart(source).mark_bar().encode( + x='sum(yield):Q', + y=alt.Y('site:N', sort='-x') +) diff --git a/runtime/Lib/site-packages/altair/examples/bar_chart_trellis_compact.py b/runtime/Lib/site-packages/altair/examples/bar_chart_trellis_compact.py new file mode 100644 index 0000000000000000000000000000000000000000..6fb0114760ca5b62415cb168515e3eaaec1f3d84 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/bar_chart_trellis_compact.py @@ -0,0 +1,50 @@ +""" +Compact Trellis Grid of Bar Charts +================================== +This example shows a simple grid of bar charts to compare performance data.. +""" +# category: bar charts +import altair as alt +import pandas as pd + +source = pd.DataFrame( + [ + {"a": "a1", "b": "b1", "c": "x", "p": "0.14"}, + {"a": "a1", "b": "b1", "c": "y", "p": "0.60"}, + {"a": "a1", "b": "b1", "c": "z", "p": "0.03"}, + {"a": "a1", "b": "b2", "c": "x", "p": "0.80"}, + {"a": "a1", "b": "b2", "c": "y", "p": "0.38"}, + {"a": "a1", "b": "b2", "c": "z", "p": "0.55"}, + {"a": "a1", "b": "b3", "c": "x", "p": "0.11"}, + {"a": "a1", "b": "b3", "c": "y", "p": "0.58"}, + {"a": "a1", "b": "b3", "c": "z", "p": "0.79"}, + {"a": "a2", "b": "b1", "c": "x", "p": "0.83"}, + {"a": "a2", "b": "b1", "c": "y", "p": "0.87"}, + {"a": "a2", "b": "b1", "c": "z", "p": "0.67"}, + {"a": "a2", "b": "b2", "c": "x", "p": "0.97"}, + {"a": "a2", "b": "b2", "c": "y", "p": "0.84"}, + {"a": "a2", "b": "b2", "c": "z", "p": "0.90"}, + {"a": "a2", "b": "b3", "c": "x", "p": "0.74"}, + {"a": "a2", "b": "b3", "c": "y", "p": "0.64"}, + {"a": "a2", "b": "b3", "c": "z", "p": "0.19"}, + {"a": "a3", "b": "b1", "c": "x", "p": "0.57"}, + {"a": "a3", "b": "b1", "c": "y", "p": "0.35"}, + {"a": "a3", "b": "b1", "c": "z", "p": "0.49"}, + {"a": "a3", "b": "b2", "c": "x", "p": "0.91"}, + {"a": "a3", "b": "b2", "c": "y", "p": "0.38"}, + {"a": "a3", "b": "b2", "c": "z", "p": "0.91"}, + {"a": "a3", "b": "b3", "c": "x", "p": "0.99"}, + {"a": "a3", "b": "b3", "c": "y", "p": "0.80"}, + {"a": "a3", "b": "b3", "c": "z", "p": "0.37"}, + ] +) + +alt.Chart(source, width=60, height=alt.Step(8)).mark_bar().encode( + y=alt.Y("c:N", axis=None), + x=alt.X("p:Q", title=None, axis=alt.Axis(format="%")), + color=alt.Color( + "c:N", title="settings", legend=alt.Legend(orient="bottom", titleOrient="left") + ), + row=alt.Row("a:N", title="Factor A", header=alt.Header(labelAngle=0)), + column=alt.Column("b:N", title="Factor B"), +) diff --git a/runtime/Lib/site-packages/altair/examples/bar_chart_with_highlighted_bar.py b/runtime/Lib/site-packages/altair/examples/bar_chart_with_highlighted_bar.py new file mode 100644 index 0000000000000000000000000000000000000000..d277bf9f3eccae3b8cb5b1b734a231be760f05ac --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/bar_chart_with_highlighted_bar.py @@ -0,0 +1,21 @@ +""" +Bar Chart with Highlighted Bar +------------------------------ +This example shows a basic bar chart with a single bar highlighted. +""" +# category: bar charts +import altair as alt +from vega_datasets import data + +source = data.wheat() + +alt.Chart(source).mark_bar().encode( + x='year:O', + y="wheat:Q", + # The highlight will be set on the result of a conditional statement + color=alt.condition( + alt.datum.year == 1810, # If the year is 1810 this test returns True, + alt.value('orange'), # which sets the bar orange. + alt.value('steelblue') # And if it's not true it sets the bar steelblue. + ) +).properties(width=600) diff --git a/runtime/Lib/site-packages/altair/examples/bar_chart_with_highlighted_segment.py b/runtime/Lib/site-packages/altair/examples/bar_chart_with_highlighted_segment.py new file mode 100644 index 0000000000000000000000000000000000000000..3326ac500cbc3fb309c714b06db37eefd7ae0cdb --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/bar_chart_with_highlighted_segment.py @@ -0,0 +1,30 @@ +""" +Bar Chart with Highlighted Segment +---------------------------------- +This example shows a bar chart that highlights values beyond a threshold. +""" +import altair as alt +import pandas as pd +from vega_datasets import data + +source = data.wheat() +threshold = pd.DataFrame([{"threshold": 90}]) + +bars = alt.Chart(source).mark_bar().encode( + x="year:O", + y="wheat:Q", +) + +highlight = alt.Chart(source).mark_bar(color="#e45755").encode( + x='year:O', + y='baseline:Q', + y2='wheat:Q' +).transform_filter( + alt.datum.wheat > 90 +).transform_calculate("baseline", "90") + +rule = alt.Chart(threshold).mark_rule().encode( + y='threshold:Q' +) + +(bars + highlight + rule).properties(width=600) diff --git a/runtime/Lib/site-packages/altair/examples/bar_chart_with_labels.py b/runtime/Lib/site-packages/altair/examples/bar_chart_with_labels.py new file mode 100644 index 0000000000000000000000000000000000000000..2ac67b46418e84c8c31a80ecb23b88a1ef1240a4 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/bar_chart_with_labels.py @@ -0,0 +1,25 @@ +""" +Bar Chart with Labels +===================== +This example shows a basic horizontal bar chart with labels created with Altair. +""" +# category: bar charts +import altair as alt +from vega_datasets import data + +source = data.wheat() + +bars = alt.Chart(source).mark_bar().encode( + x='wheat:Q', + y="year:O" +) + +text = bars.mark_text( + align='left', + baseline='middle', + dx=3 # Nudges text to right so it doesn't appear on top of the bar +).encode( + text='wheat:Q' +) + +(bars + text).properties(height=900) diff --git a/runtime/Lib/site-packages/altair/examples/bar_chart_with_mean_line.py b/runtime/Lib/site-packages/altair/examples/bar_chart_with_mean_line.py new file mode 100644 index 0000000000000000000000000000000000000000..0a4638aecf1466121bd0a18d486d25a1038101b1 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/bar_chart_with_mean_line.py @@ -0,0 +1,21 @@ +""" +Bar Chart with Line at Mean +--------------------------- +This example shows the mean value overlayed on a bar chart. +""" +# category: bar charts +import altair as alt +from vega_datasets import data + +source = data.wheat() + +bar = alt.Chart(source).mark_bar().encode( + x='year:O', + y='wheat:Q' +) + +rule = alt.Chart(source).mark_rule(color='red').encode( + y='mean(wheat):Q' +) + +(bar + rule).properties(width=600) diff --git a/runtime/Lib/site-packages/altair/examples/bar_chart_with_negatives.py b/runtime/Lib/site-packages/altair/examples/bar_chart_with_negatives.py new file mode 100644 index 0000000000000000000000000000000000000000..127a16ba4ffd13f96fcab13c44e5e96d9ea0d534 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/bar_chart_with_negatives.py @@ -0,0 +1,20 @@ +""" +Bar Chart with Negative Values +============================== +This example shows a bar chart with both positive and negative values. +""" +# category: bar charts +import altair as alt +from vega_datasets import data + +source = data.us_employment() + +alt.Chart(source).mark_bar().encode( + x="month:T", + y="nonfarm_change:Q", + color=alt.condition( + alt.datum.nonfarm_change > 0, + alt.value("steelblue"), # The positive color + alt.value("orange") # The negative color + ) +).properties(width=600) diff --git a/runtime/Lib/site-packages/altair/examples/bar_rounded.py b/runtime/Lib/site-packages/altair/examples/bar_rounded.py new file mode 100644 index 0000000000000000000000000000000000000000..3db4cbf37e2754495c7a0d9c98faf076a08a5e5c --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/bar_rounded.py @@ -0,0 +1,19 @@ +""" +Bar Chart with rounded edges +---------------------------- +This example shows how to create a bar chart with rounded edges. +""" +# category: bar charts +import altair as alt +from vega_datasets import data + +source = data.seattle_weather() + +alt.Chart(source).mark_bar( + cornerRadiusTopLeft=3, + cornerRadiusTopRight=3 +).encode( + x='month(date):O', + y='count():Q', + color='weather:N' +) diff --git a/runtime/Lib/site-packages/altair/examples/bar_with_rolling_mean.py b/runtime/Lib/site-packages/altair/examples/bar_with_rolling_mean.py new file mode 100644 index 0000000000000000000000000000000000000000..1f7d9033150d210f74266301bb5cf38b5a27ccb3 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/bar_with_rolling_mean.py @@ -0,0 +1,27 @@ +""" +Bar Chart with Rolling Mean +--------------------------- +A bar chart overlayed with a rolling mean. In this example the average of values over the previous decade is displayed as a line. +""" +# category: bar charts +import altair as alt +from vega_datasets import data + +source = data.wheat() + +bar = alt.Chart(source).mark_bar().encode( + x='year:O', + y='wheat:Q' +) + +line = alt.Chart(source).mark_line(color='red').transform_window( + # The field to average + rolling_mean='mean(wheat)', + # The number of values before and after the current value to include. + frame=[-9, 0] +).encode( + x='year:O', + y='rolling_mean:Q' +) + +(bar + line).properties(width=600) diff --git a/runtime/Lib/site-packages/altair/examples/beckers_barley_trellis_plot.py b/runtime/Lib/site-packages/altair/examples/beckers_barley_trellis_plot.py new file mode 100644 index 0000000000000000000000000000000000000000..4f780d96314606989073db5a56d3ce075a08fdb0 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/beckers_barley_trellis_plot.py @@ -0,0 +1,33 @@ +""" +Becker's Barley Trellis Plot +---------------------------- +The example demonstrates the trellis charts created by Richard Becker, William Cleveland and others in the 1990s. Using the visualization technique below they identified an anomoly in a widely used agriculatural dataset, which they termed `"The Morris Mistake." `_. It became their favored way of showcasing the power of this pioneering plot. +""" +# category: case studies +import altair as alt +from vega_datasets import data + +source = data.barley() + +alt.Chart(source, title="The Morris Mistake").mark_point().encode( + alt.X( + 'yield:Q', + title="Barley Yield (bushels/acre)", + scale=alt.Scale(zero=False), + axis=alt.Axis(grid=False) + ), + alt.Y( + 'variety:N', + title="", + sort='-x', + axis=alt.Axis(grid=True) + ), + color=alt.Color('year:N', legend=alt.Legend(title="Year")), + row=alt.Row( + 'site:N', + title="", + sort=alt.EncodingSortField(field='yield', op='sum', order='descending'), + ) +).properties( + height=alt.Step(20) +).configure_view(stroke="transparent") diff --git a/runtime/Lib/site-packages/altair/examples/beckers_barley_wrapped_facet.py b/runtime/Lib/site-packages/altair/examples/beckers_barley_wrapped_facet.py new file mode 100644 index 0000000000000000000000000000000000000000..e379a7fead49bbad720c9c9c3a48019444f015fc --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/beckers_barley_wrapped_facet.py @@ -0,0 +1,22 @@ +""" +Becker's Barley Trellis Plot (wrapped facet) +-------------------------------------------- +The example demonstrates the trellis charts created by Richard Becker, William Cleveland and others in the 1990s. +This is the Altair replicate of `the VegaLite version `_ +demonstrating the usage of `columns` argument to create wrapped facet. +""" +# category: other charts +import altair as alt +from vega_datasets import data + +source = data.barley.url + +alt.Chart(source).mark_point().encode( + alt.X('median(yield):Q', scale=alt.Scale(zero=False)), + y='variety:O', + color='year:N', + facet=alt.Facet('site:O', columns=2), +).properties( + width=200, + height=100, +) diff --git a/runtime/Lib/site-packages/altair/examples/binned_heatmap.py b/runtime/Lib/site-packages/altair/examples/binned_heatmap.py new file mode 100644 index 0000000000000000000000000000000000000000..ecdaab81374156a538cdc92fa166320a9510292c --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/binned_heatmap.py @@ -0,0 +1,16 @@ +""" +Binned Heatmap +-------------- +This example shows how to make a heatmap from binned quantitative data. +""" +# category: other charts +import altair as alt +from vega_datasets import data + +source = data.movies.url + +alt.Chart(source).mark_rect().encode( + alt.X('IMDB_Rating:Q', bin=alt.Bin(maxbins=60)), + alt.Y('Rotten_Tomatoes_Rating:Q', bin=alt.Bin(maxbins=40)), + alt.Color('count():Q', scale=alt.Scale(scheme='greenblue')) +) diff --git a/runtime/Lib/site-packages/altair/examples/binned_scatterplot.py b/runtime/Lib/site-packages/altair/examples/binned_scatterplot.py new file mode 100644 index 0000000000000000000000000000000000000000..413aacba2ce24da741b6c1f386c7334659676845 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/binned_scatterplot.py @@ -0,0 +1,16 @@ +""" +Binned Scatterplot +------------------ +This example shows how to make a binned scatterplot. +""" +# category: scatter plots +import altair as alt +from vega_datasets import data + +source = data.movies.url + +alt.Chart(source).mark_circle().encode( + alt.X('IMDB_Rating:Q', bin=True), + alt.Y('Rotten_Tomatoes_Rating:Q', bin=True), + size='count()' +) diff --git a/runtime/Lib/site-packages/altair/examples/boxplot.py b/runtime/Lib/site-packages/altair/examples/boxplot.py new file mode 100644 index 0000000000000000000000000000000000000000..31cd62f42db8cab10ebde58a46bccb24f6fa1754 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/boxplot.py @@ -0,0 +1,18 @@ +""" +Boxplot with Min/Max Whiskers +------------------------------ +This example shows how to make a boxplot using US Population data from 2000. +Note that the default value of the `extent` property is 1.5, +which represents the convention of extending the whiskers +to the furthest points within 1.5 * IQR from the first and third quartile. +""" +# category: other charts +import altair as alt +from vega_datasets import data + +source = data.population.url + +alt.Chart(source).mark_boxplot(extent='min-max').encode( + x='age:O', + y='people:Q' +) diff --git a/runtime/Lib/site-packages/altair/examples/bubble_plot.py b/runtime/Lib/site-packages/altair/examples/bubble_plot.py new file mode 100644 index 0000000000000000000000000000000000000000..44b74bced4654c696211a9da654d5c56c15fd5db --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/bubble_plot.py @@ -0,0 +1,16 @@ +""" +Bubble Plot +----------------- +This example shows how to make a bubble plot. +""" +# category: scatter plots +import altair as alt +from vega_datasets import data + +source = data.cars() + +alt.Chart(source).mark_point().encode( + x='Horsepower', + y='Miles_per_Gallon', + size='Acceleration' +) diff --git a/runtime/Lib/site-packages/altair/examples/bump_chart.py b/runtime/Lib/site-packages/altair/examples/bump_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..1586b956e724078115cd9f54cefaa9d3f3d38f2b --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/bump_chart.py @@ -0,0 +1,29 @@ +""" +Bump Chart +---------- +This example shows a bump chart. The data is first grouped into six-month +intervals using pandas. The ranks are computed by Altair using a +window transform. +""" +# category: line charts + +import altair as alt +from vega_datasets import data +import pandas as pd + +stocks = data.stocks() +source = stocks.groupby([pd.Grouper(key="date", freq="6M"),"symbol"]).mean().reset_index() + +alt.Chart(source).mark_line(point = True).encode( + x = alt.X("date:O", timeUnit="yearmonth", title="date"), + y="rank:O", + color=alt.Color("symbol:N") +).transform_window( + rank="rank()", + sort=[alt.SortField("price", order="descending")], + groupby=["date"] +).properties( + title="Bump Chart for Stock Prices", + width=600, + height=150, +) \ No newline at end of file diff --git a/runtime/Lib/site-packages/altair/examples/candlestick_chart.py b/runtime/Lib/site-packages/altair/examples/candlestick_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..1997cda3d280defeb11d45c8e7f1f3051dc7bc43 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/candlestick_chart.py @@ -0,0 +1,44 @@ +""" +Candlestick Chart +================= +A candlestick chart inspired from `Protovis `_. +This example shows the performance of the Chicago Board Options Exchange `Volatility Index `_ (VIX) +in the summer of 2009. The thick bar represents the opening and closing prices, +while the thin bar shows intraday high and low prices; if the index closed higher on a given day, the bars are colored green rather than red. +""" +# category: other charts +import altair as alt +from vega_datasets import data + +source = data.ohlc() + +open_close_color = alt.condition("datum.open <= datum.close", + alt.value("#06982d"), + alt.value("#ae1325")) + +base = alt.Chart(source).encode( + alt.X('date:T', + axis=alt.Axis( + format='%m/%d', + labelAngle=-45, + title='Date in 2009' + ) + ), + color=open_close_color +) + +rule = base.mark_rule().encode( + alt.Y( + 'low:Q', + title='Price', + scale=alt.Scale(zero=False), + ), + alt.Y2('high:Q') +) + +bar = base.mark_bar().encode( + alt.Y('open:Q'), + alt.Y2('close:Q') +) + +rule + bar \ No newline at end of file diff --git a/runtime/Lib/site-packages/altair/examples/choropleth.py b/runtime/Lib/site-packages/altair/examples/choropleth.py new file mode 100644 index 0000000000000000000000000000000000000000..889edb2f5cc693a63487bce8da62fb3a8c9f1e37 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/choropleth.py @@ -0,0 +1,23 @@ +""" +Choropleth Map +============== +A choropleth map of unemployment rate per county in the US +""" +# category: maps +import altair as alt +from vega_datasets import data + +counties = alt.topo_feature(data.us_10m.url, 'counties') +source = data.unemployment.url + +alt.Chart(counties).mark_geoshape().encode( + color='rate:Q' +).transform_lookup( + lookup='id', + from_=alt.LookupData(source, 'id', ['rate']) +).project( + type='albersUsa' +).properties( + width=500, + height=300 +) diff --git a/runtime/Lib/site-packages/altair/examples/choropleth_repeat.py b/runtime/Lib/site-packages/altair/examples/choropleth_repeat.py new file mode 100644 index 0000000000000000000000000000000000000000..3cd913ec4872465964639eefebde3d5763de57c1 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/choropleth_repeat.py @@ -0,0 +1,28 @@ +""" +Repeated Choropleth Map +======================= +Three choropleths representing disjoint data from the same table. +""" +# category: maps +import altair as alt +from vega_datasets import data + +states = alt.topo_feature(data.us_10m.url, 'states') +source = data.population_engineers_hurricanes.url +variable_list = ['population', 'engineers', 'hurricanes'] + +alt.Chart(states).mark_geoshape().encode( + alt.Color(alt.repeat('row'), type='quantitative') +).transform_lookup( + lookup='id', + from_=alt.LookupData(source, 'id', variable_list) +).properties( + width=500, + height=300 +).project( + type='albersUsa' +).repeat( + row=variable_list +).resolve_scale( + color='independent' +) diff --git a/runtime/Lib/site-packages/altair/examples/co2_concentration.py b/runtime/Lib/site-packages/altair/examples/co2_concentration.py new file mode 100644 index 0000000000000000000000000000000000000000..cd53d4ed773bfa4dc0acdff6e5bf86193b55376e --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/co2_concentration.py @@ -0,0 +1,65 @@ +""" +Atmospheric CO2 Concentration +----------------------------- +This example is a fully developed line chart that uses a window transformation. +It was inspired by `Gregor Aisch's work at datawrapper +`_. +""" +# category: case studies +import altair as alt +from vega_datasets import data + +source = data.co2_concentration.url + +base = alt.Chart( + source, + title="Carbon Dioxide in the Atmosphere" +).transform_calculate( + year="year(datum.Date)" +).transform_calculate( + decade="floor(datum.year / 10)" +).transform_calculate( + scaled_date="(datum.year % 10) + (month(datum.Date)/12)" +).transform_window( + first_date='first_value(scaled_date)', + last_date='last_value(scaled_date)', + sort=[{"field": "scaled_date", "order": "ascending"}], + groupby=['decade'], + frame=[None, None] +).transform_calculate( + end="datum.first_date === datum.scaled_date ? 'first' : datum.last_date === datum.scaled_date ? 'last' : null" +).encode( + x=alt.X( + "scaled_date:Q", + axis=alt.Axis(title="Year into Decade", tickCount=11) + ), + y=alt.Y( + "CO2:Q", + title="CO2 concentration in ppm", + scale=alt.Scale(zero=False) + ) +) + +line = base.mark_line().encode( + color=alt.Color( + "decade:O", + scale=alt.Scale(scheme="magma"), + legend=None + ) +) + +text = base.encode(text="year:N") + +start_year = text.transform_filter( + alt.datum.end == 'first' +).mark_text(baseline="top") + +end_year = text.transform_filter( + alt.datum.end == 'last' +).mark_text(baseline="bottom") + +(line + start_year + end_year).configure_text( + align="left", + dx=1, + dy=3 +).properties(width=600, height=375) diff --git a/runtime/Lib/site-packages/altair/examples/comet_chart.py b/runtime/Lib/site-packages/altair/examples/comet_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..e0749a0abb09e653f78d5813343433d22b083c8c --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/comet_chart.py @@ -0,0 +1,32 @@ +""" +Comet Chart Example +---------------------------- +Inspired by `Zan Armstrong's comet chart `_ +this plot uses ``mark_trail`` to visualize change of grouped data over time. +A more elaborate example and explanation of creating comet charts in Altair +is shown in `this blogpost `_. +""" +# category: other charts + +import altair as alt +import vega_datasets + +( + alt.Chart(vega_datasets.data.barley.url) + .transform_pivot("year", value="yield", groupby=["variety", "site"]) + .transform_fold(["1931", "1932"], as_=["year", "yield"]) + .transform_calculate(calculate="datum['1932'] - datum['1931']", as_="delta") + .mark_trail() + .encode( + x=alt.X('year:O', title=None), + y=alt.Y('variety:N', title='Variety'), + size=alt.Size('yield:Q', scale=alt.Scale(range=[0, 12]), legend=alt.Legend(values=[20, 60], title='Barley Yield (bushels/acre)')), + color=alt.Color('delta:Q', scale=alt.Scale(domainMid=0), legend=alt.Legend(title='Yield Delta (%)')), + tooltip=alt.Tooltip(['year:O', 'yield:Q']), + column=alt.Column('site:N', title='Site') + + ) + .configure_view(stroke=None) + .configure_legend(orient='bottom', direction='horizontal') + .properties(title='Barley Yield comparison between 1932 and 1931') +) diff --git a/runtime/Lib/site-packages/altair/examples/connected_scatterplot.py b/runtime/Lib/site-packages/altair/examples/connected_scatterplot.py new file mode 100644 index 0000000000000000000000000000000000000000..39f27d813b1b945bfa1e8fb7aa69880968a21272 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/connected_scatterplot.py @@ -0,0 +1,18 @@ +""" +Connected Scatterplot (Lines with Custom Paths) +----------------------------------------------- + +This example show how the order encoding can be used to draw a custom path. The dataset tracks miles driven per capita along with gas prices annually from 1956 to 2010. +It is based on Hannah Fairfield's article 'Driving Shifts Into Reverse'. See https://archive.nytimes.com/www.nytimes.com/imagepages/2010/05/02/business/02metrics.html for the original. +""" +# category: scatter plots +import altair as alt +from vega_datasets import data + +source = data.driving() + +alt.Chart(source).mark_line(point=True).encode( + alt.X('miles', scale=alt.Scale(zero=False)), + alt.Y('gas', scale=alt.Scale(zero=False)), + order='year' +) diff --git a/runtime/Lib/site-packages/altair/examples/cumulative_count_chart.py b/runtime/Lib/site-packages/altair/examples/cumulative_count_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..810a614936ebbb8e0d58f05fc7f39e58b773e899 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/cumulative_count_chart.py @@ -0,0 +1,21 @@ +""" +Cumulative Count Chart +---------------------- +This example shows an area chart with cumulative count. +Adapted from https://vega.github.io/vega-lite/examples/area_cumulative_freq.html + +""" +# category: area charts + +import altair as alt +from vega_datasets import data + +source = data.movies.url + +alt.Chart(source).transform_window( + cumulative_count="count()", + sort=[{"field": "IMDB_Rating"}], +).mark_area().encode( + x="IMDB_Rating:Q", + y="cumulative_count:Q" +) diff --git a/runtime/Lib/site-packages/altair/examples/cumulative_wiki_donations.py b/runtime/Lib/site-packages/altair/examples/cumulative_wiki_donations.py new file mode 100644 index 0000000000000000000000000000000000000000..9c193aba221d269359492aaada1f340a8a0ee516 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/cumulative_wiki_donations.py @@ -0,0 +1,17 @@ +""" +Cumulative Wikipedia Donations +============================== + +This chart shows cumulative donations to Wikipedia over the past 10 years. Inspired by this `Reddit post `_ but using lines instead of areas. +""" +# category: case studies +import altair as alt + +source = "https://frdata.wikimedia.org/donationdata-vs-day.csv" + +alt.Chart(source).mark_line().encode( + alt.X('monthdate(date):T', title='Month', axis=alt.Axis(format='%B')), + alt.Y('max(ytdsum):Q', title='Cumulative Donations', stack=None), + alt.Color('year(date):O', legend=alt.Legend(title='Year')), + alt.Order('year(data):O') +) diff --git a/runtime/Lib/site-packages/altair/examples/density_facet.py b/runtime/Lib/site-packages/altair/examples/density_facet.py new file mode 100644 index 0000000000000000000000000000000000000000..e8b1bbe78f42d2f564e806de35e3e12992909f57 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/density_facet.py @@ -0,0 +1,28 @@ +""" +Faceted Density Estimates +------------------------- +Density estimates of measurements for each iris flower feature +""" +# category: area charts + +import altair as alt +from vega_datasets import data + +source = data.iris() + +alt.Chart(source).transform_fold( + ['petalWidth', + 'petalLength', + 'sepalWidth', + 'sepalLength'], + as_ = ['Measurement_type', 'value'] +).transform_density( + density='value', + bandwidth=0.3, + groupby=['Measurement_type'], + extent= [0, 8] +).mark_area().encode( + alt.X('value:Q'), + alt.Y('density:Q'), + alt.Row('Measurement_type:N') +).properties(width=300, height=50) diff --git a/runtime/Lib/site-packages/altair/examples/density_stack.py b/runtime/Lib/site-packages/altair/examples/density_stack.py new file mode 100644 index 0000000000000000000000000000000000000000..2fdbdc06ade9203a16320fb0513bbddd8c1c5abb --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/density_stack.py @@ -0,0 +1,35 @@ +""" +Stacked Density Estimates +------------------------- +To plot a stacked graph of estimates, use a shared ``extent`` and a fixed +number of subdivision ``steps`` to ensure that the points for each area align +well. Density estimates of measurements for each iris flower feature are plot +in a stacked method. In addition, setting ``counts`` to true multiplies the +densities by the number of data points in each group, preserving proportional +differences. +""" +# category: area charts + +import altair as alt +from vega_datasets import data + +source = data.iris() + +alt.Chart(source).transform_fold( + ['petalWidth', + 'petalLength', + 'sepalWidth', + 'sepalLength'], + as_ = ['Measurement_type', 'value'] +).transform_density( + density='value', + bandwidth=0.3, + groupby=['Measurement_type'], + extent= [0, 8], + counts = True, + steps=200 +).mark_area().encode( + alt.X('value:Q'), + alt.Y('density:Q', stack='zero'), + alt.Color('Measurement_type:N') +).properties(width=400, height=100) diff --git a/runtime/Lib/site-packages/altair/examples/diverging_stacked_bar_chart.py b/runtime/Lib/site-packages/altair/examples/diverging_stacked_bar_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..cb2c218329a63a7f072df0c0667c6d247029e7c0 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/diverging_stacked_bar_chart.py @@ -0,0 +1,367 @@ +""" +Diverging Stacked Bar Chart +--------------------------- +This example shows a diverging stacked bar chart for sentiments towards a set of eight questions, displayed as percentages with neutral responses straddling the 0% mark. +""" +# category: bar charts +import altair as alt + +source = alt.pd.DataFrame([ + { + "question": "Question 1", + "type": "Strongly disagree", + "value": 24, + "percentage": 0.7, + "percentage_start": -19.1, + "percentage_end": -18.4 + }, + { + "question": "Question 1", + "type": "Disagree", + "value": 294, + "percentage": 9.1, + "percentage_start": -18.4, + "percentage_end": -9.2 + }, + { + "question": "Question 1", + "type": "Neither agree nor disagree", + "value": 594, + "percentage": 18.5, + "percentage_start": -9.2, + "percentage_end": 9.2 + }, + { + "question": "Question 1", + "type": "Agree", + "value": 1927, + "percentage": 59.9, + "percentage_start": 9.2, + "percentage_end": 69.2 + }, + { + "question": "Question 1", + "type": "Strongly agree", + "value": 376, + "percentage": 11.7, + "percentage_start": 69.2, + "percentage_end": 80.9 + }, + + { + "question": "Question 2", + "type": "Strongly disagree", + "value": 2, + "percentage": 18.2, + "percentage_start": -36.4, + "percentage_end": -18.2 + }, + { + "question": "Question 2", + "type": "Disagree", + "value": 2, + "percentage": 18.2, + "percentage_start": -18.2, + "percentage_end": 0 + }, + { + "question": "Question 2", + "type": "Neither agree nor disagree", + "value": 0, + "percentage": 0, + "percentage_start": 0, + "percentage_end": 0 + }, + { + "question": "Question 2", + "type": "Agree", + "value": 7, + "percentage": 63.6, + "percentage_start": 0, + "percentage_end": 63.6 + }, + { + "question": "Question 2", + "type": "Strongly agree", + "value": 11, + "percentage": 0, + "percentage_start": 63.6, + "percentage_end": 63.6 + }, + + { + "question": "Question 3", + "type": "Strongly disagree", + "value": 2, + "percentage": 20, + "percentage_start": -30, + "percentage_end": -10 + }, + { + "question": "Question 3", + "type": "Disagree", + "value": 0, + "percentage": 0, + "percentage_start": -10, + "percentage_end": -10 + }, + { + "question": "Question 3", + "type": "Neither agree nor disagree", + "value": 2, + "percentage": 20, + "percentage_start": -10, + "percentage_end": 10 + }, + { + "question": "Question 3", + "type": "Agree", + "value": 4, + "percentage": 40, + "percentage_start": 10, + "percentage_end": 50 + }, + { + "question": "Question 3", + "type": "Strongly agree", + "value": 2, + "percentage": 20, + "percentage_start": 50, + "percentage_end": 70 + }, + + { + "question": "Question 4", + "type": "Strongly disagree", + "value": 0, + "percentage": 0, + "percentage_start": -15.6, + "percentage_end": -15.6 + }, + { + "question": "Question 4", + "type": "Disagree", + "value": 2, + "percentage": 12.5, + "percentage_start": -15.6, + "percentage_end": -3.1 + }, + { + "question": "Question 4", + "type": "Neither agree nor disagree", + "value": 1, + "percentage": 6.3, + "percentage_start": -3.1, + "percentage_end": 3.1 + }, + { + "question": "Question 4", + "type": "Agree", + "value": 7, + "percentage": 43.8, + "percentage_start": 3.1, + "percentage_end": 46.9 + }, + { + "question": "Question 4", + "type": "Strongly agree", + "value": 6, + "percentage": 37.5, + "percentage_start": 46.9, + "percentage_end": 84.4 + }, + + { + "question": "Question 5", + "type": "Strongly disagree", + "value": 0, + "percentage": 0, + "percentage_start": -10.4, + "percentage_end": -10.4 + }, + { + "question": "Question 5", + "type": "Disagree", + "value": 1, + "percentage": 4.2, + "percentage_start": -10.4, + "percentage_end": -6.3 + }, + { + "question": "Question 5", + "type": "Neither agree nor disagree", + "value": 3, + "percentage": 12.5, + "percentage_start": -6.3, + "percentage_end": 6.3 + }, + { + "question": "Question 5", + "type": "Agree", + "value": 16, + "percentage": 66.7, + "percentage_start": 6.3, + "percentage_end": 72.9 + }, + { + "question": "Question 5", + "type": "Strongly agree", + "value": 4, + "percentage": 16.7, + "percentage_start": 72.9, + "percentage_end": 89.6 + }, + + { + "question": "Question 6", + "type": "Strongly disagree", + "value": 1, + "percentage": 6.3, + "percentage_start": -18.8, + "percentage_end": -12.5 + }, + { + "question": "Question 6", + "type": "Disagree", + "value": 1, + "percentage": 6.3, + "percentage_start": -12.5, + "percentage_end": -6.3 + }, + { + "question": "Question 6", + "type": "Neither agree nor disagree", + "value": 2, + "percentage": 12.5, + "percentage_start": -6.3, + "percentage_end": 6.3 + }, + { + "question": "Question 6", + "type": "Agree", + "value": 9, + "percentage": 56.3, + "percentage_start": 6.3, + "percentage_end": 62.5 + }, + { + "question": "Question 6", + "type": "Strongly agree", + "value": 3, + "percentage": 18.8, + "percentage_start": 62.5, + "percentage_end": 81.3 + }, + + { + "question": "Question 7", + "type": "Strongly disagree", + "value": 0, + "percentage": 0, + "percentage_start": -10, + "percentage_end": -10 + }, + { + "question": "Question 7", + "type": "Disagree", + "value": 0, + "percentage": 0, + "percentage_start": -10, + "percentage_end": -10 + }, + { + "question": "Question 7", + "type": "Neither agree nor disagree", + "value": 1, + "percentage": 20, + "percentage_start": -10, + "percentage_end": 10 + }, + { + "question": "Question 7", + "type": "Agree", + "value": 4, + "percentage": 80, + "percentage_start": 10, + "percentage_end": 90 + }, + { + "question": "Question 7", + "type": "Strongly agree", + "value": 0, + "percentage": 0, + "percentage_start": 90, + "percentage_end": 90 + }, + + { + "question": "Question 8", + "type": "Strongly disagree", + "value": 0, + "percentage": 0, + "percentage_start": 0, + "percentage_end": 0 + }, + { + "question": "Question 8", + "type": "Disagree", + "value": 0, + "percentage": 0, + "percentage_start": 0, + "percentage_end": 0 + }, + { + "question": "Question 8", + "type": "Neither agree nor disagree", + "value": 0, + "percentage": 0, + "percentage_start": 0, + "percentage_end": 0 + }, + { + "question": "Question 8", + "type": "Agree", + "value": 0, + "percentage": 0, + "percentage_start": 0, + "percentage_end": 0 + }, + { + "question": "Question 8", + "type": "Strongly agree", + "value": 2, + "percentage": 100, + "percentage_start": 0, + "percentage_end": 100 + } +]) + +color_scale = alt.Scale( + domain=[ + "Strongly disagree", + "Disagree", + "Neither agree nor disagree", + "Agree", + "Strongly agree" + ], + range=["#c30d24", "#f3a583", "#cccccc", "#94c6da", "#1770ab"] +) + +y_axis = alt.Axis( + title='Question', + offset=5, + ticks=False, + minExtent=60, + domain=False +) + +alt.Chart(source).mark_bar().encode( + x='percentage_start:Q', + x2='percentage_end:Q', + y=alt.Y('question:N', axis=y_axis), + color=alt.Color( + 'type:N', + legend=alt.Legend( title='Response'), + scale=color_scale, + ) +) diff --git a/runtime/Lib/site-packages/altair/examples/donut_chart.py b/runtime/Lib/site-packages/altair/examples/donut_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..32498a56d7eb08aac93f862f8596d3ee1cdf9b1c --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/donut_chart.py @@ -0,0 +1,18 @@ +""" +Donut Chart +----------- +This example shows how to make a Donut Chart using ``mark_arc``. +This is adapted from a corresponding Vega-Lite Example: +`Donut Chart `_. +""" +# category: circular plots + +import pandas as pd +import altair as alt + +source = pd.DataFrame({"category": [1, 2, 3, 4, 5, 6], "value": [4, 6, 10, 3, 7, 8]}) + +alt.Chart(source).mark_arc(innerRadius=50).encode( + theta=alt.Theta(field="value", type="quantitative"), + color=alt.Color(field="category", type="nominal"), +) diff --git a/runtime/Lib/site-packages/altair/examples/dot_dash_plot.py b/runtime/Lib/site-packages/altair/examples/dot_dash_plot.py new file mode 100644 index 0000000000000000000000000000000000000000..4554082c8bfad9af04a96205f27d8638e423e719 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/dot_dash_plot.py @@ -0,0 +1,40 @@ +""" +Dot Dash Plot +============= +How to make the dot-dash plot presented in Edward Tufte's `Visual Display of Quantitative Information `_. Based +on a JavaScript implementation by `g3o2 `_. +""" +# category: scatter plots +import altair as alt +from vega_datasets import data + +source = data.cars() + +# Configure the options common to all layers +brush = alt.selection(type='interval') +base = alt.Chart(source).add_selection(brush) + +# Configure the points +points = base.mark_point().encode( + x=alt.X('Miles_per_Gallon', title=''), + y=alt.Y('Horsepower', title=''), + color=alt.condition(brush, 'Origin', alt.value('grey')) +) + +# Configure the ticks +tick_axis = alt.Axis(labels=False, domain=False, ticks=False) + +x_ticks = base.mark_tick().encode( + alt.X('Miles_per_Gallon', axis=tick_axis), + alt.Y('Origin', title='', axis=tick_axis), + color=alt.condition(brush, 'Origin', alt.value('lightgrey')) +) + +y_ticks = base.mark_tick().encode( + alt.X('Origin', title='', axis=tick_axis), + alt.Y('Horsepower', axis=tick_axis), + color=alt.condition(brush, 'Origin', alt.value('lightgrey')) +) + +# Build the chart +y_ticks | (points & x_ticks) diff --git a/runtime/Lib/site-packages/altair/examples/errorbars_with_ci.py b/runtime/Lib/site-packages/altair/examples/errorbars_with_ci.py new file mode 100644 index 0000000000000000000000000000000000000000..ec70b27b4943e0bc64b0f8d0fcc7cd45c3ffbac3 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/errorbars_with_ci.py @@ -0,0 +1,24 @@ +""" +Error Bars showing Confidence Interval +====================================== +This example shows how to show error bars using confidence intervals. +The confidence intervals are computed internally in vega by a non-parametric +`bootstrap of the mean `_. +""" +# category: other charts +import altair as alt +from vega_datasets import data + +source = data.barley() + +error_bars = alt.Chart(source).mark_errorbar(extent='ci').encode( + x=alt.X('yield:Q', scale=alt.Scale(zero=False)), + y=alt.Y('variety:N') +) + +points = alt.Chart(source).mark_point(filled=True, color='black').encode( + x=alt.X('yield:Q', aggregate='mean'), + y=alt.Y('variety:N'), +) + +error_bars + points diff --git a/runtime/Lib/site-packages/altair/examples/errorbars_with_std.py b/runtime/Lib/site-packages/altair/examples/errorbars_with_std.py new file mode 100644 index 0000000000000000000000000000000000000000..1864e0ece7a57a76342a790b89d9216363aa0b8f --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/errorbars_with_std.py @@ -0,0 +1,23 @@ +""" +Error Bar with Standard Deviation +--------------------------------- +This example shows how to show error bars with standard deviation using crop yields data of different +in the years of 1930s. +""" +# category: other charts +import altair as alt +from vega_datasets import data + +source = data.barley() + +error_bars = alt.Chart(source).mark_errorbar(extent='stdev').encode( + x=alt.X('yield:Q', scale=alt.Scale(zero=False)), + y=alt.Y('variety:N') +) + +points = alt.Chart(source).mark_point(filled=True, color='black').encode( + x=alt.X('yield:Q', aggregate='mean'), + y=alt.Y('variety:N'), +) + +error_bars + points diff --git a/runtime/Lib/site-packages/altair/examples/falkensee.py b/runtime/Lib/site-packages/altair/examples/falkensee.py new file mode 100644 index 0000000000000000000000000000000000000000..ff91fe72ae81f7d3cbcb51484dfd3b229aefa1cb --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/falkensee.py @@ -0,0 +1,82 @@ +""" +Falkensee +----------------------- +This example is a reproduction of the Falkensee plot found in the vega-lite examples. +""" +# category: case studies +import altair as alt + +source = [ + {"year": "1875", "population": 1309}, + {"year": "1890", "population": 1558}, + {"year": "1910", "population": 4512}, + {"year": "1925", "population": 8180}, + {"year": "1933", "population": 15915}, + {"year": "1939", "population": 24824}, + {"year": "1946", "population": 28275}, + {"year": "1950", "population": 29189}, + {"year": "1964", "population": 29881}, + {"year": "1971", "population": 26007}, + {"year": "1981", "population": 24029}, + {"year": "1985", "population": 23340}, + {"year": "1989", "population": 22307}, + {"year": "1990", "population": 22087}, + {"year": "1991", "population": 22139}, + {"year": "1992", "population": 22105}, + {"year": "1993", "population": 22242}, + {"year": "1994", "population": 22801}, + {"year": "1995", "population": 24273}, + {"year": "1996", "population": 25640}, + {"year": "1997", "population": 27393}, + {"year": "1998", "population": 29505}, + {"year": "1999", "population": 32124}, + {"year": "2000", "population": 33791}, + {"year": "2001", "population": 35297}, + {"year": "2002", "population": 36179}, + {"year": "2003", "population": 36829}, + {"year": "2004", "population": 37493}, + {"year": "2005", "population": 38376}, + {"year": "2006", "population": 39008}, + {"year": "2007", "population": 39366}, + {"year": "2008", "population": 39821}, + {"year": "2009", "population": 40179}, + {"year": "2010", "population": 40511}, + {"year": "2011", "population": 40465}, + {"year": "2012", "population": 40905}, + {"year": "2013", "population": 41258}, + {"year": "2014", "population": 41777} + ] + +source2 = [{ + "start": "1933", + "end": "1945", + "event": "Nazi Rule" + }, + { + "start": "1948", + "end": "1989", + "event": "GDR (East Germany)" + }] + + +source = alt.pd.DataFrame(source) +source2 = alt.pd.DataFrame(source2) + + +line = alt.Chart(source).mark_line(color='#333').encode( + alt.X('year:T', axis=alt.Axis(format='%Y')), + y='population' +).properties( + width=500, + height=300 +) + +point = line.mark_point(color='#333') + +rect = alt.Chart(source2).mark_rect().encode( + x='start:T', + x2='end:T', + color='event:N' +) + +rect + line + point diff --git a/runtime/Lib/site-packages/altair/examples/filled_step_chart.py b/runtime/Lib/site-packages/altair/examples/filled_step_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..dadb5770e54d385c8b02c2f78a139046931ded91 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/filled_step_chart.py @@ -0,0 +1,19 @@ +""" +Filled Step Chart +----------------- +This example shows Google's stock price over time as a step chart with its area filled in and its line emphasized. +""" +# category: line charts +import altair as alt +from vega_datasets import data + +source = data.stocks() + +alt.Chart(source).mark_area( + color="lightblue", + interpolate='step-after', + line=True +).encode( + x='date', + y='price' +).transform_filter(alt.datum.symbol == 'GOOG') diff --git a/runtime/Lib/site-packages/altair/examples/gantt_chart.py b/runtime/Lib/site-packages/altair/examples/gantt_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..6368890a13c5a4cf55b0d1a0de5fa05d94a650f4 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/gantt_chart.py @@ -0,0 +1,20 @@ +""" +Gantt Chart +----------------- +This example shows how to make a simple Gantt chart. +""" +# category: other charts +import altair as alt +import pandas as pd + +source = pd.DataFrame([ + {"task": "A", "start": 1, "end": 3}, + {"task": "B", "start": 3, "end": 8}, + {"task": "C", "start": 8, "end": 10} +]) + +alt.Chart(source).mark_bar().encode( + x='start', + x2='end', + y='task' +) diff --git a/runtime/Lib/site-packages/altair/examples/gapminder_bubble_plot.py b/runtime/Lib/site-packages/altair/examples/gapminder_bubble_plot.py new file mode 100644 index 0000000000000000000000000000000000000000..381f81017144930d69d6ff7eb9c2dd239430296f --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/gapminder_bubble_plot.py @@ -0,0 +1,18 @@ +""" +Gapminder Bubble Plot +===================== +This example shows how to make a bubble plot showing the correlation between +health and income for 187 countries in the world (modified from an example +in Lisa Charlotte Rost's blog post `'One Chart, Twelve Charting Libraries' `_. +""" +# category: case studies +import altair as alt +from vega_datasets import data + +source = data.gapminder_health_income.url + +alt.Chart(source).mark_circle().encode( + alt.X('income:Q', scale=alt.Scale(type='log')), + alt.Y('health:Q', scale=alt.Scale(zero=False)), + size='population:Q' +) diff --git a/runtime/Lib/site-packages/altair/examples/grouped_bar_chart.py b/runtime/Lib/site-packages/altair/examples/grouped_bar_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..211167b9484f9d2f352fdd6f8162d3b7d6b4b5d1 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/grouped_bar_chart.py @@ -0,0 +1,17 @@ +""" +Grouped Bar Chart +----------------- +This example shows a grouped bar chart. +""" +# category: bar charts +import altair as alt +from vega_datasets import data + +source = data.barley() + +alt.Chart(source).mark_bar().encode( + x='year:O', + y='sum(yield):Q', + color='year:N', + column='site:N' +) diff --git a/runtime/Lib/site-packages/altair/examples/grouped_bar_chart_horizontal.py b/runtime/Lib/site-packages/altair/examples/grouped_bar_chart_horizontal.py new file mode 100644 index 0000000000000000000000000000000000000000..b4ac2ec81636a48d2f10bb3ef138e9011f03243b --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/grouped_bar_chart_horizontal.py @@ -0,0 +1,17 @@ +""" +Horizontal Grouped Bar Chart +---------------------------- +This example shows a horizontal grouped bar chart. +""" +# category: bar charts +import altair as alt +from vega_datasets import data + +source = data.barley() + +alt.Chart(source).mark_bar().encode( + x='sum(yield):Q', + y='year:O', + color='year:N', + row='site:N' +) diff --git a/runtime/Lib/site-packages/altair/examples/grouped_bar_chart_with_error_bars.py b/runtime/Lib/site-packages/altair/examples/grouped_bar_chart_with_error_bars.py new file mode 100644 index 0000000000000000000000000000000000000000..c1eab965d7ec6a97360642d779589dd1882f3991 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/grouped_bar_chart_with_error_bars.py @@ -0,0 +1,25 @@ +""" +Grouped Bar Chart with Error Bars +--------------------------------- +This example shows a grouped bar chart with error bars. +""" +# category: bar charts +import altair as alt +from vega_datasets import data + +source = data.barley() + +bars = alt.Chart().mark_bar().encode( + x='year:O', + y=alt.Y('mean(yield):Q', title='Mean Yield'), + color='year:N', +) + +error_bars = alt.Chart().mark_errorbar(extent='ci').encode( + x='year:O', + y='yield:Q' +) + +alt.layer(bars, error_bars, data=source).facet( + column='site:N' +) diff --git a/runtime/Lib/site-packages/altair/examples/hexbins.py b/runtime/Lib/site-packages/altair/examples/hexbins.py new file mode 100644 index 0000000000000000000000000000000000000000..974630e625a96c0a3b374d18739f6e166f6ef470 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/hexbins.py @@ -0,0 +1,43 @@ +""" +Hexbin Chart +----------------- +This example shows a hexbin chart. +""" +import altair as alt +from vega_datasets import data + +source = data.seattle_weather() + +# Size of the hexbins +size = 15 +# Count of distinct x features +xFeaturesCount = 12 +# Count of distinct y features +yFeaturesCount = 7 +# Name of the x field +xField = 'date' +# Name of the y field +yField = 'date' + +# the shape of a hexagon +hexagon = "M0,-2.3094010768L2,-1.1547005384 2,1.1547005384 0,2.3094010768 -2,1.1547005384 -2,-1.1547005384Z" + +alt.Chart(source).mark_point(size=size**2, shape=hexagon).encode( + x=alt.X('xFeaturePos:Q', axis=alt.Axis(title='Month', + grid=False, tickOpacity=0, domainOpacity=0)), + y=alt.Y('day(' + yField + '):O', axis=alt.Axis(title='Weekday', + labelPadding=20, tickOpacity=0, domainOpacity=0)), + stroke=alt.value('black'), + strokeWidth=alt.value(0.2), + fill=alt.Color('mean(temp_max):Q', scale=alt.Scale(scheme='darkblue')), + tooltip=['month(' + xField + '):O', 'day(' + yField + '):O', 'mean(temp_max):Q'] +).transform_calculate( + # This field is required for the hexagonal X-Offset + xFeaturePos='(day(datum.' + yField + ') % 2) / 2 + month(datum.' + xField + ')' +).properties( + # Exact scaling factors to make the hexbins fit + width=size * xFeaturesCount * 2, + height=size * yFeaturesCount * 1.7320508076, # 1.7320508076 is approx. sin(60°)*2 +).configure_view( + strokeWidth=0 +) diff --git a/runtime/Lib/site-packages/altair/examples/histogram_responsive.py b/runtime/Lib/site-packages/altair/examples/histogram_responsive.py new file mode 100644 index 0000000000000000000000000000000000000000..c8af4e7148d97d9babde22a9824843693bcd6074 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/histogram_responsive.py @@ -0,0 +1,35 @@ +""" +Histogram with Responsive Bins +------------------------------ +This shows an example of a histogram with bins that are responsive to a +selection domain. Click and drag on the bottom panel to see the bins +change on the top panel. +""" +# category: histograms +import altair as alt +from vega_datasets import data + +source = data.flights_5k.url + +brush = alt.selection_interval(encodings=['x']) + +base = alt.Chart(source).transform_calculate( + time="hours(datum.date) + minutes(datum.date) / 60" +).mark_bar().encode( + y='count():Q' +).properties( + width=600, + height=100 +) + +alt.vconcat( + base.encode( + alt.X('time:Q', + bin=alt.Bin(maxbins=30, extent=brush), + scale=alt.Scale(domain=brush) + ) + ), + base.encode( + alt.X('time:Q', bin=alt.Bin(maxbins=30)), + ).add_selection(brush) +) \ No newline at end of file diff --git a/runtime/Lib/site-packages/altair/examples/histogram_with_a_global_mean_overlay.py b/runtime/Lib/site-packages/altair/examples/histogram_with_a_global_mean_overlay.py new file mode 100644 index 0000000000000000000000000000000000000000..8d4d67c4a02ec686e8154068972241ea073fb3eb --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/histogram_with_a_global_mean_overlay.py @@ -0,0 +1,24 @@ +""" +Histogram with a Global Mean Overlay +------------------------------------ +This example shows a histogram with a global mean overlay. +""" +# category: histograms +import altair as alt +from vega_datasets import data + +source = data.movies.url + +base = alt.Chart(source) + +bar = base.mark_bar().encode( + x=alt.X('IMDB_Rating:Q', bin=True, axis=None), + y='count()' +) + +rule = base.mark_rule(color='red').encode( + x='mean(IMDB_Rating):Q', + size=alt.value(5) +) + +bar + rule diff --git a/runtime/Lib/site-packages/altair/examples/horizon_graph.py b/runtime/Lib/site-packages/altair/examples/horizon_graph.py new file mode 100644 index 0000000000000000000000000000000000000000..8335957897674be96afd0fd817ee2dd88bf00978 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/horizon_graph.py @@ -0,0 +1,41 @@ +""" +Horizon Graph +------------- +This example shows how to make a Horizon Graph with 2 layers. (See https://idl.cs.washington.edu/papers/horizon/ for more details on Horizon Graphs.) +""" +# category: area charts +import altair as alt +import pandas as pd + +source = pd.DataFrame([ + {"x": 1, "y": 28}, {"x": 2, "y": 55}, + {"x": 3, "y": 43}, {"x": 4, "y": 91}, + {"x": 5, "y": 81}, {"x": 6, "y": 53}, + {"x": 7, "y": 19}, {"x": 8, "y": 87}, + {"x": 9, "y": 52}, {"x": 10, "y": 48}, + {"x": 11, "y": 24}, {"x": 12, "y": 49}, + {"x": 13, "y": 87}, {"x": 14, "y": 66}, + {"x": 15, "y": 17}, {"x": 16, "y": 27}, + {"x": 17, "y": 68}, {"x": 18, "y": 16}, + {"x": 19, "y": 49}, {"x": 20, "y": 15} +]) + +area1 = alt.Chart(source).mark_area( + clip=True, + interpolate='monotone' +).encode( + alt.X('x', scale=alt.Scale(zero=False, nice=False)), + alt.Y('y', scale=alt.Scale(domain=[0, 50]), title='y'), + opacity=alt.value(0.6) +).properties( + width=500, + height=75 +) + +area2 = area1.encode( + alt.Y('ny:Q', scale=alt.Scale(domain=[0, 50])) +).transform_calculate( + "ny", alt.datum.y - 50 +) + +area1 + area2 diff --git a/runtime/Lib/site-packages/altair/examples/horizontal_stacked_bar_chart.py b/runtime/Lib/site-packages/altair/examples/horizontal_stacked_bar_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..89271e03e5f43db350d1c5e6a792a2be9337b93c --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/horizontal_stacked_bar_chart.py @@ -0,0 +1,16 @@ +""" +Horizontal Stacked Bar Chart +============================ +This is an example of a horizontal stacked bar chart using data which contains crop yields over different regions and different years in the 1930s. +""" +# category: bar charts +import altair as alt +from vega_datasets import data + +source = data.barley() + +alt.Chart(source).mark_bar().encode( + x='sum(yield)', + y='variety', + color='site' +) diff --git a/runtime/Lib/site-packages/altair/examples/image_tooltip.py b/runtime/Lib/site-packages/altair/examples/image_tooltip.py new file mode 100644 index 0000000000000000000000000000000000000000..9b818c6f74a577b636f2cd1166671702889c1a14 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/image_tooltip.py @@ -0,0 +1,21 @@ +""" +Image tooltip +------------- +This example shows how to render images in tooltips. +Either URLs or local file paths can be used to reference +the images. +""" +# category: other charts + +import altair as alt +import pandas as pd + +source = pd.DataFrame.from_records( + [{'a': 1, 'b': 1, 'image': 'https://altair-viz.github.io/_static/altair-logo-light.png'}, + {'a': 2, 'b': 2, 'image': 'https://avatars.githubusercontent.com/u/11796929?s=200&v=4'}] +) +alt.Chart(source).mark_circle(size=200).encode( + x='a', + y='b', + tooltip=['image'] # Must be a list for the image to render +) diff --git a/runtime/Lib/site-packages/altair/examples/interactive_brush.py b/runtime/Lib/site-packages/altair/examples/interactive_brush.py new file mode 100644 index 0000000000000000000000000000000000000000..cbeec1b08507e1295ec1699ec5d52c7afcefd308 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/interactive_brush.py @@ -0,0 +1,19 @@ +""" +Interactive Rectangular Brush +============================= +This example shows how to add a simple rectangular brush to a scatter plot. +By clicking and dragging on the plot, you can highlight points within the +range. +""" +# category: interactive charts +import altair as alt +from vega_datasets import data + +source = data.cars() +brush = alt.selection(type='interval') + +alt.Chart(source).mark_point().encode( + x='Horsepower:Q', + y='Miles_per_Gallon:Q', + color=alt.condition(brush, 'Cylinders:O', alt.value('grey')), +).add_selection(brush) diff --git a/runtime/Lib/site-packages/altair/examples/interactive_cross_highlight.py b/runtime/Lib/site-packages/altair/examples/interactive_cross_highlight.py new file mode 100644 index 0000000000000000000000000000000000000000..1ba80cf2617642717d2ac485e757f06039e749b0 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/interactive_cross_highlight.py @@ -0,0 +1,49 @@ +""" +Interactive Chart with Cross-Highlight +====================================== +This example shows an interactive chart where selections in one portion of +the chart affect what is shown in other panels. Click on the bar chart to +see a detail of the distribution in the upper panel. +""" +# category: interactive charts +import altair as alt +from vega_datasets import data + +source = data.movies.url + +pts = alt.selection(type="single", encodings=['x']) + +rect = alt.Chart(data.movies.url).mark_rect().encode( + alt.X('IMDB_Rating:Q', bin=True), + alt.Y('Rotten_Tomatoes_Rating:Q', bin=True), + alt.Color('count()', + scale=alt.Scale(scheme='greenblue'), + legend=alt.Legend(title='Total Records') + ) +) + +circ = rect.mark_point().encode( + alt.ColorValue('grey'), + alt.Size('count()', + legend=alt.Legend(title='Records in Selection') + ) +).transform_filter( + pts +) + +bar = alt.Chart(source).mark_bar().encode( + x='Major_Genre:N', + y='count()', + color=alt.condition(pts, alt.ColorValue("steelblue"), alt.ColorValue("grey")) +).properties( + width=550, + height=200 +).add_selection(pts) + +alt.vconcat( + rect + circ, + bar +).resolve_legend( + color="independent", + size="independent" +) diff --git a/runtime/Lib/site-packages/altair/examples/interactive_layered_crossfilter.py b/runtime/Lib/site-packages/altair/examples/interactive_layered_crossfilter.py new file mode 100644 index 0000000000000000000000000000000000000000..edde1957b2d7a2ea72a8bc700933129dea1b69d9 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/interactive_layered_crossfilter.py @@ -0,0 +1,45 @@ +""" +Interactive Crossfilter +======================= +This example shows a multi-panel view of the same data, where you can interactively +select a portion of the data in any of the panels to highlight that portion in any +of the other panels. +""" +# category: interactive charts +import altair as alt +from vega_datasets import data + +source = alt.UrlData( + data.flights_2k.url, + format={'parse': {'date': 'date'}} +) + +brush = alt.selection(type='interval', encodings=['x']) + +# Define the base chart, with the common parts of the +# background and highlights +base = alt.Chart().mark_bar().encode( + x=alt.X(alt.repeat('column'), type='quantitative', bin=alt.Bin(maxbins=20)), + y='count()' +).properties( + width=160, + height=130 +) + +# gray background with selection +background = base.encode( + color=alt.value('#ddd') +).add_selection(brush) + +# blue highlights on the transformed data +highlight = base.transform_filter(brush) + +# layer the two charts & repeat +alt.layer( + background, + highlight, + data=source +).transform_calculate( + "time", + "hours(datum.date)" +).repeat(column=["distance", "delay", "time"]) diff --git a/runtime/Lib/site-packages/altair/examples/interactive_legend.py b/runtime/Lib/site-packages/altair/examples/interactive_legend.py new file mode 100644 index 0000000000000000000000000000000000000000..040d80b73413b47d4866cfb82456d92b781a1083 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/interactive_legend.py @@ -0,0 +1,24 @@ +""" +Interactive Legend +------------------ +The following shows how to create a chart with an interactive legend, by +binding the selection to ``"legend"``. Such a binding only works with +``selection_single`` or ``selection_multi`` when projected over a single +field or encoding. +""" +# category: interactive charts +import altair as alt +from vega_datasets import data + +source = data.unemployment_across_industries.url + +selection = alt.selection_multi(fields=['series'], bind='legend') + +alt.Chart(source).mark_area().encode( + alt.X('yearmonth(date):T', axis=alt.Axis(domain=False, format='%Y', tickSize=0)), + alt.Y('sum(count):Q', stack='center', axis=None), + alt.Color('series:N', scale=alt.Scale(scheme='category20b')), + opacity=alt.condition(selection, alt.value(1), alt.value(0.2)) +).add_selection( + selection +) \ No newline at end of file diff --git a/runtime/Lib/site-packages/altair/examples/interactive_scatter_plot.py b/runtime/Lib/site-packages/altair/examples/interactive_scatter_plot.py new file mode 100644 index 0000000000000000000000000000000000000000..69be3fe8fdceb327a9e0c950b73d3211d499f2c9 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/interactive_scatter_plot.py @@ -0,0 +1,16 @@ +""" +Simple Interactive Colored Scatterplot +-------------------------------------- +This example shows how to make an interactive scatterplot. +""" +# category: interactive charts +import altair as alt +from vega_datasets import data + +source = data.cars() + +alt.Chart(source).mark_circle().encode( + x='Horsepower', + y='Miles_per_Gallon', + color='Origin', +).interactive() diff --git a/runtime/Lib/site-packages/altair/examples/interval_selection.py b/runtime/Lib/site-packages/altair/examples/interval_selection.py new file mode 100644 index 0000000000000000000000000000000000000000..55853d9af1d8dc8ce70be178282fe611f9d0f8ff --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/interval_selection.py @@ -0,0 +1,32 @@ +""" +Interval Selection Example +========================== + +This is an example of creating a stacked chart for which the domain of the +top chart can be selected by interacting with the bottom chart. +""" +# category: area charts +import altair as alt +from vega_datasets import data + +source = data.sp500.url + +brush = alt.selection(type='interval', encodings=['x']) + +base = alt.Chart(source).mark_area().encode( + x = 'date:T', + y = 'price:Q' +).properties( + width=600, + height=200 +) + +upper = base.encode( + alt.X('date:T', scale=alt.Scale(domain=brush)) +) + +lower = base.properties( + height=60 +).add_selection(brush) + +upper & lower diff --git a/runtime/Lib/site-packages/altair/examples/iowa_electricity.py b/runtime/Lib/site-packages/altair/examples/iowa_electricity.py new file mode 100644 index 0000000000000000000000000000000000000000..dfb4e824de1ea10b7c4def8634bf0db2374de75c --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/iowa_electricity.py @@ -0,0 +1,27 @@ +""" +Iowa's renewable energy boom +---------------------------- +This example is a fully developed stacked chart using the sample dataset of Iowa's electricity sources. +""" +# category: case studies +import altair as alt +from vega_datasets import data + +source = data.iowa_electricity() + +alt.Chart(source, title="Iowa's renewable energy boom").mark_area().encode( + x=alt.X( + "year:T", + title="Year" + ), + y=alt.Y( + "net_generation:Q", + stack="normalize", + title="Share of net generation", + axis=alt.Axis(format=".0%"), + ), + color=alt.Color( + "source:N", + legend=alt.Legend(title="Electricity source"), + ) +) diff --git a/runtime/Lib/site-packages/altair/examples/isotype.py b/runtime/Lib/site-packages/altair/examples/isotype.py new file mode 100644 index 0000000000000000000000000000000000000000..076441195c3b8f01a1eb483261cd103e81bcba05 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/isotype.py @@ -0,0 +1,78 @@ +''' +Isotype Visualization +===================== +Isotype Visualization shows the distribution of animals across UK and US. +Inspired by `Only An Ocean Between, 1943 `_. Population Live Stock, p.13. +This is adapted from Vega-Lite example https://vega.github.io/editor/#/examples/vega-lite/isotype_bar_chart +''' +# category: case studies +import altair as alt +import pandas as pd + +source = pd.DataFrame([ + {'country': 'Great Britain', 'animal': 'cattle'}, + {'country': 'Great Britain', 'animal': 'cattle'}, + {'country': 'Great Britain', 'animal': 'cattle'}, + {'country': 'Great Britain', 'animal': 'pigs'}, + {'country': 'Great Britain', 'animal': 'pigs'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'pigs'}, + {'country': 'United States', 'animal': 'pigs'}, + {'country': 'United States', 'animal': 'pigs'}, + {'country': 'United States', 'animal': 'pigs'}, + {'country': 'United States', 'animal': 'pigs'}, + {'country': 'United States', 'animal': 'pigs'}, + {'country': 'United States', 'animal': 'sheep'}, + {'country': 'United States', 'animal': 'sheep'}, + {'country': 'United States', 'animal': 'sheep'}, + {'country': 'United States', 'animal': 'sheep'}, + {'country': 'United States', 'animal': 'sheep'}, + {'country': 'United States', 'animal': 'sheep'}, + {'country': 'United States', 'animal': 'sheep'} + ]) + +domains = ['person', 'cattle', 'pigs', 'sheep'] + +shape_scale = alt.Scale( + domain=domains, + range=[ + 'M1.7 -1.7h-0.8c0.3 -0.2 0.6 -0.5 0.6 -0.9c0 -0.6 -0.4 -1 -1 -1c-0.6 0 -1 0.4 -1 1c0 0.4 0.2 0.7 0.6 0.9h-0.8c-0.4 0 -0.7 0.3 -0.7 0.6v1.9c0 0.3 0.3 0.6 0.6 0.6h0.2c0 0 0 0.1 0 0.1v1.9c0 0.3 0.2 0.6 0.3 0.6h1.3c0.2 0 0.3 -0.3 0.3 -0.6v-1.8c0 0 0 -0.1 0 -0.1h0.2c0.3 0 0.6 -0.3 0.6 -0.6v-2c0.2 -0.3 -0.1 -0.6 -0.4 -0.6z', + 'M4 -2c0 0 0.9 -0.7 1.1 -0.8c0.1 -0.1 -0.1 0.5 -0.3 0.7c-0.2 0.2 1.1 1.1 1.1 1.2c0 0.2 -0.2 0.8 -0.4 0.7c-0.1 0 -0.8 -0.3 -1.3 -0.2c-0.5 0.1 -1.3 1.6 -1.5 2c-0.3 0.4 -0.6 0.4 -0.6 0.4c0 0.1 0.3 1.7 0.4 1.8c0.1 0.1 -0.4 0.1 -0.5 0c0 0 -0.6 -1.9 -0.6 -1.9c-0.1 0 -0.3 -0.1 -0.3 -0.1c0 0.1 -0.5 1.4 -0.4 1.6c0.1 0.2 0.1 0.3 0.1 0.3c0 0 -0.4 0 -0.4 0c0 0 -0.2 -0.1 -0.1 -0.3c0 -0.2 0.3 -1.7 0.3 -1.7c0 0 -2.8 -0.9 -2.9 -0.8c-0.2 0.1 -0.4 0.6 -0.4 1c0 0.4 0.5 1.9 0.5 1.9l-0.5 0l-0.6 -2l0 -0.6c0 0 -1 0.8 -1 1c0 0.2 -0.2 1.3 -0.2 1.3c0 0 0.3 0.3 0.2 0.3c0 0 -0.5 0 -0.5 0c0 0 -0.2 -0.2 -0.1 -0.4c0 -0.1 0.2 -1.6 0.2 -1.6c0 0 0.5 -0.4 0.5 -0.5c0 -0.1 0 -2.7 -0.2 -2.7c-0.1 0 -0.4 2 -0.4 2c0 0 0 0.2 -0.2 0.5c-0.1 0.4 -0.2 1.1 -0.2 1.1c0 0 -0.2 -0.1 -0.2 -0.2c0 -0.1 -0.1 -0.7 0 -0.7c0.1 -0.1 0.3 -0.8 0.4 -1.4c0 -0.6 0.2 -1.3 0.4 -1.5c0.1 -0.2 0.6 -0.4 0.6 -0.4z', + 'M1.2 -2c0 0 0.7 0 1.2 0.5c0.5 0.5 0.4 0.6 0.5 0.6c0.1 0 0.7 0 0.8 0.1c0.1 0 0.2 0.2 0.2 0.2c0 0 -0.6 0.2 -0.6 0.3c0 0.1 0.4 0.9 0.6 0.9c0.1 0 0.6 0 0.6 0.1c0 0.1 0 0.7 -0.1 0.7c-0.1 0 -1.2 0.4 -1.5 0.5c-0.3 0.1 -1.1 0.5 -1.1 0.7c-0.1 0.2 0.4 1.2 0.4 1.2l-0.4 0c0 0 -0.4 -0.8 -0.4 -0.9c0 -0.1 -0.1 -0.3 -0.1 -0.3l-0.2 0l-0.5 1.3l-0.4 0c0 0 -0.1 -0.4 0 -0.6c0.1 -0.1 0.3 -0.6 0.3 -0.7c0 0 -0.8 0 -1.5 -0.1c-0.7 -0.1 -1.2 -0.3 -1.2 -0.2c0 0.1 -0.4 0.6 -0.5 0.6c0 0 0.3 0.9 0.3 0.9l-0.4 0c0 0 -0.4 -0.5 -0.4 -0.6c0 -0.1 -0.2 -0.6 -0.2 -0.5c0 0 -0.4 0.4 -0.6 0.4c-0.2 0.1 -0.4 0.1 -0.4 0.1c0 0 -0.1 0.6 -0.1 0.6l-0.5 0l0 -1c0 0 0.5 -0.4 0.5 -0.5c0 -0.1 -0.7 -1.2 -0.6 -1.4c0.1 -0.1 0.1 -1.1 0.1 -1.1c0 0 -0.2 0.1 -0.2 0.1c0 0 0 0.9 0 1c0 0.1 -0.2 0.3 -0.3 0.3c-0.1 0 0 -0.5 0 -0.9c0 -0.4 0 -0.4 0.2 -0.6c0.2 -0.2 0.6 -0.3 0.8 -0.8c0.3 -0.5 1 -0.6 1 -0.6z', + 'M-4.1 -0.5c0.2 0 0.2 0.2 0.5 0.2c0.3 0 0.3 -0.2 0.5 -0.2c0.2 0 0.2 0.2 0.4 0.2c0.2 0 0.2 -0.2 0.5 -0.2c0.2 0 0.2 0.2 0.4 0.2c0.2 0 0.2 -0.2 0.4 -0.2c0.1 0 0.2 0.2 0.4 0.1c0.2 0 0.2 -0.2 0.4 -0.3c0.1 0 0.1 -0.1 0.4 0c0.3 0 0.3 -0.4 0.6 -0.4c0.3 0 0.6 -0.3 0.7 -0.2c0.1 0.1 1.4 1 1.3 1.4c-0.1 0.4 -0.3 0.3 -0.4 0.3c-0.1 0 -0.5 -0.4 -0.7 -0.2c-0.3 0.2 -0.1 0.4 -0.2 0.6c-0.1 0.1 -0.2 0.2 -0.3 0.4c0 0.2 0.1 0.3 0 0.5c-0.1 0.2 -0.3 0.2 -0.3 0.5c0 0.3 -0.2 0.3 -0.3 0.6c-0.1 0.2 0 0.3 -0.1 0.5c-0.1 0.2 -0.1 0.2 -0.2 0.3c-0.1 0.1 0.3 1.1 0.3 1.1l-0.3 0c0 0 -0.3 -0.9 -0.3 -1c0 -0.1 -0.1 -0.2 -0.3 -0.2c-0.2 0 -0.3 0.1 -0.4 0.4c0 0.3 -0.2 0.8 -0.2 0.8l-0.3 0l0.3 -1c0 0 0.1 -0.6 -0.2 -0.5c-0.3 0.1 -0.2 -0.1 -0.4 -0.1c-0.2 -0.1 -0.3 0.1 -0.4 0c-0.2 -0.1 -0.3 0.1 -0.5 0c-0.2 -0.1 -0.1 0 -0.3 0.3c-0.2 0.3 -0.4 0.3 -0.4 0.3l0.2 1.1l-0.3 0l-0.2 -1.1c0 0 -0.4 -0.6 -0.5 -0.4c-0.1 0.3 -0.1 0.4 -0.3 0.4c-0.1 -0.1 -0.2 1.1 -0.2 1.1l-0.3 0l0.2 -1.1c0 0 -0.3 -0.1 -0.3 -0.5c0 -0.3 0.1 -0.5 0.1 -0.7c0.1 -0.2 -0.1 -1 -0.2 -1.1c-0.1 -0.2 -0.2 -0.8 -0.2 -0.8c0 0 -0.1 -0.5 0.4 -0.8z' + ] +) + +color_scale = alt.Scale( + domain=domains, + range=['rgb(162,160,152)', 'rgb(194,81,64)', 'rgb(93,93,93)', 'rgb(91,131,149)'] +) + +alt.Chart(source).mark_point(filled=True, opacity=1, size=100).encode( + alt.X('x:O', axis=None), + alt.Y('animal:O', axis=None), + alt.Row('country:N', header=alt.Header(title='')), + alt.Shape('animal:N', legend=None, scale=shape_scale), + alt.Color('animal:N', legend=None, scale=color_scale), +).transform_window( + x='rank()', + groupby=['country', 'animal'] +).properties(width=550, height=140) diff --git a/runtime/Lib/site-packages/altair/examples/isotype_emoji.py b/runtime/Lib/site-packages/altair/examples/isotype_emoji.py new file mode 100644 index 0000000000000000000000000000000000000000..3469070edce953cd2fd3d2dee7b06659ab6bca7d --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/isotype_emoji.py @@ -0,0 +1,63 @@ +''' +Isotype Visualization with Emoji +================================ +Isotype Visualization shows the distribution of animals across UK and US, using unicode emoji +marks rather than custom SVG paths (see https://altair-viz.github.io/gallery/isotype.html). +This is adapted from Vega-Lite example https://vega.github.io/vega-lite/examples/isotype_bar_chart_emoji.html. +''' +# category: case studies +import altair as alt +import pandas as pd + +source = pd.DataFrame([ + {'country': 'Great Britain', 'animal': 'cattle'}, + {'country': 'Great Britain', 'animal': 'cattle'}, + {'country': 'Great Britain', 'animal': 'cattle'}, + {'country': 'Great Britain', 'animal': 'pigs'}, + {'country': 'Great Britain', 'animal': 'pigs'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'Great Britain', 'animal': 'sheep'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'cattle'}, + {'country': 'United States', 'animal': 'pigs'}, + {'country': 'United States', 'animal': 'pigs'}, + {'country': 'United States', 'animal': 'pigs'}, + {'country': 'United States', 'animal': 'pigs'}, + {'country': 'United States', 'animal': 'pigs'}, + {'country': 'United States', 'animal': 'pigs'}, + {'country': 'United States', 'animal': 'sheep'}, + {'country': 'United States', 'animal': 'sheep'}, + {'country': 'United States', 'animal': 'sheep'}, + {'country': 'United States', 'animal': 'sheep'}, + {'country': 'United States', 'animal': 'sheep'}, + {'country': 'United States', 'animal': 'sheep'}, + {'country': 'United States', 'animal': 'sheep'} + ]) + + +alt.Chart(source).mark_text(size=45, baseline='middle').encode( + alt.X('x:O', axis=None), + alt.Y('animal:O', axis=None), + alt.Row('country:N', header=alt.Header(title='')), + alt.Text('emoji:N') +).transform_calculate( + emoji="{'cattle': '🐄', 'pigs': '🐖', 'sheep': '🐏'}[datum.animal]" +).transform_window( + x='rank()', + groupby=['country', 'animal'] +).properties(width=550, height=140) diff --git a/runtime/Lib/site-packages/altair/examples/isotype_grid.py b/runtime/Lib/site-packages/altair/examples/isotype_grid.py new file mode 100644 index 0000000000000000000000000000000000000000..fd446e4bc6cb9f44d1dd5deb7d4b0ecd5dc2c9c9 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/isotype_grid.py @@ -0,0 +1,38 @@ +""" +Isotype Grid +------------ +This example is a grid of isotype figures. +""" +# category: other charts +import altair as alt +import pandas as pd + +data = pd.DataFrame([dict(id=i) for i in range(1, 101)]) + +person = ( + "M1.7 -1.7h-0.8c0.3 -0.2 0.6 -0.5 0.6 -0.9c0 -0.6 " + "-0.4 -1 -1 -1c-0.6 0 -1 0.4 -1 1c0 0.4 0.2 0.7 0.6 " + "0.9h-0.8c-0.4 0 -0.7 0.3 -0.7 0.6v1.9c0 0.3 0.3 0.6 " + "0.6 0.6h0.2c0 0 0 0.1 0 0.1v1.9c0 0.3 0.2 0.6 0.3 " + "0.6h1.3c0.2 0 0.3 -0.3 0.3 -0.6v-1.8c0 0 0 -0.1 0 " + "-0.1h0.2c0.3 0 0.6 -0.3 0.6 -0.6v-2c0.2 -0.3 -0.1 " + "-0.6 -0.4 -0.6z" +) + +alt.Chart(data).transform_calculate( + row="ceil(datum.id/10)" +).transform_calculate( + col="datum.id - datum.row*10" +).mark_point( + filled=True, + size=50 +).encode( + x=alt.X("col:O", axis=None), + y=alt.Y("row:O", axis=None), + shape=alt.ShapeValue(person) +).properties( + width=400, + height=400 +).configure_view( + strokeWidth=0 +) diff --git a/runtime/Lib/site-packages/altair/examples/layer_line_color_rule.py b/runtime/Lib/site-packages/altair/examples/layer_line_color_rule.py new file mode 100644 index 0000000000000000000000000000000000000000..aa948ecb72e8718bf48a603706daf4960087316c --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/layer_line_color_rule.py @@ -0,0 +1,28 @@ +""" +Line Chart with Layered Aggregates +---------------------------------- +This example shows how to make a multi-series line chart of the daily closing +stock prices for AAPL, AMZN, GOOG, IBM, and MSFT between 2000 and 2010, along +with a layered rule showing the average values. +""" +# category: line charts +import altair as alt +from vega_datasets import data + +source = data.stocks() + +base = alt.Chart(source).properties(width=550) + +line = base.mark_line().encode( + x='date', + y='price', + color='symbol' +) + +rule = base.mark_rule().encode( + y='average(price)', + color='symbol', + size=alt.value(2) +) + +line + rule diff --git a/runtime/Lib/site-packages/altair/examples/layered_area_chart.py b/runtime/Lib/site-packages/altair/examples/layered_area_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..fe9e42c2cf36fabf2a5b76defc2288acfc63588e --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/layered_area_chart.py @@ -0,0 +1,16 @@ +""" +Layered Area Chart +------------------ +This example shows a layered area chart. +""" +# category: area charts +import altair as alt +from vega_datasets import data + +source = data.iowa_electricity() + +alt.Chart(source).mark_area(opacity=0.3).encode( + x="year:T", + y=alt.Y("net_generation:Q", stack=None), + color="source:N" +) diff --git a/runtime/Lib/site-packages/altair/examples/layered_bar_chart.py b/runtime/Lib/site-packages/altair/examples/layered_bar_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..48d221e3bb7301cb4202cce4edf5ca463d704cf7 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/layered_bar_chart.py @@ -0,0 +1,16 @@ +""" +Layered Bar Chart +----------------- +This example shows a segmented bar chart that is layered rather than stacked. +""" +# category: bar charts +import altair as alt +from vega_datasets import data + +source = data.iowa_electricity() + +alt.Chart(source).mark_bar(opacity=0.7).encode( + x='year:O', + y=alt.Y('net_generation:Q', stack=None), + color="source", +) diff --git a/runtime/Lib/site-packages/altair/examples/layered_chart_bar_mark.py b/runtime/Lib/site-packages/altair/examples/layered_chart_bar_mark.py new file mode 100644 index 0000000000000000000000000000000000000000..3cc651205cfe6800608741149bf17aac93c3ffb3 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/layered_chart_bar_mark.py @@ -0,0 +1,32 @@ +""" +Bar and Tick Chart +------------------ +How to layer a tick chart on top of a bar chart. +""" +# category: bar charts +import altair as alt +import pandas as pd + +source = pd.DataFrame({ + 'project': ['a', 'b', 'c', 'd', 'e', 'f', 'g'], + 'score': [25, 57, 23, 19, 8, 47, 8], + 'goal': [25, 47, 30, 27, 38, 19, 4] +}) + +bar = alt.Chart(source).mark_bar().encode( + x='project', + y='score' +).properties( + width=alt.Step(40) # controls width of bar. +) + +tick = alt.Chart(source).mark_tick( + color='red', + thickness=2, + size=40 * 0.9, # controls width of tick. +).encode( + x='project', + y='goal' +) + +bar + tick diff --git a/runtime/Lib/site-packages/altair/examples/layered_chart_with_dual_axis.py b/runtime/Lib/site-packages/altair/examples/layered_chart_with_dual_axis.py new file mode 100644 index 0000000000000000000000000000000000000000..f01b94a4304956fb1b4ade64db9ba929ccf604f8 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/layered_chart_with_dual_axis.py @@ -0,0 +1,30 @@ +""" +Layered chart with Dual-Axis +---------------------------- +This example shows how to create a second independent y axis. +""" +# category: other charts + +import altair as alt +from vega_datasets import data + +source = data.seattle_weather() + +base = alt.Chart(source).encode( + alt.X('month(date):T', axis=alt.Axis(title=None)) +) + +area = base.mark_area(opacity=0.3, color='#57A44C').encode( + alt.Y('average(temp_max)', + axis=alt.Axis(title='Avg. Temperature (°C)', titleColor='#57A44C')), + alt.Y2('average(temp_min)') +) + +line = base.mark_line(stroke='#5276A7', interpolate='monotone').encode( + alt.Y('average(precipitation)', + axis=alt.Axis(title='Precipitation (inches)', titleColor='#5276A7')) +) + +alt.layer(area, line).resolve_scale( + y = 'independent' +) diff --git a/runtime/Lib/site-packages/altair/examples/layered_heatmap_text.py b/runtime/Lib/site-packages/altair/examples/layered_heatmap_text.py new file mode 100644 index 0000000000000000000000000000000000000000..396f50b61b70f59ad63ecaa092cd8f1972b5f744 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/layered_heatmap_text.py @@ -0,0 +1,41 @@ +""" +Text over a Heatmap +------------------- + +An example of a layered chart of text over a heatmap using the cars dataset. +""" +# category: other charts +import altair as alt +from vega_datasets import data + +source = data.cars() + +# Configure common options +base = alt.Chart(source).transform_aggregate( + num_cars='count()', + groupby=['Origin', 'Cylinders'] +).encode( + alt.X('Cylinders:O', scale=alt.Scale(paddingInner=0)), + alt.Y('Origin:O', scale=alt.Scale(paddingInner=0)), +) + +# Configure heatmap +heatmap = base.mark_rect().encode( + color=alt.Color('num_cars:Q', + scale=alt.Scale(scheme='viridis'), + legend=alt.Legend(direction='horizontal') + ) +) + +# Configure text +text = base.mark_text(baseline='middle').encode( + text='num_cars:Q', + color=alt.condition( + alt.datum.num_cars > 100, + alt.value('black'), + alt.value('white') + ) +) + +# Draw the chart +heatmap + text \ No newline at end of file diff --git a/runtime/Lib/site-packages/altair/examples/layered_histogram.py b/runtime/Lib/site-packages/altair/examples/layered_histogram.py new file mode 100644 index 0000000000000000000000000000000000000000..4dca759371593dbaf9db6c0f6e219c2a4a50fc1f --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/layered_histogram.py @@ -0,0 +1,29 @@ +""" +Layered Histogram +================= +This example shows how to use opacity to make a layered histogram in Altair. +""" +# category: histograms +import pandas as pd +import altair as alt +import numpy as np +np.random.seed(42) + +# Generating Data +source = pd.DataFrame({ + 'Trial A': np.random.normal(0, 0.8, 1000), + 'Trial B': np.random.normal(-2, 1, 1000), + 'Trial C': np.random.normal(3, 2, 1000) +}) + +alt.Chart(source).transform_fold( + ['Trial A', 'Trial B', 'Trial C'], + as_=['Experiment', 'Measurement'] +).mark_bar( + opacity=0.3, + binSpacing=0 +).encode( + alt.X('Measurement:Q', bin=alt.Bin(maxbins=100)), + alt.Y('count()', stack=None), + alt.Color('Experiment:N') +) diff --git a/runtime/Lib/site-packages/altair/examples/line_chart_with_color_datum.py b/runtime/Lib/site-packages/altair/examples/line_chart_with_color_datum.py new file mode 100644 index 0000000000000000000000000000000000000000..912b32aa86be4653af36a71c4d7eb39807f4c3a8 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/line_chart_with_color_datum.py @@ -0,0 +1,21 @@ +""" +Line Chart with datum for color +------------------------------- +An example of using ``datum`` and ``repeat`` to color a multi-series line chart. +This is adapted from this corresponding Vega-Lite Example: +`Repeat and Layer to Show Different Movie Measures `_. +""" +# category: line charts + +import altair as alt +from vega_datasets import data + +source = data.movies() + +alt.Chart(source).mark_line().encode( + x=alt.X("IMDB_Rating", bin=True), + y=alt.Y( + alt.repeat("layer"), aggregate="mean", title="Mean of US and Worldwide Gross" + ), + color=alt.datum(alt.repeat("layer")), +).repeat(layer=["US_Gross", "Worldwide_Gross"]) diff --git a/runtime/Lib/site-packages/altair/examples/line_chart_with_cumsum.py b/runtime/Lib/site-packages/altair/examples/line_chart_with_cumsum.py new file mode 100644 index 0000000000000000000000000000000000000000..2b21b0845adc1bafb74de6786715686360bd5390 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/line_chart_with_cumsum.py @@ -0,0 +1,24 @@ +""" +Line Chart with Cumulative Sum +------------------------------ +This chart creates a simple line chart from the cumulative sum of a fields. +""" +# category: line charts +import altair as alt +from vega_datasets import data + +source = data.wheat() + +alt.Chart(source).mark_line().transform_window( + # Sort the data chronologically + sort=[{'field': 'year'}], + # Include all previous records before the current record and none after + # (This is the default value so you could skip it and it would still work.) + frame=[None, 0], + # What to add up as you go + cumulative_wheat='sum(wheat)' +).encode( + x='year:O', + # Plot the calculated field created by the transformation + y='cumulative_wheat:Q' +).properties(width=600) \ No newline at end of file diff --git a/runtime/Lib/site-packages/altair/examples/line_chart_with_datum.py b/runtime/Lib/site-packages/altair/examples/line_chart_with_datum.py new file mode 100644 index 0000000000000000000000000000000000000000..490bd0dcc59baf2b95bfbb4673466834e5e56da0 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/line_chart_with_datum.py @@ -0,0 +1,32 @@ +""" +Line Chart with datum +--------------------------------- +An example of using ``datum`` to highlight certain values, including a ``DateTime`` value. +This is adapted from two corresponding Vega-Lite Examples: +`Highlight a Specific Value `_. +""" +# category: line charts + +import altair as alt +from vega_datasets import data + +source = data.stocks() + +lines = ( + alt.Chart(source) + .mark_line() + .encode(x="date", y="price", color="symbol") +) + +xrule = ( + alt.Chart() + .mark_rule(color="cyan", strokeWidth=2) + .encode(x=alt.datum(alt.DateTime(year=2006, month="November"))) +) + +yrule = ( + alt.Chart().mark_rule(strokeDash=[12, 6], size=2).encode(y=alt.datum(350)) +) + + +lines + yrule + xrule diff --git a/runtime/Lib/site-packages/altair/examples/line_chart_with_generator.py b/runtime/Lib/site-packages/altair/examples/line_chart_with_generator.py new file mode 100644 index 0000000000000000000000000000000000000000..096c2489c7074f3fb08f32a4f12efd148cc96616 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/line_chart_with_generator.py @@ -0,0 +1,21 @@ +""" +Line Chart with Sequence Generator +---------------------------------- +This examples shows how to create multiple lines using the sequence generator. +""" +# category: line charts + +import altair as alt + +source = alt.sequence(start=0, stop=12.7, step=0.1, as_='x') + +alt.Chart(source).mark_line().transform_calculate( + sin='sin(datum.x)', + cos='cos(datum.x)' +).transform_fold( + ['sin', 'cos'] +).encode( + x='x:Q', + y='value:Q', + color='key:N' +) diff --git a/runtime/Lib/site-packages/altair/examples/line_chart_with_points.py b/runtime/Lib/site-packages/altair/examples/line_chart_with_points.py new file mode 100644 index 0000000000000000000000000000000000000000..26bd5431041b85a51ea8df76178b3d0451fb2669 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/line_chart_with_points.py @@ -0,0 +1,24 @@ +""" +Line Chart with Points +---------------------- +This chart shows a simple line chart with points marking each value. Use +``point=True`` for points with default appearance or customize it with +``OverlayMarkDef()``. +""" +# category: line charts +import altair as alt +import numpy as np +import pandas as pd + +x = np.arange(100) +source = pd.DataFrame({ + 'x': x, + 'f(x)': np.sin(x / 5) +}) + +alt.Chart(source).mark_line( + point=alt.OverlayMarkDef(color="red") +).encode( + x='x', + y='f(x)' +) diff --git a/runtime/Lib/site-packages/altair/examples/line_percent.py b/runtime/Lib/site-packages/altair/examples/line_percent.py new file mode 100644 index 0000000000000000000000000000000000000000..fd23572dedbc1445a7924981a94eba1b2ff2afce --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/line_percent.py @@ -0,0 +1,18 @@ +""" +Line Chart with Percent axis +---------------------------- +This example shows how to format the tick labels of the y-axis of a chart as percentages. +""" +# category: line charts +import altair as alt +from vega_datasets import data + +source = data.jobs.url + +alt.Chart(source).mark_line().encode( + alt.X('year:O'), + alt.Y('perc:Q', axis=alt.Axis(format='%')), + color='sex:N' +).transform_filter( + alt.datum.job == 'Welder' +) diff --git a/runtime/Lib/site-packages/altair/examples/line_with_ci.py b/runtime/Lib/site-packages/altair/examples/line_with_ci.py new file mode 100644 index 0000000000000000000000000000000000000000..410cbfe57ef8e7eac6dcacf3bce73432d3c7e0df --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/line_with_ci.py @@ -0,0 +1,22 @@ +""" +Line Chart with Confidence Interval Band +---------------------------------------- +How to make a line chart with a bootstrapped 95% confidence interval band. +""" +# category: line charts +import altair as alt +from vega_datasets import data + +source = data.cars() + +line = alt.Chart(source).mark_line().encode( + x='Year', + y='mean(Miles_per_Gallon)' +) + +band = alt.Chart(source).mark_errorband(extent='ci').encode( + x='Year', + y=alt.Y('Miles_per_Gallon', title='Miles/Gallon'), +) + +band + line diff --git a/runtime/Lib/site-packages/altair/examples/line_with_log_scale.py b/runtime/Lib/site-packages/altair/examples/line_with_log_scale.py new file mode 100644 index 0000000000000000000000000000000000000000..b45fcd92ebd0a07a46e87a4afac896a85ea235d8 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/line_with_log_scale.py @@ -0,0 +1,18 @@ +""" +Line Chart with Logarithmic Scale +--------------------------------- +How to make a line chart on a `Logarithmic scale `_. +""" +# category: line charts +import altair as alt +from vega_datasets import data + +source = data.population() + +alt.Chart(source).mark_line().encode( + x='year:O', + y=alt.Y( + 'sum(people)', + scale=alt.Scale(type="log") # Here the scale is applied + ) +) \ No newline at end of file diff --git a/runtime/Lib/site-packages/altair/examples/london_tube.py b/runtime/Lib/site-packages/altair/examples/london_tube.py new file mode 100644 index 0000000000000000000000000000000000000000..3a39e6aef5cd8534f76698a2379221b9fe368f0c --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/london_tube.py @@ -0,0 +1,59 @@ +""" +London Tube Lines +================= +This example shows the London tube lines against the background of the +borough boundaries. It is based on the vega-lite example at +https://vega.github.io/vega-lite/examples/geo_layer_line_london.html. +""" +# category: case studies +import altair as alt +from vega_datasets import data + +boroughs = alt.topo_feature(data.londonBoroughs.url, 'boroughs') +tubelines = alt.topo_feature(data.londonTubeLines.url, 'line') +centroids = data.londonCentroids.url + +background = alt.Chart(boroughs).mark_geoshape( + stroke='white', + strokeWidth=2 +).encode( + color=alt.value('#eee'), +).properties( + width=700, + height=500 +) + +labels = alt.Chart(centroids).mark_text().encode( + longitude='cx:Q', + latitude='cy:Q', + text='bLabel:N', + size=alt.value(8), + opacity=alt.value(0.6) +).transform_calculate( + "bLabel", "indexof (datum.name,' ') > 0 ? substring(datum.name,0,indexof(datum.name, ' ')) : datum.name" +) + +line_scale = alt.Scale(domain=["Bakerloo", "Central", "Circle", "District", "DLR", + "Hammersmith & City", "Jubilee", "Metropolitan", "Northern", + "Piccadilly", "Victoria", "Waterloo & City"], + range=["rgb(137,78,36)", "rgb(220,36,30)", "rgb(255,206,0)", + "rgb(1,114,41)", "rgb(0,175,173)", "rgb(215,153,175)", + "rgb(106,114,120)", "rgb(114,17,84)", "rgb(0,0,0)", + "rgb(0,24,168)", "rgb(0,160,226)", "rgb(106,187,170)"]) + +lines = alt.Chart(tubelines).mark_geoshape( + filled=False, + strokeWidth=2 +).encode( + alt.Color( + 'id:N', + legend=alt.Legend( + title=None, + orient='bottom-right', + offset=0 + ), + scale=line_scale + ) +) + +background + labels + lines diff --git a/runtime/Lib/site-packages/altair/examples/multi_series_line.py b/runtime/Lib/site-packages/altair/examples/multi_series_line.py new file mode 100644 index 0000000000000000000000000000000000000000..ffd68501ecd5aa2456db9d95ac2d01d2d46b4c1b --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/multi_series_line.py @@ -0,0 +1,18 @@ +""" +Multi Series Line Chart +----------------------- + +This example shows how to make a multi series line chart of the daily closing stock prices for AAPL, AMZN, GOOG, IBM, and MSFT between 2000 and 2010. +""" +# category: line charts +import altair as alt +from vega_datasets import data + +source = data.stocks() + +alt.Chart(source).mark_line().encode( + x='date', + y='price', + color='symbol', + strokeDash='symbol', +) diff --git a/runtime/Lib/site-packages/altair/examples/multifeature_scatter_plot.py b/runtime/Lib/site-packages/altair/examples/multifeature_scatter_plot.py new file mode 100644 index 0000000000000000000000000000000000000000..40e189bbf6608330dba5c9d69ba24af286782f17 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/multifeature_scatter_plot.py @@ -0,0 +1,17 @@ +""" +Multifeature Scatter Plot +========================= +This example shows how to make a scatter plot with multiple feature encodings. +""" +# category: scatter plots +import altair as alt +from vega_datasets import data + +source = data.iris() + +alt.Chart(source).mark_circle().encode( + alt.X('sepalLength', scale=alt.Scale(zero=False)), + alt.Y('sepalWidth', scale=alt.Scale(zero=False, padding=1)), + color='species', + size='petalWidth' +) diff --git a/runtime/Lib/site-packages/altair/examples/multiline_highlight.py b/runtime/Lib/site-packages/altair/examples/multiline_highlight.py new file mode 100644 index 0000000000000000000000000000000000000000..231ff7372e310992258a98ccd9f534902bf10253 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/multiline_highlight.py @@ -0,0 +1,36 @@ +""" +Multi-Line Highlight +==================== +This multi-line chart uses an invisible Voronoi tessellation to handle mouseover to +identify the nearest point and then highlight the line on which the point falls. +It is adapted from the Vega-Lite example found at +https://bl.ocks.org/amitkaps/fe4238e716db53930b2f1a70d3401701 +""" +# category: interactive charts +import altair as alt +from vega_datasets import data + +source = data.stocks() + +highlight = alt.selection(type='single', on='mouseover', + fields=['symbol'], nearest=True) + +base = alt.Chart(source).encode( + x='date:T', + y='price:Q', + color='symbol:N' +) + +points = base.mark_circle().encode( + opacity=alt.value(0) +).add_selection( + highlight +).properties( + width=600 +) + +lines = base.mark_line().encode( + size=alt.condition(~highlight, alt.value(1), alt.value(3)) +) + +points + lines diff --git a/runtime/Lib/site-packages/altair/examples/multiline_tooltip.py b/runtime/Lib/site-packages/altair/examples/multiline_tooltip.py new file mode 100644 index 0000000000000000000000000000000000000000..84d06d8d012d863447a60ab3b67e2a79da343819 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/multiline_tooltip.py @@ -0,0 +1,67 @@ +""" +Multi-Line Tooltip +================== +This example shows how you can use selections and layers to create a +tooltip-like behavior tied to the x position of the cursor. +If you are looking for more standard tooltips, it is recommended to use the +tooltip encoding channel as shown in the +`Scatter Plot With Tooltips `_ +example. + +The following example employs a little trick to isolate the x-position of the +cursor: we add some transparent points with only an x encoding (no y encoding) +and tie a *nearest* selection to these, tied to the "x" field. +""" +# category: interactive charts +import altair as alt +import pandas as pd +import numpy as np + +np.random.seed(42) +source = pd.DataFrame(np.cumsum(np.random.randn(100, 3), 0).round(2), + columns=['A', 'B', 'C'], index=pd.RangeIndex(100, name='x')) +source = source.reset_index().melt('x', var_name='category', value_name='y') + +# Create a selection that chooses the nearest point & selects based on x-value +nearest = alt.selection(type='single', nearest=True, on='mouseover', + fields=['x'], empty='none') + +# The basic line +line = alt.Chart(source).mark_line(interpolate='basis').encode( + x='x:Q', + y='y:Q', + color='category:N' +) + +# Transparent selectors across the chart. This is what tells us +# the x-value of the cursor +selectors = alt.Chart(source).mark_point().encode( + x='x:Q', + opacity=alt.value(0), +).add_selection( + nearest +) + +# Draw points on the line, and highlight based on selection +points = line.mark_point().encode( + opacity=alt.condition(nearest, alt.value(1), alt.value(0)) +) + +# Draw text labels near the points, and highlight based on selection +text = line.mark_text(align='left', dx=5, dy=-5).encode( + text=alt.condition(nearest, 'y:Q', alt.value(' ')) +) + +# Draw a rule at the location of the selection +rules = alt.Chart(source).mark_rule(color='gray').encode( + x='x:Q', +).transform_filter( + nearest +) + +# Put the five layers into a chart and bind the data +alt.layer( + line, selectors, points, rules, text +).properties( + width=600, height=300 +) diff --git a/runtime/Lib/site-packages/altair/examples/multiple_interactions.py b/runtime/Lib/site-packages/altair/examples/multiple_interactions.py new file mode 100644 index 0000000000000000000000000000000000000000..2588b7e1d2b61b05eb3adf567d16535a6fb51fc3 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/multiple_interactions.py @@ -0,0 +1,90 @@ +""" +Multiple Interactions +===================== +This example shows how multiple user inputs can be layered onto a chart. The four inputs have functionality as follows: + +* Dropdown: Filters the movies by genre +* Radio Buttons: Highlights certain films by Worldwide Gross +* Mouse Drag and Scroll: Zooms the x and y scales to allow for panning. + + + +""" +# category: interactive charts +import altair as alt +from vega_datasets import data + +movies = alt.UrlData( + data.movies.url, + format=alt.DataFormat(parse={"Release_Date":"date"}) +) +ratings = ['G', 'NC-17', 'PG', 'PG-13', 'R'] +genres = ['Action', 'Adventure', 'Black Comedy', 'Comedy', + 'Concert/Performance', 'Documentary', 'Drama', 'Horror', 'Musical', + 'Romantic Comedy', 'Thriller/Suspense', 'Western'] + +base = alt.Chart(movies, width=200, height=200).mark_point(filled=True).transform_calculate( + Rounded_IMDB_Rating = "floor(datum.IMDB_Rating)", + Hundred_Million_Production = "datum.Production_Budget > 100000000.0 ? 100 : 10", + Release_Year = "year(datum.Release_Date)" +).transform_filter( + alt.datum.IMDB_Rating > 0 +).transform_filter( + alt.FieldOneOfPredicate(field='MPAA_Rating', oneOf=ratings) +).encode( + x=alt.X('Worldwide_Gross:Q', scale=alt.Scale(domain=(100000,10**9), clamp=True)), + y='IMDB_Rating:Q', + tooltip="Title:N" +) + +# A slider filter +year_slider = alt.binding_range(min=1969, max=2018, step=1) +slider_selection = alt.selection_single(bind=year_slider, fields=['Release_Year'], name="Release Year_") + + +filter_year = base.add_selection( + slider_selection +).transform_filter( + slider_selection +).properties(title="Slider Filtering") + +# A dropdown filter +genre_dropdown = alt.binding_select(options=genres) +genre_select = alt.selection_single(fields=['Major_Genre'], bind=genre_dropdown, name="Genre") + +filter_genres = base.add_selection( + genre_select +).transform_filter( + genre_select +).properties(title="Dropdown Filtering") + +#color changing marks +rating_radio = alt.binding_radio(options=ratings) + +rating_select = alt.selection_single(fields=['MPAA_Rating'], bind=rating_radio, name="Rating") +rating_color_condition = alt.condition(rating_select, + alt.Color('MPAA_Rating:N', legend=None), + alt.value('lightgray')) + +highlight_ratings = base.add_selection( + rating_select +).encode( + color=rating_color_condition +).properties(title="Radio Button Highlighting") + +# Boolean selection for format changes +input_checkbox = alt.binding_checkbox() +checkbox_selection = alt.selection_single(bind=input_checkbox, name="Big Budget Films") + +size_checkbox_condition = alt.condition(checkbox_selection, + alt.SizeValue(25), + alt.Size('Hundred_Million_Production:Q') + ) + +budget_sizing = base.add_selection( + checkbox_selection +).encode( + size=size_checkbox_condition +).properties(title="Checkbox Formatting") + +( filter_year | filter_genres) & (highlight_ratings | budget_sizing ) diff --git a/runtime/Lib/site-packages/altair/examples/multiple_marks.py b/runtime/Lib/site-packages/altair/examples/multiple_marks.py new file mode 100644 index 0000000000000000000000000000000000000000..e262dd306481044009faa815c5637017da8fe41e --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/multiple_marks.py @@ -0,0 +1,17 @@ +""" +Multiple Marks +============== +This example demonstrates creating a single chart with multiple markers +representing the same data. +""" +# category: other charts +import altair as alt +from vega_datasets import data + +source = data.stocks() + +alt.Chart(source).mark_line(point=True).encode( + x='date:T', + y='price:Q', + color='symbol:N' +) diff --git a/runtime/Lib/site-packages/altair/examples/natural_disasters.py b/runtime/Lib/site-packages/altair/examples/natural_disasters.py new file mode 100644 index 0000000000000000000000000000000000000000..339033db0a304941f919ef23db4819df30966fd4 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/natural_disasters.py @@ -0,0 +1,29 @@ +""" +Natural Disasters +----------------- +This example shows a visualization of global deaths from natural disasters. +""" +# category: case studies +import altair as alt +from vega_datasets import data + +source = data.disasters.url + +alt.Chart(source).mark_circle( + opacity=0.8, + stroke='black', + strokeWidth=1 +).encode( + alt.X('Year:O', axis=alt.Axis(labelAngle=0)), + alt.Y('Entity:N'), + alt.Size('Deaths:Q', + scale=alt.Scale(range=[0, 4000]), + legend=alt.Legend(title='Annual Global Deaths') + ), + alt.Color('Entity:N', legend=None) +).properties( + width=450, + height=320 +).transform_filter( + alt.datum.Entity != 'All natural disasters' +) diff --git a/runtime/Lib/site-packages/altair/examples/normalized_stacked_area_chart.py b/runtime/Lib/site-packages/altair/examples/normalized_stacked_area_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..a6bfec3652763552145acc85e5646dadc519cc06 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/normalized_stacked_area_chart.py @@ -0,0 +1,16 @@ +""" +Normalized Stacked Area Chart +----------------------------- +This example shows how to make a normalized stacked area chart. +""" +# category: area charts +import altair as alt +from vega_datasets import data + +source = data.iowa_electricity() + +alt.Chart(source).mark_area().encode( + x="year:T", + y=alt.Y("net_generation:Q", stack="normalize"), + color="source:N" +) diff --git a/runtime/Lib/site-packages/altair/examples/normalized_stacked_bar_chart.py b/runtime/Lib/site-packages/altair/examples/normalized_stacked_bar_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..307a452d243f6e4af7ef95639fa810f4e138689e --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/normalized_stacked_bar_chart.py @@ -0,0 +1,16 @@ +""" +Normalized Stacked Bar Chart +---------------------------- +This is an example of a normalized stacked bar chart using data which contains crop yields over different regions and different years in the 1930s. +""" +# category: bar charts +import altair as alt +from vega_datasets import data + +source = data.barley() + +alt.Chart(source).mark_bar().encode( + x=alt.X('sum(yield)', stack="normalize"), + y='variety', + color='site' +) diff --git a/runtime/Lib/site-packages/altair/examples/normed_parallel_coordinates.py b/runtime/Lib/site-packages/altair/examples/normed_parallel_coordinates.py new file mode 100644 index 0000000000000000000000000000000000000000..88cd45c90ac3617555e4022564c78b682588158c --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/normed_parallel_coordinates.py @@ -0,0 +1,41 @@ +""" +Normalized Parallel Coordinates Example +--------------------------------------- +A `Parallel Coordinates `_ +chart is a chart that lets you visualize the individual data points by drawing +a single line for each of them. + +Such a chart can be created in Altair by first transforming the data into a +suitable representation. + +This example shows a modified parallel coordinates chart with the Iris dataset, +where the y-axis shows the value after min-max rather than the raw value. It's a +simplified Altair version of `the VegaLite version `_ +""" +# category: other charts +import altair as alt +from vega_datasets import data +from altair import datum + +source = data.iris() + +alt.Chart(source).transform_window( + index='count()' +).transform_fold( + ['petalLength', 'petalWidth', 'sepalLength', 'sepalWidth'] +).transform_joinaggregate( + min='min(value)', + max='max(value)', + groupby=['key'] +).transform_calculate( + minmax_value=(datum.value-datum.min)/(datum.max-datum.min), + mid=(datum.min+datum.max)/2 +).mark_line().encode( + x='key:N', + y='minmax_value:Q', + color='species:N', + detail='index:N', + opacity=alt.value(0.5) +).properties(width=500) + + diff --git a/runtime/Lib/site-packages/altair/examples/one_dot_per_zipcode.py b/runtime/Lib/site-packages/altair/examples/one_dot_per_zipcode.py new file mode 100644 index 0000000000000000000000000000000000000000..c08ff3932b883de7f5dad153d2f7a470e6099d40 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/one_dot_per_zipcode.py @@ -0,0 +1,25 @@ +""" +One Dot Per Zipcode +----------------------- +This example shows a geographical plot with one dot per zipcode. +""" +# category: case studies +import altair as alt +from vega_datasets import data + +# Since the data is more than 5,000 rows we'll import it from a URL +source = data.zipcodes.url + +alt.Chart(source).transform_calculate( + "leading digit", alt.expr.substring(alt.datum.zip_code, 0, 1) +).mark_circle(size=3).encode( + longitude='longitude:Q', + latitude='latitude:Q', + color='leading digit:N', + tooltip='zip_code:N' +).project( + type='albersUsa' +).properties( + width=650, + height=400 +) diff --git a/runtime/Lib/site-packages/altair/examples/pacman_chart.py b/runtime/Lib/site-packages/altair/examples/pacman_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..0058acd7bec629be3bf6790c1c4b6a78b62cebe4 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/pacman_chart.py @@ -0,0 +1,17 @@ +""" +Pacman Chart +------------ +Chart made using ``mark_arc`` and constant values. +This could also be made using +``alt.Chart(source).mark_arc(color = "gold", theta = (5/8)*np.pi, theta2 = (19/8)*np.pi,radius=100)``. +""" +# category: circular plots + +import numpy as np +import altair as alt + +alt.Chart().mark_arc(color="gold").encode( + theta=alt.datum((5 / 8) * np.pi, scale=None), + theta2=alt.datum((19 / 8) * np.pi), + radius=alt.datum(100, scale=None), +) diff --git a/runtime/Lib/site-packages/altair/examples/parallel_coordinates.py b/runtime/Lib/site-packages/altair/examples/parallel_coordinates.py new file mode 100644 index 0000000000000000000000000000000000000000..2f977dbf543d6d0bd5fe985bf22c6441e71261d2 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/parallel_coordinates.py @@ -0,0 +1,28 @@ +""" +Parallel Coordinates Example +---------------------------- +A `Parallel Coordinates `_ +chart is a chart that lets you visualize the individual data points by drawing +a single line for each of them. +Such a chart can be created in Altair by first transforming the data into a +suitable representation. +This example shows a parallel coordinates chart with the Iris dataset. +""" +# category: other charts + +import altair as alt +from vega_datasets import data + +source = data.iris() + +alt.Chart(source).transform_window( + index='count()' +).transform_fold( + ['petalLength', 'petalWidth', 'sepalLength', 'sepalWidth'] +).mark_line().encode( + x='key:N', + y='value:Q', + color='species:N', + detail='index:N', + opacity=alt.value(0.5) +).properties(width=500) diff --git a/runtime/Lib/site-packages/altair/examples/percentage_of_total.py b/runtime/Lib/site-packages/altair/examples/percentage_of_total.py new file mode 100644 index 0000000000000000000000000000000000000000..462353fde83e195efd5500c902d3a9c187cf8f8a --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/percentage_of_total.py @@ -0,0 +1,21 @@ +""" +Calculating Percentage of Total +------------------------------- +This chart demonstrates how to use a joinaggregate transform to display +data values as a percentage of total. +""" +# category: bar charts +import altair as alt +import pandas as pd + +source = pd.DataFrame({'Activity': ['Sleeping', 'Eating', 'TV', 'Work', 'Exercise'], + 'Time': [8, 2, 4, 8, 2]}) + +alt.Chart(source).transform_joinaggregate( + TotalTime='sum(Time)', +).transform_calculate( + PercentOfTotal="datum.Time / datum.TotalTime" +).mark_bar().encode( + alt.X('PercentOfTotal:Q', axis=alt.Axis(format='.0%')), + y='Activity:N' +) diff --git a/runtime/Lib/site-packages/altair/examples/pie_chart.py b/runtime/Lib/site-packages/altair/examples/pie_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..230127a930b31fac28076c27984da1720487a8b3 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/pie_chart.py @@ -0,0 +1,18 @@ +""" +Pie Chart +--------- +This example shows how to make a Pie Chart using ``mark_arc``. +This is adapted from a corresponding Vega-Lite Example: +`Pie Chart `_. +""" +# category: circular plots + +import pandas as pd +import altair as alt + +source = pd.DataFrame({"category": [1, 2, 3, 4, 5, 6], "value": [4, 6, 10, 3, 7, 8]}) + +alt.Chart(source).mark_arc().encode( + theta=alt.Theta(field="value", type="quantitative"), + color=alt.Color(field="category", type="nominal"), +) diff --git a/runtime/Lib/site-packages/altair/examples/pie_chart_with_labels.py b/runtime/Lib/site-packages/altair/examples/pie_chart_with_labels.py new file mode 100644 index 0000000000000000000000000000000000000000..15a3fb188f98fa8408acc8d2df70fd53c79c4b87 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/pie_chart_with_labels.py @@ -0,0 +1,24 @@ +""" +Pie Chart with Labels +--------------------- +This example shows how to layer text over arc marks (``mark_arc``) to label pie charts. +This is adapted from a corresponding Vega-Lite Example: +`Pie Chart with Labels `_. +""" +# category: circular plots + +import pandas as pd +import altair as alt + +source = pd.DataFrame( + {"category": ["a", "b", "c", "d", "e", "f"], "value": [4, 6, 10, 3, 7, 8]} +) + +base = alt.Chart(source).encode( + theta=alt.Theta("value:Q", stack=True), color=alt.Color("category:N", legend=None) +) + +pie = base.mark_arc(outerRadius=120) +text = base.mark_text(radius=140, size=20).encode(text="category:N") + +pie + text diff --git a/runtime/Lib/site-packages/altair/examples/poly_fit_regression.py b/runtime/Lib/site-packages/altair/examples/poly_fit_regression.py new file mode 100644 index 0000000000000000000000000000000000000000..0e710532d2dde59f6e4f06df1202b6483227b429 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/poly_fit_regression.py @@ -0,0 +1,36 @@ +""" +Polynomial Fit Plot with Regression Transform +============================================= +This example shows how to overlay data with multiple fitted polynomials using +the regression transform. +""" +# category: scatter plots + +import numpy as np +import pandas as pd +import altair as alt + +# Generate some random data +rng = np.random.RandomState(1) +x = rng.rand(40) ** 2 +y = 10 - 1.0 / (x + 0.1) + rng.randn(40) +source = pd.DataFrame({"x": x, "y": y}) + +# Define the degree of the polynomial fits +degree_list = [1, 3, 5] + +base = alt.Chart(source).mark_circle(color="black").encode( + alt.X("x"), alt.Y("y") +) + +polynomial_fit = [ + base.transform_regression( + "x", "y", method="poly", order=order, as_=["x", str(order)] + ) + .mark_line() + .transform_fold([str(order)], as_=["degree", "y"]) + .encode(alt.Color("degree:N")) + for order in degree_list +] + +alt.layer(base, *polynomial_fit) diff --git a/runtime/Lib/site-packages/altair/examples/pyramid.py b/runtime/Lib/site-packages/altair/examples/pyramid.py new file mode 100644 index 0000000000000000000000000000000000000000..a53b90e05ddb117507f46a4385a6d63db1e3bb28 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/pyramid.py @@ -0,0 +1,19 @@ +""" +Pyramid Pie Chart +----------------- +Altair reproduction of http://robslink.com/SAS/democd91/pyramid_pie.htm +""" +import altair as alt +import pandas as pd + +category = ['Sky', 'Shady side of a pyramid', 'Sunny side of a pyramid'] +color = ["#416D9D", "#674028", "#DEAC58"] +df = pd.DataFrame({'category': category, 'value': [75, 10, 15]}) + +alt.Chart(df).mark_arc(outerRadius=80).encode( + alt.Theta('value:Q', scale=alt.Scale(range=[2.356, 8.639])), + alt.Color('category:N', + scale=alt.Scale(domain=category, range=color), + legend=alt.Legend(title=None, orient='none', legendX=160, legendY=50)), + order='value:Q' +).properties(width=150, height=150).configure_view(strokeOpacity=0) \ No newline at end of file diff --git a/runtime/Lib/site-packages/altair/examples/radial_chart.py b/runtime/Lib/site-packages/altair/examples/radial_chart.py new file mode 100644 index 0000000000000000000000000000000000000000..3240d092ffa13dafae6a1af0a8d0c3e32d8ab468 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/radial_chart.py @@ -0,0 +1,25 @@ +""" +Radial Chart +------------ +This radial plot uses both angular and radial extent to convey multiple dimensions of data. +This is adapted from a corresponding Vega-Lite Example: +`Radial Plot `_. +""" +# category: circular plots + +import pandas as pd +import altair as alt + +source = pd.DataFrame({"values": [12, 23, 47, 6, 52, 19]}) + +base = alt.Chart(source).encode( + theta=alt.Theta("values:Q", stack=True), + radius=alt.Radius("values", scale=alt.Scale(type="sqrt", zero=True, rangeMin=20)), + color="values:N", +) + +c1 = base.mark_arc(innerRadius=20, stroke="#fff") + +c2 = base.mark_text(radiusOffset=10).encode(text="values:Q") + +c1 + c2 diff --git a/runtime/Lib/site-packages/altair/examples/ranged_dot_plot.py b/runtime/Lib/site-packages/altair/examples/ranged_dot_plot.py new file mode 100644 index 0000000000000000000000000000000000000000..76967338e5c30c9411535b03316f7a6e212c7bf3 --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/ranged_dot_plot.py @@ -0,0 +1,43 @@ +""" +Ranged Dot Plot +----------------- +This example shows a ranged dot plot that uses 'layer' to convey changing life expectancy for the five most populous countries (between 1955 and 2000). +""" +# category: other charts +import altair as alt +from vega_datasets import data + +source = data.countries.url + +chart = alt.layer( + data=source +).transform_filter( + filter={"field": 'country', + "oneOf": ["China", "India", "United States", "Indonesia", "Brazil"]} +).transform_filter( + filter={'field': 'year', + "oneOf": [1955, 2000]} +) + +chart += alt.Chart().mark_line(color='#db646f').encode( + x='life_expect:Q', + y='country:N', + detail='country:N' +) +# Add points for life expectancy in 1955 & 2000 +chart += alt.Chart().mark_point( + size=100, + opacity=1, + filled=True +).encode( + x='life_expect:Q', + y='country:N', + color=alt.Color('year:O', + scale=alt.Scale( + domain=['1955', '2000'], + range=['#e6959c', '#911a24'] + ) + ) +).interactive() + +chart diff --git a/runtime/Lib/site-packages/altair/examples/ridgeline_plot.py b/runtime/Lib/site-packages/altair/examples/ridgeline_plot.py new file mode 100644 index 0000000000000000000000000000000000000000..e6425b9c23920faa476694f887e2afe4bf1dfd9b --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/ridgeline_plot.py @@ -0,0 +1,63 @@ +""" +Ridgeline plot Example +---------------------- +A `Ridgeline plot `_ +chart is a chart that lets you visualize distribution of a numeric value for +several groups. + +Such a chart can be created in Altair by first transforming the data into a +suitable representation. + +""" +# category: other charts +import altair as alt +from vega_datasets import data + +source = data.seattle_weather.url + +step = 20 +overlap = 1 + +alt.Chart(source, height=step).transform_timeunit( + Month='month(date)' +).transform_joinaggregate( + mean_temp='mean(temp_max)', groupby=['Month'] +).transform_bin( + ['bin_max', 'bin_min'], 'temp_max' +).transform_aggregate( + value='count()', groupby=['Month', 'mean_temp', 'bin_min', 'bin_max'] +).transform_impute( + impute='value', groupby=['Month', 'mean_temp'], key='bin_min', value=0 +).mark_area( + interpolate='monotone', + fillOpacity=0.8, + stroke='lightgray', + strokeWidth=0.5 +).encode( + alt.X('bin_min:Q', bin='binned', title='Maximum Daily Temperature (C)'), + alt.Y( + 'value:Q', + scale=alt.Scale(range=[step, -step * overlap]), + axis=None + ), + alt.Fill( + 'mean_temp:Q', + legend=None, + scale=alt.Scale(domain=[30, 5], scheme='redyellowblue') + ) +).facet( + row=alt.Row( + 'Month:T', + title=None, + header=alt.Header(labelAngle=0, labelAlign='right', format='%B') + ) +).properties( + title='Seattle Weather', + bounds='flush' +).configure_facet( + spacing=0 +).configure_view( + stroke=None +).configure_title( + anchor='end' +) diff --git a/runtime/Lib/site-packages/altair/examples/scatter_href.py b/runtime/Lib/site-packages/altair/examples/scatter_href.py new file mode 100644 index 0000000000000000000000000000000000000000..d9f0725215af37505f420b921664f8afed4e936b --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/scatter_href.py @@ -0,0 +1,23 @@ +""" +Scatter Plot with Href +---------------------- +This example shows a scatter plot with an ``href`` encoding constructed from +the car name. With this encoding, you can click on any of the points to open +a google search for the car name. +""" +# category: scatter plots + +import altair as alt +from vega_datasets import data + +source = data.cars() + +alt.Chart(source).transform_calculate( + url='https://www.google.com/search?q=' + alt.datum.Name +).mark_point().encode( + x='Horsepower:Q', + y='Miles_per_Gallon:Q', + color='Origin:N', + href='url:N', + tooltip=['Name:N', 'url:N'] +) diff --git a/runtime/Lib/site-packages/altair/examples/scatter_linked_brush.py b/runtime/Lib/site-packages/altair/examples/scatter_linked_brush.py new file mode 100644 index 0000000000000000000000000000000000000000..47181a3c80e912c1804a5d235f37ca145e77033e --- /dev/null +++ b/runtime/Lib/site-packages/altair/examples/scatter_linked_brush.py @@ -0,0 +1,25 @@ +""" +Multi-panel Scatter Plot with Linked Brushing +--------------------------------------------- +This is an example of using an interval selection to control the color of +points across multiple panels. +""" +# category: interactive charts +import altair as alt +from vega_datasets import data + +source = data.cars() + +brush = alt.selection(type='interval', resolve='global') + +base = alt.Chart(source).mark_point().encode( + y='Miles_per_Gallon', + color=alt.condition(brush, 'Origin', alt.ColorValue('gray')), +).add_selection( + brush +).properties( + width=250, + height=250 +) + +base.encode(x='Horsepower') | base.encode(x='Acceleration') diff --git a/runtime/Lib/site-packages/altair/expr/__init__.py b/runtime/Lib/site-packages/altair/expr/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8390b992a65164d801fb42c51705a5b4c2604025 --- /dev/null +++ b/runtime/Lib/site-packages/altair/expr/__init__.py @@ -0,0 +1,5 @@ +"""Tools for creating transform & filter expressions with a python syntax""" +# flake8: noqa +from .core import datum, Expression +from .funcs import * +from .consts import * diff --git a/runtime/Lib/site-packages/altair/expr/consts.py b/runtime/Lib/site-packages/altair/expr/consts.py new file mode 100644 index 0000000000000000000000000000000000000000..bb14f0b4bb6dde00e1883d1f5acad126dce376b1 --- /dev/null +++ b/runtime/Lib/site-packages/altair/expr/consts.py @@ -0,0 +1,27 @@ +from .core import ConstExpression + + +CONST_LISTING = { + "NaN": "not a number (same as JavaScript literal NaN)", + "LN10": "the natural log of 10 (alias to Math.LN10)", + "E": "the transcendental number e (alias to Math.E)", + "LOG10E": "the base 10 logarithm e (alias to Math.LOG10E)", + "LOG2E": "the base 2 logarithm of e (alias to Math.LOG2E)", + "SQRT1_2": "the square root of 0.5 (alias to Math.SQRT1_2)", + "LN2": "the natural log of 2 (alias to Math.LN2)", + "SQRT2": "the square root of 2 (alias to Math.SQRT1_2)", + "PI": "the transcendental number pi (alias to Math.PI)", +} + +NAME_MAP = {} + + +def _populate_namespace(): + globals_ = globals() + for name, doc in CONST_LISTING.items(): + py_name = NAME_MAP.get(name, name) + globals_[py_name] = ConstExpression(name, doc) + yield py_name + + +__all__ = list(_populate_namespace()) diff --git a/runtime/Lib/site-packages/altair/expr/core.py b/runtime/Lib/site-packages/altair/expr/core.py new file mode 100644 index 0000000000000000000000000000000000000000..264c5a1956fbc90a3322f3d69a2f555d416a9d95 --- /dev/null +++ b/runtime/Lib/site-packages/altair/expr/core.py @@ -0,0 +1,197 @@ +from ..utils import SchemaBase + + +class DatumType(object): + """An object to assist in building Vega-Lite Expressions""" + + 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): + return GetItemExpression("datum", attr) + + def __call__(self, datum, **kwargs): + """Specify a datum for use in an encoding""" + return dict(datum=datum, **kwargs) + + +datum = DatumType() + + +def _js_repr(val): + """Return a javascript-safe string representation of val""" + if val is True: + return "true" + elif val is False: + return "false" + elif val is None: + return "null" + else: + return repr(val) + + +class Expression(SchemaBase): + """Expression + + Base object for enabling build-up of Javascript expressions using + a Python syntax. Calling ``repr(obj)`` will return a Javascript + representation of the object and the operations it encodes. + """ + + _schema = {"type": "string"} + + def to_dict(self, *args, **kwargs): + return repr(self) + + def __setattr__(self, attr, val): + # We don't need the setattr magic defined in SchemaBase + return object.__setattr__(self, attr, val) + + def __add__(self, other): + return BinaryExpression("+", self, other) + + def __radd__(self, other): + return BinaryExpression("+", other, self) + + def __sub__(self, other): + return BinaryExpression("-", self, other) + + def __rsub__(self, other): + return BinaryExpression("-", other, self) + + def __mul__(self, other): + return BinaryExpression("*", self, other) + + def __rmul__(self, other): + return BinaryExpression("*", other, self) + + def __truediv__(self, other): + return BinaryExpression("/", self, other) + + def __rtruediv__(self, other): + return BinaryExpression("/", other, self) + + __div__ = __truediv__ + + __rdiv__ = __rtruediv__ + + def __mod__(self, other): + return BinaryExpression("%", self, other) + + def __rmod__(self, other): + return BinaryExpression("%", other, self) + + def __pow__(self, other): + # "**" Javascript operator is not supported in all browsers + return FunctionExpression("pow", (self, other)) + + def __rpow__(self, other): + # "**" Javascript operator is not supported in all browsers + return FunctionExpression("pow", (other, self)) + + def __neg__(self): + return UnaryExpression("-", self) + + def __pos__(self): + return UnaryExpression("+", self) + + # comparison operators + + def __eq__(self, other): + return BinaryExpression("===", self, other) + + def __ne__(self, other): + return BinaryExpression("!==", self, other) + + def __gt__(self, other): + return BinaryExpression(">", self, other) + + def __lt__(self, other): + return BinaryExpression("<", self, other) + + def __ge__(self, other): + return BinaryExpression(">=", self, other) + + def __le__(self, other): + return BinaryExpression("<=", self, other) + + def __abs__(self): + return FunctionExpression("abs", (self,)) + + # logical operators + + def __and__(self, other): + return BinaryExpression("&&", self, other) + + def __rand__(self, other): + return BinaryExpression("&&", other, self) + + def __or__(self, other): + return BinaryExpression("||", self, other) + + def __ror__(self, other): + return BinaryExpression("||", other, self) + + def __invert__(self): + return UnaryExpression("!", self) + + # item access + def __getitem__(self, val): + return GetItemExpression(self, val) + + +class UnaryExpression(Expression): + def __init__(self, op, val): + super(UnaryExpression, self).__init__(op=op, val=val) + + def __repr__(self): + return "({op}{val})".format(op=self.op, val=_js_repr(self.val)) + + +class BinaryExpression(Expression): + def __init__(self, op, lhs, rhs): + super(BinaryExpression, self).__init__(op=op, lhs=lhs, rhs=rhs) + + def __repr__(self): + return "({lhs} {op} {rhs})".format( + op=self.op, lhs=_js_repr(self.lhs), rhs=_js_repr(self.rhs) + ) + + +class FunctionExpression(Expression): + def __init__(self, name, args): + super(FunctionExpression, self).__init__(name=name, args=args) + + def __repr__(self): + args = ",".join(_js_repr(arg) for arg in self.args) + return "{name}({args})".format(name=self.name, args=args) + + +class ConstExpression(Expression): + def __init__(self, name, doc): + self.__doc__ = """{}: {}""".format(name, doc) + super(ConstExpression, self).__init__(name=name, doc=doc) + + def __repr__(self): + return str(self.name) + + +class GetAttrExpression(Expression): + def __init__(self, group, name): + super(GetAttrExpression, self).__init__(group=group, name=name) + + def __repr__(self): + return "{}.{}".format(self.group, self.name) + + +class GetItemExpression(Expression): + def __init__(self, group, name): + super(GetItemExpression, self).__init__(group=group, name=name) + + def __repr__(self): + return "{}[{!r}]".format(self.group, self.name) diff --git a/runtime/Lib/site-packages/altair/expr/funcs.py b/runtime/Lib/site-packages/altair/expr/funcs.py new file mode 100644 index 0000000000000000000000000000000000000000..ed86d536722b00ca629a74ea9ecc52986789948d --- /dev/null +++ b/runtime/Lib/site-packages/altair/expr/funcs.py @@ -0,0 +1,168 @@ +from .core import FunctionExpression + + +FUNCTION_LISTING = { + "isArray": r"Returns true if _value_ is an array, false otherwise.", + "isBoolean": r"Returns true if _value_ is a boolean (`true` or `false`), false otherwise.", + "isDate": r"Returns true if _value_ is a Date object, false otherwise. This method will return false for timestamp numbers or date-formatted strings; it recognizes Date objects only.", + "isNumber": r"Returns true if _value_ is a number, false otherwise. `NaN` and `Infinity` are considered numbers.", + "isObject": r"Returns true if _value_ is an object (including arrays and Dates), false otherwise.", + "isRegExp": r"Returns true if _value_ is a RegExp (regular expression) object, false otherwise.", + "isString": r"Returns true if _value_ is a string, false otherwise.", + "toBoolean": r"Coerces the input _value_ to a string. Null values and empty strings are mapped to `null`.", + "toDate": r"Coerces the input _value_ to a Date instance. Null values and empty strings are mapped to `null`. If an optional _parser_ function is provided, it is used to perform date parsing, otherwise `Date.parse` is used. Be aware that `Date.parse` has different implementations across browsers!", + "toNumber": r"Coerces the input _value_ to a number. Null values and empty strings are mapped to `null`.", + "toString": r"Coerces the input _value_ to a string. Null values and empty strings are mapped to `null`.", + "if": r"If _test_ is truthy, returns _thenValue_. Otherwise, returns _elseValue_. The _if_ function is equivalent to the ternary operator `a ? b : c`.", + "isNaN": r"Returns true if _value_ is not a number. Same as JavaScript's `isNaN`.", + "isFinite": r"Returns true if _value_ is a finite number. Same as JavaScript's `isFinite`.", + "abs": r"Returns the absolute value of _value_. Same as JavaScript's `Math.abs`.", + "acos": r"Trigonometric arccosine. Same as JavaScript's `Math.acos`.", + "asin": r"Trigonometric arcsine. Same as JavaScript's `Math.asin`.", + "atan": r"Trigonometric arctangent. Same as JavaScript's `Math.atan`.", + "atan2": r"Returns the arctangent of _dy / dx_. Same as JavaScript's `Math.atan2`.", + "ceil": r"Rounds _value_ to the nearest integer of equal or greater value. Same as JavaScript's `Math.ceil`.", + "clamp": r"Restricts _value_ to be between the specified _min_ and _max_.", + "cos": r"Trigonometric cosine. Same as JavaScript's `Math.cos`.", + "exp": r"Returns the value of _e_ raised to the provided _exponent_. Same as JavaScript's `Math.exp`.", + "floor": r"Rounds _value_ to the nearest integer of equal or lower value. Same as JavaScript's `Math.floor`.", + "log": r"Returns the natural logarithm of _value_. Same as JavaScript's `Math.log`.", + "max": r"Returns the maximum argument value. Same as JavaScript's `Math.max`.", + "min": r"Returns the minimum argument value. Same as JavaScript's `Math.min`.", + "pow": r"Returns _value_ raised to the given _exponent_. Same as JavaScript's `Math.pow`.", + "random": r"Returns a pseudo-random number in the range [0,1). Same as JavaScript's `Math.random`.", + "round": r"Rounds _value_ to the nearest integer. Same as JavaScript's `Math.round`.", + "sin": r"Trigonometric sine. Same as JavaScript's `Math.sin`.", + "sqrt": r"Square root function. Same as JavaScript's `Math.sqrt`.", + "tan": r"Trigonometric tangent. Same as JavaScript's `Math.tan`.", + "now": r"Returns the timestamp for the current time.", + "datetime": r"Returns a new `Date` instance. The _month_ is 0-based, such that `1` represents February.", + "date": r"Returns the day of the month for the given _datetime_ value, in local time.", + "day": r"Returns the day of the week for the given _datetime_ value, in local time.", + "year": r"Returns the year for the given _datetime_ value, in local time.", + "quarter": r"Returns the quarter of the year (0-3) for the given _datetime_ value, in local time.", + "month": r"Returns the (zero-based) month for the given _datetime_ value, in local time.", + "hours": r"Returns the hours component for the given _datetime_ value, in local time.", + "minutes": r"Returns the minutes component for the given _datetime_ value, in local time.", + "seconds": r"Returns the seconds component for the given _datetime_ value, in local time.", + "milliseconds": r"Returns the milliseconds component for the given _datetime_ value, in local time.", + "time": r"Returns the epoch-based timestamp for the given _datetime_ value.", + "timezoneoffset": r"Returns the timezone offset from the local timezone to UTC for the given _datetime_ value.", + "utc": r"Returns a timestamp for the given UTC date. The _month_ is 0-based, such that `1` represents February.", + "utcdate": r"Returns the day of the month for the given _datetime_ value, in UTC time.", + "utcday": r"Returns the day of the week for the given _datetime_ value, in UTC time.", + "utcyear": r"Returns the year for the given _datetime_ value, in UTC time.", + "utcquarter": r"Returns the quarter of the year (0-3) for the given _datetime_ value, in UTC time.", + "utcmonth": r"Returns the (zero-based) month for the given _datetime_ value, in UTC time.", + "utchours": r"Returns the hours component for the given _datetime_ value, in UTC time.", + "utcminutes": r"Returns the minutes component for the given _datetime_ value, in UTC time.", + "utcseconds": r"Returns the seconds component for the given _datetime_ value, in UTC time.", + "utcmilliseconds": r"Returns the milliseconds component for the given _datetime_ value, in UTC time.", + "extent": r"Returns a new _[min, max]_ array with the minimum and maximum values of the input array, ignoring `null`, `undefined`, and `NaN` values.", + "clampRange": r"Clamps a two-element _range_ array in a span-preserving manner. If the span of the input _range_ is less than _(max - min)_ and an endpoint exceeds either the _min_ or _max_ value, the range is translated such that the span is preserved and one endpoint touches the boundary of the _[min, max]_ range. If the span exceeds _(max - min)_, the range _[min, max]_ is returned.", + "indexof": r"Returns the first index of _value_ in the input _array_, or the first index of _substring_ in the input _string_..", + "inrange": r"Tests whether _value_ lies within (or is equal to either) the first and last values of the _range_ array.", + "join": r"Returns a new string by concatenating all of the elements of the input _array_, separated by commas or a specified _separator_ string.", + "lastindexof": r"Returns the last index of _value_ in the input _array_, or the last index of _substring_ in the input _string_..", + "length": r"Returns the length of the input _array_, or the length of the input _string_.", + "lerp": r"Returns the linearly interpolated value between the first and last entries in the _array_ for the provided interpolation _fraction_ (typically between 0 and 1). For example, `lerp([0, 50], 0.5)` returns 25.", + "peek": r"Returns the last element in the input _array_. Similar to the built-in `Array.pop` method, except that it does not remove the last element. This method is a convenient shorthand for `array[array.length - 1]`.", + "reverse": r"Returns a new array with elements in a reverse order of the input _array_. The first array element becomes the last, and the last array element becomes the first.", + "sequence": r"Returns an array containing an arithmetic sequence of numbers. If _step_ is omitted, it defaults to 1. If _start_ is omitted, it defaults to 0. The _stop_ value is exclusive; it is not included in the result. If _step_ is positive, the last element is the largest _start + i * step_ less than _stop_; if _step_ is negative, the last element is the smallest _start + i * step_ greater than _stop_. If the returned array would contain an infinite number of values, an empty range is returned. The arguments are not required to be integers.", + "slice": r"Returns a section of _array_ between the _start_ and _end_ indices. If the _end_ argument is negative, it is treated as an offset from the end of the array (_length(array) + end_).", + "span": r"Returns the span of _array_: the difference between the last and first elements, or _array[array.length-1] - array[0]_. Or if input is a string: a section of _string_ between the _start_ and _end_ indices. If the _end_ argument is negative, it is treated as an offset from the end of the string (_length(string) + end_)..", + "lower": r"Transforms _string_ to lower-case letters.", + "pad": r"Pads a _string_ value with repeated instances of a _character_ up to a specified _length_. If _character_ is not specified, a space (' ') is used. By default, padding is added to the end of a string. An optional _align_ parameter specifies if padding should be added to the `'left'` (beginning), `'center'`, or `'right'` (end) of the input string.", + "parseFloat": r"Parses the input _string_ to a floating-point value. Same as JavaScript's `parseFloat`.", + "parseInt": r"Parses the input _string_ to an integer value. Same as JavaScript's `parseInt`.", + "replace": r"Returns a new string with some or all matches of _pattern_ replaced by a _replacement_ string. The _pattern_ can be a string or a regular expression. If _pattern_ is a string, only the first instance will be replaced. Same as [JavaScript's String.replace](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace).", + "split": r"Returns an array of tokens created by splitting the input _string_ according to a provided _separator_ pattern. The result can optionally be constrained to return at most _limit_ tokens.", + "substring": r"Returns a section of _string_ between the _start_ and _end_ indices.", + "trim": r"Returns a trimmed string with preceding and trailing whitespace removed.", + "truncate": r"Truncates an input _string_ to a target _length_. The optional _align_ argument indicates what part of the string should be truncated: `'left'` (the beginning), `'center'`, or `'right'` (the end). By default, the `'right'` end of the string is truncated. The optional _ellipsis_ argument indicates the string to use to indicate truncated content; by default the ellipsis character `...` (`\\u2026`) is used.", + "upper": r"Transforms _string_ to upper-case letters.", + "merge": r"Merges the input objects _object1_, _object2_, etc into a new output object. Inputs are visited in sequential order, such that key values from later arguments can overwrite those from earlier arguments. Example: `merge({a:1, b:2}, {a:3}) -> {a:3, b:2}`.", + "dayFormat": r"Formats a (0-6) _weekday_ number as a full week day name, according to the current locale. For example: `dayFormat(0) -> \"Sunday\"`.", + "dayAbbrevFormat": r"Formats a (0-6) _weekday_ number as an abbreviated week day name, according to the current locale. For example: `dayAbbrevFormat(0) -> \"Sun\"`.", + "format": r"Formats a numeric _value_ as a string. The _specifier_ must be a valid [d3-format specifier](https://github.com/d3/d3-format/) (e.g., `format(value, ',.2f')`.", + "monthFormat": r"Formats a (zero-based) _month_ number as a full month name, according to the current locale. For example: `monthFormat(0) -> \"January\"`.", + "monthAbbrevFormat": r"Formats a (zero-based) _month_ number as an abbreviated month name, according to the current locale. For example: `monthAbbrevFormat(0) -> \"Jan\"`.", + "timeFormat": r"Formats a datetime _value_ (either a `Date` object or timestamp) as a string, according to the local time. The _specifier_ must be a valid [d3-time-format specifier](https://github.com/d3/d3-time-format/). For example: `timeFormat(timestamp, '%A')`.", + "timeParse": r"Parses a _string_ value to a Date object, according to the local time. The _specifier_ must be a valid [d3-time-format specifier](https://github.com/d3/d3-time-format/). For example: `timeParse('June 30, 2015', '%B %d, %Y')`.", + "utcFormat": r"Formats a datetime _value_ (either a `Date` object or timestamp) as a string, according to [UTC](https://en.wikipedia.org/wiki/Coordinated_Universal_Time) time. The _specifier_ must be a valid [d3-time-format specifier](https://github.com/d3/d3-time-format/). For example: `utcFormat(timestamp, '%A')`.", + "utcParse": r"Parses a _string_ value to a Date object, according to [UTC](https://en.wikipedia.org/wiki/Coordinated_Universal_Time) time. The _specifier_ must be a valid [d3-time-format specifier](https://github.com/d3/d3-time-format/). For example: `utcParse('June 30, 2015', '%B %d, %Y')`.", + "regexp": r"Creates a regular expression instance from an input _pattern_ string and optional _flags_. Same as [JavaScript's `RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp).", + "test": r"Evaluates a regular expression _regexp_ against the input _string_, returning `true` if the string matches the pattern, `false` otherwise. For example: `test(/\\d{3}/, \"32-21-9483\") -> true`.", + "rgb": r"Constructs a new [RGB](https://en.wikipedia.org/wiki/RGB_color_model) color. If _r_, _g_ and _b_ are specified, these represent the channel values of the returned color; an _opacity_ may also be specified. If a CSS Color Module Level 3 _specifier_ string is specified, it is parsed and then converted to the RGB color space. Uses [d3-color's rgb function](https://github.com/d3/d3-color#rgb).", + "hsl": r"Constructs a new [HSL](https://en.wikipedia.org/wiki/HSL_and_HSV) color. If _h_, _s_ and _l_ are specified, these represent the channel values of the returned color; an _opacity_ may also be specified. If a CSS Color Module Level 3 _specifier_ string is specified, it is parsed and then converted to the HSL color space. Uses [d3-color's hsl function](https://github.com/d3/d3-color#hsl).", + "lab": r"Constructs a new [CIE LAB](https://en.wikipedia.org/wiki/Lab_color_space#CIELAB) color. If _l_, _a_ and _b_ are specified, these represent the channel values of the returned color; an _opacity_ may also be specified. If a CSS Color Module Level 3 _specifier_ string is specified, it is parsed and then converted to the LAB color space. Uses [d3-color's lab function](https://github.com/d3/d3-color#lab).", + "hcl": r"Constructs a new [HCL](https://en.wikipedia.org/wiki/Lab_color_space#CIELAB) (hue, chroma, luminance) color. If _h_, _c_ and _l_ are specified, these represent the channel values of the returned color; an _opacity_ may also be specified. If a CSS Color Module Level 3 _specifier_ string is specified, it is parsed and then converted to the HCL color space. Uses [d3-color's hcl function](https://github.com/d3/d3-color#hcl).", + "item": r"Returns the current scenegraph item that is the target of the event.", + "group": r"Returns the scenegraph group mark item in which the current event has occurred. If no arguments are provided, the immediate parent group is returned. If a group name is provided, the matching ancestor group item is returned.", + "xy": r"Returns the x- and y-coordinates for the current event as a two-element array. If no arguments are provided, the top-level coordinate space of the view is used. If a scenegraph _item_ (or string group name) is provided, the coordinate space of the group item is used.", + "x": r"Returns the x coordinate for the current event. If no arguments are provided, the top-level coordinate space of the view is used. If a scenegraph _item_ (or string group name) is provided, the coordinate space of the group item is used.", + "y": r"Returns the y coordinate for the current event. If no arguments are provided, the top-level coordinate space of the view is used. If a scenegraph _item_ (or string group name) is provided, the coordinate space of the group item is used.", + "pinchDistance": r"Returns the pixel distance between the first two touch points of a multi-touch event.", + "pinchAngle": r"Returns the angle of the line connecting the first two touch points of a multi-touch event.", + "inScope": r"Returns true if the given scenegraph _item_ is a descendant of the group mark in which the event handler was defined, false otherwise.", + "data": r"Returns the array of data objects for the Vega data set with the given _name_. If the data set is not found, returns an empty array.", + "indata": r"Tests if the data set with a given _name_ contains a datum with a _field_ value that matches the input _value_. For example: `indata('table', 'category', value)`.", + "scale": r"Applies the named scale transform (or projection) to the specified _value_. The optional _group_ argument takes a scenegraph group mark item to indicate the specific scope in which to look up the scale or projection.", + "invert": r"Inverts the named scale transform (or projection) for the specified _value_. The optional _group_ argument takes a scenegraph group mark item to indicate the specific scope in which to look up the scale or projection.", + "copy": r"Returns a copy (a new cloned instance) of the named scale transform of projection, or `undefined` if no scale or projection is found. The optional _group_ argument takes a scenegraph group mark item to indicate the specific scope in which to look up the scale or projection.", + "domain": r"Returns the scale domain array for the named scale transform, or an empty array if the scale is not found. The optional _group_ argument takes a scenegraph group mark item to indicate the specific scope in which to look up the scale.", + "range": r"Returns the scale range array for the named scale transform, or an empty array if the scale is not found. The optional _group_ argument takes a scenegraph group mark item to indicate the specific scope in which to look up the scale.", + "bandwidth": r"Returns the current band width for the named band scale transform, or zero if the scale is not found or is not a band scale. The optional _group_ argument takes a scenegraph group mark item to indicate the specific scope in which to look up the scale.", + "bandspace": r"Returns the number of steps needed within a band scale, based on the _count_ of domain elements and the inner and outer padding values. While normally calculated within the scale itself, this function can be helpful for determining the size of a chart's layout.", + "gradient": r"Returns a linear color gradient for the _scale_ (whose range must be a [continuous color scheme](../schemes)) and starting and ending points _p0_ and _p1_, each an _[x, y]_ array. The points _p0_ and _p1_ should be expressed in normalized coordinates in the domain [0, 1], relative to the bounds of the item being colored. If unspecified, _p0_ defaults to `[0, 0]` and _p1_ defaults to `[1, 0]`, for a horizontal gradient that spans the full bounds of an item. The optional _count_ argument indicates a desired target number of sample points to take from the color scale.", + "panLinear": r"Given a linear scale _domain_ array with numeric or datetime values, returns a new two-element domain array that is the result of panning the domain by a fractional _delta_. The _delta_ value represents fractional units of the scale range; for example, `0.5` indicates panning the scale domain to the right by half the scale range.", + "panLog": r"Given a log scale _domain_ array with numeric or datetime values, returns a new two-element domain array that is the result of panning the domain by a fractional _delta_. The _delta_ value represents fractional units of the scale range; for example, `0.5` indicates panning the scale domain to the right by half the scale range.", + "panPow": r"Given a power scale _domain_ array with numeric or datetime values and the given _exponent_, returns a new two-element domain array that is the result of panning the domain by a fractional _delta_. The _delta_ value represents fractional units of the scale range; for example, `0.5` indicates panning the scale domain to the right by half the scale range.", + "panSymlog": r"Given a symmetric log scale _domain_ array with numeric or datetime values parameterized by the given _constant_, returns a new two-element domain array that is the result of panning the domain by a fractional _delta_. The _delta_ value represents fractional units of the scale range; for example, `0.5` indicates panning the scale domain to the right by half the scale range.", + "zoomLinear": r"Given a linear scale _domain_ array with numeric or datetime values, returns a new two-element domain array that is the result of zooming the domain by a _scaleFactor_, centered at the provided fractional _anchor_. The _anchor_ value represents the zoom position in terms of fractional units of the scale range; for example, `0.5` indicates a zoom centered on the mid-point of the scale range.", + "zoomLog": r"Given a log scale _domain_ array with numeric or datetime values, returns a new two-element domain array that is the result of zooming the domain by a _scaleFactor_, centered at the provided fractional _anchor_. The _anchor_ value represents the zoom position in terms of fractional units of the scale range; for example, `0.5` indicates a zoom centered on the mid-point of the scale range.", + "zoomPow": r"Given a power scale _domain_ array with numeric or datetime values and the given _exponent_, returns a new two-element domain array that is the result of zooming the domain by a _scaleFactor_, centered at the provided fractional _anchor_. The _anchor_ value represents the zoom position in terms of fractional units of the scale range; for example, `0.5` indicates a zoom centered on the mid-point of the scale range.", + "zoomSymlog": r"Given a symmetric log scale _domain_ array with numeric or datetime values parameterized by the given _constant_, returns a new two-element domain array that is the result of zooming the domain by a _scaleFactor_, centered at the provided fractional _anchor_. The _anchor_ value represents the zoom position in terms of fractional units of the scale range; for example, `0.5` indicates a zoom centered on the mid-point of the scale range.", + "geoArea": r"Returns the projected planar area (typically in square pixels) of a GeoJSON _feature_ according to the named _projection_. If the _projection_ argument is `null`, computes the spherical area in steradians using unprojected longitude, latitude coordinates. The optional _group_ argument takes a scenegraph group mark item to indicate the specific scope in which to look up the projection. Uses d3-geo's [geoArea](https://github.com/d3/d3-geo#geoArea) and [path.area](https://github.com/d3/d3-geo#path_area) methods.", + "geoBounds": r"Returns the projected planar bounding box (typically in pixels) for the specified GeoJSON _feature_, according to the named _projection_. The bounding box is represented by a two-dimensional array: [[_x0_, _y0_], [_x1_, _y1_]], where _x0_ is the minimum x-coordinate, _y0_ is the minimum y-coordinate, _x1_ is the maximum x-coordinate, and _y1_ is the maximum y-coordinate. If the _projection_ argument is `null`, computes the spherical bounding box using unprojected longitude, latitude coordinates. The optional _group_ argument takes a scenegraph group mark item to indicate the specific scope in which to look up the projection. Uses d3-geo's [geoBounds](https://github.com/d3/d3-geo#geoBounds) and [path.bounds](https://github.com/d3/d3-geo#path_bounds) methods.", + "geoCentroid": r"Returns the projected planar centroid (typically in pixels) for the specified GeoJSON _feature_, according to the named _projection_. If the _projection_ argument is `null`, computes the spherical centroid using unprojected longitude, latitude coordinates. The optional _group_ argument takes a scenegraph group mark item to indicate the specific scope in which to look up the projection. Uses d3-geo's [geoCentroid](https://github.com/d3/d3-geo#geoCentroid) and [path.centroid](https://github.com/d3/d3-geo#path_centroid) methods.", + "treePath": r"For the hierarchy data set with the given _name_, returns the shortest path through from the _source_ node id to the _target_ node id. The path starts at the _source_ node, ascends to the least common ancestor of the _source_ node and the _target_ node, and then descends to the _target_ node.", + "treeAncestors": r"For the hierarchy data set with the given _name_, returns the array of ancestors nodes, starting with the input _node_, then followed by each parent up to the root.", + "warn": r"Logs a warning message and returns the last argument. For the message to appear in the console, the visualization view must have the appropriate logging level set.", + "info": r"Logs an informative message and returns the last argument. For the message to appear in the console, the visualization view must have the appropriate logging level set.", + "debug": r"Logs a debugging message and returns the last argument. For the message to appear in the console, the visualization view must have the appropriate logging level set.", + "eventGroup": "returns the scenegraph group mark item within which the current event has occurred. If no arguments are provided, the immediate parent group is returned. If a group name is provided, the matching ancestor group item is returned.", + "eventItem": "a zero-argument function that returns the current scenegraph item that is the subject of the event.", + "eventX": "returns the x-coordinate for the current event. If no arguments are provided, the top-level coordinate space of the visualization is used. If a group name is provided, the coordinate-space of the matching ancestor group item is used.", + "eventY": "returns the y-coordinate for the current event. If no arguments are provided, the top-level coordinate space of the visualization is used. If a group name is provided, the coordinate-space of the matching ancestor group item is used.", + "iscale": 'applies an inverse scale transform to a specified value; by default, looks for the scale at the top-level of the specification, but an optional signal can also be supplied corresponding to the group which contains the scale (i.e., `iscale("x", val, group)`). *Note:* This function is only legal within signal stream handlers and mark [production rules](https://github.com/vega/vega/wiki/Marks#production-rules). Invoking this function elsewhere (e.g., with filter or formula transforms) will result in an error.', + "open": "opens a hyperlink (alias to `window.open`). This function is only valid when running in the browser. It should not be invoked within a server-side (e.g., node.js) environment.", +} + + +# This maps vega expression function names to the Python name +NAME_MAP = {"if": "if_"} + + +class ExprFunc(object): + def __init__(self, name, doc): + self.name = name + self.doc = doc + self.__doc__ = """{}(*args)\n {}""".format(name, doc) + + def __call__(self, *args): + return FunctionExpression(self.name, args) + + def __repr__(self): + return "".format(self.name) + + +def _populate_namespace(): + globals_ = globals() + for name, doc in FUNCTION_LISTING.items(): + py_name = NAME_MAP.get(name, name) + globals_[py_name] = ExprFunc(name, doc) + yield py_name + + +__all__ = list(_populate_namespace()) diff --git a/runtime/Lib/site-packages/altair/expr/tests/__init__.py b/runtime/Lib/site-packages/altair/expr/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/altair/expr/tests/test_expr.py b/runtime/Lib/site-packages/altair/expr/tests/test_expr.py new file mode 100644 index 0000000000000000000000000000000000000000..19265406ebca6e27f6121ace8ddad7798de5ea26 --- /dev/null +++ b/runtime/Lib/site-packages/altair/expr/tests/test_expr.py @@ -0,0 +1,106 @@ +import operator + +import pytest + +from ... import expr +from .. import datum + + +def test_unary_operations(): + OP_MAP = {"-": operator.neg, "+": operator.pos} + for op, func in OP_MAP.items(): + z = func(datum.xxx) + assert repr(z) == "({}datum.xxx)".format(op) + + +def test_binary_operations(): + OP_MAP = { + "+": operator.add, + "-": operator.sub, + "*": operator.mul, + "/": operator.truediv, + "%": operator.mod, + "===": operator.eq, + "<": operator.lt, + "<=": operator.le, + ">": operator.gt, + ">=": operator.ge, + "!==": operator.ne, + "&&": operator.and_, + "||": operator.or_, + } + # When these are on the RHS, the opposite is evaluated instead. + INEQ_REVERSE = { + ">": "<", + "<": ">", + "<=": ">=", + ">=": "<=", + "===": "===", + "!==": "!==", + } + for op, func in OP_MAP.items(): + z1 = func(datum.xxx, 2) + assert repr(z1) == "(datum.xxx {} 2)".format(op) + + z2 = func(2, datum.xxx) + if op in INEQ_REVERSE: + assert repr(z2) == "(datum.xxx {} 2)".format(INEQ_REVERSE[op]) + else: + assert repr(z2) == "(2 {} datum.xxx)".format(op) + + z3 = func(datum.xxx, datum.yyy) + assert repr(z3) == "(datum.xxx {} datum.yyy)".format(op) + + +def test_abs(): + z = abs(datum.xxx) + assert repr(z) == "abs(datum.xxx)" + + +def test_expr_funcs(): + """test all functions defined in expr.funcs""" + name_map = {val: key for key, val in expr.funcs.NAME_MAP.items()} + for funcname in expr.funcs.__all__: + func = getattr(expr, funcname) + z = func(datum.xxx) + assert repr(z) == "{}(datum.xxx)".format(name_map.get(funcname, funcname)) + + +def test_expr_consts(): + """Test all constants defined in expr.consts""" + name_map = {val: key for key, val in expr.consts.NAME_MAP.items()} + for constname in expr.consts.__all__: + const = getattr(expr, constname) + z = const * datum.xxx + assert repr(z) == "({} * datum.xxx)".format(name_map.get(constname, constname)) + + +def test_json_reprs(): + """Test JSON representations of special values""" + assert repr(datum.xxx == None) == "(datum.xxx === null)" # noqa: E711 + assert repr(datum.xxx == False) == "(datum.xxx === false)" # noqa: E712 + assert repr(datum.xxx == True) == "(datum.xxx === true)" # noqa: E712 + + +def test_to_dict(): + ex = datum.xxx * 2 > datum.yyy + assert ex.to_dict() == repr(ex) + + +def test_copy(): + ex = datum.xxx * 2 > abs(datum.yyy) + ex_copy = ex.copy() + assert ex.to_dict() == ex_copy.to_dict() + + +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] + assert repr(x) == "datum.foo[0]" diff --git a/runtime/Lib/site-packages/altair/sphinxext/__init__.py b/runtime/Lib/site-packages/altair/sphinxext/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/altair/sphinxext/altairgallery.py b/runtime/Lib/site-packages/altair/sphinxext/altairgallery.py new file mode 100644 index 0000000000000000000000000000000000000000..93090667ea4dfbd5004aaad53caa4dc684c5c51e --- /dev/null +++ b/runtime/Lib/site-packages/altair/sphinxext/altairgallery.py @@ -0,0 +1,311 @@ +import hashlib +import os +import json +import random +import collections +from operator import itemgetter +import warnings + +import jinja2 + +from docutils import nodes +from docutils.statemachine import ViewList +from docutils.parsers.rst import Directive +from docutils.parsers.rst.directives import flag + +from sphinx.util.nodes import nested_parse_with_titles + +from .utils import ( + get_docstring_and_rest, + prev_this_next, + create_thumbnail, + create_generic_image, +) +from altair.utils.execeval import eval_block +from altair.examples import iter_examples + + +EXAMPLE_MODULE = "altair.examples" + + +GALLERY_TEMPLATE = jinja2.Template( + """ +.. This document is auto-generated by the altair-gallery extension. Do not modify directly. + +.. _{{ gallery_ref }}: + +{{ title }} +{% for char in title %}-{% endfor %} + +This gallery contains a selection of examples of the plots Altair can create. + +Some may seem fairly complicated at first glance, but they are built by combining a simple set of declarative building blocks. + +Many draw upon sample datasets compiled by the `Vega `_ project. To access them yourself, install `vega_datasets `_. + +.. code-block:: none + + $ pip install vega_datasets + +{% for grouper, group in examples %} + +.. _gallery-category-{{ grouper }}: + +{{ grouper }} +{% for char in grouper %}~{% endfor %} + +.. raw:: html + + + {% for example in group %} + + + {{ example.title }} + + {% endfor %} + + +
    + +.. toctree:: + :hidden: +{% for example in group %} + {{ example.name }} +{%- endfor %} + +{% endfor %} +""" +) + +MINIGALLERY_TEMPLATE = jinja2.Template( + """ +.. raw:: html + +
    +
    + {% for example in examples %} + + {% endfor %} +
    +
    +""" +) + + +EXAMPLE_TEMPLATE = jinja2.Template( + """ +.. This document is auto-generated by the altair-gallery extension. Do not modify directly. + +.. _gallery_{{ name }}: + +{{ docstring }} + +.. altair-plot:: + {% if code_below %}:code-below:{% endif %} + + {{ code | indent(4) }} + +.. toctree:: + :hidden: +""" +) + + +def save_example_pngs(examples, image_dir, make_thumbnails=True): + """Save example pngs and (optionally) thumbnails""" + if not os.path.exists(image_dir): + os.makedirs(image_dir) + + # store hashes so that we know whether images need to be generated + hash_file = os.path.join(image_dir, "_image_hashes.json") + + if os.path.exists(hash_file): + with open(hash_file) as f: + hashes = json.load(f) + else: + hashes = {} + + for example in examples: + filename = example["name"] + ".png" + image_file = os.path.join(image_dir, filename) + + example_hash = hashlib.md5(example["code"].encode()).hexdigest() + hashes_match = hashes.get(filename, "") == example_hash + + if hashes_match and os.path.exists(image_file): + print("-> using cached {}".format(image_file)) + else: + # the file changed or the image file does not exist. Generate it. + print("-> saving {}".format(image_file)) + chart = eval_block(example["code"]) + try: + chart.save(image_file) + hashes[filename] = example_hash + except ImportError: + warnings.warn("Unable to save image: using generic image") + create_generic_image(image_file) + + with open(hash_file, "w") as f: + json.dump(hashes, f) + + if make_thumbnails: + params = example.get("galleryParameters", {}) + thumb_file = os.path.join(image_dir, example["name"] + "-thumb.png") + create_thumbnail(image_file, thumb_file, **params) + + # Save hashes so we know whether we need to re-generate plots + with open(hash_file, "w") as f: + json.dump(hashes, f) + + +def populate_examples(**kwds): + """Iterate through Altair examples and extract code""" + + examples = sorted(iter_examples(), key=itemgetter("name")) + + for example in examples: + docstring, category, code, lineno = get_docstring_and_rest(example["filename"]) + example.update(kwds) + if category is None: + category = "other charts" + example.update( + { + "docstring": docstring, + "title": docstring.strip().split("\n")[0], + "code": code, + "category": category.title(), + "lineno": lineno, + } + ) + + return examples + + +class AltairMiniGalleryDirective(Directive): + has_content = False + + option_spec = { + "size": int, + "names": str, + "indices": lambda x: list(map(int, x.split())), + "shuffle": flag, + "seed": int, + "titles": bool, + "width": str, + } + + def run(self): + size = self.options.get("size", 15) + names = [name.strip() for name in self.options.get("names", "").split(",")] + indices = self.options.get("indices", []) + shuffle = "shuffle" in self.options + seed = self.options.get("seed", 42) + titles = self.options.get("titles", False) + width = self.options.get("width", None) + + env = self.state.document.settings.env + app = env.app + + gallery_dir = app.builder.config.altair_gallery_dir + + examples = populate_examples() + + if names: + if len(names) < size: + raise ValueError( + "altair-minigallery: if names are specified, " + "the list must be at least as long as size." + ) + mapping = {example["name"]: example for example in examples} + examples = [mapping[name] for name in names] + else: + if indices: + examples = [examples[i] for i in indices] + if shuffle: + random.seed(seed) + random.shuffle(examples) + if size: + examples = examples[:size] + + include = MINIGALLERY_TEMPLATE.render( + image_dir="/_static", + gallery_dir=gallery_dir, + examples=examples, + titles=titles, + width=width, + ) + + # parse and return documentation + result = ViewList() + for line in include.split("\n"): + result.append(line, "") + node = nodes.paragraph() + node.document = self.state.document + nested_parse_with_titles(self.state, result, node) + + return node.children + + +def main(app): + gallery_dir = app.builder.config.altair_gallery_dir + target_dir = os.path.join(app.builder.srcdir, gallery_dir) + image_dir = os.path.join(app.builder.srcdir, "_images") + + gallery_ref = app.builder.config.altair_gallery_ref + gallery_title = app.builder.config.altair_gallery_title + examples = populate_examples(gallery_ref=gallery_ref, code_below=True) + + if not os.path.exists(target_dir): + os.makedirs(target_dir) + + examples = sorted(examples, key=lambda x: x["title"]) + examples_toc = collections.OrderedDict( + { + "Simple Charts": [], + "Bar Charts": [], + "Line Charts": [], + "Area Charts": [], + "Circular Plots": [], + "Scatter Plots": [], + "Histograms": [], + "Maps": [], + "Interactive Charts": [], + "Case Studies": [], + "Other Charts": [], + } + ) + for d in examples: + examples_toc[d["category"]].append(d) + + # Write the gallery index file + with open(os.path.join(target_dir, "index.rst"), "w") as f: + f.write( + GALLERY_TEMPLATE.render( + title=gallery_title, + examples=examples_toc.items(), + image_dir="/_static", + gallery_ref=gallery_ref, + ) + ) + + # save the images to file + save_example_pngs(examples, image_dir) + + # Write the individual example files + for prev_ex, example, next_ex in prev_this_next(examples): + if prev_ex: + example["prev_ref"] = "gallery_{name}".format(**prev_ex) + if next_ex: + example["next_ref"] = "gallery_{name}".format(**next_ex) + target_filename = os.path.join(target_dir, example["name"] + ".rst") + with open(os.path.join(target_filename), "w", encoding="utf-8") as f: + f.write(EXAMPLE_TEMPLATE.render(example)) + + +def setup(app): + app.connect("builder-inited", main) + app.add_css_file("altair-gallery.css") + app.add_config_value("altair_gallery_dir", "gallery", "env") + app.add_config_value("altair_gallery_ref", "example-gallery", "env") + app.add_config_value("altair_gallery_title", "Example Gallery", "env") + app.add_directive_to_domain("py", "altair-minigallery", AltairMiniGalleryDirective) diff --git a/runtime/Lib/site-packages/altair/sphinxext/altairplot.py b/runtime/Lib/site-packages/altair/sphinxext/altairplot.py new file mode 100644 index 0000000000000000000000000000000000000000..b6e3f53319eb2808c5ce7bae91464b2614d91ee8 --- /dev/null +++ b/runtime/Lib/site-packages/altair/sphinxext/altairplot.py @@ -0,0 +1,341 @@ +""" +Altair Plot Sphinx Extension +============================ + +This extension provides a means of inserting live-rendered Altair plots within +sphinx documentation. There are two directives defined: ``altair-setup`` and +``altair-plot``. ``altair-setup`` code is used to set-up various options +prior to running the plot code. For example:: + + .. altair-plot:: + :output: none + + from altair import * + import pandas as pd + data = pd.DataFrame({'a': list('CCCDDDEEE'), + 'b': [2, 7, 4, 1, 2, 6, 8, 4, 7]}) + + .. altair-plot:: + + Chart(data).mark_point().encode( + x='a', + y='b' + ) + +In the case of the ``altair-plot`` code, the *last statement* of the code-block +should contain the chart object you wish to be rendered. + +Options +------- +The directives have the following options:: + + .. altair-plot:: + :namespace: # specify a plotting namespace that is persistent within the doc + :hide-code: # if set, then hide the code and only show the plot + :code-below: # if set, then code is below rather than above the figure + :output: [plot|repr|stdout|none] + :alt: text # Alternate text when plot cannot be rendered + :links: editor source export # specify one or more of these options + :chart-var-name: chart # name of variable in namespace containing output + + +Additionally, this extension introduces a global configuration +``altairplot_links``, set in your ``conf.py`` which is a dictionary +of links that will appear below plots, unless the ``:links:`` option +again overrides it. It should look something like this:: + + # conf.py + # ... + altairplot_links = {'editor': True, 'source': True, 'export': True} + # ... + +If this configuration is not specified, all are set to True. +""" + +import contextlib +import io +import os +import json +import warnings + +import jinja2 + +from docutils import nodes +from docutils.parsers.rst import Directive +from docutils.parsers.rst.directives import flag, unchanged + +from sphinx.locale import _ + +import altair as alt +from altair.utils.execeval import eval_block + +# These default URLs can be changed in conf.py; see setup() below. +VEGA_JS_URL_DEFAULT = "https://cdn.jsdelivr.net/npm/vega@{}".format(alt.VEGA_VERSION) +VEGALITE_JS_URL_DEFAULT = "https://cdn.jsdelivr.net/npm/vega-lite@{}".format( + alt.VEGALITE_VERSION +) +VEGAEMBED_JS_URL_DEFAULT = "https://cdn.jsdelivr.net/npm/vega-embed@{}".format( + alt.VEGAEMBED_VERSION +) + + +VGL_TEMPLATE = jinja2.Template( + """ +
    + +
    +""" +) + + +class altair_plot(nodes.General, nodes.Element): + pass + + +def purge_altair_namespaces(app, env, docname): + if not hasattr(env, "_altair_namespaces"): + return + env._altair_namespaces.pop(docname, {}) + + +DEFAULT_ALTAIRPLOT_LINKS = {"editor": True, "source": True, "export": True} + + +def validate_links(links): + if links.strip().lower() == "none": + return False + + links = links.strip().split() + diff = set(links) - set(DEFAULT_ALTAIRPLOT_LINKS.keys()) + if diff: + raise ValueError("Following links are invalid: {}".format(list(diff))) + return {link: link in links for link in DEFAULT_ALTAIRPLOT_LINKS} + + +def validate_output(output): + output = output.strip().lower() + if output not in ["plot", "repr", "stdout", "none"]: + raise ValueError(":output: flag must be one of [plot|repr|stdout|none]") + return output + + +class AltairPlotDirective(Directive): + has_content = True + + option_spec = { + "hide-code": flag, + "code-below": flag, + "namespace": unchanged, + "output": validate_output, + "alt": unchanged, + "links": validate_links, + "chart-var-name": unchanged, + } + + def run(self): + env = self.state.document.settings.env + app = env.app + + show_code = "hide-code" not in self.options + code_below = "code-below" in self.options + + if not hasattr(env, "_altair_namespaces"): + env._altair_namespaces = {} + namespace_id = self.options.get("namespace", "default") + namespace = env._altair_namespaces.setdefault(env.docname, {}).setdefault( + namespace_id, {} + ) + + code = "\n".join(self.content) + + if show_code: + source_literal = nodes.literal_block(code, code) + source_literal["language"] = "python" + + # get the name of the source file we are currently processing + rst_source = self.state_machine.document["source"] + rst_dir = os.path.dirname(rst_source) + rst_filename = os.path.basename(rst_source) + + # use the source file name to construct a friendly target_id + serialno = env.new_serialno("altair-plot") + rst_base = rst_filename.replace(".", "-") + div_id = "{}-altair-plot-{}".format(rst_base, serialno) + target_id = "{}-altair-source-{}".format(rst_base, serialno) + target_node = nodes.target("", "", ids=[target_id]) + + # create the node in which the plot will appear; + # this will be processed by html_visit_altair_plot + plot_node = altair_plot() + plot_node["target_id"] = target_id + plot_node["div_id"] = div_id + plot_node["code"] = code + plot_node["namespace"] = namespace + plot_node["relpath"] = os.path.relpath(rst_dir, env.srcdir) + plot_node["rst_source"] = rst_source + plot_node["rst_lineno"] = self.lineno + plot_node["links"] = self.options.get( + "links", app.builder.config.altairplot_links + ) + plot_node["output"] = self.options.get("output", "plot") + plot_node["chart-var-name"] = self.options.get("chart-var-name", None) + + if "alt" in self.options: + plot_node["alt"] = self.options["alt"] + + result = [target_node] + + if code_below: + result += [plot_node] + if show_code: + result += [source_literal] + if not code_below: + result += [plot_node] + + return result + + +def html_visit_altair_plot(self, node): + # Execute the code, saving output and namespace + namespace = node["namespace"] + try: + f = io.StringIO() + with contextlib.redirect_stdout(f): + chart = eval_block(node["code"], namespace) + stdout = f.getvalue() + except Exception as e: + warnings.warn( + "altair-plot: {}:{} Code Execution failed:" + "{}: {}".format( + node["rst_source"], node["rst_lineno"], e.__class__.__name__, str(e) + ) + ) + raise nodes.SkipNode + + chart_name = node["chart-var-name"] + if chart_name is not None: + if chart_name not in namespace: + raise ValueError( + "chart-var-name='{}' not present in namespace" "".format(chart_name) + ) + chart = namespace[chart_name] + + output = node["output"] + + if output == "none": + raise nodes.SkipNode + elif output == "stdout": + if not stdout: + raise nodes.SkipNode + else: + output_literal = nodes.literal_block(stdout, stdout) + output_literal["language"] = "none" + node.extend([output_literal]) + elif output == "repr": + if chart is None: + raise nodes.SkipNode + else: + rep = " " + repr(chart).replace("\n", "\n ") + repr_literal = nodes.literal_block(rep, rep) + repr_literal["language"] = "none" + node.extend([repr_literal]) + elif output == "plot": + if isinstance(chart, alt.TopLevelMixin): + # Last line should be a chart; convert to spec dict + try: + spec = chart.to_dict() + except alt.utils.schemapi.SchemaValidationError: + raise ValueError("Invalid chart: {0}".format(node["code"])) + actions = node["links"] + + # TODO: add an option to save spects to file & load from there. + # TODO: add renderer option + + # Write spec to a *.vl.json file + # dest_dir = os.path.join(self.builder.outdir, node['relpath']) + # if not os.path.exists(dest_dir): + # os.makedirs(dest_dir) + # filename = "{0}.vl.json".format(node['target_id']) + # dest_path = os.path.join(dest_dir, filename) + # with open(dest_path, 'w') as f: + # json.dump(spec, f) + + # Pass relevant info into the template and append to the output + html = VGL_TEMPLATE.render( + div_id=node["div_id"], + spec=json.dumps(spec), + mode="vega-lite", + renderer="canvas", + actions=json.dumps(actions), + ) + self.body.append(html) + else: + warnings.warn( + "altair-plot: {}:{} Malformed block. Last line of " + "code block should define a valid altair Chart object." + "".format(node["rst_source"], node["rst_lineno"]) + ) + raise nodes.SkipNode + + +def generic_visit_altair_plot(self, node): + # TODO: generate PNGs and insert them here + if "alt" in node.attributes: + self.body.append(_("[ graph: %s ]") % node["alt"]) + else: + self.body.append(_("[ graph ]")) + raise nodes.SkipNode + + +def depart_altair_plot(self, node): + return + + +def builder_inited(app): + app.add_js_file(app.config.altairplot_vega_js_url) + app.add_js_file(app.config.altairplot_vegalite_js_url) + app.add_js_file(app.config.altairplot_vegaembed_js_url) + + +def setup(app): + setup.app = app + setup.config = app.config + setup.confdir = app.confdir + + app.add_config_value("altairplot_links", DEFAULT_ALTAIRPLOT_LINKS, "env") + + app.add_config_value("altairplot_vega_js_url", VEGA_JS_URL_DEFAULT, "html") + app.add_config_value("altairplot_vegalite_js_url", VEGALITE_JS_URL_DEFAULT, "html") + app.add_config_value( + "altairplot_vegaembed_js_url", VEGAEMBED_JS_URL_DEFAULT, "html" + ) + + app.add_directive("altair-plot", AltairPlotDirective) + + app.add_css_file("altair-plot.css") + + app.add_node( + altair_plot, + html=(html_visit_altair_plot, depart_altair_plot), + latex=(generic_visit_altair_plot, depart_altair_plot), + texinfo=(generic_visit_altair_plot, depart_altair_plot), + text=(generic_visit_altair_plot, depart_altair_plot), + man=(generic_visit_altair_plot, depart_altair_plot), + ) + + app.connect("env-purge-doc", purge_altair_namespaces) + app.connect("builder-inited", builder_inited) + + return {"version": "0.1"} diff --git a/runtime/Lib/site-packages/altair/sphinxext/schematable.py b/runtime/Lib/site-packages/altair/sphinxext/schematable.py new file mode 100644 index 0000000000000000000000000000000000000000..880e7e190d19200adec3e987cc8263afa6aff877 --- /dev/null +++ b/runtime/Lib/site-packages/altair/sphinxext/schematable.py @@ -0,0 +1,195 @@ +import importlib +import warnings +import re + +from docutils.parsers.rst import Directive +from docutils import nodes, utils +from sphinx import addnodes +from recommonmark.parser import CommonMarkParser + + +def type_description(schema): + """Return a concise type description for the given schema""" + if not schema or not isinstance(schema, dict) or schema.keys() == {"description"}: + return "any" + elif "$ref" in schema: + return ":class:`{}`".format(schema["$ref"].split("/")[-1]) + elif "enum" in schema: + return "[{}]".format(", ".join(repr(s) for s in schema["enum"])) + elif "type" in schema: + if isinstance(schema["type"], list): + return "[{}]".format(", ".join(schema["type"])) + elif schema["type"] == "array": + return "array({})".format(type_description(schema.get("items", {}))) + elif schema["type"] == "object": + return "dict" + else: + return "`{}`".format(schema["type"]) + elif "anyOf" in schema: + return "anyOf({})".format( + ", ".join(type_description(s) for s in schema["anyOf"]) + ) + else: + warnings.warn( + "cannot infer type for schema with keys {}" "".format(schema.keys()) + ) + return "--" + + +def prepare_table_header(titles, widths): + """Build docutil empty table""" + ncols = len(titles) + assert len(widths) == ncols + + tgroup = nodes.tgroup(cols=ncols) + for width in widths: + tgroup += nodes.colspec(colwidth=width) + header = nodes.row() + for title in titles: + header += nodes.entry("", nodes.paragraph(text=title)) + tgroup += nodes.thead("", header) + + tbody = nodes.tbody() + tgroup += tbody + + return nodes.table("", tgroup), tbody + + +reClassDef = re.compile(r":class:`([^`]+)`") +reCode = re.compile(r"`([^`]+)`") + + +def add_class_def(node, classDef): + """Add reference on classDef to node""" + + ref = addnodes.pending_xref( + reftarget=classDef, + reftype="class", + refdomain="py", # py:class="None" py:module="altair" refdoc="user_guide/marks" + refexplicit=False, + # refdoc="", + refwarn=False, + ) + ref["py:class"] = "None" + ref["py:module"] = "altair" + + ref += nodes.literal(text=classDef, classes=["xref", "py", "py-class"]) + node += ref + return node + + +def add_text(node, text): + """Add text with inline code to node""" + is_text = True + for part in reCode.split(text): + if part: + if is_text: + node += nodes.Text(part, part) + else: + node += nodes.literal(part, part) + + is_text = not is_text + + return node + + +def build_row(item): + """Return nodes.row with property description""" + + prop, propschema, required = item + row = nodes.row() + + # Property + + row += nodes.entry("", nodes.paragraph(text=prop), classes=["vl-prop"]) + + # Type + str_type = type_description(propschema) + par_type = nodes.paragraph() + + is_text = True + for part in reClassDef.split(str_type): + if part: + if is_text: + add_text(par_type, part) + else: + add_class_def(par_type, part) + is_text = not is_text + + # row += nodes.entry('') + row += nodes.entry("", par_type) # , classes=["vl-type-def"] + + # Description + md_parser = CommonMarkParser() + # str_descr = "***Required.*** " if required else "" + str_descr = "" + str_descr += propschema.get("description", " ") + doc_descr = utils.new_document("schema_description") + md_parser.parse(str_descr, doc_descr) + + # row += nodes.entry('', *doc_descr.children, classes="vl-decsr") + row += nodes.entry("", *doc_descr.children, classes=["vl-decsr"]) + + return row + + +def build_schema_tabel(items): + """Return schema table of items (iterator of prop, schema.item, requred)""" + table, tbody = prepare_table_header( + ["Property", "Type", "Description"], [10, 20, 50] + ) + for item in items: + tbody += build_row(item) + + return table + + +def select_items_from_schema(schema, props=None): + """Return iterator (prop, schema.item, requred) on prop, return all in None""" + properties = schema.get("properties", {}) + required = schema.get("required", []) + if not props: + for prop, item in properties.items(): + yield prop, item, prop in required + else: + for prop in props: + try: + yield prop, properties[prop], prop in required + except KeyError: + warnings.warn("Can't find property:", prop) + + +def prepare_schema_tabel(schema, props=None): + + items = select_items_from_schema(schema, props) + return build_schema_tabel(items) + + +class AltairObjectTableDirective(Directive): + """ + Directive for building a table of attribute descriptions. + + Usage: + + .. altair-object-table:: altair.MarkConfig + + """ + + has_content = False + required_arguments = 1 + + def run(self): + + objectname = self.arguments[0] + modname, classname = objectname.rsplit(".", 1) + module = importlib.import_module(modname) + cls = getattr(module, classname) + schema = cls.resolve_references(cls._schema) + + # create the table from the object + table = prepare_schema_tabel(schema) + return [table] + + +def setup(app): + app.add_directive("altair-object-table", AltairObjectTableDirective) diff --git a/runtime/Lib/site-packages/altair/sphinxext/utils.py b/runtime/Lib/site-packages/altair/sphinxext/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..44b5074b2a6afdf5a66ee9ae025688c12f008e8d --- /dev/null +++ b/runtime/Lib/site-packages/altair/sphinxext/utils.py @@ -0,0 +1,199 @@ +import ast +import hashlib +import itertools +import json +import re + + +def create_thumbnail(image_filename, thumb_filename, window_size=(280, 160)): + """Create a thumbnail whose shortest dimension matches the window""" + from PIL import Image + + im = Image.open(image_filename) + im_width, im_height = im.size + width, height = window_size + + width_factor, height_factor = width / im_width, height / im_height + + if width_factor > height_factor: + final_width = width + final_height = int(im_height * width_factor) + else: + final_height = height + final_width = int(im_width * height_factor) + + thumb = im.resize((final_width, final_height), Image.ANTIALIAS) + thumb.save(thumb_filename) + + +def create_generic_image(filename, shape=(200, 300), gradient=True): + """Create a generic image""" + from PIL import Image + import numpy as np + + assert len(shape) == 2 + + arr = np.zeros((shape[0], shape[1], 3)) + if gradient: + # gradient from gray to white + arr += np.linspace(128, 255, shape[1])[:, None] + im = Image.fromarray(arr.astype("uint8")) + im.save(filename) + + +SYNTAX_ERROR_DOCSTRING = """ +SyntaxError +=========== +Example script with invalid Python syntax +""" + + +def _parse_source_file(filename): + """Parse source file into AST node + + Parameters + ---------- + filename : str + File path + + Returns + ------- + node : AST node + content : utf-8 encoded string + + Notes + ----- + This function adapted from the sphinx-gallery project; license: BSD-3 + https://github.com/sphinx-gallery/sphinx-gallery/ + """ + + with open(filename, "r", encoding="utf-8") as fid: + content = fid.read() + # change from Windows format to UNIX for uniformity + content = content.replace("\r\n", "\n") + + try: + node = ast.parse(content) + except SyntaxError: + node = None + return node, content + + +def get_docstring_and_rest(filename): + """Separate ``filename`` content between docstring and the rest + + Strongly inspired from ast.get_docstring. + + Parameters + ---------- + filename: str + The path to the file containing the code to be read + + Returns + ------- + docstring: str + docstring of ``filename`` + category: list + list of categories specified by the "# category:" comment + rest: str + ``filename`` content without the docstring + lineno: int + the line number on which the code starts + + Notes + ----- + This function adapted from the sphinx-gallery project; license: BSD-3 + https://github.com/sphinx-gallery/sphinx-gallery/ + """ + node, content = _parse_source_file(filename) + + # Find the category comment + find_category = re.compile(r"^#\s*category:\s*(.*)$", re.MULTILINE) + match = find_category.search(content) + if match is not None: + category = match.groups()[0] + # remove this comment from the content + content = find_category.sub("", content) + else: + category = None + + if node is None: + return SYNTAX_ERROR_DOCSTRING, category, content, 1 + + if not isinstance(node, ast.Module): + raise TypeError( + "This function only supports modules. " + "You provided {}".format(node.__class__.__name__) + ) + try: + # In python 3.7 module knows its docstring. + # Everything else will raise an attribute error + docstring = node.docstring + + import tokenize + from io import BytesIO + + ts = tokenize.tokenize(BytesIO(content).readline) + ds_lines = 0 + # find the first string according to the tokenizer and get + # it's end row + for tk in ts: + if tk.exact_type == 3: + ds_lines, _ = tk.end + break + # grab the rest of the file + rest = "\n".join(content.split("\n")[ds_lines:]) + lineno = ds_lines + 1 + + except AttributeError: + # this block can be removed when python 3.6 support is dropped + if ( + node.body + and isinstance(node.body[0], ast.Expr) + and isinstance(node.body[0].value, (ast.Str, ast.Constant)) + ): + docstring_node = node.body[0] + docstring = docstring_node.value.s + # python2.7: Code was read in bytes needs decoding to utf-8 + # unless future unicode_literals is imported in source which + # make ast output unicode strings + if hasattr(docstring, "decode") and not isinstance(docstring, str): + docstring = docstring.decode("utf-8") + # python3.8: has end_lineno + lineno = ( + getattr(docstring_node, "end_lineno", None) or docstring_node.lineno + ) # The last line of the string. + # This get the content of the file after the docstring last line + # Note: 'maxsplit' argument is not a keyword argument in python2 + rest = content.split("\n", lineno)[-1] + lineno += 1 + else: + docstring, rest = "", "" + + if not docstring: + raise ValueError( + ( + 'Could not find docstring in file "{0}". ' + "A docstring is required for the example gallery." + ).format(filename) + ) + return docstring, category, rest, lineno + + +def prev_this_next(it, sentinel=None): + """Utility to return (prev, this, next) tuples from an iterator""" + i1, i2, i3 = itertools.tee(it, 3) + next(i3, None) + return zip(itertools.chain([sentinel], i1), i2, itertools.chain(i3, [sentinel])) + + +def dict_hash(dct): + """Return a hash of the contents of a dictionary""" + serialized = json.dumps(dct, sort_keys=True) + + try: + m = hashlib.md5(serialized) + except TypeError: + m = hashlib.md5(serialized.encode()) + + return m.hexdigest() diff --git a/runtime/Lib/site-packages/altair/tests/__init__.py b/runtime/Lib/site-packages/altair/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/altair/tests/test_magics.py b/runtime/Lib/site-packages/altair/tests/test_magics.py new file mode 100644 index 0000000000000000000000000000000000000000..59ddff11929aee98daa76c65a632d28bce669fae --- /dev/null +++ b/runtime/Lib/site-packages/altair/tests/test_magics.py @@ -0,0 +1,176 @@ +import json +import pytest + +try: + from IPython import InteractiveShell + + IPYTHON_AVAILABLE = True +except ImportError: + IPYTHON_AVAILABLE = False + pass + +from altair.vegalite.v4 import VegaLite +from altair.vega.v5 import Vega + + +DATA_RECORDS = [ + {"amount": 28, "category": "A"}, + {"amount": 55, "category": "B"}, + {"amount": 43, "category": "C"}, + {"amount": 91, "category": "D"}, + {"amount": 81, "category": "E"}, + {"amount": 53, "category": "F"}, + {"amount": 19, "category": "G"}, + {"amount": 87, "category": "H"}, +] + +if IPYTHON_AVAILABLE: + _ipshell = InteractiveShell.instance() + _ipshell.run_cell("%load_ext altair") + _ipshell.run_cell( + """ +import pandas as pd +table = pd.DataFrame.from_records({}) +the_data = table +""".format( + DATA_RECORDS + ) + ) + + +VEGA_SPEC = { + "$schema": "https://vega.github.io/schema/vega/v5.json", + "axes": [ + {"orient": "bottom", "scale": "xscale"}, + {"orient": "left", "scale": "yscale"}, + ], + "data": [{"name": "table", "values": DATA_RECORDS}], + "height": 200, + "marks": [ + { + "encode": { + "enter": { + "width": {"band": 1, "scale": "xscale"}, + "x": {"field": "category", "scale": "xscale"}, + "y": {"field": "amount", "scale": "yscale"}, + "y2": {"scale": "yscale", "value": 0}, + }, + "hover": {"fill": {"value": "red"}}, + "update": {"fill": {"value": "steelblue"}}, + }, + "from": {"data": "table"}, + "type": "rect", + }, + { + "encode": { + "enter": { + "align": {"value": "center"}, + "baseline": {"value": "bottom"}, + "fill": {"value": "#333"}, + }, + "update": { + "fillOpacity": [ + {"test": "datum === tooltip", "value": 0}, + {"value": 1}, + ], + "text": {"signal": "tooltip.amount"}, + "x": {"band": 0.5, "scale": "xscale", "signal": "tooltip.category"}, + "y": {"offset": -2, "scale": "yscale", "signal": "tooltip.amount"}, + }, + }, + "type": "text", + }, + ], + "padding": 5, + "scales": [ + { + "domain": {"data": "table", "field": "category"}, + "name": "xscale", + "padding": 0.05, + "range": "width", + "round": True, + "type": "band", + }, + { + "domain": {"data": "table", "field": "amount"}, + "name": "yscale", + "nice": True, + "range": "height", + }, + ], + "signals": [ + { + "name": "tooltip", + "on": [ + {"events": "rect:mouseover", "update": "datum"}, + {"events": "rect:mouseout", "update": "{}"}, + ], + "value": {}, + } + ], + "width": 400, +} + + +VEGALITE_SPEC = { + "$schema": "https://vega.github.io/schema/vega-lite/v4.json", + "data": {"values": DATA_RECORDS}, + "description": "A simple bar chart with embedded data.", + "encoding": { + "x": {"field": "category", "type": "ordinal"}, + "y": {"field": "amount", "type": "quantitative"}, + }, + "mark": "bar", +} + + +@pytest.mark.skipif(not IPYTHON_AVAILABLE, reason="requires ipython") +def test_vegalite_magic_data_included(): + result = _ipshell.run_cell("%%vegalite\n" + json.dumps(VEGALITE_SPEC)) + assert isinstance(result.result, VegaLite) + assert VEGALITE_SPEC == result.result.spec + + +@pytest.mark.skipif(not IPYTHON_AVAILABLE, reason="requires ipython") +def test_vegalite_magic_json_flag(): + result = _ipshell.run_cell("%%vegalite --json\n" + json.dumps(VEGALITE_SPEC)) + assert isinstance(result.result, VegaLite) + assert VEGALITE_SPEC == result.result.spec + + +@pytest.mark.skipif(not IPYTHON_AVAILABLE, reason="requires ipython") +def test_vegalite_magic_pandas_data(): + spec = {key: val for key, val in VEGALITE_SPEC.items() if key != "data"} + result = _ipshell.run_cell("%%vegalite table\n" + json.dumps(spec)) + assert isinstance(result.result, VegaLite) + assert VEGALITE_SPEC == result.result.spec + + +@pytest.mark.skipif(not IPYTHON_AVAILABLE, reason="requires ipython") +def test_vega_magic_data_included(): + result = _ipshell.run_cell("%%vega\n" + json.dumps(VEGA_SPEC)) + assert isinstance(result.result, Vega) + assert VEGA_SPEC == result.result.spec + + +@pytest.mark.skipif(not IPYTHON_AVAILABLE, reason="requires ipython") +def test_vega_magic_json_flag(): + result = _ipshell.run_cell("%%vega --json\n" + json.dumps(VEGA_SPEC)) + assert isinstance(result.result, Vega) + assert VEGA_SPEC == result.result.spec + + +@pytest.mark.skipif(not IPYTHON_AVAILABLE, reason="requires ipython") +def test_vega_magic_pandas_data(): + spec = {key: val for key, val in VEGA_SPEC.items() if key != "data"} + result = _ipshell.run_cell("%%vega table\n" + json.dumps(spec)) + assert isinstance(result.result, Vega) + assert VEGA_SPEC == result.result.spec + + +@pytest.mark.skipif(not IPYTHON_AVAILABLE, reason="requires ipython") +def test_vega_magic_pandas_data_renamed(): + spec = {key: val for key, val in VEGA_SPEC.items() if key != "data"} + result = _ipshell.run_cell("%%vega table:the_data\n" + json.dumps(spec)) + assert isinstance(result.result, Vega) + assert VEGA_SPEC == result.result.spec diff --git a/runtime/Lib/site-packages/altair/utils/__init__.py b/runtime/Lib/site-packages/altair/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2a52383457408f121c06fb716f6a4865f001b98d --- /dev/null +++ b/runtime/Lib/site-packages/altair/utils/__init__.py @@ -0,0 +1,32 @@ +from .core import ( + infer_vegalite_type, + infer_encoding_types, + sanitize_dataframe, + parse_shorthand, + use_signature, + update_subtraits, + update_nested, + display_traceback, + SchemaBase, + Undefined, +) +from .html import spec_to_html +from .plugin_registry import PluginRegistry +from .deprecation import AltairDeprecationWarning + + +__all__ = ( + "infer_vegalite_type", + "infer_encoding_types", + "sanitize_dataframe", + "spec_to_html", + "parse_shorthand", + "use_signature", + "update_subtraits", + "update_nested", + "display_traceback", + "AltairDeprecationWarning", + "SchemaBase", + "Undefined", + "PluginRegistry", +) diff --git a/runtime/Lib/site-packages/altair/utils/core.py b/runtime/Lib/site-packages/altair/utils/core.py new file mode 100644 index 0000000000000000000000000000000000000000..43bc1b4d583ce73d862126f9fc77f78dde0b990e --- /dev/null +++ b/runtime/Lib/site-packages/altair/utils/core.py @@ -0,0 +1,731 @@ +""" +Utility routines +""" +from collections.abc import Mapping +from copy import deepcopy +import json +import itertools +import re +import sys +import traceback +import warnings + +import jsonschema +import pandas as pd +import numpy as np + +from .schemapi import SchemaBase, Undefined + +try: + from pandas.api.types import infer_dtype as _infer_dtype +except ImportError: + # Import for pandas < 0.20.0 + from pandas.lib import infer_dtype as _infer_dtype + + +def infer_dtype(value): + """Infer the dtype of the value. + + This is a compatibility function for pandas infer_dtype, + with skipna=False regardless of the pandas version. + """ + if not hasattr(infer_dtype, "_supports_skipna"): + try: + _infer_dtype([1], skipna=False) + except TypeError: + # pandas < 0.21.0 don't support skipna keyword + infer_dtype._supports_skipna = False + else: + infer_dtype._supports_skipna = True + if infer_dtype._supports_skipna: + return _infer_dtype(value, skipna=False) + else: + return _infer_dtype(value) + + +TYPECODE_MAP = { + "ordinal": "O", + "nominal": "N", + "quantitative": "Q", + "temporal": "T", + "geojson": "G", +} + +INV_TYPECODE_MAP = {v: k for k, v in TYPECODE_MAP.items()} + + +# aggregates from vega-lite version 4.6.0 +AGGREGATES = [ + "argmax", + "argmin", + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep", +] + +# window aggregates from vega-lite version 4.6.0 +WINDOW_AGGREGATES = [ + "row_number", + "rank", + "dense_rank", + "percent_rank", + "cume_dist", + "ntile", + "lag", + "lead", + "first_value", + "last_value", + "nth_value", +] + +# timeUnits from vega-lite version 4.17.0 +TIMEUNITS = [ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds", + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds", + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds", + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds", +] + + +def infer_vegalite_type(data): + """ + From an array-like input, infer the correct vega typecode + ('ordinal', 'nominal', 'quantitative', or 'temporal') + + Parameters + ---------- + data: Numpy array or Pandas Series + """ + # 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", + "integer", + "mixed-integer", + "complex", + ]: + return "quantitative" + elif typ in ["string", "bytes", "categorical", "boolean", "mixed", "unicode"]: + return "nominal" + elif typ in [ + "datetime", + "datetime64", + "timedelta", + "timedelta64", + "date", + "time", + "period", + ]: + return "temporal" + else: + warnings.warn( + "I don't know how to infer vegalite type from '{}'. " + "Defaulting to nominal.".format(typ) + ) + return "nominal" + + +def merge_props_geom(feat): + """ + Merge properties with geometry + * Overwrites 'type' and 'geometry' entries if existing + """ + + geom = {k: feat[k] for k in ("type", "geometry")} + try: + feat["properties"].update(geom) + props_geom = feat["properties"] + except (AttributeError, KeyError): + # AttributeError when 'properties' equals None + # KeyError when 'properties' is non-existing + props_geom = geom + + return props_geom + + +def sanitize_geo_interface(geo): + """Santize a geo_interface to prepare it for serialization. + + * Make a copy + * Convert type array or _Array to list + * Convert tuples to lists (using json.loads/dumps) + * Merge properties with geometry + """ + + geo = deepcopy(geo) + + # convert type _Array or array to list + for key in geo.keys(): + if str(type(geo[key]).__name__).startswith(("_Array", "array")): + geo[key] = geo[key].tolist() + + # convert (nested) tuples to lists + geo = json.loads(json.dumps(geo)) + + # sanitize features + if geo["type"] == "FeatureCollection": + geo = geo["features"] + if len(geo) > 0: + for idx, feat in enumerate(geo): + geo[idx] = merge_props_geom(feat) + elif geo["type"] == "Feature": + geo = merge_props_geom(geo) + else: + geo = {"type": "Feature", "geometry": geo} + + return geo + + +def sanitize_dataframe(df): # noqa: C901 + """Sanitize a DataFrame to prepare it for serialization. + + * Make a copy + * Convert RangeIndex columns to strings + * Raise ValueError if column names are not strings + * Raise ValueError if it has a hierarchical index. + * Convert categoricals to strings. + * Convert np.bool_ dtypes to Python bool objects + * 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 + * Convert Nullable integers to objects and replace NaN with None + * Convert Nullable boolean to objects and replace NaN with None + * convert dedicated string column to objects and replace NaN with None + * Raise a ValueError for TimeDelta dtypes + """ + df = df.copy() + + if isinstance(df.columns, pd.RangeIndex): + df.columns = df.columns.astype(str) + + for col in df.columns: + if not isinstance(col, str): + raise ValueError( + "Dataframe contains invalid column name: {0!r}. " + "Column names must be strings".format(col) + ) + + if isinstance(df.index, pd.MultiIndex): + raise ValueError("Hierarchical indices not supported") + if isinstance(df.columns, pd.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 + # https://github.com/pydata/pandas/issues/10778 + col = df[col_name].astype(object) + df[col_name] = col.where(col.notnull(), None) + elif str(dtype) == "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": + # convert numpy bools to objects; np.bool is not JSON serializable + df[col_name] = df[col_name].astype(object) + elif str(dtype) == "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"): + # 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", "") + ) + 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 str(dtype).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 { + "Int8", + "Int16", + "Int32", + "Int64", + "UInt8", + "UInt16", + "UInt32", + "UInt64", + "Float32", + "Float64", + }: # nullable integer datatypes (since 24.0) and nullable float datatypes (since 1.2.0) + # 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): + # convert integers to objects; np.int is not JSON serializable + df[col_name] = df[col_name].astype(object) + elif np.issubdtype(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] + bad_values = col.isnull() | np.isinf(col) + df[col_name] = col.astype(object).where(~bad_values, None) + 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 + + +def parse_shorthand( + shorthand, + data=None, + parse_aggregates=True, + parse_window_ops=False, + parse_timeunits=True, + parse_types=True, +): + """General tool to parse shorthand values + + These are of the form: + + - "col_name" + - "col_name:O" + - "average(col_name)" + - "average(col_name):O" + + Optionally, a dataframe may be supplied, from which the type + will be inferred if not specified in the shorthand. + + Parameters + ---------- + shorthand : dict or string + The shorthand representation to be parsed + data : DataFrame, optional + If specified and of type DataFrame, then use these values to infer the + column type if not provided by the shorthand. + parse_aggregates : boolean + If True (default), then parse aggregate functions within the shorthand. + parse_window_ops : boolean + If True then parse window operations within the shorthand (default:False) + parse_timeunits : boolean + If True (default), then parse timeUnits from within the shorthand + parse_types : boolean + If True (default), then parse typecodes within the shorthand + + Returns + ------- + attrs : dict + a dictionary of attributes extracted from the shorthand + + Examples + -------- + >>> data = pd.DataFrame({'foo': ['A', 'B', 'A', 'B'], + ... 'bar': [1, 2, 3, 4]}) + + >>> parse_shorthand('name') == {'field': 'name'} + True + + >>> parse_shorthand('name:Q') == {'field': 'name', 'type': 'quantitative'} + True + + >>> parse_shorthand('average(col)') == {'aggregate': 'average', 'field': 'col'} + True + + >>> parse_shorthand('foo:O') == {'field': 'foo', 'type': 'ordinal'} + True + + >>> parse_shorthand('min(foo):Q') == {'aggregate': 'min', 'field': 'foo', 'type': 'quantitative'} + True + + >>> parse_shorthand('month(col)') == {'field': 'col', 'timeUnit': 'month', 'type': 'temporal'} + True + + >>> parse_shorthand('year(col):O') == {'field': 'col', 'timeUnit': 'year', 'type': 'ordinal'} + True + + >>> parse_shorthand('foo', data) == {'field': 'foo', 'type': 'nominal'} + True + + >>> parse_shorthand('bar', data) == {'field': 'bar', 'type': 'quantitative'} + True + + >>> parse_shorthand('bar:O', data) == {'field': 'bar', 'type': 'ordinal'} + True + + >>> parse_shorthand('sum(bar)', data) == {'aggregate': 'sum', 'field': 'bar', 'type': 'quantitative'} + True + + >>> parse_shorthand('count()', data) == {'aggregate': 'count', 'type': 'quantitative'} + True + """ + if not shorthand: + return {} + + valid_typecodes = list(TYPECODE_MAP) + list(INV_TYPECODE_MAP) + + units = dict( + field="(?P.*)", + type="(?P{})".format("|".join(valid_typecodes)), + agg_count="(?Pcount)", + op_count="(?Pcount)", + aggregate="(?P{})".format("|".join(AGGREGATES)), + window_op="(?P{})".format("|".join(AGGREGATES + WINDOW_AGGREGATES)), + timeUnit="(?P{})".format("|".join(TIMEUNITS)), + ) + + patterns = [] + + if parse_aggregates: + patterns.extend([r"{agg_count}\(\)"]) + patterns.extend([r"{aggregate}\({field}\)"]) + if parse_window_ops: + patterns.extend([r"{op_count}\(\)"]) + patterns.extend([r"{window_op}\({field}\)"]) + if parse_timeunits: + patterns.extend([r"{timeUnit}\({field}\)"]) + + patterns.extend([r"{field}"]) + + if parse_types: + patterns = list(itertools.chain(*((p + ":{type}", p) for p in patterns))) + + regexps = ( + re.compile(r"\A" + p.format(**units) + r"\Z", re.DOTALL) for p in patterns + ) + + # find matches depending on valid fields passed + if isinstance(shorthand, dict): + attrs = shorthand + else: + attrs = next( + exp.match(shorthand).groupdict() for exp in regexps if exp.match(shorthand) + ) + + # Handle short form of the type expression + if "type" in attrs: + attrs["type"] = INV_TYPECODE_MAP.get(attrs["type"], attrs["type"]) + + # counts are quantitative by default + if attrs == {"aggregate": "count"}: + attrs["type"] = "quantitative" + + # times are temporal by default + if "timeUnit" in attrs and "type" not in attrs: + 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: + if "field" in attrs and attrs["field"] in data.columns: + attrs["type"] = infer_vegalite_type(data[attrs["field"]]) + return attrs + + +def use_signature(Obj): + """Apply call signature and documentation of Obj to the decorated method""" + + def decorate(f): + # call-signature of f is exposed via __wrapped__. + # we want it to mimic Obj.__init__ + f.__wrapped__ = Obj.__init__ + f._uses_signature = Obj + + # Supplement the docstring of f with information from Obj + if Obj.__doc__: + doclines = Obj.__doc__.splitlines() + if f.__doc__: + doc = f.__doc__ + "\n".join(doclines[1:]) + else: + doc = "\n".join(doclines) + try: + f.__doc__ = doc + except AttributeError: + # __doc__ is not modifiable for classes in Python < 3.3 + pass + + return f + + return decorate + + +def update_subtraits(obj, attrs, **kwargs): + """Recursively update sub-traits without overwriting other traits""" + # TODO: infer keywords from args + if not kwargs: + return obj + + # obj can be a SchemaBase object or a dict + if obj is Undefined: + obj = dct = {} + elif isinstance(obj, SchemaBase): + dct = obj._kwds + else: + dct = obj + + if isinstance(attrs, str): + attrs = (attrs,) + + if len(attrs) == 0: + dct.update(kwargs) + else: + attr = attrs[0] + trait = dct.get(attr, Undefined) + if trait is Undefined: + 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) # doctest: +SKIP + {'x': {'b': 5, 'c': 4, 'd': 6}, 'y': 40} + >>> original # doctest: +SKIP + {'x': {'b': 5, 'c': 4, 'd': 6}, 'y': 40} + """ + if copy: + original = deepcopy(original) + for key, val in update.items(): + if isinstance(val, Mapping): + orig_val = original.get(key, {}) + if isinstance(orig_val, Mapping): + original[key] = update_nested(orig_val, val) + else: + original[key] = val + else: + original[key] = val + return original + + +def display_traceback(in_ipython=True): + exc_info = sys.exc_info() + + if in_ipython: + from IPython.core.getipython import get_ipython + + ip = get_ipython() + else: + ip = None + + if ip is not None: + 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, {}) + if chan.__name__.endswith("Datum"): + key = "datum" + elif chan.__name__.endswith("Value"): + key = "value" + else: + key = "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, str): + 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/runtime/Lib/site-packages/altair/utils/data.py b/runtime/Lib/site-packages/altair/utils/data.py new file mode 100644 index 0000000000000000000000000000000000000000..403b69e823313b48a00e976ba5bde27243b6f263 --- /dev/null +++ b/runtime/Lib/site-packages/altair/utils/data.py @@ -0,0 +1,244 @@ +import json +import os +import random +import hashlib +import warnings + +import pandas as pd +from toolz import curried +from typing import Callable + +from .core import sanitize_dataframe +from .core import sanitize_geo_interface +from .deprecation import AltairDeprecationWarning +from .plugin_registry import PluginRegistry + + +# ============================================================================== +# Data transformer registry +# ============================================================================== +DataTransformerType = Callable + + +class DataTransformerRegistry(PluginRegistry[DataTransformerType]): + _global_settings = {"consolidate_datasets": True} + + @property + def consolidate_datasets(self): + return self._global_settings["consolidate_datasets"] + + @consolidate_datasets.setter + def consolidate_datasets(self, value): + self._global_settings["consolidate_datasets"] = value + + +# ============================================================================== +# Data model transformers +# +# A data model transformer is a pure function that takes a dict or DataFrame +# and returns a transformed version of a dict or DataFrame. The dict objects +# will be the Data portion of the VegaLite schema. The idea is that user can +# pipe a sequence of these data transformers together to prepare the data before +# it hits the renderer. +# +# In this version of Altair, renderers only deal with the dict form of a +# VegaLite spec, after the Data model has been put into a schema compliant +# form. +# +# A data model transformer has the following type signature: +# DataModelType = Union[dict, pd.DataFrame] +# DataModelTransformerType = Callable[[DataModelType, KwArgs], DataModelType] +# ============================================================================== + + +class MaxRowsError(Exception): + """Raised when a data model has too many rows.""" + + pass + + +@curried.curry +def limit_rows(data, max_rows=5000): + """Raise MaxRowsError if the data model has more than max_rows. + + If max_rows is None, then do not perform any check. + """ + check_data_type(data) + if hasattr(data, "__geo_interface__"): + if data.__geo_interface__["type"] == "FeatureCollection": + values = data.__geo_interface__["features"] + else: + values = data.__geo_interface__ + elif isinstance(data, pd.DataFrame): + values = data + elif isinstance(data, dict): + if "values" in data: + values = data["values"] + else: + return data + if max_rows is not None and len(values) > max_rows: + raise MaxRowsError( + "The number of rows in your dataset is greater " + "than the maximum allowed ({}). " + "For information on how to plot larger datasets " + "in Altair, see the documentation".format(max_rows) + ) + return data + + +@curried.curry +def sample(data, n=None, frac=None): + """Reduce the size of the data model by sampling without replacement.""" + check_data_type(data) + if isinstance(data, pd.DataFrame): + return data.sample(n=n, frac=frac) + elif isinstance(data, dict): + if "values" in data: + values = data["values"] + n = n if n else int(frac * len(values)) + values = random.sample(values, n) + return {"values": values} + + +@curried.curry +def to_json( + data, + prefix="altair-data", + extension="json", + filename="{prefix}-{hash}.{extension}", + urlpath="", +): + """ + Write the data model to a .json file and return a url based data model. + """ + data_json = _data_to_json_string(data) + data_hash = _compute_data_hash(data_json) + filename = filename.format(prefix=prefix, hash=data_hash, extension=extension) + with open(filename, "w") as f: + f.write(data_json) + return {"url": os.path.join(urlpath, filename), "format": {"type": "json"}} + + +@curried.curry +def to_csv( + data, + prefix="altair-data", + extension="csv", + filename="{prefix}-{hash}.{extension}", + urlpath="", +): + """Write the data model to a .csv file and return a url based data model.""" + data_csv = _data_to_csv_string(data) + data_hash = _compute_data_hash(data_csv) + filename = filename.format(prefix=prefix, hash=data_hash, extension=extension) + with open(filename, "w") as f: + f.write(data_csv) + return {"url": os.path.join(urlpath, filename), "format": {"type": "csv"}} + + +@curried.curry +def to_values(data): + """Replace a DataFrame by a data model with values.""" + check_data_type(data) + if hasattr(data, "__geo_interface__"): + if isinstance(data, pd.DataFrame): + data = sanitize_dataframe(data) + data = sanitize_geo_interface(data.__geo_interface__) + return {"values": data} + elif isinstance(data, pd.DataFrame): + data = sanitize_dataframe(data) + return {"values": data.to_dict(orient="records")} + elif isinstance(data, dict): + if "values" not in data: + raise KeyError("values expected in data dict, but not present.") + return data + + +def check_data_type(data): + """Raise if the data is not a dict or DataFrame.""" + if not isinstance(data, (dict, pd.DataFrame)) and not hasattr( + data, "__geo_interface__" + ): + raise TypeError( + "Expected dict, DataFrame or a __geo_interface__ attribute, got: {}".format( + type(data) + ) + ) + + +# ============================================================================== +# Private utilities +# ============================================================================== + + +def _compute_data_hash(data_str): + return hashlib.md5(data_str.encode()).hexdigest() + + +def _data_to_json_string(data): + """Return a JSON string representation of the input data""" + check_data_type(data) + if hasattr(data, "__geo_interface__"): + if isinstance(data, pd.DataFrame): + data = sanitize_dataframe(data) + data = sanitize_geo_interface(data.__geo_interface__) + return json.dumps(data) + elif isinstance(data, pd.DataFrame): + data = sanitize_dataframe(data) + return data.to_json(orient="records", double_precision=15) + elif isinstance(data, dict): + if "values" not in data: + raise KeyError("values expected in data dict, but not present.") + return json.dumps(data["values"], sort_keys=True) + else: + raise NotImplementedError( + "to_json only works with data expressed as " "a DataFrame or as a dict" + ) + + +def _data_to_csv_string(data): + """return a CSV string representation of the input data""" + check_data_type(data) + if hasattr(data, "__geo_interface__"): + raise NotImplementedError( + "to_csv does not work with data that " + "contains the __geo_interface__ attribute" + ) + elif isinstance(data, pd.DataFrame): + data = sanitize_dataframe(data) + return data.to_csv(index=False) + elif isinstance(data, dict): + 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) + else: + raise NotImplementedError( + "to_csv only works with data expressed as " "a DataFrame or as a dict" + ) + + +def pipe(data, *funcs): + """ + Pipe a value through a sequence of functions + + Deprecated: use toolz.curried.pipe() instead. + """ + warnings.warn( + "alt.pipe() is deprecated, and will be removed in a future release. " + "Use toolz.curried.pipe() instead.", + AltairDeprecationWarning, + ) + return curried.pipe(data, *funcs) + + +def curry(*args, **kwargs): + """Curry a callable function + + Deprecated: use toolz.curried.curry() instead. + """ + warnings.warn( + "alt.curry() is deprecated, and will be removed in a future release. " + "Use toolz.curried.curry() instead.", + AltairDeprecationWarning, + ) + return curried.curry(*args, **kwargs) diff --git a/runtime/Lib/site-packages/altair/utils/deprecation.py b/runtime/Lib/site-packages/altair/utils/deprecation.py new file mode 100644 index 0000000000000000000000000000000000000000..9deca223b1f6952e03d8e82a17baca5dee8a4751 --- /dev/null +++ b/runtime/Lib/site-packages/altair/utils/deprecation.py @@ -0,0 +1,70 @@ +import warnings +import functools + + +class AltairDeprecationWarning(UserWarning): + pass + + +def deprecated(message=None): + """Decorator to deprecate a function or class. + + Parameters + ---------- + message : string (optional) + The deprecation message + """ + + def wrapper(obj): + return _deprecate(obj, message=message) + + return wrapper + + +def _deprecate(obj, name=None, message=None): + """Return a version of a class or function that raises a deprecation warning. + + Parameters + ---------- + obj : class or function + The object to create a deprecated version of. + name : string (optional) + The name of the deprecated object + message : string (optional) + The deprecation message + + Returns + ------- + deprecated_obj : + The deprecated version of obj + + Examples + -------- + >>> class Foo(object): pass + >>> OldFoo = _deprecate(Foo, "OldFoo") + >>> f = OldFoo() # doctest: +SKIP + AltairDeprecationWarning: alt.OldFoo is deprecated. Use alt.Foo instead. + """ + if message is None: + message = "alt.{} is deprecated. Use alt.{} instead." "".format( + name, obj.__name__ + ) + if isinstance(obj, type): + return type( + name, + (obj,), + { + "__doc__": obj.__doc__, + "__init__": _deprecate(obj.__init__, "__init__", message), + }, + ) + elif callable(obj): + + @functools.wraps(obj) + def new_obj(*args, **kwargs): + warnings.warn(message, AltairDeprecationWarning) + return obj(*args, **kwargs) + + return new_obj + else: + raise ValueError("Cannot deprecate object of type {}".format(type(obj))) diff --git a/runtime/Lib/site-packages/altair/utils/display.py b/runtime/Lib/site-packages/altair/utils/display.py new file mode 100644 index 0000000000000000000000000000000000000000..92d7c7835fb64a7b40f4fd064c75ba72b149ec0e --- /dev/null +++ b/runtime/Lib/site-packages/altair/utils/display.py @@ -0,0 +1,182 @@ +import json +import pkgutil +import textwrap +from typing import Callable, Dict +import uuid + +from jsonschema import validate + +from .plugin_registry import PluginRegistry +from .mimebundle import spec_to_mimebundle + + +# ============================================================================== +# Renderer registry +# ============================================================================== +MimeBundleType = Dict[str, object] +RendererType = Callable[..., MimeBundleType] + + +class RendererRegistry(PluginRegistry[RendererType]): + entrypoint_err_messages = { + "notebook": textwrap.dedent( + """ + To use the 'notebook' renderer, you must install the vega package + and the associated Jupyter extension. + See https://altair-viz.github.io/getting_started/installation.html + for more information. + """ + ), + "altair_viewer": textwrap.dedent( + """ + To use the 'altair_viewer' renderer, you must install the altair_viewer + package; see http://github.com/altair-viz/altair_viewer/ + for more information. + """ + ), + } + + def set_embed_options( + self, + defaultStyle=None, + renderer=None, + width=None, + height=None, + padding=None, + scaleFactor=None, + actions=None, + **kwargs, + ): + """Set options for embeddings of Vega & Vega-Lite charts. + + Options are fully documented at https://github.com/vega/vega-embed. + Similar to the `enable()` method, this can be used as either + a persistent global switch, or as a temporary local setting using + a context manager (i.e. a `with` statement). + + Parameters + ---------- + defaultStyle : bool or string + Specify a default stylesheet for embed actions. + renderer : string + The renderer to use for the view. One of "canvas" (default) or "svg" + width : integer + The view width in pixels + height : integer + The view height in pixels + padding : integer + The view padding in pixels + scaleFactor : number + The number by which to multiply the width and height (default 1) + of an exported PNG or SVG image. + actions : bool or dict + Determines if action links ("Export as PNG/SVG", "View Source", + "View Vega" (only for Vega-Lite), "Open in Vega Editor") are + included with the embedded view. If the value is true, all action + links will be shown and none if the value is false. This property + can take a key-value mapping object that maps keys (export, source, + compiled, editor) to boolean values for determining if + each action link should be shown. + **kwargs : + Additional options are passed directly to embed options. + """ + options = { + "defaultStyle": defaultStyle, + "renderer": renderer, + "width": width, + "height": height, + "padding": padding, + "scaleFactor": scaleFactor, + "actions": actions, + } + kwargs.update({key: val for key, val in options.items() if val is not None}) + return self.enable(None, embed_options=kwargs) + + +# ============================================================================== +# VegaLite v1/v2 renderer logic +# ============================================================================== + + +class Displayable(object): + """A base display class for VegaLite v1/v2. + + This class takes a VegaLite v1/v2 spec and does the following: + + 1. Optionally validates the spec against a schema. + 2. Uses the RendererPlugin to grab a renderer and call it when the + IPython/Jupyter display method (_repr_mimebundle_) is called. + + The spec passed to this class must be fully schema compliant and already + have the data portion of the spec fully processed and ready to serialize. + In practice, this means, the data portion of the spec should have been passed + through appropriate data model transformers. + """ + + renderers = None + schema_path = ("altair", "") + + def __init__(self, spec, validate=False): + # type: (dict, bool) -> None + self.spec = spec + self.validate = validate + self._validate() + + 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(self.spec, schema_dict) + + def _repr_mimebundle_(self, include=None, exclude=None): + """Return a MIME bundle for display in Jupyter frontends.""" + if self.renderers is not None: + return self.renderers.get()(self.spec) + else: + return {} + + +def default_renderer_base(spec, mime_type, str_repr, **options): + """A default renderer for Vega or VegaLite that works for modern frontends. + + This renderer works with modern frontends (JupyterLab, nteract) that know + how to render the custom VegaLite MIME type listed above. + """ + assert isinstance(spec, dict) + bundle = {} + metadata = {} + + bundle[mime_type] = spec + bundle["text/plain"] = str_repr + if options: + metadata[mime_type] = options + return bundle, metadata + + +def json_renderer_base(spec, str_repr, **options): + """A renderer that returns a MIME type of application/json. + + In JupyterLab/nteract this is rendered as a nice JSON tree. + """ + return default_renderer_base( + spec, mime_type="application/json", str_repr=str_repr, **options + ) + + +class HTMLRenderer(object): + """Object to render charts as HTML, with a unique output div each time""" + + def __init__(self, output_div="altair-viz-{}", **kwargs): + self._output_div = output_div + self.kwargs = kwargs + + @property + def output_div(self): + return self._output_div.format(uuid.uuid4().hex) + + def __call__(self, spec, **metadata): + kwargs = self.kwargs.copy() + kwargs.update(metadata) + return spec_to_mimebundle( + spec, format="html", output_div=self.output_div, **kwargs + ) diff --git a/runtime/Lib/site-packages/altair/utils/execeval.py b/runtime/Lib/site-packages/altair/utils/execeval.py new file mode 100644 index 0000000000000000000000000000000000000000..c135fe4a72b48798bb6b1f6ed9dad1ac535d1ea7 --- /dev/null +++ b/runtime/Lib/site-packages/altair/utils/execeval.py @@ -0,0 +1,61 @@ +import ast +import sys + + +if sys.version_info > (3, 8): + Module = ast.Module +else: + # Mock the Python >= 3.8 API + def Module(nodelist, type_ignores): + return ast.Module(nodelist) + + +class _CatchDisplay(object): + """Class to temporarily catch sys.displayhook""" + + def __init__(self): + self.output = None + + def __enter__(self): + self.old_hook = sys.displayhook + sys.displayhook = self + return self + + def __exit__(self, type, value, traceback): + sys.displayhook = self.old_hook + # Returning False will cause exceptions to propagate + return False + + def __call__(self, output): + self.output = output + + +def eval_block(code, namespace=None, filename=""): + """ + Execute a multi-line block of code in the given namespace + + If the final statement in the code is an expression, return + the result of the expression. + """ + tree = ast.parse(code, filename="", mode="exec") + if namespace is None: + namespace = {} + catch_display = _CatchDisplay() + + if isinstance(tree.body[-1], ast.Expr): + to_exec, to_eval = tree.body[:-1], tree.body[-1:] + else: + to_exec, to_eval = tree.body, [] + + for node in to_exec: + compiled = compile(Module([node], []), filename=filename, mode="exec") + exec(compiled, namespace) + + with catch_display: + for node in to_eval: + compiled = compile( + ast.Interactive([node]), filename=filename, mode="single" + ) + exec(compiled, namespace) + + return catch_display.output diff --git a/runtime/Lib/site-packages/altair/utils/html.py b/runtime/Lib/site-packages/altair/utils/html.py new file mode 100644 index 0000000000000000000000000000000000000000..1aa507e9cbea224ad5a11994997e5b8db526ad54 --- /dev/null +++ b/runtime/Lib/site-packages/altair/utils/html.py @@ -0,0 +1,236 @@ +import json +import jinja2 + + +HTML_TEMPLATE = jinja2.Template( + """ +{%- if fullhtml -%} + + + +{%- endif %} + +{%- if not requirejs %} + + {%- if mode == 'vega-lite' %} + + {%- endif %} + +{%- endif %} +{%- if fullhtml %} +{%- if requirejs %} + + +{%- endif %} + + +{%- endif %} +
    + +{%- if fullhtml %} + + +{%- endif %} +""" +) + + +HTML_TEMPLATE_UNIVERSAL = jinja2.Template( + """ +
    + +""" +) + + +TEMPLATES = { + "standard": HTML_TEMPLATE, + "universal": HTML_TEMPLATE_UNIVERSAL, +} + + +def spec_to_html( + spec, + mode, + vega_version, + vegaembed_version, + vegalite_version=None, + base_url="https://cdn.jsdelivr.net/npm/", + output_div="vis", + embed_options=None, + json_kwds=None, + fullhtml=True, + requirejs=False, + template="standard", +): + """Embed a Vega/Vega-Lite spec into an HTML page + + Parameters + ---------- + spec : dict + a dictionary representing a vega-lite plot spec. + mode : string {'vega' | 'vega-lite'} + The rendering mode. This value is overridden by embed_options['mode'], + if it is present. + 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. + base_url : string (optional) + The base url from which to load the javascript libraries. + output_div : string (optional) + The id of the div element where the plot will be shown. + embed_options : dict (optional) + Dictionary of options to pass to the vega-embed script. Default + entry is {'mode': mode}. + json_kwds : dict (optional) + Dictionary of keywords to pass to json.dumps(). + fullhtml : boolean (optional) + If True (default) then return a full html page. If False, then return + an HTML snippet that can be embedded into an HTML page. + requirejs : boolean (optional) + If False (default) then load libraries from base_url using ") + + if requirejs: + assert "require(" in html + else: + assert "require(" not in html + + assert "vega-lite@{}".format(vegalite_version) in html + assert "vega@{}".format(vega_version) in html + assert "vega-embed@{}".format(vegaembed_version) in html diff --git a/runtime/Lib/site-packages/altair/utils/tests/test_mimebundle.py b/runtime/Lib/site-packages/altair/utils/tests/test_mimebundle.py new file mode 100644 index 0000000000000000000000000000000000000000..c893b7ce21d34a050362b3eb1aa3d89376bafbe8 --- /dev/null +++ b/runtime/Lib/site-packages/altair/utils/tests/test_mimebundle.py @@ -0,0 +1,207 @@ +import pytest + +import altair as alt +from ..mimebundle import spec_to_mimebundle + + +@pytest.fixture +def require_altair_saver(): + try: + import altair_saver # noqa: F401 + except ImportError: + pytest.skip("altair_saver not importable; cannot run saver tests") + + +@pytest.fixture +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}, + ] + }, + "mark": "bar", + "encoding": { + "x": {"field": "a", "type": "ordinal"}, + "y": {"field": "b", "type": "quantitative"}, + }, + } + + +@pytest.fixture +def vega_spec(): + return { + "$schema": "https://vega.github.io/schema/vega/v5.json", + "axes": [ + { + "aria": False, + "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", + "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": { + "ariaRoleDescription": {"value": "bar"}, + "description": { + "signal": '"a: " + (isValid(datum["a"]) ? datum["a"] : ""+datum["a"]) + "; b: " + (format(datum["b"], ""))' + }, + "fill": {"value": "#4c78a8"}, + "width": {"band": 1, "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", + } + ], + "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", + } + + +def test_vegalite_to_vega_mimebundle(require_altair_saver, vegalite_spec, vega_spec): + # temporay fix for https://github.com/vega/vega-lite/issues/7776 + def delete_none(axes): + for axis in axes: + for key, value in list(axis.items()): + if value is None: + del axis[key] + return axes + + 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, + ) + + bundle["application/vnd.vega.v5+json"]["axes"] = delete_none( + bundle["application/vnd.vega.v5+json"]["axes"] + ) + assert bundle == {"application/vnd.vega.v5+json": vega_spec} + + +def test_spec_to_vegalite_mimebundle(vegalite_spec): + bundle = spec_to_mimebundle( + spec=vegalite_spec, + mode="vega-lite", + format="vega-lite", + vegalite_version=alt.VEGALITE_VERSION, + ) + assert bundle == {"application/vnd.vegalite.v4+json": vegalite_spec} + + +def test_spec_to_vega_mimebundle(vega_spec): + bundle = spec_to_mimebundle( + spec=vega_spec, mode="vega", format="vega", vega_version=alt.VEGA_VERSION + ) + 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/runtime/Lib/site-packages/altair/utils/tests/test_plugin_registry.py b/runtime/Lib/site-packages/altair/utils/tests/test_plugin_registry.py new file mode 100644 index 0000000000000000000000000000000000000000..cbfb62ac2a2c0fc482bff57b9f1ea05295df21de --- /dev/null +++ b/runtime/Lib/site-packages/altair/utils/tests/test_plugin_registry.py @@ -0,0 +1,123 @@ +from ..plugin_registry import PluginRegistry +from typing import Callable + + +class TypedCallableRegistry(PluginRegistry[Callable[[int], int]]): + pass + + +class GeneralCallableRegistry(PluginRegistry): + _global_settings = {"global_setting": None} + + @property + def global_setting(self): + return self._global_settings["global_setting"] + + @global_setting.setter + def global_setting(self, val): + self._global_settings["global_setting"] = val + + +def test_plugin_registry(): + plugins = TypedCallableRegistry() + + assert plugins.names() == [] + assert plugins.active == "" + assert plugins.get() is None + assert repr(plugins) == "TypedCallableRegistry(active='', registered=[])" + + plugins.register("new_plugin", lambda x: x ** 2) + assert plugins.names() == ["new_plugin"] + assert plugins.active == "" + assert plugins.get() is None + assert repr(plugins) == ( + "TypedCallableRegistry(active='', " "registered=['new_plugin'])" + ) + + plugins.enable("new_plugin") + assert plugins.names() == ["new_plugin"] + assert plugins.active == "new_plugin" + assert plugins.get()(3) == 9 + assert repr(plugins) == ( + "TypedCallableRegistry(active='new_plugin', " "registered=['new_plugin'])" + ) + + +def test_plugin_registry_extra_options(): + plugins = GeneralCallableRegistry() + + plugins.register("metadata_plugin", lambda x, p=2: x ** p) + plugins.enable("metadata_plugin") + 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_global_settings(): + plugins = GeneralCallableRegistry() + + # we need some default plugin, but we won't do anything with it + plugins.register("default", lambda x: x) + plugins.enable("default") + + # default value of the global flag + assert plugins.global_setting is None + + # enabling changes the global state, not the options + plugins.enable(global_setting=True) + assert plugins.global_setting is True + assert plugins._options == {} + + # context manager changes global state temporarily + with plugins.enable(global_setting="temp"): + assert plugins.global_setting == "temp" + assert plugins._options == {} + assert plugins.global_setting is True + assert plugins._options == {} + + +def test_plugin_registry_context(): + plugins = GeneralCallableRegistry() + + plugins.register("default", lambda x, p=2: x ** p) + + # At first there is no plugin enabled + assert plugins.active == "" + assert plugins.options == {} + + # Make sure the context is set and reset correctly + with plugins.enable("default", p=6): + assert plugins.active == "default" + assert plugins.options == {"p": 6} + + assert plugins.active == "" + assert plugins.options == {} + + # Make sure the context is reset even if there is an error + try: + with plugins.enable("default", p=6): + assert plugins.active == "default" + assert plugins.options == {"p": 6} + raise ValueError() + except ValueError: + pass + + 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/runtime/Lib/site-packages/altair/utils/tests/test_schemapi.py b/runtime/Lib/site-packages/altair/utils/tests/test_schemapi.py new file mode 100644 index 0000000000000000000000000000000000000000..09bbde74794222f0e902aa641ac87b4f01886d74 --- /dev/null +++ b/runtime/Lib/site-packages/altair/utils/tests/test_schemapi.py @@ -0,0 +1,351 @@ +# The contents of this file are automatically written by +# 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, +) + +# Make tests inherit from _TestSchema, so that when we test from_dict it won't +# try to use SchemaBase objects defined elsewhere as wrappers. + + +class _TestSchema(SchemaBase): + @classmethod + def _default_wrapper_classes(cls): + return _TestSchema.__subclasses__() + + +class MySchema(_TestSchema): + _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"}, + ] + }, + "e": {"items": [{"type": "string"}, {"type": "string"}]}, + }, + } + + +class StringMapping(_TestSchema): + _schema = {"$ref": "#/definitions/StringMapping"} + _rootschema = MySchema._schema + + +class StringArray(_TestSchema): + _schema = {"$ref": "#/definitions/StringArray"} + _rootschema = MySchema._schema + + +class Derived(_TestSchema): + _schema = { + "definitions": { + "Foo": {"type": "object", "properties": {"d": {"type": "string"}}}, + "Bar": {"type": "string", "enum": ["A", "B"]}, + }, + "type": "object", + "additionalProperties": False, + "properties": { + "a": {"type": "integer"}, + "b": {"type": "string"}, + "c": {"$ref": "#/definitions/Foo"}, + }, + } + + +class Foo(_TestSchema): + _schema = {"$ref": "#/definitions/Foo"} + _rootschema = Derived._schema + + +class Bar(_TestSchema): + _schema = {"$ref": "#/definitions/Bar"} + _rootschema = Derived._schema + + +class SimpleUnion(_TestSchema): + _schema = {"anyOf": [{"type": "integer"}, {"type": "string"}]} + + +class DefinitionUnion(_TestSchema): + _schema = {"anyOf": [{"$ref": "#/definitions/Foo"}, {"$ref": "#/definitions/Bar"}]} + _rootschema = Derived._schema + + +class SimpleArray(_TestSchema): + _schema = { + "type": "array", + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + } + + +class InvalidProperties(_TestSchema): + _schema = { + "type": "object", + "properties": {"for": {}, "as": {}, "vega-lite": {}, "$schema": {}}, + } + + +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"], + "e": ["a", "b"], + } + + myschema = MySchema.from_dict(dct) + assert myschema.to_dict() == dct + + myschema2 = MySchema(**dct) + assert myschema2.to_dict() == dct + + assert isinstance(myschema.a, StringMapping) + assert isinstance(myschema.a2, dict) + assert isinstance(myschema.b, StringArray) + assert isinstance(myschema.b2, list) + assert isinstance(myschema.d, StringArray) + + +def test_schema_cases(): + assert Derived(a=4, b="yo").to_dict() == {"a": 4, "b": "yo"} + assert Derived(a=4, c={"d": "hey"}).to_dict() == {"a": 4, "c": {"d": "hey"}} + assert Derived(a=4, b="5", c=Foo(d="val")).to_dict() == { + "a": 4, + "b": "5", + "c": {"d": "val"}, + } + assert Foo(d="hello", f=4).to_dict() == {"d": "hello", "f": 4} + + assert Derived().to_dict() == {} + assert Foo().to_dict() == {} + + with pytest.raises(jsonschema.ValidationError): + # a needs to be an integer + Derived(a="yo").to_dict() + + with pytest.raises(jsonschema.ValidationError): + # Foo.d needs to be a string + Derived(c=Foo(4)).to_dict() + + with pytest.raises(jsonschema.ValidationError): + # no additional properties allowed + Derived(foo="bar").to_dict() + + +def test_round_trip(): + D = {"a": 4, "b": "yo"} + assert Derived.from_dict(D).to_dict() == D + + D = {"a": 4, "c": {"d": "hey"}} + assert Derived.from_dict(D).to_dict() == D + + D = {"a": 4, "b": "5", "c": {"d": "val"}} + assert Derived.from_dict(D).to_dict() == D + + D = {"d": "hello", "f": 4} + assert Foo.from_dict(D).to_dict() == D + + +def test_from_dict(): + D = {"a": 4, "b": "5", "c": {"d": "val"}} + obj = Derived.from_dict(D) + assert obj.a == 4 + assert obj.b == "5" + assert isinstance(obj.c, Foo) + + +def test_simple_type(): + assert SimpleUnion(4).to_dict() == 4 + + +def test_simple_array(): + assert SimpleArray([4, 5, "six"]).to_dict() == [4, 5, "six"] + assert SimpleArray.from_dict(list("abc")).to_dict() == list("abc") + + +def test_definition_union(): + obj = DefinitionUnion.from_dict("A") + assert isinstance(obj, Bar) + assert obj.to_dict() == "A" + + obj = DefinitionUnion.from_dict("B") + assert isinstance(obj, Bar) + assert obj.to_dict() == "B" + + obj = DefinitionUnion.from_dict({"d": "yo"}) + assert isinstance(obj, Foo) + assert obj.to_dict() == {"d": "yo"} + + +def test_invalid_properties(): + dct = {"for": 2, "as": 3, "vega-lite": 4, "$schema": 5} + invalid = InvalidProperties.from_dict(dct) + assert invalid["for"] == 2 + assert invalid["as"] == 3 + assert invalid["vega-lite"] == 4 + assert invalid["$schema"] == 5 + assert invalid.to_dict() == dct + + +def test_undefined_singleton(): + assert Undefined is UndefinedType() + + +@pytest.fixture +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 + copy = myschema.copy(deep=True) + copy["a"]["foo"] = "new value" + copy["b"] = ["A", "B", "C"] + copy["c"] = 164 + assert myschema.to_dict() == dct + + # If we ignore a value, changing the copy changes the original + copy = myschema.copy(deep=True, ignore=["a"]) + copy["a"]["foo"] = "new value" + copy["b"] = ["A", "B", "C"] + copy["c"] = 164 + mydct = myschema.to_dict() + assert mydct["a"]["foo"] == "new value" + assert mydct["b"][0] == dct["b"][0] + assert mydct["c"] == dct["c"] + + # If copy is not deep, then changing copy below top level changes original + copy = myschema.copy(deep=False) + copy["a"]["foo"] = "baz" + copy["b"] = ["A", "B", "C"] + copy["c"] = 164 + mydct = myschema.to_dict() + assert mydct["a"]["foo"] == "baz" + assert mydct["b"] == dct["b"] + 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: + m.invalid_attribute + assert str(err.value) == ( + "'MySchema' object has no attribute " "'invalid_attribute'" + ) + + +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 + + with pytest.raises(ValueError) as err: + BadSchema(4) + assert str(err.value).startswith("Cannot instantiate object") + + +@pytest.mark.parametrize("use_json", [True, False]) +def test_hash_schema(use_json): + classes = _TestSchema._default_wrapper_classes() + + for cls in classes: + hsh1 = _FromDict.hash_schema(cls._schema, use_json=use_json) + hsh2 = _FromDict.hash_schema(cls._schema, use_json=use_json) + assert hsh1 == hsh2 + assert hash(hsh1) == hash(hsh2) + + +def test_schema_validation_error(): + try: + MySchema(a={"foo": 4}) + the_err = None + except jsonschema.ValidationError as err: + the_err = err + + 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 + + +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/runtime/Lib/site-packages/altair/utils/tests/test_server.py b/runtime/Lib/site-packages/altair/utils/tests/test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..09129e9c462dde31df26e40177c2f34ae389e583 --- /dev/null +++ b/runtime/Lib/site-packages/altair/utils/tests/test_server.py @@ -0,0 +1,10 @@ +""" +Test http server +""" + +from altair.utils.server import serve, MockServer + + +def test_serve(): + html = "Title

    Content

    " + serve(html, open_browser=False, http_server=MockServer) diff --git a/runtime/Lib/site-packages/altair/utils/tests/test_utils.py b/runtime/Lib/site-packages/altair/utils/tests/test_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..1ccede4148767199c1f87e5cb5cdd1b00aa4bad6 --- /dev/null +++ b/runtime/Lib/site-packages/altair/utils/tests/test_utils.py @@ -0,0 +1,192 @@ +import pytest +import warnings +import json + +import numpy as np +import pandas as pd + +from .. import infer_vegalite_type, sanitize_dataframe + + +def test_infer_vegalite_type(): + def _check(arr, typ): + assert infer_vegalite_type(arr) == typ + + _check(np.arange(5, dtype=float), "quantitative") + _check(np.arange(5, dtype=int), "quantitative") + _check(np.zeros(5, dtype=bool), "nominal") + _check(pd.date_range("2012", "2013"), "temporal") + _check(pd.timedelta_range(365, periods=12), "temporal") + + nulled = pd.Series(np.random.randint(10, size=10)) + nulled[0] = None + _check(nulled, "quantitative") + _check(["a", "b", "c"], "nominal") + + if hasattr(pytest, "warns"): # added in pytest 2.8 + with pytest.warns(UserWarning): + _check([], "nominal") + else: + with warnings.catch_warnings(): + warnings.filterwarnings("ignore") + _check([], "nominal") + + +def test_sanitize_dataframe(): + # 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"), + "c2": pd.Series([1, "A", 2.5, "B", None], dtype="category"), + "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 + df.iloc[0, df.columns.get_loc("f")] = np.nan + df.iloc[0, df.columns.get_loc("d")] = pd.NaT + df.iloc[0, df.columns.get_loc("o")] = np.array(np.nan) + + # JSON serialize. This will fail on non-sanitized dataframes + print(df[["s", "c2"]]) + df_clean = sanitize_dataframe(df) + print(df_clean[["s", "c2"]]) + print(df_clean[["s", "c2"]].to_dict()) + s = json.dumps(df_clean.to_dict(orient="records")) + print(s) + + # Re-construct pandas dataframe + df2 = pd.read_json(s) + + # Re-order the columns to match df + df2 = df2[df.columns] + + # Re-apply original types + for col in df: + if str(df[col].dtype).startswith("datetime"): + # astype(datetime) introduces time-zone issues: + # to_datetime() does not. + 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) + + # pandas doesn't properly recognize np.array(np.nan), so change it here + df.iloc[0, df.columns.get_loc("o")] = np.nan + assert df.equals(df2) + + +def test_sanitize_dataframe_colnames(): + df = pd.DataFrame(np.arange(12).reshape(4, 3)) + + # Test that RangeIndex is converted to strings + df = sanitize_dataframe(df) + assert [isinstance(col, str) for col in df.columns] + + # Test that non-string columns result in an error + df.columns = [4, "foo", "bar"] + with pytest.raises(ValueError) as err: + sanitize_dataframe(df) + assert str(err.value).startswith("Dataframe contains invalid column name: 4.") + + +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) + assert list(df_clean.dtypes) == [object] + assert list(df_clean["x"]) == [0, 1, 2, None, None, None] + + +@pytest.mark.skipif( + not hasattr(pd, "Int64Dtype"), + reason="Nullable integers not supported in pandas v{}".format(pd.__version__), +) +def test_sanitize_nullable_integers(): + + df = pd.DataFrame( + { + "int_np": [1, 2, 3, 4, 5], + "int64": pd.Series([1, 2, 3, None, 5], dtype="UInt8"), + "int64_nan": pd.Series([1, 2, 3, float("nan"), 5], dtype="Int64"), + "float": [1.0, 2.0, 3.0, 4, 5.0], + "float_null": [1, 2, None, 4, 5], + "float_inf": [1, 2, None, 4, (float("inf"))], + } + ) + + df_clean = sanitize_dataframe(df) + assert {col.dtype.name for _, col in df_clean.iteritems()} == {"object"} + + result_python = {col_name: list(col) for col_name, col in df_clean.iteritems()} + assert result_python == { + "int_np": [1, 2, 3, 4, 5], + "int64": [1, 2, 3, None, 5], + "int64_nan": [1, 2, 3, None, 5], + "float": [1.0, 2.0, 3.0, 4.0, 5.0], + "float_null": [1.0, 2.0, None, 4.0, 5.0], + "float_inf": [1.0, 2.0, None, 4.0, None], + } + + +@pytest.mark.skipif( + not hasattr(pd, "StringDtype"), + reason="dedicated String dtype not supported in pandas v{}".format(pd.__version__), +) +def test_sanitize_string_dtype(): + df = pd.DataFrame( + { + "string_object": ["a", "b", "c", "d"], + "string_string": pd.array(["a", "b", "c", "d"], dtype="string"), + "string_object_null": ["a", "b", None, "d"], + "string_string_null": pd.array(["a", "b", None, "d"], dtype="string"), + } + ) + + df_clean = sanitize_dataframe(df) + assert {col.dtype.name for _, col in df_clean.iteritems()} == {"object"} + + result_python = {col_name: list(col) for col_name, col in df_clean.iteritems()} + assert result_python == { + "string_object": ["a", "b", "c", "d"], + "string_string": ["a", "b", "c", "d"], + "string_object_null": ["a", "b", None, "d"], + "string_string_null": ["a", "b", None, "d"], + } + + +@pytest.mark.skipif( + not hasattr(pd, "BooleanDtype"), + reason="Nullable boolean dtype not supported in pandas v{}".format(pd.__version__), +) +def test_sanitize_boolean_dtype(): + df = pd.DataFrame( + { + "bool_none": pd.array([True, False, None], dtype="boolean"), + "none": pd.array([None, None, None], dtype="boolean"), + "bool": pd.array([True, False, True], dtype="boolean"), + } + ) + + df_clean = sanitize_dataframe(df) + assert {col.dtype.name for _, col in df_clean.iteritems()} == {"object"} + + result_python = {col_name: list(col) for col_name, col in df_clean.iteritems()} + assert result_python == { + "bool_none": [True, False, None], + "none": [None, None, None], + "bool": [True, False, True], + } diff --git a/runtime/Lib/site-packages/altair/utils/theme.py b/runtime/Lib/site-packages/altair/utils/theme.py new file mode 100644 index 0000000000000000000000000000000000000000..10dc6fa8a81646ed7e9fa8d6be4e1634ec14e7d8 --- /dev/null +++ b/runtime/Lib/site-packages/altair/utils/theme.py @@ -0,0 +1,10 @@ +"""Utilities for registering and working with themes""" + +from .plugin_registry import PluginRegistry +from typing import Callable + +ThemeType = Callable[..., dict] + + +class ThemeRegistry(PluginRegistry[ThemeType]): + pass diff --git a/runtime/Lib/site-packages/altair/vega/__init__.py b/runtime/Lib/site-packages/altair/vega/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..eec9f692ddb2117e5196f654f5ff6d5a1a44e786 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vega/__init__.py @@ -0,0 +1,2 @@ +# flake8: noqa +from .v5 import * diff --git a/runtime/Lib/site-packages/altair/vega/data.py b/runtime/Lib/site-packages/altair/vega/data.py new file mode 100644 index 0000000000000000000000000000000000000000..8ad01f3b52a933c50252e50117d44bd2d0da738e --- /dev/null +++ b/runtime/Lib/site-packages/altair/vega/data.py @@ -0,0 +1,47 @@ +import pandas as pd +from toolz import curried +from ..utils.core import sanitize_dataframe +from ..utils.data import ( + MaxRowsError, + curry, + pipe, + sample, + to_csv, + to_json, + to_values, + check_data_type, +) + + +@curried.curry +def limit_rows(data, max_rows=5000): + """Raise MaxRowsError if the data model has more than max_rows.""" + if not isinstance(data, (list, pd.DataFrame)): + raise TypeError("Expected dict or DataFrame, got: {}".format(type(data))) + if len(data) > max_rows: + raise MaxRowsError( + "The number of rows in your dataset is greater than the max of {}".format( + max_rows + ) + ) + return data + + +@curried.curry +def default_data_transformer(data): + return curried.pipe(data, limit_rows, to_values) + + +__all__ = ( + "MaxRowsError", + "curry", + "default_data_transformer", + "limit_rows", + "pipe", + "sanitize_dataframe", + "sample", + "to_csv", + "to_json", + "to_values", + "check_data_type", +) diff --git a/runtime/Lib/site-packages/altair/vega/display.py b/runtime/Lib/site-packages/altair/vega/display.py new file mode 100644 index 0000000000000000000000000000000000000000..adc3167ca759b6ce1257ca9e79329ec543d238a9 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vega/display.py @@ -0,0 +1,12 @@ +from ..utils.display import Displayable, default_renderer_base, json_renderer_base +from ..utils.display import MimeBundleType, RendererType, HTMLRenderer + + +__all__ = ( + "Displayable", + "default_renderer_base", + "json_renderer_base", + "MimeBundleType", + "RendererType", + "HTMLRenderer", +) diff --git a/runtime/Lib/site-packages/altair/vega/tests/__init__.py b/runtime/Lib/site-packages/altair/vega/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/altair/vega/tests/test_import.py b/runtime/Lib/site-packages/altair/vega/tests/test_import.py new file mode 100644 index 0000000000000000000000000000000000000000..c569b86b758989b550fa3993653fe653b9709630 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vega/tests/test_import.py @@ -0,0 +1,5 @@ +from altair.vega import SCHEMA_VERSION, SCHEMA_URL + + +def test_schema_version(): + assert SCHEMA_VERSION in SCHEMA_URL diff --git a/runtime/Lib/site-packages/altair/vega/v5/__init__.py b/runtime/Lib/site-packages/altair/vega/v5/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..39d36c1d63125236185eb207ea57cf90c6765212 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vega/v5/__init__.py @@ -0,0 +1,14 @@ +# flake8: noqa +from .display import vega, Vega, renderers +from .schema import * + +from .data import ( + pipe, + curry, + limit_rows, + sample, + to_json, + to_csv, + to_values, + default_data_transformer, +) diff --git a/runtime/Lib/site-packages/altair/vega/v5/data.py b/runtime/Lib/site-packages/altair/vega/v5/data.py new file mode 100644 index 0000000000000000000000000000000000000000..78273363d19679819237caa91d8e337ad2d3c936 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vega/v5/data.py @@ -0,0 +1,29 @@ +from ..data import ( + MaxRowsError, + curry, + default_data_transformer, + limit_rows, + pipe, + sample, + to_csv, + to_json, + to_values, +) + + +# ============================================================================== +# Vega 5 data transformers +# ============================================================================== + + +__all__ = ( + "MaxRowsError", + "curry", + "default_data_transformer", + "limit_rows", + "pipe", + "sample", + "to_csv", + "to_json", + "to_values", +) diff --git a/runtime/Lib/site-packages/altair/vega/v5/display.py b/runtime/Lib/site-packages/altair/vega/v5/display.py new file mode 100644 index 0000000000000000000000000000000000000000..3e7f39a603b9c442d791c7a49a2314af4502a9ab --- /dev/null +++ b/runtime/Lib/site-packages/altair/vega/v5/display.py @@ -0,0 +1,110 @@ +import os + +from ...utils import PluginRegistry +from ..display import Displayable +from ..display import default_renderer_base +from ..display import json_renderer_base +from ..display import RendererType +from ..display import HTMLRenderer + +from .schema import SCHEMA_VERSION + +VEGA_VERSION = SCHEMA_VERSION.lstrip("v") +VEGAEMBED_VERSION = "3" + + +# ============================================================================== +# Vega 5 renderer logic +# ============================================================================== + + +# The MIME type for Vega 5 releases. +VEGA_MIME_TYPE = "application/vnd.vega.v5+json" # type: str + +# 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. +ENTRY_POINT_GROUP = "altair.vega.v5.renderer" # type: str + +# The display message when rendering fails +DEFAULT_DISPLAY = """\ + + +If you see this message, it means the renderer has not been properly enabled +for the frontend that you are using. For more information, see +https://altair-viz.github.io/user_guide/troubleshooting.html +""" + +renderers = PluginRegistry[RendererType](entry_point_group=ENTRY_POINT_GROUP) + + +here = os.path.dirname(os.path.realpath(__file__)) + + +def default_renderer(spec): + return default_renderer_base(spec, VEGA_MIME_TYPE, DEFAULT_DISPLAY) + + +def json_renderer(spec): + return json_renderer_base(spec, DEFAULT_DISPLAY) + + +colab_renderer = HTMLRenderer( + mode="vega", + fullhtml=True, + requirejs=False, + output_div="altair-viz", + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, +) + + +kaggle_renderer = HTMLRenderer( + mode="vega", + fullhtml=False, + requirejs=True, + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, +) + + +html_renderer = HTMLRenderer( + mode="vega", + template="universal", + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, +) + + +renderers.register("default", default_renderer) +renderers.register("html", html_renderer) +renderers.register("jupyterlab", default_renderer) +renderers.register("nteract", default_renderer) +renderers.register("colab", colab_renderer) +renderers.register("kaggle", kaggle_renderer) +renderers.register("json", json_renderer) +renderers.enable("default") + + +class Vega(Displayable): + """An IPython/Jupyter display class for rendering Vega 5.""" + + renderers = renderers + schema_path = (__name__, "schema/vega-schema.json") + + +def vega(spec, validate=True): + """Render and optionally validate a Vega 5 spec. + + This will use the currently enabled renderer to render the spec. + + Parameters + ========== + spec: dict + A fully compliant Vega 5 spec, with the data portion fully processed. + validate: bool + Should the spec be validated against the Vega 5 schema? + """ + from IPython.display import display + + display(Vega(spec, validate=validate)) diff --git a/runtime/Lib/site-packages/altair/vega/v5/schema/__init__.py b/runtime/Lib/site-packages/altair/vega/v5/schema/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3764f925d985210ebb924abe8d1447489cff3fae --- /dev/null +++ b/runtime/Lib/site-packages/altair/vega/v5/schema/__init__.py @@ -0,0 +1,5 @@ +# flake8: noqa +from .core import * + +SCHEMA_VERSION = 'v5.10.0' +SCHEMA_URL = 'https://vega.github.io/schema/vega/v5.10.0.json' diff --git a/runtime/Lib/site-packages/altair/vega/v5/schema/core.py b/runtime/Lib/site-packages/altair/vega/v5/schema/core.py new file mode 100644 index 0000000000000000000000000000000000000000..39b43e29adbdae3c29f9a0b28380ba2398288c4e --- /dev/null +++ b/runtime/Lib/site-packages/altair/vega/v5/schema/core.py @@ -0,0 +1,3416 @@ +# The contents of this file are automatically written by +# tools/generate_schema_wrapper.py. Do not modify directly. + +from altair.utils.schemapi import SchemaBase, Undefined, _subclasses + +import pkgutil +import json + +def load_schema(): + """Load the json schema associated with this module's functions""" + return json.loads(pkgutil.get_data(__name__, 'vega-schema.json').decode('utf-8')) + + +class VegaSchema(SchemaBase): + _rootschema = load_schema() + @classmethod + def _default_wrapper_classes(cls): + return _subclasses(VegaSchema) + + +class Root(VegaSchema): + """Root schema wrapper + + allOf(:class:`scope`, Mapping(required=[])) + """ + _schema = VegaSchema._rootschema + + def __init__(self, autosize=Undefined, axes=Undefined, background=Undefined, config=Undefined, + data=Undefined, description=Undefined, encode=Undefined, height=Undefined, + layout=Undefined, legends=Undefined, marks=Undefined, padding=Undefined, + projections=Undefined, scales=Undefined, signals=Undefined, style=Undefined, + title=Undefined, usermeta=Undefined, width=Undefined, **kwds): + super(Root, self).__init__(autosize=autosize, axes=axes, background=background, config=config, + data=data, description=description, encode=encode, height=height, + layout=layout, legends=legends, marks=marks, padding=padding, + projections=projections, scales=scales, signals=signals, style=style, + title=title, usermeta=usermeta, width=width, **kwds) + + +class autosize(VegaSchema): + """autosize schema wrapper + + oneOf(enum('pad', 'fit', 'fit-x', 'fit-y', 'none'), Mapping(required=[type]), + :class:`signal`) + """ + _schema = {'$ref': '#/defs/autosize'} + + def __init__(self, *args, **kwds): + super(autosize, self).__init__(*args, **kwds) + + +class axis(VegaSchema): + """axis schema wrapper + + Mapping(required=[orient, scale]) + + Attributes + ---------- + + orient : enum('top', 'bottom', 'left', 'right') + + scale : string + + bandPosition : oneOf(float, :class:`numberValue`) + + domain : boolean + + domainColor : oneOf(None, string, :class:`colorValue`) + + domainDash : oneOf(List(float), :class:`arrayValue`) + + domainDashOffset : oneOf(float, :class:`numberValue`) + + domainOpacity : oneOf(float, :class:`numberValue`) + + domainWidth : oneOf(float, :class:`numberValue`) + + encode : Mapping(required=[]) + + format : oneOf(string, Mapping(required=[]), :class:`signal`) + + formatType : oneOf(enum('number', 'time', 'utc'), :class:`signal`) + + grid : boolean + + gridColor : oneOf(None, string, :class:`colorValue`) + + gridDash : oneOf(List(float), :class:`arrayValue`) + + gridDashOffset : oneOf(float, :class:`numberValue`) + + gridOpacity : oneOf(float, :class:`numberValue`) + + gridScale : string + + gridWidth : oneOf(float, :class:`numberValue`) + + labelAlign : oneOf(enum('left', 'right', 'center'), :class:`alignValue`) + + labelAngle : oneOf(float, :class:`numberValue`) + + labelBaseline : oneOf(enum('top', 'middle', 'bottom', 'alphabetic', 'line-top', + 'line-bottom'), :class:`baselineValue`) + + labelBound : oneOf(boolean, float, :class:`signal`) + + labelColor : oneOf(None, string, :class:`colorValue`) + + labelFlush : oneOf(boolean, float, :class:`signal`) + + labelFlushOffset : :class:`numberOrSignal` + + labelFont : oneOf(string, :class:`stringValue`) + + labelFontSize : oneOf(float, :class:`numberValue`) + + labelFontStyle : oneOf(string, :class:`stringValue`) + + labelFontWeight : oneOf(enum(None, 'normal', 'bold', 'lighter', 'bolder', '100', '200', + '300', '400', '500', '600', '700', '800', '900', 100, 200, 300, 400, 500, 600, 700, 800, + 900), :class:`fontWeightValue`) + + labelLimit : oneOf(float, :class:`numberValue`) + + labelLineHeight : oneOf(float, :class:`numberValue`) + + labelOffset : oneOf(float, :class:`numberValue`) + + labelOpacity : oneOf(float, :class:`numberValue`) + + labelOverlap : :class:`labelOverlap` + + labelPadding : oneOf(float, :class:`numberValue`) + + labelSeparation : :class:`numberOrSignal` + + labels : boolean + + maxExtent : oneOf(float, :class:`numberValue`) + + minExtent : oneOf(float, :class:`numberValue`) + + offset : oneOf(float, :class:`numberValue`) + + position : oneOf(float, :class:`numberValue`) + + tickBand : :class:`tickBand` + + tickColor : oneOf(None, string, :class:`colorValue`) + + tickCount : :class:`tickCount` + + tickDash : oneOf(List(float), :class:`arrayValue`) + + tickDashOffset : oneOf(float, :class:`numberValue`) + + tickExtra : :class:`booleanOrSignal` + + tickMinStep : :class:`numberOrSignal` + + tickOffset : oneOf(float, :class:`numberValue`) + + tickOpacity : oneOf(float, :class:`numberValue`) + + tickRound : oneOf(boolean, :class:`booleanValue`) + + tickSize : oneOf(float, :class:`numberValue`) + + tickWidth : oneOf(float, :class:`numberValue`) + + ticks : boolean + + title : :class:`textOrSignal` + + titleAlign : oneOf(enum('left', 'right', 'center'), :class:`alignValue`) + + titleAnchor : oneOf(enum(None, 'start', 'middle', 'end'), :class:`anchorValue`) + + titleAngle : oneOf(float, :class:`numberValue`) + + titleBaseline : oneOf(enum('top', 'middle', 'bottom', 'alphabetic', 'line-top', + 'line-bottom'), :class:`baselineValue`) + + titleColor : oneOf(None, string, :class:`colorValue`) + + titleFont : oneOf(string, :class:`stringValue`) + + titleFontSize : oneOf(float, :class:`numberValue`) + + titleFontStyle : oneOf(string, :class:`stringValue`) + + titleFontWeight : oneOf(enum(None, 'normal', 'bold', 'lighter', 'bolder', '100', '200', + '300', '400', '500', '600', '700', '800', '900', 100, 200, 300, 400, 500, 600, 700, 800, + 900), :class:`fontWeightValue`) + + titleLimit : oneOf(float, :class:`numberValue`) + + titleLineHeight : oneOf(float, :class:`numberValue`) + + titleOpacity : oneOf(float, :class:`numberValue`) + + titlePadding : oneOf(float, :class:`numberValue`) + + titleX : oneOf(float, :class:`numberValue`) + + titleY : oneOf(float, :class:`numberValue`) + + translate : float + + values : :class:`arrayOrSignal` + + zindex : float + + """ + _schema = {'$ref': '#/defs/axis'} + + def __init__(self, orient=Undefined, scale=Undefined, bandPosition=Undefined, domain=Undefined, + domainColor=Undefined, domainDash=Undefined, domainDashOffset=Undefined, + domainOpacity=Undefined, domainWidth=Undefined, encode=Undefined, format=Undefined, + formatType=Undefined, grid=Undefined, gridColor=Undefined, gridDash=Undefined, + gridDashOffset=Undefined, gridOpacity=Undefined, gridScale=Undefined, + gridWidth=Undefined, labelAlign=Undefined, labelAngle=Undefined, + labelBaseline=Undefined, labelBound=Undefined, labelColor=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, position=Undefined, tickBand=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__(orient=orient, scale=scale, bandPosition=bandPosition, domain=domain, + domainColor=domainColor, domainDash=domainDash, + domainDashOffset=domainDashOffset, domainOpacity=domainOpacity, + domainWidth=domainWidth, encode=encode, format=format, + formatType=formatType, grid=grid, gridColor=gridColor, + gridDash=gridDash, gridDashOffset=gridDashOffset, + gridOpacity=gridOpacity, gridScale=gridScale, gridWidth=gridWidth, + labelAlign=labelAlign, labelAngle=labelAngle, + labelBaseline=labelBaseline, labelBound=labelBound, + labelColor=labelColor, 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, position=position, tickBand=tickBand, + 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 background(VegaSchema): + """background schema wrapper + + oneOf(string, :class:`signal`) + """ + _schema = {'$ref': '#/defs/background'} + + def __init__(self, *args, **kwds): + super(background, self).__init__(*args, **kwds) + + +class bind(VegaSchema): + """bind schema wrapper + + oneOf(Mapping(required=[input]), Mapping(required=[input, options]), + Mapping(required=[input]), Mapping(required=[input])) + """ + _schema = {'$ref': '#/defs/bind'} + + def __init__(self, *args, **kwds): + super(bind, self).__init__(*args, **kwds) + + +class data(VegaSchema): + """data schema wrapper + + oneOf(Mapping(required=[name]), Mapping(required=[source, name]), Mapping(required=[url, + name]), Mapping(required=[values, name])) + """ + _schema = {'$ref': '#/defs/data'} + + def __init__(self, *args, **kwds): + super(data, self).__init__(*args, **kwds) + + +class rule(VegaSchema): + """rule schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + test : string + + """ + _schema = {'$ref': '#/defs/rule'} + + def __init__(self, test=Undefined, **kwds): + super(rule, self).__init__(test=test, **kwds) + + +class encodeEntry(VegaSchema): + """encodeEntry schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : :class:`alignValue` + + angle : :class:`numberValue` + + aspect : :class:`booleanValue` + + baseline : :class:`baselineValue` + + blend : :class:`blendValue` + + clip : :class:`booleanValue` + + cornerRadius : :class:`numberValue` + + cornerRadiusBottomLeft : :class:`numberValue` + + cornerRadiusBottomRight : :class:`numberValue` + + cornerRadiusTopLeft : :class:`numberValue` + + cornerRadiusTopRight : :class:`numberValue` + + cursor : :class:`stringValue` + + defined : :class:`booleanValue` + + dir : :class:`stringValue` + + dx : :class:`numberValue` + + dy : :class:`numberValue` + + ellipsis : :class:`stringValue` + + endAngle : :class:`numberValue` + + fill : :class:`colorValue` + + fillOpacity : :class:`numberValue` + + font : :class:`stringValue` + + fontSize : :class:`numberValue` + + fontStyle : :class:`stringValue` + + fontWeight : :class:`fontWeightValue` + + height : :class:`numberValue` + + innerRadius : :class:`numberValue` + + interpolate : :class:`stringValue` + + limit : :class:`numberValue` + + lineBreak : :class:`stringValue` + + lineHeight : :class:`numberValue` + + opacity : :class:`numberValue` + + orient : :class:`directionValue` + + outerRadius : :class:`numberValue` + + padAngle : :class:`numberValue` + + path : :class:`stringValue` + + radius : :class:`numberValue` + + scaleX : :class:`numberValue` + + scaleY : :class:`numberValue` + + shape : :class:`stringValue` + + size : :class:`numberValue` + + smooth : :class:`booleanValue` + + startAngle : :class:`numberValue` + + stroke : :class:`colorValue` + + strokeCap : :class:`strokeCapValue` + + strokeDash : :class:`arrayValue` + + strokeDashOffset : :class:`numberValue` + + strokeForeground : :class:`booleanValue` + + strokeJoin : :class:`strokeJoinValue` + + strokeMiterLimit : :class:`numberValue` + + strokeOffset : :class:`numberValue` + + strokeOpacity : :class:`numberValue` + + strokeWidth : :class:`numberValue` + + tension : :class:`numberValue` + + text : :class:`textValue` + + theta : :class:`numberValue` + + tooltip : :class:`anyValue` + + url : :class:`stringValue` + + width : :class:`numberValue` + + x : :class:`numberValue` + + x2 : :class:`numberValue` + + xc : :class:`numberValue` + + y : :class:`numberValue` + + y2 : :class:`numberValue` + + yc : :class:`numberValue` + + zindex : :class:`numberValue` + + """ + _schema = {'$ref': '#/defs/encodeEntry'} + + def __init__(self, align=Undefined, angle=Undefined, aspect=Undefined, baseline=Undefined, + blend=Undefined, clip=Undefined, cornerRadius=Undefined, + cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, + cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, + defined=Undefined, dir=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, + endAngle=Undefined, fill=Undefined, fillOpacity=Undefined, font=Undefined, + fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, height=Undefined, + innerRadius=Undefined, interpolate=Undefined, limit=Undefined, lineBreak=Undefined, + lineHeight=Undefined, opacity=Undefined, orient=Undefined, outerRadius=Undefined, + padAngle=Undefined, path=Undefined, radius=Undefined, scaleX=Undefined, + scaleY=Undefined, shape=Undefined, size=Undefined, smooth=Undefined, + startAngle=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeForeground=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, tension=Undefined, text=Undefined, theta=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + xc=Undefined, y=Undefined, y2=Undefined, yc=Undefined, zindex=Undefined, **kwds): + super(encodeEntry, self).__init__(align=align, angle=angle, aspect=aspect, baseline=baseline, + blend=blend, clip=clip, cornerRadius=cornerRadius, + cornerRadiusBottomLeft=cornerRadiusBottomLeft, + cornerRadiusBottomRight=cornerRadiusBottomRight, + cornerRadiusTopLeft=cornerRadiusTopLeft, + cornerRadiusTopRight=cornerRadiusTopRight, cursor=cursor, + defined=defined, dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, + endAngle=endAngle, fill=fill, fillOpacity=fillOpacity, + font=font, fontSize=fontSize, fontStyle=fontStyle, + fontWeight=fontWeight, height=height, innerRadius=innerRadius, + interpolate=interpolate, limit=limit, lineBreak=lineBreak, + lineHeight=lineHeight, opacity=opacity, orient=orient, + outerRadius=outerRadius, padAngle=padAngle, path=path, + radius=radius, scaleX=scaleX, scaleY=scaleY, shape=shape, + size=size, smooth=smooth, startAngle=startAngle, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, + strokeForeground=strokeForeground, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOffset=strokeOffset, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + tension=tension, text=text, theta=theta, tooltip=tooltip, + url=url, width=width, x=x, x2=x2, xc=xc, y=y, y2=y2, yc=yc, + zindex=zindex, **kwds) + + +class encode(VegaSchema): + """encode schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/defs/encode'} + + def __init__(self, **kwds): + super(encode, self).__init__(**kwds) + + +class layout(VegaSchema): + """layout schema wrapper + + oneOf(Mapping(required=[]), :class:`signal`) + """ + _schema = {'$ref': '#/defs/layout'} + + def __init__(self, *args, **kwds): + super(layout, self).__init__(*args, **kwds) + + +class guideEncode(VegaSchema): + """guideEncode schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + interactive : boolean + + name : string + + style : :class:`style` + + """ + _schema = {'$ref': '#/defs/guideEncode'} + + def __init__(self, interactive=Undefined, name=Undefined, style=Undefined, **kwds): + super(guideEncode, self).__init__(interactive=interactive, name=name, style=style, **kwds) + + +class legend(VegaSchema): + """legend schema wrapper + + allOf(Mapping(required=[]), anyOf(Mapping(required=[size]), Mapping(required=[shape]), + Mapping(required=[fill]), Mapping(required=[stroke]), Mapping(required=[opacity]), + Mapping(required=[strokeDash]), Mapping(required=[strokeWidth]))) + """ + _schema = {'$ref': '#/defs/legend'} + + def __init__(self, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, + cornerRadius=Undefined, direction=Undefined, encode=Undefined, fill=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, + labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, + labelFontWeight=Undefined, labelLimit=Undefined, labelOffset=Undefined, + labelOpacity=Undefined, labelOverlap=Undefined, labelSeparation=Undefined, + legendX=Undefined, legendY=Undefined, offset=Undefined, opacity=Undefined, + orient=Undefined, padding=Undefined, rowPadding=Undefined, shape=Undefined, + size=Undefined, stroke=Undefined, strokeColor=Undefined, strokeDash=Undefined, + strokeWidth=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__(clipHeight=clipHeight, columnPadding=columnPadding, + columns=columns, cornerRadius=cornerRadius, direction=direction, + encode=encode, fill=fill, fillColor=fillColor, format=format, + formatType=formatType, gradientLength=gradientLength, + gradientOpacity=gradientOpacity, + gradientStrokeColor=gradientStrokeColor, + gradientStrokeWidth=gradientStrokeWidth, + gradientThickness=gradientThickness, gridAlign=gridAlign, + labelAlign=labelAlign, labelBaseline=labelBaseline, + labelColor=labelColor, labelFont=labelFont, + labelFontSize=labelFontSize, labelFontStyle=labelFontStyle, + labelFontWeight=labelFontWeight, labelLimit=labelLimit, + labelOffset=labelOffset, labelOpacity=labelOpacity, + labelOverlap=labelOverlap, labelSeparation=labelSeparation, + legendX=legendX, legendY=legendY, offset=offset, opacity=opacity, + orient=orient, padding=padding, rowPadding=rowPadding, shape=shape, + size=size, stroke=stroke, strokeColor=strokeColor, + strokeDash=strokeDash, strokeWidth=strokeWidth, + 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 mark(VegaSchema): + """mark schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`marktype` + + clip : :class:`markclip` + + encode : :class:`encode` + + interactive : :class:`booleanOrSignal` + + key : string + + name : string + + on : :class:`onMarkTrigger` + + role : string + + sort : :class:`compare` + + style : :class:`style` + + transform : List(:class:`transformMark`) + + """ + _schema = {'$ref': '#/defs/mark'} + + def __init__(self, type=Undefined, clip=Undefined, encode=Undefined, interactive=Undefined, + key=Undefined, name=Undefined, on=Undefined, role=Undefined, sort=Undefined, + style=Undefined, transform=Undefined, **kwds): + super(mark, self).__init__(type=type, clip=clip, encode=encode, interactive=interactive, + key=key, name=name, on=on, role=role, sort=sort, style=style, + transform=transform, **kwds) + + +class markGroup(VegaSchema): + """markGroup schema wrapper + + allOf(Mapping(required=[type]), :class:`mark`, :class:`scope`) + """ + _schema = {'$ref': '#/defs/markGroup'} + + def __init__(self, type=Undefined, axes=Undefined, clip=Undefined, data=Undefined, encode=Undefined, + interactive=Undefined, key=Undefined, layout=Undefined, legends=Undefined, + marks=Undefined, name=Undefined, on=Undefined, projections=Undefined, role=Undefined, + scales=Undefined, signals=Undefined, sort=Undefined, style=Undefined, title=Undefined, + transform=Undefined, usermeta=Undefined, **kwds): + super(markGroup, self).__init__(type=type, axes=axes, clip=clip, data=data, encode=encode, + interactive=interactive, key=key, layout=layout, + legends=legends, marks=marks, name=name, on=on, + projections=projections, role=role, scales=scales, + signals=signals, sort=sort, style=style, title=title, + transform=transform, usermeta=usermeta, **kwds) + + +class markVisual(VegaSchema): + """markVisual schema wrapper + + allOf(Mapping(required=[]), :class:`mark`) + """ + _schema = {'$ref': '#/defs/markVisual'} + + def __init__(self, type=Undefined, clip=Undefined, encode=Undefined, interactive=Undefined, + key=Undefined, name=Undefined, on=Undefined, role=Undefined, sort=Undefined, + style=Undefined, transform=Undefined, **kwds): + super(markVisual, self).__init__(type=type, clip=clip, encode=encode, interactive=interactive, + key=key, name=name, on=on, role=role, sort=sort, style=style, + transform=transform, **kwds) + + +class listener(VegaSchema): + """listener schema wrapper + + oneOf(:class:`signal`, Mapping(required=[scale]), :class:`stream`) + """ + _schema = {'$ref': '#/defs/listener'} + + def __init__(self, *args, **kwds): + super(listener, self).__init__(*args, **kwds) + + +class onEvents(VegaSchema): + """onEvents schema wrapper + + List(allOf(Mapping(required=[events]), oneOf(Mapping(required=[encode]), + Mapping(required=[update])))) + """ + _schema = {'$ref': '#/defs/onEvents'} + + def __init__(self, *args): + super(onEvents, self).__init__(*args) + + +class onTrigger(VegaSchema): + """onTrigger schema wrapper + + List(Mapping(required=[trigger])) + """ + _schema = {'$ref': '#/defs/onTrigger'} + + def __init__(self, *args): + super(onTrigger, self).__init__(*args) + + +class onMarkTrigger(VegaSchema): + """onMarkTrigger schema wrapper + + List(Mapping(required=[trigger])) + """ + _schema = {'$ref': '#/defs/onMarkTrigger'} + + def __init__(self, *args): + super(onMarkTrigger, self).__init__(*args) + + +class padding(VegaSchema): + """padding schema wrapper + + oneOf(float, Mapping(required=[]), :class:`signal`) + """ + _schema = {'$ref': '#/defs/padding'} + + def __init__(self, *args, **kwds): + super(padding, self).__init__(*args, **kwds) + + +class projection(VegaSchema): + """projection schema wrapper + + Mapping(required=[name]) + + Attributes + ---------- + + name : string + + center : oneOf(List(:class:`numberOrSignal`), :class:`signal`) + + clipAngle : :class:`numberOrSignal` + + clipExtent : oneOf(List(oneOf(List(:class:`numberOrSignal`), :class:`signal`)), + :class:`signal`) + + extent : oneOf(List(oneOf(List(:class:`numberOrSignal`), :class:`signal`)), :class:`signal`) + + fit : oneOf(Mapping(required=[]), List(Any)) + + parallels : oneOf(List(:class:`numberOrSignal`), :class:`signal`) + + pointRadius : :class:`numberOrSignal` + + precision : :class:`numberOrSignal` + + rotate : oneOf(List(:class:`numberOrSignal`), :class:`signal`) + + scale : :class:`numberOrSignal` + + size : oneOf(List(:class:`numberOrSignal`), :class:`signal`) + + translate : oneOf(List(:class:`numberOrSignal`), :class:`signal`) + + type : :class:`stringOrSignal` + + """ + _schema = {'$ref': '#/defs/projection'} + + def __init__(self, name=Undefined, center=Undefined, clipAngle=Undefined, clipExtent=Undefined, + extent=Undefined, fit=Undefined, parallels=Undefined, pointRadius=Undefined, + precision=Undefined, rotate=Undefined, scale=Undefined, size=Undefined, + translate=Undefined, type=Undefined, **kwds): + super(projection, self).__init__(name=name, center=center, clipAngle=clipAngle, + clipExtent=clipExtent, extent=extent, fit=fit, + parallels=parallels, pointRadius=pointRadius, + precision=precision, rotate=rotate, scale=scale, size=size, + translate=translate, type=type, **kwds) + + +class scale(VegaSchema): + """scale schema wrapper + + oneOf(Mapping(required=[type, name]), Mapping(required=[type, name]), + Mapping(required=[type, name]), Mapping(required=[type, name]), Mapping(required=[type, + name]), Mapping(required=[type, name]), Mapping(required=[type, name]), + Mapping(required=[type, name]), Mapping(required=[name]), Mapping(required=[type, name]), + Mapping(required=[type, name]), Mapping(required=[type, name])) + """ + _schema = {'$ref': '#/defs/scale'} + + def __init__(self, *args, **kwds): + super(scale, self).__init__(*args, **kwds) + + +class scope(VegaSchema): + """scope schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + axes : List(:class:`axis`) + + data : List(:class:`data`) + + encode : :class:`encode` + + layout : :class:`layout` + + legends : List(:class:`legend`) + + marks : List(oneOf(:class:`markGroup`, :class:`markVisual`)) + + projections : List(:class:`projection`) + + scales : List(:class:`scale`) + + signals : List(:class:`signal`) + + title : :class:`title` + + usermeta : Mapping(required=[]) + + """ + _schema = {'$ref': '#/defs/scope'} + + def __init__(self, axes=Undefined, data=Undefined, encode=Undefined, layout=Undefined, + legends=Undefined, marks=Undefined, projections=Undefined, scales=Undefined, + signals=Undefined, title=Undefined, usermeta=Undefined, **kwds): + super(scope, self).__init__(axes=axes, data=data, encode=encode, layout=layout, legends=legends, + marks=marks, projections=projections, scales=scales, + signals=signals, title=title, usermeta=usermeta, **kwds) + + +class signalName(VegaSchema): + """signalName schema wrapper + + not enum('parent', 'datum', 'event', 'item') + """ + _schema = {'$ref': '#/defs/signalName'} + + def __init__(self, *args): + super(signalName, self).__init__(*args) + + +class signal(VegaSchema): + """signal schema wrapper + + oneOf(Mapping(required=[name, push]), Mapping(required=[name]), Mapping(required=[name, + init])) + """ + _schema = {'$ref': '#/defs/signal'} + + def __init__(self, *args, **kwds): + super(signal, self).__init__(*args, **kwds) + + +class stream(VegaSchema): + """stream schema wrapper + + allOf(Mapping(required=[]), oneOf(Mapping(required=[type]), Mapping(required=[stream]), + Mapping(required=[merge]))) + """ + _schema = {'$ref': '#/defs/stream'} + + def __init__(self, between=Undefined, consume=Undefined, debounce=Undefined, filter=Undefined, + markname=Undefined, marktype=Undefined, throttle=Undefined, **kwds): + super(stream, self).__init__(between=between, consume=consume, debounce=debounce, filter=filter, + markname=markname, marktype=marktype, throttle=throttle, **kwds) + + +class title(VegaSchema): + """title schema wrapper + + oneOf(string, Mapping(required=[])) + """ + _schema = {'$ref': '#/defs/title'} + + def __init__(self, *args, **kwds): + super(title, self).__init__(*args, **kwds) + + +class transform(VegaSchema): + """transform schema wrapper + + oneOf(:class:`crossfilterTransform`, :class:`resolvefilterTransform`, + :class:`linkpathTransform`, :class:`pieTransform`, :class:`stackTransform`, + :class:`forceTransform`, :class:`contourTransform`, :class:`geojsonTransform`, + :class:`geopathTransform`, :class:`geopointTransform`, :class:`geoshapeTransform`, + :class:`graticuleTransform`, :class:`heatmapTransform`, :class:`isocontourTransform`, + :class:`kde2dTransform`, :class:`nestTransform`, :class:`packTransform`, + :class:`partitionTransform`, :class:`stratifyTransform`, :class:`treeTransform`, + :class:`treelinksTransform`, :class:`treemapTransform`, :class:`loessTransform`, + :class:`regressionTransform`, :class:`aggregateTransform`, :class:`binTransform`, + :class:`collectTransform`, :class:`countpatternTransform`, :class:`crossTransform`, + :class:`densityTransform`, :class:`dotbinTransform`, :class:`extentTransform`, + :class:`filterTransform`, :class:`flattenTransform`, :class:`foldTransform`, + :class:`formulaTransform`, :class:`imputeTransform`, :class:`joinaggregateTransform`, + :class:`kdeTransform`, :class:`lookupTransform`, :class:`pivotTransform`, + :class:`projectTransform`, :class:`quantileTransform`, :class:`sampleTransform`, + :class:`sequenceTransform`, :class:`timeunitTransform`, :class:`windowTransform`, + :class:`identifierTransform`, :class:`voronoiTransform`, :class:`wordcloudTransform`) + """ + _schema = {'$ref': '#/defs/transform'} + + def __init__(self, *args, **kwds): + super(transform, self).__init__(*args, **kwds) + + +class transformMark(VegaSchema): + """transformMark schema wrapper + + oneOf(:class:`crossfilterTransform`, :class:`resolvefilterTransform`, + :class:`linkpathTransform`, :class:`pieTransform`, :class:`stackTransform`, + :class:`forceTransform`, :class:`geojsonTransform`, :class:`geopathTransform`, + :class:`geopointTransform`, :class:`geoshapeTransform`, :class:`heatmapTransform`, + :class:`packTransform`, :class:`partitionTransform`, :class:`stratifyTransform`, + :class:`treeTransform`, :class:`treemapTransform`, :class:`binTransform`, + :class:`collectTransform`, :class:`dotbinTransform`, :class:`extentTransform`, + :class:`formulaTransform`, :class:`joinaggregateTransform`, :class:`lookupTransform`, + :class:`sampleTransform`, :class:`timeunitTransform`, :class:`windowTransform`, + :class:`identifierTransform`, :class:`voronoiTransform`, :class:`wordcloudTransform`) + """ + _schema = {'$ref': '#/defs/transformMark'} + + def __init__(self, *args, **kwds): + super(transformMark, self).__init__(*args, **kwds) + + +class crossfilterTransform(VegaSchema): + """crossfilterTransform schema wrapper + + Mapping(required=[type, fields, query]) + + Attributes + ---------- + + fields : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + query : oneOf(List(Any), :class:`signal`) + + type : enum('crossfilter') + + signal : string + + """ + _schema = {'$ref': '#/defs/crossfilterTransform'} + + def __init__(self, fields=Undefined, query=Undefined, type=Undefined, signal=Undefined, **kwds): + super(crossfilterTransform, self).__init__(fields=fields, query=query, type=type, signal=signal, + **kwds) + + +class resolvefilterTransform(VegaSchema): + """resolvefilterTransform schema wrapper + + Mapping(required=[type, ignore, filter]) + + Attributes + ---------- + + filter : Any + + ignore : anyOf(float, :class:`signal`) + + type : enum('resolvefilter') + + signal : string + + """ + _schema = {'$ref': '#/defs/resolvefilterTransform'} + + def __init__(self, filter=Undefined, ignore=Undefined, type=Undefined, signal=Undefined, **kwds): + super(resolvefilterTransform, self).__init__(filter=filter, ignore=ignore, type=type, + signal=signal, **kwds) + + +class linkpathTransform(VegaSchema): + """linkpathTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('linkpath') + + orient : anyOf(enum('horizontal', 'vertical', 'radial'), :class:`signal`) + + require : :class:`signal` + + shape : anyOf(enum('line', 'arc', 'curve', 'diagonal', 'orthogonal'), :class:`signal`) + + signal : string + + sourceX : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + sourceY : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + targetX : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + targetY : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + as : anyOf(string, :class:`signal`) + + """ + _schema = {'$ref': '#/defs/linkpathTransform'} + + def __init__(self, type=Undefined, orient=Undefined, require=Undefined, shape=Undefined, + signal=Undefined, sourceX=Undefined, sourceY=Undefined, targetX=Undefined, + targetY=Undefined, **kwds): + super(linkpathTransform, self).__init__(type=type, orient=orient, require=require, shape=shape, + signal=signal, sourceX=sourceX, sourceY=sourceY, + targetX=targetX, targetY=targetY, **kwds) + + +class pieTransform(VegaSchema): + """pieTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('pie') + + endAngle : anyOf(float, :class:`signal`) + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + signal : string + + sort : anyOf(boolean, :class:`signal`) + + startAngle : anyOf(float, :class:`signal`) + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/pieTransform'} + + def __init__(self, type=Undefined, endAngle=Undefined, field=Undefined, signal=Undefined, + sort=Undefined, startAngle=Undefined, **kwds): + super(pieTransform, self).__init__(type=type, endAngle=endAngle, field=field, signal=signal, + sort=sort, startAngle=startAngle, **kwds) + + +class stackTransform(VegaSchema): + """stackTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('stack') + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + groupby : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + offset : anyOf(enum('zero', 'center', 'normalize'), :class:`signal`) + + signal : string + + sort : :class:`compare` + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/stackTransform'} + + def __init__(self, type=Undefined, field=Undefined, groupby=Undefined, offset=Undefined, + signal=Undefined, sort=Undefined, **kwds): + super(stackTransform, self).__init__(type=type, field=field, groupby=groupby, offset=offset, + signal=signal, sort=sort, **kwds) + + +class forceTransform(VegaSchema): + """forceTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('force') + + alpha : anyOf(float, :class:`signal`) + + alphaMin : anyOf(float, :class:`signal`) + + alphaTarget : anyOf(float, :class:`signal`) + + forces : List(oneOf(Mapping(required=[force]), Mapping(required=[force]), + Mapping(required=[force]), Mapping(required=[force]), Mapping(required=[force]), + Mapping(required=[force]))) + + iterations : anyOf(float, :class:`signal`) + + restart : anyOf(boolean, :class:`signal`) + + signal : string + + static : anyOf(boolean, :class:`signal`) + + velocityDecay : anyOf(float, :class:`signal`) + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/forceTransform'} + + def __init__(self, type=Undefined, alpha=Undefined, alphaMin=Undefined, alphaTarget=Undefined, + forces=Undefined, iterations=Undefined, restart=Undefined, signal=Undefined, + static=Undefined, velocityDecay=Undefined, **kwds): + super(forceTransform, self).__init__(type=type, alpha=alpha, alphaMin=alphaMin, + alphaTarget=alphaTarget, forces=forces, + iterations=iterations, restart=restart, signal=signal, + static=static, velocityDecay=velocityDecay, **kwds) + + +class contourTransform(VegaSchema): + """contourTransform schema wrapper + + Mapping(required=[type, size]) + + Attributes + ---------- + + size : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + type : enum('contour') + + bandwidth : anyOf(float, :class:`signal`) + + cellSize : anyOf(float, :class:`signal`) + + count : anyOf(float, :class:`signal`) + + nice : anyOf(boolean, :class:`signal`) + + signal : string + + smooth : anyOf(boolean, :class:`signal`) + + thresholds : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + values : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + weight : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + x : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + y : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + """ + _schema = {'$ref': '#/defs/contourTransform'} + + def __init__(self, size=Undefined, type=Undefined, bandwidth=Undefined, cellSize=Undefined, + count=Undefined, nice=Undefined, signal=Undefined, smooth=Undefined, + thresholds=Undefined, values=Undefined, weight=Undefined, x=Undefined, y=Undefined, + **kwds): + super(contourTransform, self).__init__(size=size, type=type, bandwidth=bandwidth, + cellSize=cellSize, count=count, nice=nice, signal=signal, + smooth=smooth, thresholds=thresholds, values=values, + weight=weight, x=x, y=y, **kwds) + + +class geojsonTransform(VegaSchema): + """geojsonTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('geojson') + + fields : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + geojson : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + signal : string + + """ + _schema = {'$ref': '#/defs/geojsonTransform'} + + def __init__(self, type=Undefined, fields=Undefined, geojson=Undefined, signal=Undefined, **kwds): + super(geojsonTransform, self).__init__(type=type, fields=fields, geojson=geojson, signal=signal, + **kwds) + + +class geopathTransform(VegaSchema): + """geopathTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('geopath') + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + pointRadius : anyOf(float, :class:`signal`, :class:`expr`, :class:`paramField`) + + projection : string + + signal : string + + as : anyOf(string, :class:`signal`) + + """ + _schema = {'$ref': '#/defs/geopathTransform'} + + def __init__(self, type=Undefined, field=Undefined, pointRadius=Undefined, projection=Undefined, + signal=Undefined, **kwds): + super(geopathTransform, self).__init__(type=type, field=field, pointRadius=pointRadius, + projection=projection, signal=signal, **kwds) + + +class geopointTransform(VegaSchema): + """geopointTransform schema wrapper + + Mapping(required=[type, projection, fields]) + + Attributes + ---------- + + fields : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + projection : string + + type : enum('geopoint') + + signal : string + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/geopointTransform'} + + def __init__(self, fields=Undefined, projection=Undefined, type=Undefined, signal=Undefined, **kwds): + super(geopointTransform, self).__init__(fields=fields, projection=projection, type=type, + signal=signal, **kwds) + + +class geoshapeTransform(VegaSchema): + """geoshapeTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('geoshape') + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + pointRadius : anyOf(float, :class:`signal`, :class:`expr`, :class:`paramField`) + + projection : string + + signal : string + + as : anyOf(string, :class:`signal`) + + """ + _schema = {'$ref': '#/defs/geoshapeTransform'} + + def __init__(self, type=Undefined, field=Undefined, pointRadius=Undefined, projection=Undefined, + signal=Undefined, **kwds): + super(geoshapeTransform, self).__init__(type=type, field=field, pointRadius=pointRadius, + projection=projection, signal=signal, **kwds) + + +class graticuleTransform(VegaSchema): + """graticuleTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('graticule') + + extent : oneOf(List(Any), :class:`signal`) + + extentMajor : oneOf(List(Any), :class:`signal`) + + extentMinor : oneOf(List(Any), :class:`signal`) + + precision : anyOf(float, :class:`signal`) + + signal : string + + step : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + stepMajor : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + stepMinor : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/graticuleTransform'} + + def __init__(self, type=Undefined, extent=Undefined, extentMajor=Undefined, extentMinor=Undefined, + precision=Undefined, signal=Undefined, step=Undefined, stepMajor=Undefined, + stepMinor=Undefined, **kwds): + super(graticuleTransform, self).__init__(type=type, extent=extent, extentMajor=extentMajor, + extentMinor=extentMinor, precision=precision, + signal=signal, step=step, stepMajor=stepMajor, + stepMinor=stepMinor, **kwds) + + +class heatmapTransform(VegaSchema): + """heatmapTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('heatmap') + + color : anyOf(string, :class:`signal`, :class:`expr`, :class:`paramField`) + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + opacity : anyOf(float, :class:`signal`, :class:`expr`, :class:`paramField`) + + resolve : anyOf(enum('shared', 'independent'), :class:`signal`) + + signal : string + + as : anyOf(string, :class:`signal`) + + """ + _schema = {'$ref': '#/defs/heatmapTransform'} + + def __init__(self, type=Undefined, color=Undefined, field=Undefined, opacity=Undefined, + resolve=Undefined, signal=Undefined, **kwds): + super(heatmapTransform, self).__init__(type=type, color=color, field=field, opacity=opacity, + resolve=resolve, signal=signal, **kwds) + + +class isocontourTransform(VegaSchema): + """isocontourTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('isocontour') + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + levels : anyOf(float, :class:`signal`) + + nice : anyOf(boolean, :class:`signal`) + + resolve : anyOf(enum('shared', 'independent'), :class:`signal`) + + scale : anyOf(float, :class:`signal`, :class:`expr`, :class:`paramField`) + + signal : string + + smooth : anyOf(boolean, :class:`signal`) + + thresholds : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + translate : oneOf(List(anyOf(float, :class:`signal`, :class:`expr`, :class:`paramField`)), + :class:`signal`) + + zero : anyOf(boolean, :class:`signal`) + + as : anyOf(string, :class:`signal`, None) + + """ + _schema = {'$ref': '#/defs/isocontourTransform'} + + def __init__(self, type=Undefined, field=Undefined, levels=Undefined, nice=Undefined, + resolve=Undefined, scale=Undefined, signal=Undefined, smooth=Undefined, + thresholds=Undefined, translate=Undefined, zero=Undefined, **kwds): + super(isocontourTransform, self).__init__(type=type, field=field, levels=levels, nice=nice, + resolve=resolve, scale=scale, signal=signal, + smooth=smooth, thresholds=thresholds, + translate=translate, zero=zero, **kwds) + + +class kde2dTransform(VegaSchema): + """kde2dTransform schema wrapper + + Mapping(required=[type, size, x, y]) + + Attributes + ---------- + + size : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + type : enum('kde2d') + + x : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + y : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + bandwidth : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + cellSize : anyOf(float, :class:`signal`) + + counts : anyOf(boolean, :class:`signal`) + + groupby : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + signal : string + + weight : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + as : anyOf(string, :class:`signal`) + + """ + _schema = {'$ref': '#/defs/kde2dTransform'} + + def __init__(self, size=Undefined, type=Undefined, x=Undefined, y=Undefined, bandwidth=Undefined, + cellSize=Undefined, counts=Undefined, groupby=Undefined, signal=Undefined, + weight=Undefined, **kwds): + super(kde2dTransform, self).__init__(size=size, type=type, x=x, y=y, bandwidth=bandwidth, + cellSize=cellSize, counts=counts, groupby=groupby, + signal=signal, weight=weight, **kwds) + + +class nestTransform(VegaSchema): + """nestTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('nest') + + generate : anyOf(boolean, :class:`signal`) + + keys : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + signal : string + + """ + _schema = {'$ref': '#/defs/nestTransform'} + + def __init__(self, type=Undefined, generate=Undefined, keys=Undefined, signal=Undefined, **kwds): + super(nestTransform, self).__init__(type=type, generate=generate, keys=keys, signal=signal, + **kwds) + + +class packTransform(VegaSchema): + """packTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('pack') + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + padding : anyOf(float, :class:`signal`) + + radius : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + signal : string + + size : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + sort : :class:`compare` + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/packTransform'} + + def __init__(self, type=Undefined, field=Undefined, padding=Undefined, radius=Undefined, + signal=Undefined, size=Undefined, sort=Undefined, **kwds): + super(packTransform, self).__init__(type=type, field=field, padding=padding, radius=radius, + signal=signal, size=size, sort=sort, **kwds) + + +class partitionTransform(VegaSchema): + """partitionTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('partition') + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + padding : anyOf(float, :class:`signal`) + + round : anyOf(boolean, :class:`signal`) + + signal : string + + size : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + sort : :class:`compare` + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/partitionTransform'} + + def __init__(self, type=Undefined, field=Undefined, padding=Undefined, round=Undefined, + signal=Undefined, size=Undefined, sort=Undefined, **kwds): + super(partitionTransform, self).__init__(type=type, field=field, padding=padding, round=round, + signal=signal, size=size, sort=sort, **kwds) + + +class stratifyTransform(VegaSchema): + """stratifyTransform schema wrapper + + Mapping(required=[type, key, parentKey]) + + Attributes + ---------- + + key : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + parentKey : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + type : enum('stratify') + + signal : string + + """ + _schema = {'$ref': '#/defs/stratifyTransform'} + + def __init__(self, key=Undefined, parentKey=Undefined, type=Undefined, signal=Undefined, **kwds): + super(stratifyTransform, self).__init__(key=key, parentKey=parentKey, type=type, signal=signal, + **kwds) + + +class treeTransform(VegaSchema): + """treeTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('tree') + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + method : anyOf(enum('tidy', 'cluster'), :class:`signal`) + + nodeSize : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + separation : anyOf(boolean, :class:`signal`) + + signal : string + + size : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + sort : :class:`compare` + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/treeTransform'} + + def __init__(self, type=Undefined, field=Undefined, method=Undefined, nodeSize=Undefined, + separation=Undefined, signal=Undefined, size=Undefined, sort=Undefined, **kwds): + super(treeTransform, self).__init__(type=type, field=field, method=method, nodeSize=nodeSize, + separation=separation, signal=signal, size=size, sort=sort, + **kwds) + + +class treelinksTransform(VegaSchema): + """treelinksTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('treelinks') + + signal : string + + """ + _schema = {'$ref': '#/defs/treelinksTransform'} + + def __init__(self, type=Undefined, signal=Undefined, **kwds): + super(treelinksTransform, self).__init__(type=type, signal=signal, **kwds) + + +class treemapTransform(VegaSchema): + """treemapTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('treemap') + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + method : anyOf(enum('squarify', 'resquarify', 'binary', 'dice', 'slice', 'slicedice'), + :class:`signal`) + + padding : anyOf(float, :class:`signal`) + + paddingBottom : anyOf(float, :class:`signal`) + + paddingInner : anyOf(float, :class:`signal`) + + paddingLeft : anyOf(float, :class:`signal`) + + paddingOuter : anyOf(float, :class:`signal`) + + paddingRight : anyOf(float, :class:`signal`) + + paddingTop : anyOf(float, :class:`signal`) + + ratio : anyOf(float, :class:`signal`) + + round : anyOf(boolean, :class:`signal`) + + signal : string + + size : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + sort : :class:`compare` + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/treemapTransform'} + + def __init__(self, type=Undefined, field=Undefined, method=Undefined, padding=Undefined, + paddingBottom=Undefined, paddingInner=Undefined, paddingLeft=Undefined, + paddingOuter=Undefined, paddingRight=Undefined, paddingTop=Undefined, ratio=Undefined, + round=Undefined, signal=Undefined, size=Undefined, sort=Undefined, **kwds): + super(treemapTransform, self).__init__(type=type, field=field, method=method, padding=padding, + paddingBottom=paddingBottom, paddingInner=paddingInner, + paddingLeft=paddingLeft, paddingOuter=paddingOuter, + paddingRight=paddingRight, paddingTop=paddingTop, + ratio=ratio, round=round, signal=signal, size=size, + sort=sort, **kwds) + + +class loessTransform(VegaSchema): + """loessTransform schema wrapper + + Mapping(required=[type, x, y]) + + Attributes + ---------- + + type : enum('loess') + + x : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + y : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + bandwidth : anyOf(float, :class:`signal`) + + groupby : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + signal : string + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/loessTransform'} + + def __init__(self, type=Undefined, x=Undefined, y=Undefined, bandwidth=Undefined, groupby=Undefined, + signal=Undefined, **kwds): + super(loessTransform, self).__init__(type=type, x=x, y=y, bandwidth=bandwidth, groupby=groupby, + signal=signal, **kwds) + + +class regressionTransform(VegaSchema): + """regressionTransform schema wrapper + + Mapping(required=[type, x, y]) + + Attributes + ---------- + + type : enum('regression') + + x : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + y : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + extent : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + groupby : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + method : anyOf(string, :class:`signal`) + + order : anyOf(float, :class:`signal`) + + params : anyOf(boolean, :class:`signal`) + + signal : string + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/regressionTransform'} + + def __init__(self, type=Undefined, x=Undefined, y=Undefined, extent=Undefined, groupby=Undefined, + method=Undefined, order=Undefined, params=Undefined, signal=Undefined, **kwds): + super(regressionTransform, self).__init__(type=type, x=x, y=y, extent=extent, groupby=groupby, + method=method, order=order, params=params, + signal=signal, **kwds) + + +class aggregateTransform(VegaSchema): + """aggregateTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('aggregate') + + cross : anyOf(boolean, :class:`signal`) + + drop : anyOf(boolean, :class:`signal`) + + fields : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`, None)), + :class:`signal`) + + groupby : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + key : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + ops : oneOf(List(anyOf(enum('values', 'count', '__count__', 'missing', 'valid', 'sum', + 'product', 'mean', 'average', 'variance', 'variancep', 'stdev', 'stdevp', 'stderr', + 'distinct', 'ci0', 'ci1', 'median', 'q1', 'q3', 'argmin', 'argmax', 'min', 'max'), + :class:`signal`)), :class:`signal`) + + signal : string + + as : oneOf(List(anyOf(string, :class:`signal`, None)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/aggregateTransform'} + + def __init__(self, type=Undefined, cross=Undefined, drop=Undefined, fields=Undefined, + groupby=Undefined, key=Undefined, ops=Undefined, signal=Undefined, **kwds): + super(aggregateTransform, self).__init__(type=type, cross=cross, drop=drop, fields=fields, + groupby=groupby, key=key, ops=ops, signal=signal, + **kwds) + + +class binTransform(VegaSchema): + """binTransform schema wrapper + + Mapping(required=[type, field, extent]) + + Attributes + ---------- + + extent : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + type : enum('bin') + + anchor : anyOf(float, :class:`signal`) + + base : anyOf(float, :class:`signal`) + + divide : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + interval : anyOf(boolean, :class:`signal`) + + maxbins : anyOf(float, :class:`signal`) + + minstep : anyOf(float, :class:`signal`) + + name : anyOf(string, :class:`signal`) + + nice : anyOf(boolean, :class:`signal`) + + signal : string + + span : anyOf(float, :class:`signal`) + + step : anyOf(float, :class:`signal`) + + steps : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/binTransform'} + + def __init__(self, extent=Undefined, field=Undefined, type=Undefined, anchor=Undefined, + base=Undefined, divide=Undefined, interval=Undefined, maxbins=Undefined, + minstep=Undefined, name=Undefined, nice=Undefined, signal=Undefined, span=Undefined, + step=Undefined, steps=Undefined, **kwds): + super(binTransform, self).__init__(extent=extent, field=field, type=type, anchor=anchor, + base=base, divide=divide, interval=interval, maxbins=maxbins, + minstep=minstep, name=name, nice=nice, signal=signal, + span=span, step=step, steps=steps, **kwds) + + +class collectTransform(VegaSchema): + """collectTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('collect') + + signal : string + + sort : :class:`compare` + + """ + _schema = {'$ref': '#/defs/collectTransform'} + + def __init__(self, type=Undefined, signal=Undefined, sort=Undefined, **kwds): + super(collectTransform, self).__init__(type=type, signal=signal, sort=sort, **kwds) + + +class countpatternTransform(VegaSchema): + """countpatternTransform schema wrapper + + Mapping(required=[type, field]) + + Attributes + ---------- + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + type : enum('countpattern') + + case : anyOf(enum('upper', 'lower', 'mixed'), :class:`signal`) + + pattern : anyOf(string, :class:`signal`) + + signal : string + + stopwords : anyOf(string, :class:`signal`) + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/countpatternTransform'} + + def __init__(self, field=Undefined, type=Undefined, case=Undefined, pattern=Undefined, + signal=Undefined, stopwords=Undefined, **kwds): + super(countpatternTransform, self).__init__(field=field, type=type, case=case, pattern=pattern, + signal=signal, stopwords=stopwords, **kwds) + + +class crossTransform(VegaSchema): + """crossTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('cross') + + filter : :class:`exprString` + + signal : string + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/crossTransform'} + + def __init__(self, type=Undefined, filter=Undefined, signal=Undefined, **kwds): + super(crossTransform, self).__init__(type=type, filter=filter, signal=signal, **kwds) + + +class densityTransform(VegaSchema): + """densityTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('density') + + distribution : oneOf(Mapping(required=[function]), Mapping(required=[function]), + Mapping(required=[function]), Mapping(required=[function, field]), + Mapping(required=[function])) + + extent : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + maxsteps : anyOf(float, :class:`signal`) + + method : anyOf(string, :class:`signal`) + + minsteps : anyOf(float, :class:`signal`) + + signal : string + + steps : anyOf(float, :class:`signal`) + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/densityTransform'} + + def __init__(self, type=Undefined, distribution=Undefined, extent=Undefined, maxsteps=Undefined, + method=Undefined, minsteps=Undefined, signal=Undefined, steps=Undefined, **kwds): + super(densityTransform, self).__init__(type=type, distribution=distribution, extent=extent, + maxsteps=maxsteps, method=method, minsteps=minsteps, + signal=signal, steps=steps, **kwds) + + +class dotbinTransform(VegaSchema): + """dotbinTransform schema wrapper + + Mapping(required=[type, field]) + + Attributes + ---------- + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + type : enum('dotbin') + + groupby : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + signal : string + + smooth : anyOf(boolean, :class:`signal`) + + step : anyOf(float, :class:`signal`) + + as : anyOf(string, :class:`signal`) + + """ + _schema = {'$ref': '#/defs/dotbinTransform'} + + def __init__(self, field=Undefined, type=Undefined, groupby=Undefined, signal=Undefined, + smooth=Undefined, step=Undefined, **kwds): + super(dotbinTransform, self).__init__(field=field, type=type, groupby=groupby, signal=signal, + smooth=smooth, step=step, **kwds) + + +class extentTransform(VegaSchema): + """extentTransform schema wrapper + + Mapping(required=[type, field]) + + Attributes + ---------- + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + type : enum('extent') + + signal : string + + """ + _schema = {'$ref': '#/defs/extentTransform'} + + def __init__(self, field=Undefined, type=Undefined, signal=Undefined, **kwds): + super(extentTransform, self).__init__(field=field, type=type, signal=signal, **kwds) + + +class filterTransform(VegaSchema): + """filterTransform schema wrapper + + Mapping(required=[type, expr]) + + Attributes + ---------- + + expr : :class:`exprString` + + type : enum('filter') + + signal : string + + """ + _schema = {'$ref': '#/defs/filterTransform'} + + def __init__(self, expr=Undefined, type=Undefined, signal=Undefined, **kwds): + super(filterTransform, self).__init__(expr=expr, type=type, signal=signal, **kwds) + + +class flattenTransform(VegaSchema): + """flattenTransform schema wrapper + + Mapping(required=[type, fields]) + + Attributes + ---------- + + fields : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + type : enum('flatten') + + index : anyOf(string, :class:`signal`) + + signal : string + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/flattenTransform'} + + def __init__(self, fields=Undefined, type=Undefined, index=Undefined, signal=Undefined, **kwds): + super(flattenTransform, self).__init__(fields=fields, type=type, index=index, signal=signal, + **kwds) + + +class foldTransform(VegaSchema): + """foldTransform schema wrapper + + Mapping(required=[type, fields]) + + Attributes + ---------- + + fields : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + type : enum('fold') + + signal : string + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/foldTransform'} + + def __init__(self, fields=Undefined, type=Undefined, signal=Undefined, **kwds): + super(foldTransform, self).__init__(fields=fields, type=type, signal=signal, **kwds) + + +class formulaTransform(VegaSchema): + """formulaTransform schema wrapper + + Mapping(required=[type, expr, as]) + + Attributes + ---------- + + expr : :class:`exprString` + + type : enum('formula') + + initonly : anyOf(boolean, :class:`signal`) + + signal : string + + as : anyOf(string, :class:`signal`) + + """ + _schema = {'$ref': '#/defs/formulaTransform'} + + def __init__(self, expr=Undefined, type=Undefined, initonly=Undefined, signal=Undefined, **kwds): + super(formulaTransform, self).__init__(expr=expr, type=type, initonly=initonly, signal=signal, + **kwds) + + +class imputeTransform(VegaSchema): + """imputeTransform schema wrapper + + Mapping(required=[type, field, key]) + + Attributes + ---------- + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + key : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + type : enum('impute') + + groupby : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + keyvals : oneOf(List(Any), :class:`signal`) + + method : anyOf(enum('value', 'mean', 'median', 'max', 'min'), :class:`signal`) + + signal : string + + value : Any + + """ + _schema = {'$ref': '#/defs/imputeTransform'} + + def __init__(self, field=Undefined, key=Undefined, type=Undefined, groupby=Undefined, + keyvals=Undefined, method=Undefined, signal=Undefined, value=Undefined, **kwds): + super(imputeTransform, self).__init__(field=field, key=key, type=type, groupby=groupby, + keyvals=keyvals, method=method, signal=signal, + value=value, **kwds) + + +class joinaggregateTransform(VegaSchema): + """joinaggregateTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('joinaggregate') + + fields : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`, None)), + :class:`signal`) + + groupby : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + key : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + ops : oneOf(List(anyOf(enum('values', 'count', '__count__', 'missing', 'valid', 'sum', + 'product', 'mean', 'average', 'variance', 'variancep', 'stdev', 'stdevp', 'stderr', + 'distinct', 'ci0', 'ci1', 'median', 'q1', 'q3', 'argmin', 'argmax', 'min', 'max'), + :class:`signal`)), :class:`signal`) + + signal : string + + as : oneOf(List(anyOf(string, :class:`signal`, None)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/joinaggregateTransform'} + + def __init__(self, type=Undefined, fields=Undefined, groupby=Undefined, key=Undefined, + ops=Undefined, signal=Undefined, **kwds): + super(joinaggregateTransform, self).__init__(type=type, fields=fields, groupby=groupby, key=key, + ops=ops, signal=signal, **kwds) + + +class kdeTransform(VegaSchema): + """kdeTransform schema wrapper + + Mapping(required=[type, field]) + + Attributes + ---------- + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + type : enum('kde') + + bandwidth : anyOf(float, :class:`signal`) + + counts : anyOf(boolean, :class:`signal`) + + cumulative : anyOf(boolean, :class:`signal`) + + extent : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + groupby : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + maxsteps : anyOf(float, :class:`signal`) + + minsteps : anyOf(float, :class:`signal`) + + resolve : anyOf(enum('shared', 'independent'), :class:`signal`) + + signal : string + + steps : anyOf(float, :class:`signal`) + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/kdeTransform'} + + def __init__(self, field=Undefined, type=Undefined, bandwidth=Undefined, counts=Undefined, + cumulative=Undefined, extent=Undefined, groupby=Undefined, maxsteps=Undefined, + minsteps=Undefined, resolve=Undefined, signal=Undefined, steps=Undefined, **kwds): + super(kdeTransform, self).__init__(field=field, type=type, bandwidth=bandwidth, counts=counts, + cumulative=cumulative, extent=extent, groupby=groupby, + maxsteps=maxsteps, minsteps=minsteps, resolve=resolve, + signal=signal, steps=steps, **kwds) + + +class lookupTransform(VegaSchema): + """lookupTransform schema wrapper + + Mapping(required=[type, from, key, fields]) + + Attributes + ---------- + + fields : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + key : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + type : enum('lookup') + + default : Any + + signal : string + + values : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + from : string + + """ + _schema = {'$ref': '#/defs/lookupTransform'} + + def __init__(self, fields=Undefined, key=Undefined, type=Undefined, default=Undefined, + signal=Undefined, values=Undefined, **kwds): + super(lookupTransform, self).__init__(fields=fields, key=key, type=type, default=default, + signal=signal, values=values, **kwds) + + +class pivotTransform(VegaSchema): + """pivotTransform schema wrapper + + Mapping(required=[type, field, value]) + + Attributes + ---------- + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + type : enum('pivot') + + value : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + groupby : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + key : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + limit : anyOf(float, :class:`signal`) + + op : anyOf(enum('values', 'count', '__count__', 'missing', 'valid', 'sum', 'product', + 'mean', 'average', 'variance', 'variancep', 'stdev', 'stdevp', 'stderr', 'distinct', 'ci0', + 'ci1', 'median', 'q1', 'q3', 'argmin', 'argmax', 'min', 'max'), :class:`signal`) + + signal : string + + """ + _schema = {'$ref': '#/defs/pivotTransform'} + + def __init__(self, field=Undefined, type=Undefined, value=Undefined, groupby=Undefined, + key=Undefined, limit=Undefined, op=Undefined, signal=Undefined, **kwds): + super(pivotTransform, self).__init__(field=field, type=type, value=value, groupby=groupby, + key=key, limit=limit, op=op, signal=signal, **kwds) + + +class projectTransform(VegaSchema): + """projectTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('project') + + fields : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + signal : string + + as : oneOf(List(anyOf(string, :class:`signal`, None)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/projectTransform'} + + def __init__(self, type=Undefined, fields=Undefined, signal=Undefined, **kwds): + super(projectTransform, self).__init__(type=type, fields=fields, signal=signal, **kwds) + + +class quantileTransform(VegaSchema): + """quantileTransform schema wrapper + + Mapping(required=[type, field]) + + Attributes + ---------- + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + type : enum('quantile') + + groupby : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + probs : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + signal : string + + step : anyOf(float, :class:`signal`) + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/quantileTransform'} + + def __init__(self, field=Undefined, type=Undefined, groupby=Undefined, probs=Undefined, + signal=Undefined, step=Undefined, **kwds): + super(quantileTransform, self).__init__(field=field, type=type, groupby=groupby, probs=probs, + signal=signal, step=step, **kwds) + + +class sampleTransform(VegaSchema): + """sampleTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('sample') + + signal : string + + size : anyOf(float, :class:`signal`) + + """ + _schema = {'$ref': '#/defs/sampleTransform'} + + def __init__(self, type=Undefined, signal=Undefined, size=Undefined, **kwds): + super(sampleTransform, self).__init__(type=type, signal=signal, size=size, **kwds) + + +class sequenceTransform(VegaSchema): + """sequenceTransform schema wrapper + + Mapping(required=[type, start, stop]) + + Attributes + ---------- + + start : anyOf(float, :class:`signal`) + + stop : anyOf(float, :class:`signal`) + + type : enum('sequence') + + signal : string + + step : anyOf(float, :class:`signal`) + + as : anyOf(string, :class:`signal`) + + """ + _schema = {'$ref': '#/defs/sequenceTransform'} + + def __init__(self, start=Undefined, stop=Undefined, type=Undefined, signal=Undefined, + step=Undefined, **kwds): + super(sequenceTransform, self).__init__(start=start, stop=stop, type=type, signal=signal, + step=step, **kwds) + + +class timeunitTransform(VegaSchema): + """timeunitTransform schema wrapper + + Mapping(required=[type, field]) + + Attributes + ---------- + + field : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + type : enum('timeunit') + + extent : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + interval : anyOf(boolean, :class:`signal`) + + maxbins : anyOf(float, :class:`signal`) + + signal : string + + step : anyOf(float, :class:`signal`) + + timezone : anyOf(enum('local', 'utc'), :class:`signal`) + + units : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/timeunitTransform'} + + def __init__(self, field=Undefined, type=Undefined, extent=Undefined, interval=Undefined, + maxbins=Undefined, signal=Undefined, step=Undefined, timezone=Undefined, + units=Undefined, **kwds): + super(timeunitTransform, self).__init__(field=field, type=type, extent=extent, + interval=interval, maxbins=maxbins, signal=signal, + step=step, timezone=timezone, units=units, **kwds) + + +class windowTransform(VegaSchema): + """windowTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('window') + + fields : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`, None)), + :class:`signal`) + + frame : oneOf(List(anyOf(float, :class:`signal`, None)), :class:`signal`) + + groupby : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`)), + :class:`signal`) + + ignorePeers : anyOf(boolean, :class:`signal`) + + ops : oneOf(List(anyOf(enum('row_number', 'rank', 'dense_rank', 'percent_rank', 'cume_dist', + 'ntile', 'lag', 'lead', 'first_value', 'last_value', 'nth_value', 'prev_value', + 'next_value', 'values', 'count', '__count__', 'missing', 'valid', 'sum', 'product', 'mean', + 'average', 'variance', 'variancep', 'stdev', 'stdevp', 'stderr', 'distinct', 'ci0', 'ci1', + 'median', 'q1', 'q3', 'argmin', 'argmax', 'min', 'max'), :class:`signal`)), :class:`signal`) + + params : oneOf(List(anyOf(float, :class:`signal`, None)), :class:`signal`) + + signal : string + + sort : :class:`compare` + + as : oneOf(List(anyOf(string, :class:`signal`, None)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/windowTransform'} + + def __init__(self, type=Undefined, fields=Undefined, frame=Undefined, groupby=Undefined, + ignorePeers=Undefined, ops=Undefined, params=Undefined, signal=Undefined, + sort=Undefined, **kwds): + super(windowTransform, self).__init__(type=type, fields=fields, frame=frame, groupby=groupby, + ignorePeers=ignorePeers, ops=ops, params=params, + signal=signal, sort=sort, **kwds) + + +class identifierTransform(VegaSchema): + """identifierTransform schema wrapper + + Mapping(required=[type, as]) + + Attributes + ---------- + + type : enum('identifier') + + signal : string + + as : anyOf(string, :class:`signal`) + + """ + _schema = {'$ref': '#/defs/identifierTransform'} + + def __init__(self, type=Undefined, signal=Undefined, **kwds): + super(identifierTransform, self).__init__(type=type, signal=signal, **kwds) + + +class voronoiTransform(VegaSchema): + """voronoiTransform schema wrapper + + Mapping(required=[type, x, y]) + + Attributes + ---------- + + type : enum('voronoi') + + x : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + y : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + extent : oneOf(List(Any), :class:`signal`) + + signal : string + + size : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + as : anyOf(string, :class:`signal`) + + """ + _schema = {'$ref': '#/defs/voronoiTransform'} + + def __init__(self, type=Undefined, x=Undefined, y=Undefined, extent=Undefined, signal=Undefined, + size=Undefined, **kwds): + super(voronoiTransform, self).__init__(type=type, x=x, y=y, extent=extent, signal=signal, + size=size, **kwds) + + +class wordcloudTransform(VegaSchema): + """wordcloudTransform schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('wordcloud') + + font : anyOf(string, :class:`signal`, :class:`expr`, :class:`paramField`) + + fontSize : anyOf(float, :class:`signal`, :class:`expr`, :class:`paramField`) + + fontSizeRange : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`, None) + + fontStyle : anyOf(string, :class:`signal`, :class:`expr`, :class:`paramField`) + + fontWeight : anyOf(string, :class:`signal`, :class:`expr`, :class:`paramField`) + + padding : anyOf(float, :class:`signal`, :class:`expr`, :class:`paramField`) + + rotate : anyOf(float, :class:`signal`, :class:`expr`, :class:`paramField`) + + signal : string + + size : oneOf(List(anyOf(float, :class:`signal`)), :class:`signal`) + + spiral : anyOf(string, :class:`signal`) + + text : oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`) + + as : oneOf(List(anyOf(string, :class:`signal`)), :class:`signal`) + + """ + _schema = {'$ref': '#/defs/wordcloudTransform'} + + def __init__(self, type=Undefined, font=Undefined, fontSize=Undefined, fontSizeRange=Undefined, + fontStyle=Undefined, fontWeight=Undefined, padding=Undefined, rotate=Undefined, + signal=Undefined, size=Undefined, spiral=Undefined, text=Undefined, **kwds): + super(wordcloudTransform, self).__init__(type=type, font=font, fontSize=fontSize, + fontSizeRange=fontSizeRange, fontStyle=fontStyle, + fontWeight=fontWeight, padding=padding, rotate=rotate, + signal=signal, size=size, spiral=spiral, text=text, + **kwds) + + +class labelOverlap(VegaSchema): + """labelOverlap schema wrapper + + oneOf(boolean, enum('parity', 'greedy'), :class:`signal`) + """ + _schema = {'$ref': '#/refs/labelOverlap'} + + def __init__(self, *args, **kwds): + super(labelOverlap, self).__init__(*args, **kwds) + + +class tickBand(VegaSchema): + """tickBand schema wrapper + + oneOf(enum('center', 'extent'), :class:`signal`) + """ + _schema = {'$ref': '#/refs/tickBand'} + + def __init__(self, *args, **kwds): + super(tickBand, self).__init__(*args, **kwds) + + +class tickCount(VegaSchema): + """tickCount schema wrapper + + oneOf(float, enum('millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', + 'year'), Mapping(required=[interval]), :class:`signal`) + """ + _schema = {'$ref': '#/refs/tickCount'} + + def __init__(self, *args, **kwds): + super(tickCount, self).__init__(*args, **kwds) + + +class element(VegaSchema): + """element schema wrapper + + string + """ + _schema = {'$ref': '#/refs/element'} + + def __init__(self, *args): + super(element, self).__init__(*args) + + +class paramField(VegaSchema): + """paramField schema wrapper + + Mapping(required=[field]) + + Attributes + ---------- + + field : string + + as : string + + """ + _schema = {'$ref': '#/refs/paramField'} + + def __init__(self, field=Undefined, **kwds): + super(paramField, self).__init__(field=field, **kwds) + + +class field(VegaSchema): + """field schema wrapper + + oneOf(string, :class:`signal`, Mapping(required=[datum]), Mapping(required=[group]), + Mapping(required=[parent])) + """ + _schema = {'$ref': '#/refs/field'} + + def __init__(self, *args, **kwds): + super(field, self).__init__(*args, **kwds) + + +class scale(VegaSchema): + """scale schema wrapper + + oneOf(string, :class:`signal`, Mapping(required=[datum]), Mapping(required=[group]), + Mapping(required=[parent])) + """ + _schema = {'$ref': '#/refs/scale'} + + def __init__(self, *args, **kwds): + super(scale, self).__init__(*args, **kwds) + + +class stringModifiers(VegaSchema): + """stringModifiers schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + scale : :class:`scale` + + """ + _schema = {'$ref': '#/refs/stringModifiers'} + + def __init__(self, scale=Undefined, **kwds): + super(stringModifiers, self).__init__(scale=scale, **kwds) + + +class numberModifiers(VegaSchema): + """numberModifiers schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : oneOf(float, boolean) + + exponent : oneOf(float, :class:`numberValue`) + + extra : boolean + + mult : oneOf(float, :class:`numberValue`) + + offset : oneOf(float, :class:`numberValue`) + + round : boolean + + scale : :class:`scale` + + """ + _schema = {'$ref': '#/refs/numberModifiers'} + + def __init__(self, band=Undefined, exponent=Undefined, extra=Undefined, mult=Undefined, + offset=Undefined, round=Undefined, scale=Undefined, **kwds): + super(numberModifiers, self).__init__(band=band, exponent=exponent, extra=extra, mult=mult, + offset=offset, round=round, scale=scale, **kwds) + + +class anyValue(VegaSchema): + """anyValue schema wrapper + + oneOf(List(allOf(:class:`rule`, allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset]))))), allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset])))) + """ + _schema = {'$ref': '#/refs/anyValue'} + + def __init__(self, *args, **kwds): + super(anyValue, self).__init__(*args, **kwds) + + +class blendValue(VegaSchema): + """blendValue schema wrapper + + oneOf(List(allOf(:class:`rule`, allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset]))))), allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset])))) + """ + _schema = {'$ref': '#/refs/blendValue'} + + def __init__(self, *args, **kwds): + super(blendValue, self).__init__(*args, **kwds) + + +class numberValue(VegaSchema): + """numberValue schema wrapper + + oneOf(List(allOf(:class:`rule`, allOf(:class:`numberModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset]))))), allOf(:class:`numberModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset])))) + """ + _schema = {'$ref': '#/refs/numberValue'} + + def __init__(self, *args, **kwds): + super(numberValue, self).__init__(*args, **kwds) + + +class stringValue(VegaSchema): + """stringValue schema wrapper + + oneOf(List(allOf(:class:`rule`, allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset]))))), allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset])))) + """ + _schema = {'$ref': '#/refs/stringValue'} + + def __init__(self, *args, **kwds): + super(stringValue, self).__init__(*args, **kwds) + + +class textValue(VegaSchema): + """textValue schema wrapper + + oneOf(List(allOf(:class:`rule`, allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset]))))), allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset])))) + """ + _schema = {'$ref': '#/refs/textValue'} + + def __init__(self, *args, **kwds): + super(textValue, self).__init__(*args, **kwds) + + +class booleanValue(VegaSchema): + """booleanValue schema wrapper + + oneOf(List(allOf(:class:`rule`, allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset]))))), allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset])))) + """ + _schema = {'$ref': '#/refs/booleanValue'} + + def __init__(self, *args, **kwds): + super(booleanValue, self).__init__(*args, **kwds) + + +class arrayValue(VegaSchema): + """arrayValue schema wrapper + + oneOf(List(allOf(:class:`rule`, allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset]))))), allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset])))) + """ + _schema = {'$ref': '#/refs/arrayValue'} + + def __init__(self, *args, **kwds): + super(arrayValue, self).__init__(*args, **kwds) + + +class fontWeightValue(VegaSchema): + """fontWeightValue schema wrapper + + oneOf(List(allOf(:class:`rule`, allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset]))))), allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset])))) + """ + _schema = {'$ref': '#/refs/fontWeightValue'} + + def __init__(self, *args, **kwds): + super(fontWeightValue, self).__init__(*args, **kwds) + + +class anchorValue(VegaSchema): + """anchorValue schema wrapper + + oneOf(List(allOf(:class:`rule`, allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset]))))), allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset])))) + """ + _schema = {'$ref': '#/refs/anchorValue'} + + def __init__(self, *args, **kwds): + super(anchorValue, self).__init__(*args, **kwds) + + +class alignValue(VegaSchema): + """alignValue schema wrapper + + oneOf(List(allOf(:class:`rule`, allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset]))))), allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset])))) + """ + _schema = {'$ref': '#/refs/alignValue'} + + def __init__(self, *args, **kwds): + super(alignValue, self).__init__(*args, **kwds) + + +class baselineValue(VegaSchema): + """baselineValue schema wrapper + + oneOf(List(allOf(:class:`rule`, allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset]))))), allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset])))) + """ + _schema = {'$ref': '#/refs/baselineValue'} + + def __init__(self, *args, **kwds): + super(baselineValue, self).__init__(*args, **kwds) + + +class directionValue(VegaSchema): + """directionValue schema wrapper + + oneOf(List(allOf(:class:`rule`, allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset]))))), allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset])))) + """ + _schema = {'$ref': '#/refs/directionValue'} + + def __init__(self, *args, **kwds): + super(directionValue, self).__init__(*args, **kwds) + + +class orientValue(VegaSchema): + """orientValue schema wrapper + + oneOf(List(allOf(:class:`rule`, allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset]))))), allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset])))) + """ + _schema = {'$ref': '#/refs/orientValue'} + + def __init__(self, *args, **kwds): + super(orientValue, self).__init__(*args, **kwds) + + +class strokeCapValue(VegaSchema): + """strokeCapValue schema wrapper + + oneOf(List(allOf(:class:`rule`, allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset]))))), allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset])))) + """ + _schema = {'$ref': '#/refs/strokeCapValue'} + + def __init__(self, *args, **kwds): + super(strokeCapValue, self).__init__(*args, **kwds) + + +class strokeJoinValue(VegaSchema): + """strokeJoinValue schema wrapper + + oneOf(List(allOf(:class:`rule`, allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset]))))), allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset])))) + """ + _schema = {'$ref': '#/refs/strokeJoinValue'} + + def __init__(self, *args, **kwds): + super(strokeJoinValue, self).__init__(*args, **kwds) + + +class baseColorValue(VegaSchema): + """baseColorValue schema wrapper + + oneOf(allOf(:class:`stringModifiers`, anyOf(oneOf(:class:`signal`, + Mapping(required=[value]), Mapping(required=[field]), Mapping(required=[range])), + Mapping(required=[scale, value]), Mapping(required=[scale, band]), + Mapping(required=[offset]))), Mapping(required=[value]), Mapping(required=[value]), + Mapping(required=[gradient]), Mapping(required=[color])) + """ + _schema = {'$ref': '#/refs/baseColorValue'} + + def __init__(self, *args, **kwds): + super(baseColorValue, self).__init__(*args, **kwds) + + +class colorRGB(VegaSchema): + """colorRGB schema wrapper + + Mapping(required=[r, g, b]) + + Attributes + ---------- + + b : :class:`numberValue` + + g : :class:`numberValue` + + r : :class:`numberValue` + + """ + _schema = {'$ref': '#/refs/colorRGB'} + + def __init__(self, b=Undefined, g=Undefined, r=Undefined, **kwds): + super(colorRGB, self).__init__(b=b, g=g, r=r, **kwds) + + +class colorHSL(VegaSchema): + """colorHSL schema wrapper + + Mapping(required=[h, s, l]) + + Attributes + ---------- + + h : :class:`numberValue` + + l : :class:`numberValue` + + s : :class:`numberValue` + + """ + _schema = {'$ref': '#/refs/colorHSL'} + + def __init__(self, h=Undefined, l=Undefined, s=Undefined, **kwds): + super(colorHSL, self).__init__(h=h, l=l, s=s, **kwds) + + +class colorLAB(VegaSchema): + """colorLAB schema wrapper + + Mapping(required=[l, a, b]) + + Attributes + ---------- + + a : :class:`numberValue` + + b : :class:`numberValue` + + l : :class:`numberValue` + + """ + _schema = {'$ref': '#/refs/colorLAB'} + + def __init__(self, a=Undefined, b=Undefined, l=Undefined, **kwds): + super(colorLAB, self).__init__(a=a, b=b, l=l, **kwds) + + +class colorHCL(VegaSchema): + """colorHCL schema wrapper + + Mapping(required=[h, c, l]) + + Attributes + ---------- + + c : :class:`numberValue` + + h : :class:`numberValue` + + l : :class:`numberValue` + + """ + _schema = {'$ref': '#/refs/colorHCL'} + + def __init__(self, c=Undefined, h=Undefined, l=Undefined, **kwds): + super(colorHCL, self).__init__(c=c, h=h, l=l, **kwds) + + +class colorValue(VegaSchema): + """colorValue schema wrapper + + oneOf(List(allOf(:class:`rule`, :class:`baseColorValue`)), :class:`baseColorValue`) + """ + _schema = {'$ref': '#/refs/colorValue'} + + def __init__(self, *args, **kwds): + super(colorValue, self).__init__(*args, **kwds) + + +class gradientStops(VegaSchema): + """gradientStops schema wrapper + + List(Mapping(required=[offset, color])) + """ + _schema = {'$ref': '#/refs/gradientStops'} + + def __init__(self, *args): + super(gradientStops, self).__init__(*args) + + +class linearGradient(VegaSchema): + """linearGradient schema wrapper + + Mapping(required=[gradient, stops]) + + Attributes + ---------- + + gradient : enum('linear') + + stops : :class:`gradientStops` + + id : string + + x1 : float + + x2 : float + + y1 : float + + y2 : float + + """ + _schema = {'$ref': '#/refs/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) + + +class radialGradient(VegaSchema): + """radialGradient schema wrapper + + Mapping(required=[gradient, stops]) + + Attributes + ---------- + + gradient : enum('radial') + + stops : :class:`gradientStops` + + id : string + + r1 : float + + r2 : float + + x1 : float + + x2 : float + + y1 : float + + y2 : float + + """ + _schema = {'$ref': '#/refs/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) + + +class expr(VegaSchema): + """expr schema wrapper + + Mapping(required=[expr]) + + Attributes + ---------- + + expr : string + + as : string + + """ + _schema = {'$ref': '#/refs/expr'} + + def __init__(self, expr=Undefined, **kwds): + super(expr, self).__init__(expr=expr, **kwds) + + +class exprString(VegaSchema): + """exprString schema wrapper + + string + """ + _schema = {'$ref': '#/refs/exprString'} + + def __init__(self, *args): + super(exprString, self).__init__(*args) + + +class compare(VegaSchema): + """compare schema wrapper + + oneOf(Mapping(required=[]), Mapping(required=[])) + """ + _schema = {'$ref': '#/refs/compare'} + + def __init__(self, *args, **kwds): + super(compare, self).__init__(*args, **kwds) + + +class from_(VegaSchema): + """from_ schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + data : string + + """ + _schema = {'$ref': '#/refs/from'} + + def __init__(self, data=Undefined, **kwds): + super(from_, self).__init__(data=data, **kwds) + + +class facet(VegaSchema): + """facet schema wrapper + + Mapping(required=[facet]) + + Attributes + ---------- + + facet : oneOf(Mapping(required=[name, data, field]), Mapping(required=[name, data, + groupby])) + + data : string + + """ + _schema = {'$ref': '#/refs/facet'} + + def __init__(self, facet=Undefined, data=Undefined, **kwds): + super(facet, self).__init__(facet=facet, data=data, **kwds) + + +class markclip(VegaSchema): + """markclip schema wrapper + + oneOf(:class:`booleanOrSignal`, Mapping(required=[path]), Mapping(required=[sphere])) + """ + _schema = {'$ref': '#/refs/markclip'} + + def __init__(self, *args, **kwds): + super(markclip, self).__init__(*args, **kwds) + + +class style(VegaSchema): + """style schema wrapper + + oneOf(string, List(string)) + """ + _schema = {'$ref': '#/refs/style'} + + def __init__(self, *args, **kwds): + super(style, self).__init__(*args, **kwds) + + +class marktype(VegaSchema): + """marktype schema wrapper + + string + """ + _schema = {'$ref': '#/refs/marktype'} + + def __init__(self, *args): + super(marktype, self).__init__(*args) + + +class scaleField(VegaSchema): + """scaleField schema wrapper + + oneOf(string, :class:`signal`) + """ + _schema = {'$ref': '#/refs/scaleField'} + + def __init__(self, *args, **kwds): + super(scaleField, self).__init__(*args, **kwds) + + +class sortOrder(VegaSchema): + """sortOrder schema wrapper + + oneOf(enum('ascending', 'descending'), :class:`signal`) + """ + _schema = {'$ref': '#/refs/sortOrder'} + + def __init__(self, *args, **kwds): + super(sortOrder, self).__init__(*args, **kwds) + + +class scaleBins(VegaSchema): + """scaleBins schema wrapper + + oneOf(List(:class:`numberOrSignal`), Mapping(required=[step]), :class:`signal`) + """ + _schema = {'$ref': '#/refs/scaleBins'} + + def __init__(self, *args, **kwds): + super(scaleBins, self).__init__(*args, **kwds) + + +class scaleInterpolate(VegaSchema): + """scaleInterpolate schema wrapper + + oneOf(string, :class:`signal`, Mapping(required=[type])) + """ + _schema = {'$ref': '#/refs/scaleInterpolate'} + + def __init__(self, *args, **kwds): + super(scaleInterpolate, self).__init__(*args, **kwds) + + +class scaleData(VegaSchema): + """scaleData schema wrapper + + oneOf(Mapping(required=[data, field]), Mapping(required=[data, fields]), + Mapping(required=[fields])) + """ + _schema = {'$ref': '#/refs/scaleData'} + + def __init__(self, *args, **kwds): + super(scaleData, self).__init__(*args, **kwds) + + +class selector(VegaSchema): + """selector schema wrapper + + string + """ + _schema = {'$ref': '#/refs/selector'} + + def __init__(self, *args): + super(selector, self).__init__(*args) + + +class signal(VegaSchema): + """signal schema wrapper + + Mapping(required=[signal]) + + Attributes + ---------- + + signal : string + + """ + _schema = {'$ref': '#/refs/signal'} + + def __init__(self, signal=Undefined, **kwds): + super(signal, self).__init__(signal=signal, **kwds) + + +class arrayOrSignal(VegaSchema): + """arrayOrSignal schema wrapper + + oneOf(List(Any), :class:`signal`) + """ + _schema = {'$ref': '#/refs/arrayOrSignal'} + + def __init__(self, *args, **kwds): + super(arrayOrSignal, self).__init__(*args, **kwds) + + +class booleanOrSignal(VegaSchema): + """booleanOrSignal schema wrapper + + oneOf(boolean, :class:`signal`) + """ + _schema = {'$ref': '#/refs/booleanOrSignal'} + + def __init__(self, *args, **kwds): + super(booleanOrSignal, self).__init__(*args, **kwds) + + +class numberOrSignal(VegaSchema): + """numberOrSignal schema wrapper + + oneOf(float, :class:`signal`) + """ + _schema = {'$ref': '#/refs/numberOrSignal'} + + def __init__(self, *args, **kwds): + super(numberOrSignal, self).__init__(*args, **kwds) + + +class stringOrSignal(VegaSchema): + """stringOrSignal schema wrapper + + oneOf(string, :class:`signal`) + """ + _schema = {'$ref': '#/refs/stringOrSignal'} + + def __init__(self, *args, **kwds): + super(stringOrSignal, self).__init__(*args, **kwds) + + +class textOrSignal(VegaSchema): + """textOrSignal schema wrapper + + oneOf(oneOf(string, List(string)), :class:`signal`) + """ + _schema = {'$ref': '#/refs/textOrSignal'} + + def __init__(self, *args, **kwds): + super(textOrSignal, self).__init__(*args, **kwds) + diff --git a/runtime/Lib/site-packages/altair/vega/v5/schema/vega-schema.json b/runtime/Lib/site-packages/altair/vega/v5/schema/vega-schema.json new file mode 100644 index 0000000000000000000000000000000000000000..f428db3c999167f0a8f747e1175195d2494db651 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vega/v5/schema/vega-schema.json @@ -0,0 +1,15964 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "title": "Vega Visualization Specification Language", + "defs": { + "autosize": { + "oneOf": [ + { + "enum": [ + "pad", + "fit", + "fit-x", + "fit-y", + "none" + ], + "default": "pad" + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "pad", + "fit", + "fit-x", + "fit-y", + "none" + ], + "default": "pad" + }, + "resize": { + "type": "boolean" + }, + "contains": { + "enum": [ + "content", + "padding" + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "axis": { + "type": "object", + "properties": { + "orient": { + "enum": [ + "top", + "bottom", + "left", + "right" + ] + }, + "scale": { + "type": "string" + }, + "format": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "year": { + "type": "string" + }, + "quarter": { + "type": "string" + }, + "month": { + "type": "string" + }, + "date": { + "type": "string" + }, + "week": { + "type": "string" + }, + "day": { + "type": "string" + }, + "hours": { + "type": "string" + }, + "minutes": { + "type": "string" + }, + "seconds": { + "type": "string" + }, + "milliseconds": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "formatType": { + "oneOf": [ + { + "enum": [ + "number", + "time", + "utc" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "minExtent": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "maxExtent": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "offset": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "position": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "bandPosition": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "translate": { + "type": "number" + }, + "values": { + "$ref": "#/refs/arrayOrSignal" + }, + "zindex": { + "type": "number" + }, + "title": { + "$ref": "#/refs/textOrSignal" + }, + "titlePadding": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "titleAlign": { + "oneOf": [ + { + "enum": [ + "left", + "right", + "center" + ] + }, + { + "$ref": "#/refs/alignValue" + } + ] + }, + "titleAnchor": { + "oneOf": [ + { + "enum": [ + null, + "start", + "middle", + "end" + ] + }, + { + "$ref": "#/refs/anchorValue" + } + ] + }, + "titleAngle": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "titleX": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "titleY": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "titleBaseline": { + "oneOf": [ + { + "enum": [ + "top", + "middle", + "bottom", + "alphabetic", + "line-top", + "line-bottom" + ] + }, + { + "$ref": "#/refs/baselineValue" + } + ] + }, + "titleColor": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "$ref": "#/refs/colorValue" + } + ] + }, + "titleFont": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/stringValue" + } + ] + }, + "titleFontSize": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "titleFontStyle": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/stringValue" + } + ] + }, + "titleFontWeight": { + "oneOf": [ + { + "enum": [ + null, + "normal", + "bold", + "lighter", + "bolder", + "100", + "200", + "300", + "400", + "500", + "600", + "700", + "800", + "900", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900 + ] + }, + { + "$ref": "#/refs/fontWeightValue" + } + ] + }, + "titleLimit": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "titleLineHeight": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "titleOpacity": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "domain": { + "type": "boolean" + }, + "domainColor": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "$ref": "#/refs/colorValue" + } + ] + }, + "domainDash": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "$ref": "#/refs/arrayValue" + } + ] + }, + "domainDashOffset": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "domainOpacity": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "domainWidth": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "ticks": { + "type": "boolean" + }, + "tickBand": { + "$ref": "#/refs/tickBand" + }, + "tickColor": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "$ref": "#/refs/colorValue" + } + ] + }, + "tickDash": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "$ref": "#/refs/arrayValue" + } + ] + }, + "tickDashOffset": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "tickOffset": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "tickOpacity": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "tickRound": { + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/booleanValue" + } + ] + }, + "tickSize": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "tickWidth": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "tickCount": { + "$ref": "#/refs/tickCount" + }, + "tickExtra": { + "$ref": "#/refs/booleanOrSignal" + }, + "tickMinStep": { + "$ref": "#/refs/numberOrSignal" + }, + "grid": { + "type": "boolean" + }, + "gridScale": { + "type": "string" + }, + "gridColor": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "$ref": "#/refs/colorValue" + } + ] + }, + "gridDash": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "$ref": "#/refs/arrayValue" + } + ] + }, + "gridDashOffset": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "gridOpacity": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "gridWidth": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "labels": { + "type": "boolean" + }, + "labelAlign": { + "oneOf": [ + { + "enum": [ + "left", + "right", + "center" + ] + }, + { + "$ref": "#/refs/alignValue" + } + ] + }, + "labelBaseline": { + "oneOf": [ + { + "enum": [ + "top", + "middle", + "bottom", + "alphabetic", + "line-top", + "line-bottom" + ] + }, + { + "$ref": "#/refs/baselineValue" + } + ] + }, + "labelBound": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "labelFlush": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "labelFlushOffset": { + "$ref": "#/refs/numberOrSignal" + }, + "labelOverlap": { + "$ref": "#/refs/labelOverlap" + }, + "labelAngle": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "labelColor": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "$ref": "#/refs/colorValue" + } + ] + }, + "labelFont": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/stringValue" + } + ] + }, + "labelFontSize": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "labelFontWeight": { + "oneOf": [ + { + "enum": [ + null, + "normal", + "bold", + "lighter", + "bolder", + "100", + "200", + "300", + "400", + "500", + "600", + "700", + "800", + "900", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900 + ] + }, + { + "$ref": "#/refs/fontWeightValue" + } + ] + }, + "labelFontStyle": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/stringValue" + } + ] + }, + "labelLimit": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "labelLineHeight": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "labelOpacity": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "labelOffset": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "labelPadding": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "labelSeparation": { + "$ref": "#/refs/numberOrSignal" + }, + "encode": { + "type": "object", + "properties": { + "axis": { + "$ref": "#/defs/guideEncode" + }, + "ticks": { + "$ref": "#/defs/guideEncode" + }, + "labels": { + "$ref": "#/defs/guideEncode" + }, + "title": { + "$ref": "#/defs/guideEncode" + }, + "grid": { + "$ref": "#/defs/guideEncode" + }, + "domain": { + "$ref": "#/defs/guideEncode" + } + }, + "additionalProperties": false + } + }, + "required": [ + "orient", + "scale" + ], + "additionalProperties": false + }, + "background": { + "$ref": "#/refs/stringOrSignal" + }, + "bind": { + "oneOf": [ + { + "type": "object", + "properties": { + "input": { + "enum": [ + "checkbox" + ] + }, + "element": { + "$ref": "#/refs/element" + }, + "debounce": { + "type": "number" + }, + "name": { + "type": "string" + } + }, + "required": [ + "input" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "input": { + "enum": [ + "radio", + "select" + ] + }, + "element": { + "$ref": "#/refs/element" + }, + "options": { + "type": "array" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "debounce": { + "type": "number" + }, + "name": { + "type": "string" + } + }, + "required": [ + "input", + "options" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "input": { + "enum": [ + "range" + ] + }, + "element": { + "$ref": "#/refs/element" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "step": { + "type": "number" + }, + "debounce": { + "type": "number" + }, + "name": { + "type": "string" + } + }, + "required": [ + "input" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "input": { + "not": { + "enum": [ + "checkbox", + "radio", + "range", + "select" + ] + } + }, + "element": { + "$ref": "#/refs/element" + }, + "debounce": { + "type": "number" + }, + "name": { + "type": "string" + } + }, + "required": [ + "input" + ], + "additionalProperties": true + } + ] + }, + "data": { + "oneOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "transform": { + "type": "array", + "items": { + "$ref": "#/defs/transform" + } + }, + "on": { + "$ref": "#/defs/onTrigger" + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "source": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + ] + }, + "name": { + "type": "string" + }, + "transform": { + "type": "array", + "items": { + "$ref": "#/defs/transform" + } + }, + "on": { + "$ref": "#/defs/onTrigger" + } + }, + "required": [ + "source", + "name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "url": { + "$ref": "#/refs/stringOrSignal" + }, + "format": { + "oneOf": [ + { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "$ref": "#/refs/stringOrSignal" + }, + "parse": { + "oneOf": [ + { + "enum": [ + "auto" + ] + }, + { + "type": "object", + "properties": {}, + "additionalProperties": { + "oneOf": [ + { + "enum": [ + "boolean", + "number", + "date", + "string" + ] + }, + { + "type": "string", + "pattern": "^(date|utc):.*$" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + } + } + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "json" + ] + }, + "parse": { + "oneOf": [ + { + "enum": [ + "auto" + ] + }, + { + "type": "object", + "properties": {}, + "additionalProperties": { + "oneOf": [ + { + "enum": [ + "boolean", + "number", + "date", + "string" + ] + }, + { + "type": "string", + "pattern": "^(date|utc):.*$" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "property": { + "$ref": "#/refs/stringOrSignal" + }, + "copy": { + "$ref": "#/refs/booleanOrSignal" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "csv", + "tsv" + ] + }, + "header": { + "type": "array", + "items": { + "type": "string" + } + }, + "parse": { + "oneOf": [ + { + "enum": [ + "auto" + ] + }, + { + "type": "object", + "properties": {}, + "additionalProperties": { + "oneOf": [ + { + "enum": [ + "boolean", + "number", + "date", + "string" + ] + }, + { + "type": "string", + "pattern": "^(date|utc):.*$" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "dsv" + ] + }, + "delimiter": { + "type": "string" + }, + "header": { + "type": "array", + "items": { + "type": "string" + } + }, + "parse": { + "oneOf": [ + { + "enum": [ + "auto" + ] + }, + { + "type": "object", + "properties": {}, + "additionalProperties": { + "oneOf": [ + { + "enum": [ + "boolean", + "number", + "date", + "string" + ] + }, + { + "type": "string", + "pattern": "^(date|utc):.*$" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "type", + "delimiter" + ], + "additionalProperties": false + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "enum": [ + "topojson" + ] + }, + "feature": { + "$ref": "#/refs/stringOrSignal" + }, + "property": { + "$ref": "#/refs/stringOrSignal" + } + }, + "required": [ + "type", + "feature" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "topojson" + ] + }, + "mesh": { + "$ref": "#/refs/stringOrSignal" + }, + "property": { + "$ref": "#/refs/stringOrSignal" + }, + "filter": { + "enum": [ + "interior", + "exterior", + null + ] + } + }, + "required": [ + "type", + "mesh" + ], + "additionalProperties": false + } + ] + } + ] + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "async": { + "$ref": "#/refs/booleanOrSignal" + }, + "name": { + "type": "string" + }, + "transform": { + "type": "array", + "items": { + "$ref": "#/defs/transform" + } + }, + "on": { + "$ref": "#/defs/onTrigger" + } + }, + "required": [ + "url", + "name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "values": { + "oneOf": [ + {}, + { + "$ref": "#/refs/signal" + } + ] + }, + "format": { + "oneOf": [ + { + "anyOf": [ + { + "type": "object", + "properties": { + "type": { + "$ref": "#/refs/stringOrSignal" + }, + "parse": { + "oneOf": [ + { + "enum": [ + "auto" + ] + }, + { + "type": "object", + "properties": {}, + "additionalProperties": { + "oneOf": [ + { + "enum": [ + "boolean", + "number", + "date", + "string" + ] + }, + { + "type": "string", + "pattern": "^(date|utc):.*$" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + } + } + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "json" + ] + }, + "parse": { + "oneOf": [ + { + "enum": [ + "auto" + ] + }, + { + "type": "object", + "properties": {}, + "additionalProperties": { + "oneOf": [ + { + "enum": [ + "boolean", + "number", + "date", + "string" + ] + }, + { + "type": "string", + "pattern": "^(date|utc):.*$" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "property": { + "$ref": "#/refs/stringOrSignal" + }, + "copy": { + "$ref": "#/refs/booleanOrSignal" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "csv", + "tsv" + ] + }, + "header": { + "type": "array", + "items": { + "type": "string" + } + }, + "parse": { + "oneOf": [ + { + "enum": [ + "auto" + ] + }, + { + "type": "object", + "properties": {}, + "additionalProperties": { + "oneOf": [ + { + "enum": [ + "boolean", + "number", + "date", + "string" + ] + }, + { + "type": "string", + "pattern": "^(date|utc):.*$" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "dsv" + ] + }, + "delimiter": { + "type": "string" + }, + "header": { + "type": "array", + "items": { + "type": "string" + } + }, + "parse": { + "oneOf": [ + { + "enum": [ + "auto" + ] + }, + { + "type": "object", + "properties": {}, + "additionalProperties": { + "oneOf": [ + { + "enum": [ + "boolean", + "number", + "date", + "string" + ] + }, + { + "type": "string", + "pattern": "^(date|utc):.*$" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "type", + "delimiter" + ], + "additionalProperties": false + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "enum": [ + "topojson" + ] + }, + "feature": { + "$ref": "#/refs/stringOrSignal" + }, + "property": { + "$ref": "#/refs/stringOrSignal" + } + }, + "required": [ + "type", + "feature" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "topojson" + ] + }, + "mesh": { + "$ref": "#/refs/stringOrSignal" + }, + "property": { + "$ref": "#/refs/stringOrSignal" + }, + "filter": { + "enum": [ + "interior", + "exterior", + null + ] + } + }, + "required": [ + "type", + "mesh" + ], + "additionalProperties": false + } + ] + } + ] + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "async": { + "$ref": "#/refs/booleanOrSignal" + }, + "name": { + "type": "string" + }, + "transform": { + "type": "array", + "items": { + "$ref": "#/defs/transform" + } + }, + "on": { + "$ref": "#/defs/onTrigger" + } + }, + "required": [ + "values", + "name" + ], + "additionalProperties": false + } + ] + }, + "rule": { + "type": "object", + "properties": { + "test": { + "type": "string" + } + } + }, + "encodeEntry": { + "type": "object", + "properties": { + "x": { + "$ref": "#/refs/numberValue" + }, + "x2": { + "$ref": "#/refs/numberValue" + }, + "xc": { + "$ref": "#/refs/numberValue" + }, + "width": { + "$ref": "#/refs/numberValue" + }, + "y": { + "$ref": "#/refs/numberValue" + }, + "y2": { + "$ref": "#/refs/numberValue" + }, + "yc": { + "$ref": "#/refs/numberValue" + }, + "height": { + "$ref": "#/refs/numberValue" + }, + "opacity": { + "$ref": "#/refs/numberValue" + }, + "fill": { + "$ref": "#/refs/colorValue" + }, + "fillOpacity": { + "$ref": "#/refs/numberValue" + }, + "stroke": { + "$ref": "#/refs/colorValue" + }, + "strokeOpacity": { + "$ref": "#/refs/numberValue" + }, + "strokeWidth": { + "$ref": "#/refs/numberValue" + }, + "strokeCap": { + "$ref": "#/refs/strokeCapValue" + }, + "strokeDash": { + "$ref": "#/refs/arrayValue" + }, + "strokeDashOffset": { + "$ref": "#/refs/numberValue" + }, + "strokeJoin": { + "$ref": "#/refs/strokeJoinValue" + }, + "strokeMiterLimit": { + "$ref": "#/refs/numberValue" + }, + "blend": { + "$ref": "#/refs/blendValue" + }, + "cursor": { + "$ref": "#/refs/stringValue" + }, + "tooltip": { + "$ref": "#/refs/anyValue" + }, + "zindex": { + "$ref": "#/refs/numberValue" + }, + "clip": { + "$ref": "#/refs/booleanValue" + }, + "strokeForeground": { + "$ref": "#/refs/booleanValue" + }, + "strokeOffset": { + "$ref": "#/refs/numberValue" + }, + "cornerRadius": { + "$ref": "#/refs/numberValue" + }, + "cornerRadiusTopLeft": { + "$ref": "#/refs/numberValue" + }, + "cornerRadiusTopRight": { + "$ref": "#/refs/numberValue" + }, + "cornerRadiusBottomRight": { + "$ref": "#/refs/numberValue" + }, + "cornerRadiusBottomLeft": { + "$ref": "#/refs/numberValue" + }, + "angle": { + "$ref": "#/refs/numberValue" + }, + "size": { + "$ref": "#/refs/numberValue" + }, + "shape": { + "$ref": "#/refs/stringValue" + }, + "path": { + "$ref": "#/refs/stringValue" + }, + "scaleX": { + "$ref": "#/refs/numberValue" + }, + "scaleY": { + "$ref": "#/refs/numberValue" + }, + "innerRadius": { + "$ref": "#/refs/numberValue" + }, + "outerRadius": { + "$ref": "#/refs/numberValue" + }, + "startAngle": { + "$ref": "#/refs/numberValue" + }, + "endAngle": { + "$ref": "#/refs/numberValue" + }, + "padAngle": { + "$ref": "#/refs/numberValue" + }, + "interpolate": { + "$ref": "#/refs/stringValue" + }, + "tension": { + "$ref": "#/refs/numberValue" + }, + "orient": { + "$ref": "#/refs/directionValue" + }, + "defined": { + "$ref": "#/refs/booleanValue" + }, + "url": { + "$ref": "#/refs/stringValue" + }, + "align": { + "$ref": "#/refs/alignValue" + }, + "baseline": { + "$ref": "#/refs/baselineValue" + }, + "aspect": { + "$ref": "#/refs/booleanValue" + }, + "smooth": { + "$ref": "#/refs/booleanValue" + }, + "text": { + "$ref": "#/refs/textValue" + }, + "dir": { + "$ref": "#/refs/stringValue" + }, + "ellipsis": { + "$ref": "#/refs/stringValue" + }, + "limit": { + "$ref": "#/refs/numberValue" + }, + "lineBreak": { + "$ref": "#/refs/stringValue" + }, + "lineHeight": { + "$ref": "#/refs/numberValue" + }, + "dx": { + "$ref": "#/refs/numberValue" + }, + "dy": { + "$ref": "#/refs/numberValue" + }, + "radius": { + "$ref": "#/refs/numberValue" + }, + "theta": { + "$ref": "#/refs/numberValue" + }, + "font": { + "$ref": "#/refs/stringValue" + }, + "fontSize": { + "$ref": "#/refs/numberValue" + }, + "fontWeight": { + "$ref": "#/refs/fontWeightValue" + }, + "fontStyle": { + "$ref": "#/refs/stringValue" + } + }, + "additionalProperties": true + }, + "encode": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^.+$": { + "$ref": "#/defs/encodeEntry" + } + } + }, + "layout": { + "oneOf": [ + { + "type": "object", + "properties": { + "align": { + "oneOf": [ + { + "oneOf": [ + { + "enum": [ + "all", + "each", + "none" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + }, + { + "type": "object", + "properties": { + "row": { + "oneOf": [ + { + "enum": [ + "all", + "each", + "none" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "column": { + "oneOf": [ + { + "enum": [ + "all", + "each", + "none" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "additionalProperties": false + } + ] + }, + "bounds": { + "oneOf": [ + { + "enum": [ + "full", + "flush" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "center": { + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "row": { + "$ref": "#/refs/booleanOrSignal" + }, + "column": { + "$ref": "#/refs/booleanOrSignal" + } + }, + "additionalProperties": false + } + ] + }, + "columns": { + "$ref": "#/refs/numberOrSignal" + }, + "padding": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "row": { + "$ref": "#/refs/numberOrSignal" + }, + "column": { + "$ref": "#/refs/numberOrSignal" + } + }, + "additionalProperties": false + } + ] + }, + "offset": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "rowHeader": { + "$ref": "#/refs/numberOrSignal" + }, + "rowFooter": { + "$ref": "#/refs/numberOrSignal" + }, + "rowTitle": { + "$ref": "#/refs/numberOrSignal" + }, + "columnHeader": { + "$ref": "#/refs/numberOrSignal" + }, + "columnFooter": { + "$ref": "#/refs/numberOrSignal" + }, + "columnTitle": { + "$ref": "#/refs/numberOrSignal" + } + }, + "additionalProperties": false + } + ] + }, + "headerBand": { + "oneOf": [ + { + "$ref": "#/refs/numberOrSignal" + }, + { + "type": "null" + }, + { + "type": "object", + "properties": { + "row": { + "$ref": "#/refs/numberOrSignal" + }, + "column": { + "$ref": "#/refs/numberOrSignal" + } + }, + "additionalProperties": false + } + ] + }, + "footerBand": { + "oneOf": [ + { + "$ref": "#/refs/numberOrSignal" + }, + { + "type": "null" + }, + { + "type": "object", + "properties": { + "row": { + "$ref": "#/refs/numberOrSignal" + }, + "column": { + "$ref": "#/refs/numberOrSignal" + } + }, + "additionalProperties": false + } + ] + }, + "titleBand": { + "oneOf": [ + { + "$ref": "#/refs/numberOrSignal" + }, + { + "type": "null" + }, + { + "type": "object", + "properties": { + "row": { + "$ref": "#/refs/numberOrSignal" + }, + "column": { + "$ref": "#/refs/numberOrSignal" + } + }, + "additionalProperties": false + } + ] + }, + "titleAnchor": { + "oneOf": [ + { + "oneOf": [ + { + "enum": [ + "start", + "end" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + }, + { + "type": "object", + "properties": { + "row": { + "oneOf": [ + { + "enum": [ + "start", + "end" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "column": { + "oneOf": [ + { + "enum": [ + "start", + "end" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "additionalProperties": false + } + ] + } + }, + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "guideEncode": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "interactive": { + "type": "boolean", + "default": false + }, + "style": { + "$ref": "#/refs/style" + } + }, + "additionalProperties": false, + "patternProperties": { + "^(?!interactive|name|style).+$": { + "$ref": "#/defs/encodeEntry" + } + } + }, + "legend": { + "allOf": [ + { + "type": "object", + "properties": { + "size": { + "type": "string" + }, + "shape": { + "type": "string" + }, + "fill": { + "type": "string" + }, + "stroke": { + "type": "string" + }, + "opacity": { + "type": "string" + }, + "strokeDash": { + "type": "string" + }, + "strokeWidth": { + "type": "string" + }, + "type": { + "enum": [ + "gradient", + "symbol" + ] + }, + "direction": { + "enum": [ + "vertical", + "horizontal" + ] + }, + "orient": { + "oneOf": [ + { + "enum": [ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right" + ], + "default": "right" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "tickCount": { + "$ref": "#/refs/tickCount" + }, + "tickMinStep": { + "$ref": "#/refs/numberOrSignal" + }, + "symbolLimit": { + "$ref": "#/refs/numberOrSignal" + }, + "values": { + "$ref": "#/refs/arrayOrSignal" + }, + "zindex": { + "type": "number" + }, + "cornerRadius": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "fillColor": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "$ref": "#/refs/colorValue" + } + ] + }, + "offset": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "padding": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "strokeColor": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "$ref": "#/refs/colorValue" + } + ] + }, + "legendX": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "legendY": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "title": { + "$ref": "#/refs/textOrSignal" + }, + "titleAlign": { + "oneOf": [ + { + "enum": [ + "left", + "right", + "center" + ] + }, + { + "$ref": "#/refs/alignValue" + } + ] + }, + "titleAnchor": { + "oneOf": [ + { + "enum": [ + null, + "start", + "middle", + "end" + ] + }, + { + "$ref": "#/refs/anchorValue" + } + ] + }, + "titleBaseline": { + "oneOf": [ + { + "enum": [ + "top", + "middle", + "bottom", + "alphabetic", + "line-top", + "line-bottom" + ] + }, + { + "$ref": "#/refs/baselineValue" + } + ] + }, + "titleColor": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "$ref": "#/refs/colorValue" + } + ] + }, + "titleFont": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/stringValue" + } + ] + }, + "titleFontSize": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "titleFontStyle": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/stringValue" + } + ] + }, + "titleFontWeight": { + "oneOf": [ + { + "enum": [ + null, + "normal", + "bold", + "lighter", + "bolder", + "100", + "200", + "300", + "400", + "500", + "600", + "700", + "800", + "900", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900 + ] + }, + { + "$ref": "#/refs/fontWeightValue" + } + ] + }, + "titleLimit": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "titleLineHeight": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "titleOpacity": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "titleOrient": { + "oneOf": [ + { + "enum": [ + "left", + "right", + "top", + "bottom" + ] + }, + { + "$ref": "#/refs/orientValue" + } + ] + }, + "titlePadding": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "gradientLength": { + "$ref": "#/refs/numberOrSignal" + }, + "gradientOpacity": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "gradientStrokeColor": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "$ref": "#/refs/colorValue" + } + ] + }, + "gradientStrokeWidth": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "gradientThickness": { + "$ref": "#/refs/numberOrSignal" + }, + "clipHeight": { + "$ref": "#/refs/numberOrSignal" + }, + "columns": { + "$ref": "#/refs/numberOrSignal" + }, + "columnPadding": { + "$ref": "#/refs/numberOrSignal" + }, + "rowPadding": { + "$ref": "#/refs/numberOrSignal" + }, + "gridAlign": { + "oneOf": [ + { + "enum": [ + "all", + "each", + "none" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "symbolDash": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "$ref": "#/refs/arrayValue" + } + ] + }, + "symbolDashOffset": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "symbolFillColor": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "$ref": "#/refs/colorValue" + } + ] + }, + "symbolOffset": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "symbolOpacity": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "symbolSize": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "symbolStrokeColor": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "$ref": "#/refs/colorValue" + } + ] + }, + "symbolStrokeWidth": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "symbolType": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/stringValue" + } + ] + }, + "format": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "year": { + "type": "string" + }, + "quarter": { + "type": "string" + }, + "month": { + "type": "string" + }, + "date": { + "type": "string" + }, + "week": { + "type": "string" + }, + "day": { + "type": "string" + }, + "hours": { + "type": "string" + }, + "minutes": { + "type": "string" + }, + "seconds": { + "type": "string" + }, + "milliseconds": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "formatType": { + "oneOf": [ + { + "enum": [ + "number", + "time", + "utc" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "labelAlign": { + "oneOf": [ + { + "enum": [ + "left", + "right", + "center" + ] + }, + { + "$ref": "#/refs/alignValue" + } + ] + }, + "labelBaseline": { + "oneOf": [ + { + "enum": [ + "top", + "middle", + "bottom", + "alphabetic", + "line-top", + "line-bottom" + ] + }, + { + "$ref": "#/refs/baselineValue" + } + ] + }, + "labelColor": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "$ref": "#/refs/colorValue" + } + ] + }, + "labelFont": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/stringValue" + } + ] + }, + "labelFontSize": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "labelFontStyle": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/stringValue" + } + ] + }, + "labelFontWeight": { + "oneOf": [ + { + "enum": [ + null, + "normal", + "bold", + "lighter", + "bolder", + "100", + "200", + "300", + "400", + "500", + "600", + "700", + "800", + "900", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900 + ] + }, + { + "$ref": "#/refs/fontWeightValue" + } + ] + }, + "labelLimit": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "labelOffset": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "labelOpacity": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "labelOverlap": { + "$ref": "#/refs/labelOverlap" + }, + "labelSeparation": { + "$ref": "#/refs/numberOrSignal" + }, + "encode": { + "type": "object", + "properties": { + "title": { + "$ref": "#/defs/guideEncode" + }, + "labels": { + "$ref": "#/defs/guideEncode" + }, + "legend": { + "$ref": "#/defs/guideEncode" + }, + "entries": { + "$ref": "#/defs/guideEncode" + }, + "symbols": { + "$ref": "#/defs/guideEncode" + }, + "gradient": { + "$ref": "#/defs/guideEncode" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "anyOf": [ + { + "type": "object", + "required": [ + "size" + ] + }, + { + "type": "object", + "required": [ + "shape" + ] + }, + { + "type": "object", + "required": [ + "fill" + ] + }, + { + "type": "object", + "required": [ + "stroke" + ] + }, + { + "type": "object", + "required": [ + "opacity" + ] + }, + { + "type": "object", + "required": [ + "strokeDash" + ] + }, + { + "type": "object", + "required": [ + "strokeWidth" + ] + } + ] + } + ] + }, + "mark": { + "type": "object", + "properties": { + "type": { + "$ref": "#/refs/marktype" + }, + "role": { + "type": "string" + }, + "name": { + "type": "string" + }, + "style": { + "$ref": "#/refs/style" + }, + "key": { + "type": "string" + }, + "clip": { + "$ref": "#/refs/markclip" + }, + "sort": { + "$ref": "#/refs/compare" + }, + "interactive": { + "$ref": "#/refs/booleanOrSignal" + }, + "encode": { + "$ref": "#/defs/encode" + }, + "transform": { + "type": "array", + "items": { + "$ref": "#/defs/transformMark" + } + }, + "on": { + "$ref": "#/defs/onMarkTrigger" + } + }, + "required": [ + "type" + ] + }, + "markGroup": { + "allOf": [ + { + "type": "object", + "properties": { + "type": { + "enum": [ + "group" + ] + }, + "from": { + "oneOf": [ + { + "$ref": "#/refs/from" + }, + { + "$ref": "#/refs/facet" + } + ] + } + }, + "required": [ + "type" + ] + }, + { + "$ref": "#/defs/mark" + }, + { + "$ref": "#/defs/scope" + } + ] + }, + "markVisual": { + "allOf": [ + { + "type": "object", + "properties": { + "type": { + "not": { + "enum": [ + "group" + ] + } + }, + "from": { + "$ref": "#/refs/from" + } + } + }, + { + "$ref": "#/defs/mark" + } + ] + }, + "listener": { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "scale": { + "type": "string" + } + }, + "required": [ + "scale" + ] + }, + { + "$ref": "#/defs/stream" + } + ] + }, + "onEvents": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "properties": { + "events": { + "oneOf": [ + { + "$ref": "#/refs/selector" + }, + { + "$ref": "#/defs/listener" + }, + { + "type": "array", + "items": { + "$ref": "#/defs/listener" + }, + "minItems": 1 + } + ] + }, + "force": { + "type": "boolean" + } + }, + "required": [ + "events" + ] + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "encode": { + "type": "string" + } + }, + "required": [ + "encode" + ] + }, + { + "type": "object", + "properties": { + "update": { + "oneOf": [ + { + "$ref": "#/refs/exprString" + }, + { + "$ref": "#/refs/expr" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": {} + }, + "required": [ + "value" + ] + } + ] + } + }, + "required": [ + "update" + ] + } + ] + } + ] + } + }, + "onTrigger": { + "type": "array", + "items": { + "type": "object", + "properties": { + "trigger": { + "$ref": "#/refs/exprString" + }, + "insert": { + "$ref": "#/refs/exprString" + }, + "remove": { + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/exprString" + } + ] + }, + "toggle": { + "$ref": "#/refs/exprString" + }, + "modify": { + "$ref": "#/refs/exprString" + }, + "values": { + "$ref": "#/refs/exprString" + } + }, + "required": [ + "trigger" + ], + "additionalProperties": false + } + }, + "onMarkTrigger": { + "type": "array", + "items": { + "type": "object", + "properties": { + "trigger": { + "$ref": "#/refs/exprString" + }, + "modify": { + "$ref": "#/refs/exprString" + }, + "values": { + "$ref": "#/refs/exprString" + } + }, + "required": [ + "trigger" + ], + "additionalProperties": false + } + }, + "padding": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "object", + "properties": { + "top": { + "type": "number" + }, + "bottom": { + "type": "number" + }, + "left": { + "type": "number" + }, + "right": { + "type": "number" + } + }, + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "projection": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "$ref": "#/refs/stringOrSignal" + }, + "clipAngle": { + "$ref": "#/refs/numberOrSignal" + }, + "clipExtent": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + }, + "minItems": 2, + "maxItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "minItems": 2, + "maxItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "scale": { + "$ref": "#/refs/numberOrSignal" + }, + "translate": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + }, + "minItems": 2, + "maxItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "center": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + }, + "minItems": 2, + "maxItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "rotate": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + }, + "minItems": 2, + "maxItems": 3 + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "parallels": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + }, + "minItems": 2, + "maxItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "precision": { + "$ref": "#/refs/numberOrSignal" + }, + "pointRadius": { + "$ref": "#/refs/numberOrSignal" + }, + "fit": { + "oneOf": [ + { + "type": "object" + }, + { + "type": "array" + } + ] + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + }, + "minItems": 2, + "maxItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "minItems": 2, + "maxItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "size": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + }, + "minItems": 2, + "maxItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": true + }, + "scale": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "enum": [ + "identity" + ] + }, + "nice": { + "$ref": "#/refs/booleanOrSignal" + }, + "name": { + "type": "string" + }, + "domain": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "$ref": "#/refs/scaleData" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "domainMin": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMax": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMid": { + "$ref": "#/refs/numberOrSignal" + }, + "domainRaw": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "array" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "reverse": { + "$ref": "#/refs/booleanOrSignal" + }, + "round": { + "$ref": "#/refs/booleanOrSignal" + } + }, + "required": [ + "type", + "name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "ordinal" + ] + }, + "range": { + "oneOf": [ + { + "enum": [ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap" + ] + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "type": "object", + "properties": { + "scheme": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "count": { + "$ref": "#/refs/numberOrSignal" + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + }, + "numItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "scheme" + ], + "additionalProperties": false + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "type": "string" + }, + "field": { + "$ref": "#/refs/stringOrSignal" + }, + "sort": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/stringOrSignal" + }, + "op": { + "$ref": "#/refs/stringOrSignal" + }, + "order": { + "$ref": "#/refs/sortOrder" + } + }, + "additionalProperties": false + } + ] + } + }, + "required": [ + "data", + "field" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/refs/stringOrSignal" + }, + "minItems": 1 + }, + "sort": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "properties": { + "op": { + "enum": [ + "count" + ] + }, + "order": { + "$ref": "#/refs/sortOrder" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/stringOrSignal" + }, + "op": { + "enum": [ + "count", + "min", + "max" + ] + }, + "order": { + "$ref": "#/refs/sortOrder" + } + }, + "required": [ + "field", + "op" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "data", + "fields" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "type": "string" + }, + "field": { + "$ref": "#/refs/stringOrSignal" + } + }, + "required": [ + "data", + "field" + ], + "additionalProperties": false + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "minItems": 1 + }, + "sort": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "properties": { + "op": { + "enum": [ + "count" + ] + }, + "order": { + "$ref": "#/refs/sortOrder" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/stringOrSignal" + }, + "op": { + "enum": [ + "count", + "min", + "max" + ] + }, + "order": { + "$ref": "#/refs/sortOrder" + } + }, + "required": [ + "field", + "op" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "fields" + ], + "additionalProperties": false + } + ] + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "interpolate": { + "$ref": "#/refs/scaleInterpolate" + }, + "domainImplicit": { + "$ref": "#/refs/booleanOrSignal" + }, + "name": { + "type": "string" + }, + "domain": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "$ref": "#/refs/scaleData" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "domainMin": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMax": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMid": { + "$ref": "#/refs/numberOrSignal" + }, + "domainRaw": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "array" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "reverse": { + "$ref": "#/refs/booleanOrSignal" + }, + "round": { + "$ref": "#/refs/booleanOrSignal" + } + }, + "required": [ + "type", + "name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "band" + ] + }, + "paddingInner": { + "$ref": "#/refs/numberOrSignal" + }, + "range": { + "oneOf": [ + { + "enum": [ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap" + ] + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "type": "object", + "properties": { + "step": { + "$ref": "#/refs/numberOrSignal" + } + }, + "required": [ + "step" + ], + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "padding": { + "$ref": "#/refs/numberOrSignal" + }, + "paddingOuter": { + "$ref": "#/refs/numberOrSignal" + }, + "align": { + "$ref": "#/refs/numberOrSignal" + }, + "name": { + "type": "string" + }, + "domain": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "$ref": "#/refs/scaleData" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "domainMin": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMax": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMid": { + "$ref": "#/refs/numberOrSignal" + }, + "domainRaw": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "array" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "reverse": { + "$ref": "#/refs/booleanOrSignal" + }, + "round": { + "$ref": "#/refs/booleanOrSignal" + } + }, + "required": [ + "type", + "name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "point" + ] + }, + "range": { + "oneOf": [ + { + "enum": [ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap" + ] + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "type": "object", + "properties": { + "step": { + "$ref": "#/refs/numberOrSignal" + } + }, + "required": [ + "step" + ], + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "padding": { + "$ref": "#/refs/numberOrSignal" + }, + "paddingOuter": { + "$ref": "#/refs/numberOrSignal" + }, + "align": { + "$ref": "#/refs/numberOrSignal" + }, + "name": { + "type": "string" + }, + "domain": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "$ref": "#/refs/scaleData" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "domainMin": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMax": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMid": { + "$ref": "#/refs/numberOrSignal" + }, + "domainRaw": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "array" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "reverse": { + "$ref": "#/refs/booleanOrSignal" + }, + "round": { + "$ref": "#/refs/booleanOrSignal" + } + }, + "required": [ + "type", + "name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "quantize", + "threshold" + ] + }, + "range": { + "oneOf": [ + { + "enum": [ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap" + ] + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "type": "object", + "properties": { + "scheme": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "count": { + "$ref": "#/refs/numberOrSignal" + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + }, + "numItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "scheme" + ], + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "interpolate": { + "$ref": "#/refs/scaleInterpolate" + }, + "nice": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "zero": { + "$ref": "#/refs/booleanOrSignal" + }, + "name": { + "type": "string" + }, + "domain": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "$ref": "#/refs/scaleData" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "domainMin": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMax": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMid": { + "$ref": "#/refs/numberOrSignal" + }, + "domainRaw": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "array" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "reverse": { + "$ref": "#/refs/booleanOrSignal" + }, + "round": { + "$ref": "#/refs/booleanOrSignal" + } + }, + "required": [ + "type", + "name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "quantile" + ] + }, + "range": { + "oneOf": [ + { + "enum": [ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap" + ] + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "type": "object", + "properties": { + "scheme": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "count": { + "$ref": "#/refs/numberOrSignal" + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + }, + "numItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "scheme" + ], + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "interpolate": { + "$ref": "#/refs/scaleInterpolate" + }, + "name": { + "type": "string" + }, + "domain": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "$ref": "#/refs/scaleData" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "domainMin": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMax": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMid": { + "$ref": "#/refs/numberOrSignal" + }, + "domainRaw": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "array" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "reverse": { + "$ref": "#/refs/booleanOrSignal" + }, + "round": { + "$ref": "#/refs/booleanOrSignal" + } + }, + "required": [ + "type", + "name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "bin-ordinal" + ] + }, + "bins": { + "$ref": "#/refs/scaleBins" + }, + "range": { + "oneOf": [ + { + "enum": [ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap" + ] + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "type": "object", + "properties": { + "scheme": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "count": { + "$ref": "#/refs/numberOrSignal" + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + }, + "numItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "scheme" + ], + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "interpolate": { + "$ref": "#/refs/scaleInterpolate" + }, + "name": { + "type": "string" + }, + "domain": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "$ref": "#/refs/scaleData" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "domainMin": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMax": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMid": { + "$ref": "#/refs/numberOrSignal" + }, + "domainRaw": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "array" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "reverse": { + "$ref": "#/refs/booleanOrSignal" + }, + "round": { + "$ref": "#/refs/booleanOrSignal" + } + }, + "required": [ + "type", + "name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "time", + "utc" + ] + }, + "nice": { + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year" + ] + }, + { + "type": "object", + "properties": { + "interval": { + "oneOf": [ + { + "enum": [ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "step": { + "$ref": "#/refs/numberOrSignal" + } + }, + "required": [ + "interval" + ], + "additionalProperties": false + } + ] + }, + "range": { + "oneOf": [ + { + "enum": [ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap" + ] + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "type": "object", + "properties": { + "scheme": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "count": { + "$ref": "#/refs/numberOrSignal" + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + }, + "numItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "scheme" + ], + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "bins": { + "$ref": "#/refs/scaleBins" + }, + "interpolate": { + "$ref": "#/refs/scaleInterpolate" + }, + "clamp": { + "$ref": "#/refs/booleanOrSignal" + }, + "padding": { + "$ref": "#/refs/numberOrSignal" + }, + "name": { + "type": "string" + }, + "domain": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "$ref": "#/refs/scaleData" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "domainMin": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMax": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMid": { + "$ref": "#/refs/numberOrSignal" + }, + "domainRaw": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "array" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "reverse": { + "$ref": "#/refs/booleanOrSignal" + }, + "round": { + "$ref": "#/refs/booleanOrSignal" + } + }, + "required": [ + "type", + "name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "linear", + "sqrt", + "sequential" + ] + }, + "nice": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "zero": { + "$ref": "#/refs/booleanOrSignal" + }, + "range": { + "oneOf": [ + { + "enum": [ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap" + ] + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "type": "object", + "properties": { + "scheme": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "count": { + "$ref": "#/refs/numberOrSignal" + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + }, + "numItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "scheme" + ], + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "bins": { + "$ref": "#/refs/scaleBins" + }, + "interpolate": { + "$ref": "#/refs/scaleInterpolate" + }, + "clamp": { + "$ref": "#/refs/booleanOrSignal" + }, + "padding": { + "$ref": "#/refs/numberOrSignal" + }, + "name": { + "type": "string" + }, + "domain": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "$ref": "#/refs/scaleData" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "domainMin": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMax": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMid": { + "$ref": "#/refs/numberOrSignal" + }, + "domainRaw": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "array" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "reverse": { + "$ref": "#/refs/booleanOrSignal" + }, + "round": { + "$ref": "#/refs/booleanOrSignal" + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "log" + ] + }, + "base": { + "$ref": "#/refs/numberOrSignal" + }, + "nice": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "zero": { + "$ref": "#/refs/booleanOrSignal" + }, + "range": { + "oneOf": [ + { + "enum": [ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap" + ] + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "type": "object", + "properties": { + "scheme": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "count": { + "$ref": "#/refs/numberOrSignal" + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + }, + "numItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "scheme" + ], + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "bins": { + "$ref": "#/refs/scaleBins" + }, + "interpolate": { + "$ref": "#/refs/scaleInterpolate" + }, + "clamp": { + "$ref": "#/refs/booleanOrSignal" + }, + "padding": { + "$ref": "#/refs/numberOrSignal" + }, + "name": { + "type": "string" + }, + "domain": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "$ref": "#/refs/scaleData" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "domainMin": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMax": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMid": { + "$ref": "#/refs/numberOrSignal" + }, + "domainRaw": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "array" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "reverse": { + "$ref": "#/refs/booleanOrSignal" + }, + "round": { + "$ref": "#/refs/booleanOrSignal" + } + }, + "required": [ + "type", + "name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "pow" + ] + }, + "exponent": { + "$ref": "#/refs/numberOrSignal" + }, + "nice": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "zero": { + "$ref": "#/refs/booleanOrSignal" + }, + "range": { + "oneOf": [ + { + "enum": [ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap" + ] + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "type": "object", + "properties": { + "scheme": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "count": { + "$ref": "#/refs/numberOrSignal" + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + }, + "numItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "scheme" + ], + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "bins": { + "$ref": "#/refs/scaleBins" + }, + "interpolate": { + "$ref": "#/refs/scaleInterpolate" + }, + "clamp": { + "$ref": "#/refs/booleanOrSignal" + }, + "padding": { + "$ref": "#/refs/numberOrSignal" + }, + "name": { + "type": "string" + }, + "domain": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "$ref": "#/refs/scaleData" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "domainMin": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMax": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMid": { + "$ref": "#/refs/numberOrSignal" + }, + "domainRaw": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "array" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "reverse": { + "$ref": "#/refs/booleanOrSignal" + }, + "round": { + "$ref": "#/refs/booleanOrSignal" + } + }, + "required": [ + "type", + "name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "enum": [ + "symlog" + ] + }, + "constant": { + "$ref": "#/refs/numberOrSignal" + }, + "nice": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "zero": { + "$ref": "#/refs/booleanOrSignal" + }, + "range": { + "oneOf": [ + { + "enum": [ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap" + ] + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "type": "object", + "properties": { + "scheme": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "count": { + "$ref": "#/refs/numberOrSignal" + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + }, + "numItems": 2 + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "scheme" + ], + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "bins": { + "$ref": "#/refs/scaleBins" + }, + "interpolate": { + "$ref": "#/refs/scaleInterpolate" + }, + "clamp": { + "$ref": "#/refs/booleanOrSignal" + }, + "padding": { + "$ref": "#/refs/numberOrSignal" + }, + "name": { + "type": "string" + }, + "domain": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + } + ] + } + }, + { + "$ref": "#/refs/scaleData" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "domainMin": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMax": { + "$ref": "#/refs/numberOrSignal" + }, + "domainMid": { + "$ref": "#/refs/numberOrSignal" + }, + "domainRaw": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "array" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "reverse": { + "$ref": "#/refs/booleanOrSignal" + }, + "round": { + "$ref": "#/refs/booleanOrSignal" + } + }, + "required": [ + "type", + "name" + ], + "additionalProperties": false + } + ] + }, + "scope": { + "type": "object", + "properties": { + "encode": { + "$ref": "#/defs/encode" + }, + "layout": { + "$ref": "#/defs/layout" + }, + "signals": { + "type": "array", + "items": { + "$ref": "#/defs/signal" + } + }, + "data": { + "type": "array", + "items": { + "$ref": "#/defs/data" + } + }, + "scales": { + "type": "array", + "items": { + "$ref": "#/defs/scale" + } + }, + "projections": { + "type": "array", + "items": { + "$ref": "#/defs/projection" + } + }, + "axes": { + "type": "array", + "items": { + "$ref": "#/defs/axis" + } + }, + "legends": { + "type": "array", + "items": { + "$ref": "#/defs/legend" + } + }, + "title": { + "$ref": "#/defs/title" + }, + "marks": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/defs/markGroup" + }, + { + "$ref": "#/defs/markVisual" + } + ] + } + }, + "usermeta": { + "type": "object" + } + } + }, + "signalName": { + "type": "string", + "not": { + "enum": [ + "parent", + "datum", + "event", + "item" + ] + } + }, + "signal": { + "oneOf": [ + { + "type": "object", + "properties": { + "name": { + "$ref": "#/defs/signalName" + }, + "description": { + "type": "string" + }, + "push": { + "enum": [ + "outer" + ] + }, + "on": { + "$ref": "#/defs/onEvents" + } + }, + "required": [ + "name", + "push" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "$ref": "#/defs/signalName" + }, + "description": { + "type": "string" + }, + "value": {}, + "react": { + "type": "boolean", + "default": true + }, + "update": { + "$ref": "#/refs/exprString" + }, + "on": { + "$ref": "#/defs/onEvents" + }, + "bind": { + "$ref": "#/defs/bind" + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "$ref": "#/defs/signalName" + }, + "description": { + "type": "string" + }, + "value": {}, + "init": { + "$ref": "#/refs/exprString" + }, + "on": { + "$ref": "#/defs/onEvents" + }, + "bind": { + "$ref": "#/defs/bind" + } + }, + "required": [ + "name", + "init" + ], + "additionalProperties": false + } + ] + }, + "stream": { + "allOf": [ + { + "type": "object", + "properties": { + "between": { + "type": "array", + "items": { + "$ref": "#/defs/stream" + }, + "minItems": 2, + "maxItems": 2 + }, + "marktype": { + "type": "string" + }, + "markname": { + "type": "string" + }, + "filter": { + "oneOf": [ + { + "$ref": "#/refs/exprString" + }, + { + "type": "array", + "items": { + "$ref": "#/refs/exprString" + }, + "minItems": 1 + } + ] + }, + "throttle": { + "type": "number" + }, + "debounce": { + "type": "number" + }, + "consume": { + "type": "boolean" + } + } + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "source": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "stream": { + "$ref": "#/defs/stream" + } + }, + "required": [ + "stream" + ] + }, + { + "type": "object", + "properties": { + "merge": { + "type": "array", + "items": { + "$ref": "#/defs/stream" + }, + "minItems": 1 + } + }, + "required": [ + "merge" + ] + } + ] + } + ] + }, + "title": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "orient": { + "oneOf": [ + { + "enum": [ + "none", + "left", + "right", + "top", + "bottom" + ], + "default": "top" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "anchor": { + "oneOf": [ + { + "enum": [ + null, + "start", + "middle", + "end" + ] + }, + { + "$ref": "#/refs/anchorValue" + } + ] + }, + "frame": { + "oneOf": [ + { + "enum": [ + "group", + "bounds" + ] + }, + { + "$ref": "#/refs/stringValue" + } + ] + }, + "offset": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "limit": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "text": { + "$ref": "#/refs/textOrSignal" + }, + "subtitle": { + "$ref": "#/refs/textOrSignal" + }, + "zindex": { + "type": "number" + }, + "align": { + "oneOf": [ + { + "enum": [ + "left", + "right", + "center" + ] + }, + { + "$ref": "#/refs/alignValue" + } + ] + }, + "angle": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "baseline": { + "oneOf": [ + { + "enum": [ + "top", + "middle", + "bottom", + "alphabetic", + "line-top", + "line-bottom" + ] + }, + { + "$ref": "#/refs/baselineValue" + } + ] + }, + "dx": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "dy": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "color": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "$ref": "#/refs/colorValue" + } + ] + }, + "font": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/stringValue" + } + ] + }, + "fontSize": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "fontStyle": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/stringValue" + } + ] + }, + "fontWeight": { + "oneOf": [ + { + "enum": [ + null, + "normal", + "bold", + "lighter", + "bolder", + "100", + "200", + "300", + "400", + "500", + "600", + "700", + "800", + "900", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900 + ] + }, + { + "$ref": "#/refs/fontWeightValue" + } + ] + }, + "lineHeight": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "subtitleColor": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "$ref": "#/refs/colorValue" + } + ] + }, + "subtitleFont": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/stringValue" + } + ] + }, + "subtitleFontSize": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "subtitleFontStyle": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/stringValue" + } + ] + }, + "subtitleFontWeight": { + "oneOf": [ + { + "enum": [ + null, + "normal", + "bold", + "lighter", + "bolder", + "100", + "200", + "300", + "400", + "500", + "600", + "700", + "800", + "900", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900 + ] + }, + { + "$ref": "#/refs/fontWeightValue" + } + ] + }, + "subtitleLineHeight": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "subtitlePadding": { + "$ref": "#/refs/numberOrSignal" + }, + "encode": { + "anyOf": [ + { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^(?!interactive|name|style).+$": { + "$ref": "#/defs/encodeEntry" + } + } + }, + { + "type": "object", + "properties": { + "group": { + "$ref": "#/defs/guideEncode" + }, + "title": { + "$ref": "#/defs/guideEncode" + }, + "subtitle": { + "$ref": "#/defs/guideEncode" + } + }, + "additionalProperties": false + } + ] + }, + "name": { + "type": "string" + }, + "interactive": { + "type": "boolean" + }, + "style": { + "$ref": "#/refs/style" + } + }, + "additionalProperties": false + } + ] + }, + "transform": { + "oneOf": [ + { + "$ref": "#/defs/crossfilterTransform" + }, + { + "$ref": "#/defs/resolvefilterTransform" + }, + { + "$ref": "#/defs/linkpathTransform" + }, + { + "$ref": "#/defs/pieTransform" + }, + { + "$ref": "#/defs/stackTransform" + }, + { + "$ref": "#/defs/forceTransform" + }, + { + "$ref": "#/defs/contourTransform" + }, + { + "$ref": "#/defs/geojsonTransform" + }, + { + "$ref": "#/defs/geopathTransform" + }, + { + "$ref": "#/defs/geopointTransform" + }, + { + "$ref": "#/defs/geoshapeTransform" + }, + { + "$ref": "#/defs/graticuleTransform" + }, + { + "$ref": "#/defs/heatmapTransform" + }, + { + "$ref": "#/defs/isocontourTransform" + }, + { + "$ref": "#/defs/kde2dTransform" + }, + { + "$ref": "#/defs/nestTransform" + }, + { + "$ref": "#/defs/packTransform" + }, + { + "$ref": "#/defs/partitionTransform" + }, + { + "$ref": "#/defs/stratifyTransform" + }, + { + "$ref": "#/defs/treeTransform" + }, + { + "$ref": "#/defs/treelinksTransform" + }, + { + "$ref": "#/defs/treemapTransform" + }, + { + "$ref": "#/defs/loessTransform" + }, + { + "$ref": "#/defs/regressionTransform" + }, + { + "$ref": "#/defs/aggregateTransform" + }, + { + "$ref": "#/defs/binTransform" + }, + { + "$ref": "#/defs/collectTransform" + }, + { + "$ref": "#/defs/countpatternTransform" + }, + { + "$ref": "#/defs/crossTransform" + }, + { + "$ref": "#/defs/densityTransform" + }, + { + "$ref": "#/defs/dotbinTransform" + }, + { + "$ref": "#/defs/extentTransform" + }, + { + "$ref": "#/defs/filterTransform" + }, + { + "$ref": "#/defs/flattenTransform" + }, + { + "$ref": "#/defs/foldTransform" + }, + { + "$ref": "#/defs/formulaTransform" + }, + { + "$ref": "#/defs/imputeTransform" + }, + { + "$ref": "#/defs/joinaggregateTransform" + }, + { + "$ref": "#/defs/kdeTransform" + }, + { + "$ref": "#/defs/lookupTransform" + }, + { + "$ref": "#/defs/pivotTransform" + }, + { + "$ref": "#/defs/projectTransform" + }, + { + "$ref": "#/defs/quantileTransform" + }, + { + "$ref": "#/defs/sampleTransform" + }, + { + "$ref": "#/defs/sequenceTransform" + }, + { + "$ref": "#/defs/timeunitTransform" + }, + { + "$ref": "#/defs/windowTransform" + }, + { + "$ref": "#/defs/identifierTransform" + }, + { + "$ref": "#/defs/voronoiTransform" + }, + { + "$ref": "#/defs/wordcloudTransform" + } + ] + }, + "transformMark": { + "oneOf": [ + { + "$ref": "#/defs/crossfilterTransform" + }, + { + "$ref": "#/defs/resolvefilterTransform" + }, + { + "$ref": "#/defs/linkpathTransform" + }, + { + "$ref": "#/defs/pieTransform" + }, + { + "$ref": "#/defs/stackTransform" + }, + { + "$ref": "#/defs/forceTransform" + }, + { + "$ref": "#/defs/geojsonTransform" + }, + { + "$ref": "#/defs/geopathTransform" + }, + { + "$ref": "#/defs/geopointTransform" + }, + { + "$ref": "#/defs/geoshapeTransform" + }, + { + "$ref": "#/defs/heatmapTransform" + }, + { + "$ref": "#/defs/packTransform" + }, + { + "$ref": "#/defs/partitionTransform" + }, + { + "$ref": "#/defs/stratifyTransform" + }, + { + "$ref": "#/defs/treeTransform" + }, + { + "$ref": "#/defs/treemapTransform" + }, + { + "$ref": "#/defs/binTransform" + }, + { + "$ref": "#/defs/collectTransform" + }, + { + "$ref": "#/defs/dotbinTransform" + }, + { + "$ref": "#/defs/extentTransform" + }, + { + "$ref": "#/defs/formulaTransform" + }, + { + "$ref": "#/defs/joinaggregateTransform" + }, + { + "$ref": "#/defs/lookupTransform" + }, + { + "$ref": "#/defs/sampleTransform" + }, + { + "$ref": "#/defs/timeunitTransform" + }, + { + "$ref": "#/defs/windowTransform" + }, + { + "$ref": "#/defs/identifierTransform" + }, + { + "$ref": "#/defs/voronoiTransform" + }, + { + "$ref": "#/defs/wordcloudTransform" + } + ] + }, + "crossfilterTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "crossfilter" + ] + }, + "signal": { + "type": "string" + }, + "fields": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "query": { + "oneOf": [ + { + "type": "array", + "items": {} + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "type", + "fields", + "query" + ], + "additionalProperties": false + }, + "resolvefilterTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "resolvefilter" + ] + }, + "signal": { + "type": "string" + }, + "ignore": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "filter": {} + }, + "required": [ + "type", + "ignore", + "filter" + ], + "additionalProperties": false + }, + "linkpathTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "linkpath" + ] + }, + "signal": { + "type": "string" + }, + "sourceX": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ], + "default": "source.x" + }, + "sourceY": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ], + "default": "source.y" + }, + "targetX": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ], + "default": "target.x" + }, + "targetY": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ], + "default": "target.y" + }, + "orient": { + "anyOf": [ + { + "enum": [ + "horizontal", + "vertical", + "radial" + ] + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "vertical" + }, + "shape": { + "anyOf": [ + { + "enum": [ + "line", + "arc", + "curve", + "diagonal", + "orthogonal" + ] + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "line" + }, + "require": { + "$ref": "#/refs/signal" + }, + "as": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "path" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "pieTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "pie" + ] + }, + "signal": { + "type": "string" + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "startAngle": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "endAngle": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 6.283185307179586 + }, + "sort": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2, + "default": [ + "startAngle", + "endAngle" + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "stackTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "stack" + ] + }, + "signal": { + "type": "string" + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "groupby": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "sort": { + "$ref": "#/refs/compare" + }, + "offset": { + "anyOf": [ + { + "enum": [ + "zero", + "center", + "normalize" + ] + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "zero" + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2, + "default": [ + "y0", + "y1" + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "forceTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "force" + ] + }, + "signal": { + "type": "string" + }, + "static": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "restart": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "iterations": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 300 + }, + "alpha": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 1 + }, + "alphaMin": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 0.001 + }, + "alphaTarget": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "velocityDecay": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 0.4 + }, + "forces": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "force": { + "enum": [ + "center" + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "force" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "force": { + "enum": [ + "collide" + ] + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "$ref": "#/refs/expr" + }, + { + "$ref": "#/refs/paramField" + } + ] + }, + "strength": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 0.7 + }, + "iterations": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 1 + } + }, + "required": [ + "force" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "force": { + "enum": [ + "nbody" + ] + }, + "strength": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": -30 + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 0.9 + }, + "distanceMin": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 1 + }, + "distanceMax": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "force" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "force": { + "enum": [ + "link" + ] + }, + "links": { + "type": "string" + }, + "id": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "distance": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "$ref": "#/refs/expr" + }, + { + "$ref": "#/refs/paramField" + } + ], + "default": 30 + }, + "strength": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "$ref": "#/refs/expr" + }, + { + "$ref": "#/refs/paramField" + } + ] + }, + "iterations": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 1 + } + }, + "required": [ + "force" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "force": { + "enum": [ + "x" + ] + }, + "strength": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 0.1 + }, + "x": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + "required": [ + "force" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "force": { + "enum": [ + "y" + ] + }, + "strength": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 0.1 + }, + "y": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + "required": [ + "force" + ], + "additionalProperties": false + } + ] + } + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "default": [ + "x", + "y", + "vx", + "vy" + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "contourTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "contour" + ] + }, + "signal": { + "type": "string" + }, + "size": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "values": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "x": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "y": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "weight": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "cellSize": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "bandwidth": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "count": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "nice": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "thresholds": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "smooth": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": true + } + }, + "required": [ + "type", + "size" + ], + "additionalProperties": false + }, + "geojsonTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "geojson" + ] + }, + "signal": { + "type": "string" + }, + "fields": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "geojson": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "geopathTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "geopath" + ] + }, + "signal": { + "type": "string" + }, + "projection": { + "type": "string" + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "pointRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "$ref": "#/refs/expr" + }, + { + "$ref": "#/refs/paramField" + } + ] + }, + "as": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "path" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "geopointTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "geopoint" + ] + }, + "signal": { + "type": "string" + }, + "projection": { + "type": "string" + }, + "fields": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2, + "default": [ + "x", + "y" + ] + } + }, + "required": [ + "type", + "projection", + "fields" + ], + "additionalProperties": false + }, + "geoshapeTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "geoshape" + ] + }, + "signal": { + "type": "string" + }, + "projection": { + "type": "string" + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ], + "default": "datum" + }, + "pointRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "$ref": "#/refs/expr" + }, + { + "$ref": "#/refs/paramField" + } + ] + }, + "as": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "shape" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "graticuleTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "graticule" + ] + }, + "signal": { + "type": "string" + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": {} + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "extentMajor": { + "oneOf": [ + { + "type": "array", + "items": {} + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "extentMinor": { + "oneOf": [ + { + "type": "array", + "items": {} + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "step": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "stepMajor": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2, + "default": [ + 90, + 360 + ] + }, + "stepMinor": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2, + "default": [ + 10, + 10 + ] + }, + "precision": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 2.5 + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "heatmapTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "heatmap" + ] + }, + "signal": { + "type": "string" + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "color": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + }, + { + "$ref": "#/refs/expr" + }, + { + "$ref": "#/refs/paramField" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "$ref": "#/refs/expr" + }, + { + "$ref": "#/refs/paramField" + } + ] + }, + "resolve": { + "anyOf": [ + { + "enum": [ + "shared", + "independent" + ] + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "independent" + }, + "as": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "image" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "isocontourTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "isocontour" + ] + }, + "signal": { + "type": "string" + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "thresholds": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "levels": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "nice": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "resolve": { + "anyOf": [ + { + "enum": [ + "shared", + "independent" + ] + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "independent" + }, + "zero": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": true + }, + "smooth": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": true + }, + "scale": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "$ref": "#/refs/expr" + }, + { + "$ref": "#/refs/paramField" + } + ] + }, + "translate": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "$ref": "#/refs/expr" + }, + { + "$ref": "#/refs/paramField" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "as": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "null" + } + ], + "default": "contour" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "kde2dTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "kde2d" + ] + }, + "signal": { + "type": "string" + }, + "size": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "x": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "y": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "weight": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "groupby": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "cellSize": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "bandwidth": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "counts": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "as": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "grid" + } + }, + "required": [ + "type", + "size", + "x", + "y" + ], + "additionalProperties": false + }, + "nestTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "nest" + ] + }, + "signal": { + "type": "string" + }, + "keys": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "generate": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "packTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "pack" + ] + }, + "signal": { + "type": "string" + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "sort": { + "$ref": "#/refs/compare" + }, + "padding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "radius": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "size": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 5, + "minItems": 5, + "default": [ + "x", + "y", + "r", + "depth", + "children" + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "partitionTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "partition" + ] + }, + "signal": { + "type": "string" + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "sort": { + "$ref": "#/refs/compare" + }, + "padding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "round": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "size": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 6, + "minItems": 6, + "default": [ + "x0", + "y0", + "x1", + "y1", + "depth", + "children" + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "stratifyTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "stratify" + ] + }, + "signal": { + "type": "string" + }, + "key": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "parentKey": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + "required": [ + "type", + "key", + "parentKey" + ], + "additionalProperties": false + }, + "treeTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "tree" + ] + }, + "signal": { + "type": "string" + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "sort": { + "$ref": "#/refs/compare" + }, + "method": { + "anyOf": [ + { + "enum": [ + "tidy", + "cluster" + ] + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "tidy" + }, + "size": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "nodeSize": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "separation": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": true + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 4, + "minItems": 4, + "default": [ + "x", + "y", + "depth", + "children" + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "treelinksTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "treelinks" + ] + }, + "signal": { + "type": "string" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "treemapTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "treemap" + ] + }, + "signal": { + "type": "string" + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "sort": { + "$ref": "#/refs/compare" + }, + "method": { + "anyOf": [ + { + "enum": [ + "squarify", + "resquarify", + "binary", + "dice", + "slice", + "slicedice" + ] + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "squarify" + }, + "padding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "paddingInner": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "paddingOuter": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "paddingTop": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "paddingRight": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "paddingBottom": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "paddingLeft": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "ratio": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 1.618033988749895 + }, + "round": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "size": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 6, + "minItems": 6, + "default": [ + "x0", + "y0", + "x1", + "y1", + "depth", + "children" + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "loessTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "loess" + ] + }, + "signal": { + "type": "string" + }, + "x": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "y": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "groupby": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "bandwidth": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 0.3 + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "type", + "x", + "y" + ], + "additionalProperties": false + }, + "regressionTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "regression" + ] + }, + "signal": { + "type": "string" + }, + "x": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "y": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "groupby": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "method": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "linear" + }, + "order": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 3 + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "params": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "type", + "x", + "y" + ], + "additionalProperties": false + }, + "aggregateTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "aggregate" + ] + }, + "signal": { + "type": "string" + }, + "groupby": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "ops": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "enum": [ + "values", + "count", + "__count__", + "missing", + "valid", + "sum", + "product", + "mean", + "average", + "variance", + "variancep", + "stdev", + "stdevp", + "stderr", + "distinct", + "ci0", + "ci1", + "median", + "q1", + "q3", + "argmin", + "argmax", + "min", + "max" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "fields": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + }, + { + "type": "null" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "null" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "drop": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": true + }, + "cross": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "key": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "binTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "bin" + ] + }, + "signal": { + "type": "string" + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "interval": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": true + }, + "anchor": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "maxbins": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 20 + }, + "base": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 10 + }, + "divide": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "default": [ + 5, + 2 + ] + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "span": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "step": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "steps": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "minstep": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "nice": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": true + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2, + "default": [ + "bin0", + "bin1" + ] + } + }, + "required": [ + "type", + "field", + "extent" + ], + "additionalProperties": false + }, + "collectTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "collect" + ] + }, + "signal": { + "type": "string" + }, + "sort": { + "$ref": "#/refs/compare" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "countpatternTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "countpattern" + ] + }, + "signal": { + "type": "string" + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "case": { + "anyOf": [ + { + "enum": [ + "upper", + "lower", + "mixed" + ] + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "mixed" + }, + "pattern": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "[\\w\"]+" + }, + "stopwords": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2, + "default": [ + "text", + "count" + ] + } + }, + "required": [ + "type", + "field" + ], + "additionalProperties": false + }, + "crossTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "cross" + ] + }, + "signal": { + "type": "string" + }, + "filter": { + "$ref": "#/refs/exprString" + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2, + "default": [ + "a", + "b" + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "densityTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "density" + ] + }, + "signal": { + "type": "string" + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "steps": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "minsteps": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 25 + }, + "maxsteps": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 200 + }, + "method": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "pdf" + }, + "distribution": { + "oneOf": [ + { + "type": "object", + "properties": { + "function": { + "enum": [ + "normal" + ] + }, + "mean": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "stdev": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 1 + } + }, + "required": [ + "function" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "function": { + "enum": [ + "lognormal" + ] + }, + "mean": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "stdev": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 1 + } + }, + "required": [ + "function" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "function": { + "enum": [ + "uniform" + ] + }, + "min": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "max": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 1 + } + }, + "required": [ + "function" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "function": { + "enum": [ + "kde" + ] + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "from": { + "type": "string" + }, + "bandwidth": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "function", + "field" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "function": { + "enum": [ + "mixture" + ] + }, + "distributions": { + "oneOf": [ + { + "type": "array", + "items": {} + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "weights": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "function" + ], + "additionalProperties": false + } + ] + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "default": [ + "value", + "density" + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "dotbinTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "dotbin" + ] + }, + "signal": { + "type": "string" + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "groupby": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "step": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "smooth": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "as": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "bin" + } + }, + "required": [ + "type", + "field" + ], + "additionalProperties": false + }, + "extentTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "extent" + ] + }, + "signal": { + "type": "string" + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + "required": [ + "type", + "field" + ], + "additionalProperties": false + }, + "filterTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "filter" + ] + }, + "signal": { + "type": "string" + }, + "expr": { + "$ref": "#/refs/exprString" + } + }, + "required": [ + "type", + "expr" + ], + "additionalProperties": false + }, + "flattenTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "flatten" + ] + }, + "signal": { + "type": "string" + }, + "fields": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "index": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "type", + "fields" + ], + "additionalProperties": false + }, + "foldTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "fold" + ] + }, + "signal": { + "type": "string" + }, + "fields": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2, + "default": [ + "key", + "value" + ] + } + }, + "required": [ + "type", + "fields" + ], + "additionalProperties": false + }, + "formulaTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "formula" + ] + }, + "signal": { + "type": "string" + }, + "expr": { + "$ref": "#/refs/exprString" + }, + "as": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "initonly": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "type", + "expr", + "as" + ], + "additionalProperties": false + }, + "imputeTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "impute" + ] + }, + "signal": { + "type": "string" + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "key": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "keyvals": { + "oneOf": [ + { + "type": "array", + "items": {} + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "groupby": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "method": { + "anyOf": [ + { + "enum": [ + "value", + "mean", + "median", + "max", + "min" + ] + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "value" + }, + "value": {} + }, + "required": [ + "type", + "field", + "key" + ], + "additionalProperties": false + }, + "joinaggregateTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "joinaggregate" + ] + }, + "signal": { + "type": "string" + }, + "groupby": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "fields": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + }, + { + "type": "null" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "ops": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "enum": [ + "values", + "count", + "__count__", + "missing", + "valid", + "sum", + "product", + "mean", + "average", + "variance", + "variancep", + "stdev", + "stdevp", + "stderr", + "distinct", + "ci0", + "ci1", + "median", + "q1", + "q3", + "argmin", + "argmax", + "min", + "max" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "null" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "key": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "kdeTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "kde" + ] + }, + "signal": { + "type": "string" + }, + "groupby": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "cumulative": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "counts": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "bandwidth": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "resolve": { + "anyOf": [ + { + "enum": [ + "shared", + "independent" + ] + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "independent" + }, + "steps": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "minsteps": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 25 + }, + "maxsteps": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 200 + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "default": [ + "value", + "density" + ] + } + }, + "required": [ + "type", + "field" + ], + "additionalProperties": false + }, + "lookupTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "lookup" + ] + }, + "signal": { + "type": "string" + }, + "from": { + "type": "string" + }, + "key": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "values": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "fields": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "default": {} + }, + "required": [ + "type", + "from", + "key", + "fields" + ], + "additionalProperties": false + }, + "pivotTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "pivot" + ] + }, + "signal": { + "type": "string" + }, + "groupby": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "value": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "op": { + "anyOf": [ + { + "enum": [ + "values", + "count", + "__count__", + "missing", + "valid", + "sum", + "product", + "mean", + "average", + "variance", + "variancep", + "stdev", + "stdevp", + "stderr", + "distinct", + "ci0", + "ci1", + "median", + "q1", + "q3", + "argmin", + "argmax", + "min", + "max" + ] + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "sum" + }, + "limit": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "key": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + "required": [ + "type", + "field", + "value" + ], + "additionalProperties": false + }, + "projectTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "project" + ] + }, + "signal": { + "type": "string" + }, + "fields": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "null" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "quantileTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "quantile" + ] + }, + "signal": { + "type": "string" + }, + "groupby": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "probs": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "step": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 0.01 + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "default": [ + "prob", + "value" + ] + } + }, + "required": [ + "type", + "field" + ], + "additionalProperties": false + }, + "sampleTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "sample" + ] + }, + "signal": { + "type": "string" + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 1000 + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "sequenceTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "sequence" + ] + }, + "signal": { + "type": "string" + }, + "start": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "stop": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "step": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 1 + }, + "as": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "data" + } + }, + "required": [ + "type", + "start", + "stop" + ], + "additionalProperties": false + }, + "timeunitTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "timeunit" + ] + }, + "signal": { + "type": "string" + }, + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "interval": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": true + }, + "units": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "step": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 1 + }, + "maxbins": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": 40 + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "timezone": { + "anyOf": [ + { + "enum": [ + "local", + "utc" + ] + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "local" + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2, + "default": [ + "unit0", + "unit1" + ] + } + }, + "required": [ + "type", + "field" + ], + "additionalProperties": false + }, + "windowTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "window" + ] + }, + "signal": { + "type": "string" + }, + "sort": { + "$ref": "#/refs/compare" + }, + "groupby": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "ops": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "enum": [ + "row_number", + "rank", + "dense_rank", + "percent_rank", + "cume_dist", + "ntile", + "lag", + "lead", + "first_value", + "last_value", + "nth_value", + "prev_value", + "next_value", + "values", + "count", + "__count__", + "missing", + "valid", + "sum", + "product", + "mean", + "average", + "variance", + "variancep", + "stdev", + "stdevp", + "stderr", + "distinct", + "ci0", + "ci1", + "median", + "q1", + "q3", + "argmin", + "argmax", + "min", + "max" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "params": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "null" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "fields": { + "oneOf": [ + { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + }, + { + "type": "null" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "null" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "frame": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "null" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2, + "default": [ + null, + 0 + ] + }, + "ignorePeers": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "identifierTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "identifier" + ] + }, + "signal": { + "type": "string" + }, + "as": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "required": [ + "type", + "as" + ], + "additionalProperties": false + }, + "voronoiTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "voronoi" + ] + }, + "signal": { + "type": "string" + }, + "x": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "y": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "size": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "extent": { + "oneOf": [ + { + "type": "array", + "items": {} + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2, + "default": [ + [ + -100000, + -100000 + ], + [ + 100000, + 100000 + ] + ] + }, + "as": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ], + "default": "path" + } + }, + "required": [ + "type", + "x", + "y" + ], + "additionalProperties": false + }, + "wordcloudTransform": { + "type": "object", + "properties": { + "type": { + "enum": [ + "wordcloud" + ] + }, + "signal": { + "type": "string" + }, + "size": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 2, + "minItems": 2 + }, + "font": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + }, + { + "$ref": "#/refs/expr" + }, + { + "$ref": "#/refs/paramField" + } + ], + "default": "sans-serif" + }, + "fontStyle": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + }, + { + "$ref": "#/refs/expr" + }, + { + "$ref": "#/refs/paramField" + } + ], + "default": "normal" + }, + "fontWeight": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + }, + { + "$ref": "#/refs/expr" + }, + { + "$ref": "#/refs/paramField" + } + ], + "default": "normal" + }, + "fontSize": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "$ref": "#/refs/expr" + }, + { + "$ref": "#/refs/paramField" + } + ], + "default": 14 + }, + "fontSizeRange": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "null" + } + ], + "default": [ + 10, + 50 + ] + }, + "rotate": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "$ref": "#/refs/expr" + }, + { + "$ref": "#/refs/paramField" + } + ] + }, + "text": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/paramField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "spiral": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "padding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + }, + { + "$ref": "#/refs/expr" + }, + { + "$ref": "#/refs/paramField" + } + ] + }, + "as": { + "oneOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ], + "maxItems": 7, + "minItems": 7, + "default": [ + "x", + "y", + "font", + "fontSize", + "fontStyle", + "fontWeight", + "angle" + ] + } + }, + "required": [ + "type" + ], + "additionalProperties": false + } + }, + "refs": { + "labelOverlap": { + "oneOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "parity", + "greedy" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "tickBand": { + "oneOf": [ + { + "enum": [ + "center", + "extent" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "tickCount": { + "oneOf": [ + { + "type": "number" + }, + { + "enum": [ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year" + ] + }, + { + "type": "object", + "properties": { + "interval": { + "oneOf": [ + { + "enum": [ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "step": { + "$ref": "#/refs/numberOrSignal" + } + }, + "required": [ + "interval" + ], + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "element": { + "type": "string" + }, + "paramField": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "as": { + "type": "string" + } + }, + "required": [ + "field" + ], + "additionalProperties": false + }, + "field": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "datum": { + "$ref": "#/refs/field" + } + }, + "required": [ + "datum" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "group": { + "$ref": "#/refs/field" + }, + "level": { + "type": "number" + } + }, + "required": [ + "group" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "parent": { + "$ref": "#/refs/field" + }, + "level": { + "type": "number" + } + }, + "required": [ + "parent" + ], + "additionalProperties": false + } + ] + }, + "scale": { + "$ref": "#/refs/field" + }, + "stringModifiers": { + "type": "object", + "properties": { + "scale": { + "$ref": "#/refs/scale" + } + } + }, + "numberModifiers": { + "type": "object", + "properties": { + "exponent": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "mult": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "offset": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/numberValue" + } + ] + }, + "round": { + "type": "boolean", + "default": false + }, + "scale": { + "$ref": "#/refs/scale" + }, + "band": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "extra": { + "type": "boolean" + } + } + }, + "anyValue": { + "oneOf": [ + { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/defs/rule" + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": {} + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + } + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": {} + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + }, + "blendValue": { + "oneOf": [ + { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/defs/rule" + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + null, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity" + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + } + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + null, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity" + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + }, + "numberValue": { + "oneOf": [ + { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/defs/rule" + }, + { + "allOf": [ + { + "$ref": "#/refs/numberModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "type": "number" + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + } + }, + { + "allOf": [ + { + "$ref": "#/refs/numberModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "type": "number" + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + }, + "stringValue": { + "oneOf": [ + { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/defs/rule" + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "type": "string" + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + } + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "type": "string" + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + }, + "textValue": { + "oneOf": [ + { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/defs/rule" + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + } + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + }, + "booleanValue": { + "oneOf": [ + { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/defs/rule" + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "type": "boolean" + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + } + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "type": "boolean" + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + }, + "arrayValue": { + "oneOf": [ + { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/defs/rule" + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "type": "array" + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + } + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "type": "array" + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + }, + "fontWeightValue": { + "oneOf": [ + { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/defs/rule" + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + null, + "normal", + "bold", + "lighter", + "bolder", + "100", + "200", + "300", + "400", + "500", + "600", + "700", + "800", + "900", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900 + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + } + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + null, + "normal", + "bold", + "lighter", + "bolder", + "100", + "200", + "300", + "400", + "500", + "600", + "700", + "800", + "900", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900 + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + }, + "anchorValue": { + "oneOf": [ + { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/defs/rule" + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + "start", + "middle", + "end" + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + } + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + "start", + "middle", + "end" + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + }, + "alignValue": { + "oneOf": [ + { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/defs/rule" + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + "left", + "right", + "center" + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + } + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + "left", + "right", + "center" + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + }, + "baselineValue": { + "oneOf": [ + { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/defs/rule" + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + "top", + "middle", + "bottom", + "alphabetic" + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + } + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + "top", + "middle", + "bottom", + "alphabetic" + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + }, + "directionValue": { + "oneOf": [ + { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/defs/rule" + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + "horizontal", + "vertical" + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + } + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + "horizontal", + "vertical" + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + }, + "orientValue": { + "oneOf": [ + { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/defs/rule" + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + "left", + "right", + "top", + "bottom" + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + } + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + "left", + "right", + "top", + "bottom" + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + }, + "strokeCapValue": { + "oneOf": [ + { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/defs/rule" + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + "butt", + "round", + "square" + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + } + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + "butt", + "round", + "square" + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + }, + "strokeJoinValue": { + "oneOf": [ + { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/defs/rule" + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + "miter", + "round", + "bevel" + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + } + }, + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "enum": [ + "miter", + "round", + "bevel" + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + } + ] + }, + "baseColorValue": { + "oneOf": [ + { + "allOf": [ + { + "$ref": "#/refs/stringModifiers" + }, + { + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "value" + ] + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/field" + } + }, + "required": [ + "field" + ] + }, + { + "type": "object", + "properties": { + "range": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + "required": [ + "range" + ] + } + ] + }, + { + "type": "object", + "required": [ + "scale", + "value" + ] + }, + { + "type": "object", + "required": [ + "scale", + "band" + ] + }, + { + "type": "object", + "required": [ + "offset" + ] + } + ] + } + ] + }, + { + "type": "object", + "properties": { + "value": { + "$ref": "#/refs/linearGradient" + } + }, + "required": [ + "value" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "value": { + "$ref": "#/refs/radialGradient" + } + }, + "required": [ + "value" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "gradient": { + "$ref": "#/refs/scale" + }, + "start": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 2 + }, + "stop": { + "type": "array", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 2 + }, + "count": { + "type": "number" + } + }, + "required": [ + "gradient" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "color": { + "oneOf": [ + { + "$ref": "#/refs/colorRGB" + }, + { + "$ref": "#/refs/colorHSL" + }, + { + "$ref": "#/refs/colorLAB" + }, + { + "$ref": "#/refs/colorHCL" + } + ] + } + }, + "required": [ + "color" + ], + "additionalProperties": false + } + ] + }, + "colorRGB": { + "type": "object", + "properties": { + "r": { + "$ref": "#/refs/numberValue" + }, + "g": { + "$ref": "#/refs/numberValue" + }, + "b": { + "$ref": "#/refs/numberValue" + } + }, + "required": [ + "r", + "g", + "b" + ] + }, + "colorHSL": { + "type": "object", + "properties": { + "h": { + "$ref": "#/refs/numberValue" + }, + "s": { + "$ref": "#/refs/numberValue" + }, + "l": { + "$ref": "#/refs/numberValue" + } + }, + "required": [ + "h", + "s", + "l" + ] + }, + "colorLAB": { + "type": "object", + "properties": { + "l": { + "$ref": "#/refs/numberValue" + }, + "a": { + "$ref": "#/refs/numberValue" + }, + "b": { + "$ref": "#/refs/numberValue" + } + }, + "required": [ + "l", + "a", + "b" + ] + }, + "colorHCL": { + "type": "object", + "properties": { + "h": { + "$ref": "#/refs/numberValue" + }, + "c": { + "$ref": "#/refs/numberValue" + }, + "l": { + "$ref": "#/refs/numberValue" + } + }, + "required": [ + "h", + "c", + "l" + ] + }, + "colorValue": { + "oneOf": [ + { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/defs/rule" + }, + { + "$ref": "#/refs/baseColorValue" + } + ] + } + }, + { + "$ref": "#/refs/baseColorValue" + } + ] + }, + "gradientStops": { + "type": "array", + "items": { + "type": "object", + "properties": { + "offset": { + "type": "number" + }, + "color": { + "type": "string" + } + }, + "required": [ + "offset", + "color" + ], + "additionalProperties": false + } + }, + "linearGradient": { + "type": "object", + "properties": { + "gradient": { + "enum": [ + "linear" + ] + }, + "id": { + "type": "string" + }, + "x1": { + "type": "number" + }, + "y1": { + "type": "number" + }, + "x2": { + "type": "number" + }, + "y2": { + "type": "number" + }, + "stops": { + "$ref": "#/refs/gradientStops" + } + }, + "required": [ + "gradient", + "stops" + ], + "additionalProperties": false + }, + "radialGradient": { + "type": "object", + "properties": { + "gradient": { + "enum": [ + "radial" + ] + }, + "id": { + "type": "string" + }, + "x1": { + "type": "number" + }, + "y1": { + "type": "number" + }, + "r1": { + "type": "number" + }, + "x2": { + "type": "number" + }, + "y2": { + "type": "number" + }, + "r2": { + "type": "number" + }, + "stops": { + "$ref": "#/refs/gradientStops" + } + }, + "required": [ + "gradient", + "stops" + ], + "additionalProperties": false + }, + "expr": { + "type": "object", + "properties": { + "expr": { + "type": "string" + }, + "as": { + "type": "string" + } + }, + "required": [ + "expr" + ] + }, + "exprString": { + "type": "string" + }, + "compare": { + "oneOf": [ + { + "type": "object", + "properties": { + "field": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/expr" + } + ] + }, + "order": { + "$ref": "#/refs/sortOrder" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "field": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/refs/scaleField" + }, + { + "$ref": "#/refs/expr" + } + ] + } + }, + "order": { + "type": "array", + "items": { + "$ref": "#/refs/sortOrder" + } + } + }, + "additionalProperties": false + } + ] + }, + "from": { + "type": "object", + "properties": { + "data": { + "type": "string" + } + }, + "additionalProperties": false + }, + "facet": { + "type": "object", + "properties": { + "data": { + "type": "string" + }, + "facet": { + "oneOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "data": { + "type": "string" + }, + "field": { + "type": "string" + } + }, + "required": [ + "name", + "data", + "field" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "data": { + "type": "string" + }, + "groupby": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "aggregate": { + "type": "object", + "properties": { + "cross": { + "type": "boolean" + }, + "fields": { + "type": "array", + "items": { + "type": "string" + } + }, + "ops": { + "type": "array", + "items": { + "type": "string" + } + }, + "as": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + }, + "required": [ + "name", + "data", + "groupby" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "facet" + ], + "additionalProperties": false + }, + "markclip": { + "oneOf": [ + { + "$ref": "#/refs/booleanOrSignal" + }, + { + "type": "object", + "properties": { + "path": { + "$ref": "#/refs/stringOrSignal" + } + }, + "required": [ + "path" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "sphere": { + "$ref": "#/refs/stringOrSignal" + } + }, + "required": [ + "sphere" + ], + "additionalProperties": false + } + ] + }, + "style": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "marktype": { + "type": "string" + }, + "scaleField": { + "$ref": "#/refs/stringOrSignal" + }, + "sortOrder": { + "oneOf": [ + { + "enum": [ + "ascending", + "descending" + ] + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "scaleBins": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/refs/numberOrSignal" + } + }, + { + "type": "object", + "properties": { + "step": { + "$ref": "#/refs/numberOrSignal" + }, + "start": { + "$ref": "#/refs/numberOrSignal" + }, + "stop": { + "$ref": "#/refs/numberOrSignal" + } + }, + "required": [ + "step" + ], + "additionalProperties": false + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "scaleInterpolate": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + }, + { + "type": "object", + "properties": { + "type": { + "$ref": "#/refs/stringOrSignal" + }, + "gamma": { + "$ref": "#/refs/numberOrSignal" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + } + ] + }, + "scaleData": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "type": "string" + }, + "field": { + "$ref": "#/refs/stringOrSignal" + }, + "sort": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/stringOrSignal" + }, + "op": { + "$ref": "#/refs/stringOrSignal" + }, + "order": { + "$ref": "#/refs/sortOrder" + } + }, + "additionalProperties": false + } + ] + } + }, + "required": [ + "data", + "field" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/refs/stringOrSignal" + }, + "minItems": 1 + }, + "sort": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "properties": { + "op": { + "enum": [ + "count" + ] + }, + "order": { + "$ref": "#/refs/sortOrder" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/stringOrSignal" + }, + "op": { + "enum": [ + "count", + "min", + "max" + ] + }, + "order": { + "$ref": "#/refs/sortOrder" + } + }, + "required": [ + "field", + "op" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "data", + "fields" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "data": { + "type": "string" + }, + "field": { + "$ref": "#/refs/stringOrSignal" + } + }, + "required": [ + "data", + "field" + ], + "additionalProperties": false + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "minItems": 1 + }, + "sort": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "properties": { + "op": { + "enum": [ + "count" + ] + }, + "order": { + "$ref": "#/refs/sortOrder" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "field": { + "$ref": "#/refs/stringOrSignal" + }, + "op": { + "enum": [ + "count", + "min", + "max" + ] + }, + "order": { + "$ref": "#/refs/sortOrder" + } + }, + "required": [ + "field", + "op" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "fields" + ], + "additionalProperties": false + } + ] + }, + "selector": { + "type": "string" + }, + "signal": { + "type": "object", + "properties": { + "signal": { + "type": "string" + } + }, + "required": [ + "signal" + ] + }, + "arrayOrSignal": { + "oneOf": [ + { + "type": "array" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "booleanOrSignal": { + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "numberOrSignal": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "stringOrSignal": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/refs/signal" + } + ] + }, + "textOrSignal": { + "oneOf": [ + { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + { + "$ref": "#/refs/signal" + } + ] + } + }, + "type": "object", + "allOf": [ + { + "$ref": "#/defs/scope" + }, + { + "properties": { + "$schema": { + "type": "string", + "format": "uri" + }, + "config": { + "type": "object" + }, + "description": { + "type": "string" + }, + "width": { + "$ref": "#/refs/numberOrSignal" + }, + "height": { + "$ref": "#/refs/numberOrSignal" + }, + "padding": { + "$ref": "#/defs/padding" + }, + "autosize": { + "$ref": "#/defs/autosize" + }, + "background": { + "$ref": "#/defs/background" + }, + "style": { + "$ref": "#/refs/style" + } + } + } + ] +} \ No newline at end of file diff --git a/runtime/Lib/site-packages/altair/vegalite/__init__.py b/runtime/Lib/site-packages/altair/vegalite/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c67625df6547855044f7fffdfe687bfa55c35b07 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/__init__.py @@ -0,0 +1,2 @@ +# flake8: noqa +from .v4 import * diff --git a/runtime/Lib/site-packages/altair/vegalite/api.py b/runtime/Lib/site-packages/altair/vegalite/api.py new file mode 100644 index 0000000000000000000000000000000000000000..b70e2bda3f992e44748334d42c2f5dff48191c1c --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/api.py @@ -0,0 +1,2 @@ +# flake8: noqa +from .v4.api import * diff --git a/runtime/Lib/site-packages/altair/vegalite/data.py b/runtime/Lib/site-packages/altair/vegalite/data.py new file mode 100644 index 0000000000000000000000000000000000000000..30289160beb260a896f04812d1eb586eb7c306ea --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/data.py @@ -0,0 +1,45 @@ +from toolz import curried +from ..utils.core import sanitize_dataframe +from ..utils.data import ( + MaxRowsError, + curry, + limit_rows, + pipe, + sample, + to_csv, + to_json, + to_values, + check_data_type, +) +from ..utils.data import DataTransformerRegistry as _DataTransformerRegistry + + +@curried.curry +def default_data_transformer(data, max_rows=5000): + return curried.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", + "curry", + "sanitize_dataframe", + "default_data_transformer", + "limit_rows", + "pipe", + "sample", + "to_csv", + "to_json", + "to_values", + "check_data_type", +) diff --git a/runtime/Lib/site-packages/altair/vegalite/display.py b/runtime/Lib/site-packages/altair/vegalite/display.py new file mode 100644 index 0000000000000000000000000000000000000000..91c5f33e093b32cf81accd6fdeeb8a18292c28c0 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/display.py @@ -0,0 +1,11 @@ +from ..utils.display import Displayable, default_renderer_base, json_renderer_base +from ..utils.display import RendererRegistry, HTMLRenderer + + +__all__ = ( + "Displayable", + "default_renderer_base", + "json_renderer_base", + "RendererRegistry", + "HTMLRenderer", +) diff --git a/runtime/Lib/site-packages/altair/vegalite/schema.py b/runtime/Lib/site-packages/altair/vegalite/schema.py new file mode 100644 index 0000000000000000000000000000000000000000..fd7f3df7eb6cc79e627a98c474754ee50825a45b --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/schema.py @@ -0,0 +1,3 @@ +"""Altair schema wrappers""" +# flake8: noqa +from .v4.schema import * diff --git a/runtime/Lib/site-packages/altair/vegalite/tests/__init__.py b/runtime/Lib/site-packages/altair/vegalite/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/altair/vegalite/tests/test_common.py b/runtime/Lib/site-packages/altair/vegalite/tests/test_common.py new file mode 100644 index 0000000000000000000000000000000000000000..49d7a18d551b9b97289b724ff0814a4964166e85 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/tests/test_common.py @@ -0,0 +1,99 @@ +"""Tests of functionality that should work in all vegalite versions""" + +import pytest + +import pandas as pd + +from .. import v3, v4 + + +@pytest.fixture +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"}, + }, + } + + +def make_final_spec(alt, basic_spec): + theme = alt.themes.get() + spec = theme() + spec.update(basic_spec) + return spec + + +def make_basic_chart(alt): + data = pd.DataFrame( + { + "a": ["A", "B", "C", "D", "E", "F", "G", "H", "I"], + "b": [28, 55, 43, 91, 81, 53, 19, 87, 52], + } + ) + + return alt.Chart(data).mark_bar().encode(x="a", y="b") + + +@pytest.mark.parametrize("alt", [v3, v4]) +def test_basic_chart_to_dict(alt, basic_spec): + chart = ( + alt.Chart("data.csv") + .mark_line() + .encode(alt.X("xval:Q"), y=alt.Y("yval:O"), color="color:N") + ) + dct = chart.to_dict() + + # schema should be in the top level + assert dct.pop("$schema").startswith("http") + + # remainder of spec should match the basic spec + assert dct == make_final_spec(alt, basic_spec) + + +@pytest.mark.parametrize("alt", [v3, v4]) +def test_basic_chart_from_dict(alt, basic_spec): + chart = alt.Chart.from_dict(basic_spec) + dct = chart.to_dict() + + # schema should be in the top level + assert dct.pop("$schema").startswith("http") + + # remainder of spec should match the basic spec + assert dct == make_final_spec(alt, basic_spec) + + +@pytest.mark.parametrize("alt", [v3, v4]) +def test_theme_enable(alt, basic_spec): + active_theme = alt.themes.active + + try: + alt.themes.enable("none") + + chart = alt.Chart.from_dict(basic_spec) + dct = chart.to_dict() + + # schema should be in the top level + assert dct.pop("$schema").startswith("http") + + # remainder of spec should match the basic spec + # without any theme settings + assert dct == basic_spec + finally: + # reset the theme to its initial value + alt.themes.enable(active_theme) + + +@pytest.mark.parametrize("alt", [v3, v4]) +def test_max_rows(alt): + basic_chart = make_basic_chart(alt) + + with alt.data_transformers.enable("default"): + basic_chart.to_dict() # this should not fail + + with alt.data_transformers.enable("default", max_rows=5): + with pytest.raises(alt.MaxRowsError): + basic_chart.to_dict() # this should not fail diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/__init__.py b/runtime/Lib/site-packages/altair/vegalite/v3/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..82755a5fa0a32fc90f8206c4ff363cc903e2c2e0 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/__init__.py @@ -0,0 +1,24 @@ +# flake8: noqa +from .schema import * +from .api import * +from ._deprecated import * + +from ...datasets import list_datasets, load_dataset + +from ... import expr +from ...expr import datum + +from .display import VegaLite, renderers + +from .data import ( + MaxRowsError, + pipe, + curry, + limit_rows, + sample, + to_json, + to_csv, + to_values, + default_data_transformer, + data_transformers, +) diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/_deprecated.py b/runtime/Lib/site-packages/altair/vegalite/v3/_deprecated.py new file mode 100644 index 0000000000000000000000000000000000000000..16a957af8efafdac94cb605d8ecc501942670e7b --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/_deprecated.py @@ -0,0 +1,19 @@ +from ...utils.deprecation import _deprecate +from . import channels + +# Deprecated classes (see https://github.com/altair-viz/altair/issues/1474). +# TODO: Remove these in Altair 3.2. +Fillopacity = _deprecate(channels.FillOpacity, "Fillopacity") +FillopacityValue = _deprecate(channels.FillOpacityValue, "FillopacityValue") +Strokeopacity = _deprecate(channels.StrokeOpacity, "Strokeopacity") +StrokeopacityValue = _deprecate(channels.StrokeOpacityValue, "StrokeopacityValue") +Strokewidth = _deprecate(channels.StrokeWidth, "Strokewidth") +StrokewidthValue = _deprecate(channels.StrokeWidthValue, "StrokewidthValue") +Xerror = _deprecate(channels.XError, "Xerror") +XerrorValue = _deprecate(channels.XErrorValue, "XerrorValue") +Xerror2 = _deprecate(channels.XError2, "Xerror2") +Xerror2Value = _deprecate(channels.XError2Value, "Xerror2Value") +Yerror = _deprecate(channels.YError, "Yerror") +YerrorValue = _deprecate(channels.YErrorValue, "YerrorValue") +Yerror2 = _deprecate(channels.YError2, "Yerror2") +Yerror2Value = _deprecate(channels.YError2Value, "Yerror2Value") diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/api.py b/runtime/Lib/site-packages/altair/vegalite/v3/api.py new file mode 100644 index 0000000000000000000000000000000000000000..6473d41e6a62cbf3cccf73264a2dcb89c70d7db6 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/api.py @@ -0,0 +1,2177 @@ +import warnings + +import hashlib +import io +import json +import jsonschema +import pandas as pd +from toolz.curried import pipe as _pipe + +from .schema import core, channels, mixins, Undefined, SCHEMA_URL + +from .data import data_transformers +from ... import utils, expr +from .display import renderers, VEGALITE_VERSION, VEGAEMBED_VERSION, VEGA_VERSION +from .theme import themes + + +# ------------------------------------------------------------------------ +# Data Utilities +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): + 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=None): + """Convert input data to data for use within schema + + Parameters + ---------- + 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 (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. + """ + if data is Undefined: + return data + + # convert dataframes or objects with __geo_interface__ to dict + if isinstance(data, pd.DataFrame) or hasattr(data, "__geo_interface__"): + data = _pipe(data, data_transformers.get()) + + # convert string input to a URLData + if isinstance(data, str): + data = core.UrlData(data) + + # consolidate inline data to top-level 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 + if not isinstance(data, (dict, core.Data)): + warnings.warn("data of type {} not recognized".format(type(data))) + + return data + + +# ------------------------------------------------------------------------ +# Aliases & specializations +Bin = core.BinParams + + +@utils.use_signature(core.LookupData) +class LookupData(core.LookupData): + def to_dict(self, *args, **kwargs): + """Convert the chart to a dictionary suitable for JSON export""" + copy = self.copy(deep=False) + copy.data = _prepare_data(copy.data, kwargs.get("context")) + return super(LookupData, copy).to_dict(*args, **kwargs) + + +@utils.use_signature(core.FacetMapping) +class FacetMapping(core.FacetMapping): + _class_is_valid_at_instantiation = False + + def to_dict(self, *args, **kwargs): + copy = self.copy(deep=False) + context = kwargs.get("context", {}) + data = context.get("data", None) + if isinstance(self.row, str): + copy.row = core.FacetFieldDef(**utils.parse_shorthand(self.row, data)) + if isinstance(self.column, str): + copy.column = core.FacetFieldDef(**utils.parse_shorthand(self.column, data)) + return super(FacetMapping, copy).to_dict(*args, **kwargs) + + +# ------------------------------------------------------------------------ +# Encoding will contain channel objects that aren't valid at instantiation +core.FacetedEncoding._class_is_valid_at_instantiation = False + +# ------------------------------------------------------------------------ +# These are parameters that are valid at the top level, but are not valid +# for specs that are within a composite chart +# (layer, hconcat, vconcat, facet, repeat) +TOPLEVEL_ONLY_KEYS = {"background", "config", "autosize", "padding", "$schema"} + + +def _get_channels_mapping(): + mapping = {} + for attr in dir(channels): + cls = getattr(channels, attr) + if isinstance(cls, type) and issubclass(cls, core.SchemaBase): + mapping[cls] = attr.replace("Value", "").lower() + return mapping + + +# ------------------------------------------------------------------------- +# Tools for working with selections +class Selection(object): + """A Selection object""" + + _counter = 0 + + @classmethod + def _get_name(cls): + cls._counter += 1 + return "selector{:03d}".format(cls._counter) + + def __init__(self, name, selection): + if name is None: + name = self._get_name() + self.name = name + self.selection = selection + + def __repr__(self): + return "Selection({0!r}, {1})".format(self.name, self.selection) + + def ref(self): + return self.to_dict() + + def to_dict(self): + return { + "selection": self.name.to_dict() + if hasattr(self.name, "to_dict") + else self.name + } + + def __invert__(self): + return Selection(core.SelectionNot(**{"not": self.name}), self.selection) + + def __and__(self, other): + if isinstance(other, Selection): + other = other.name + return Selection( + core.SelectionAnd(**{"and": [self.name, other]}), self.selection + ) + + def __or__(self, other): + if isinstance(other, Selection): + other = other.name + 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): + return expr.core.GetItemExpression(self.name, field_name) + + +# ------------------------------------------------------------------------ +# Top-Level Functions + + +def value(value, **kwargs): + """Specify a value for use in an encoding""" + return dict(value=value, **kwargs) + + +def selection(name=None, type=Undefined, **kwds): + """Create a named selection. + + Parameters + ---------- + name : string (optional) + The name of the selection. If not specified, a unique name will be + created. + type : string + The type of the selection: one of ["interval", "single", or "multi"] + **kwds : + additional keywords will be used to construct a SelectionDef instance + that controls the selection. + + Returns + ------- + selection: Selection + The selection object that can be used in chart creation. + """ + return Selection(name, core.SelectionDef(type=type, **kwds)) + + +@utils.use_signature(core.IntervalSelection) +def selection_interval(**kwargs): + """Create a selection with type='interval'""" + return selection(type="interval", **kwargs) + + +@utils.use_signature(core.MultiSelection) +def selection_multi(**kwargs): + """Create a selection with type='multi'""" + return selection(type="multi", **kwargs) + + +@utils.use_signature(core.SingleSelection) +def selection_single(**kwargs): + """Create a selection with type='single'""" + return selection(type="single", **kwargs) + + +@utils.use_signature(core.Binding) +def binding(input, **kwargs): + """A generic binding""" + return core.Binding(input=input, **kwargs) + + +@utils.use_signature(core.BindCheckbox) +def binding_checkbox(**kwargs): + """A checkbox binding""" + return core.BindCheckbox(input="checkbox", **kwargs) + + +@utils.use_signature(core.BindRadioSelect) +def binding_radio(**kwargs): + """A radio button binding""" + return core.BindRadioSelect(input="radio", **kwargs) + + +@utils.use_signature(core.BindRadioSelect) +def binding_select(**kwargs): + """A select binding""" + return core.BindRadioSelect(input="select", **kwargs) + + +@utils.use_signature(core.BindRange) +def binding_range(**kwargs): + """A range binding""" + return core.BindRange(input="range", **kwargs) + + +def condition(predicate, if_true, if_false, **kwargs): + """A conditional attribute or encoding + + Parameters + ---------- + 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: + the spec or object to use if the selection predicate is true + if_false: + the spec or object to use if the selection predicate is false + **kwargs: + additional keyword args are added to the resulting dict + + Returns + ------- + spec: dict or VegaLiteSchema + the spec that describes the condition + """ + test_predicates = (str, expr.Expression, core.LogicalOperandPredicate) + + if isinstance(predicate, Selection): + condition = {"selection": predicate.name} + elif isinstance(predicate, core.SelectionOperand): + condition = {"selection": predicate} + elif isinstance(predicate, test_predicates): + condition = {"test": predicate} + elif isinstance(predicate, dict): + condition = predicate + else: + raise NotImplementedError( + "condition predicate of type {}" "".format(type(predicate)) + ) + + if isinstance(if_true, core.SchemaBase): + # convert to dict for now; the from_dict call below will wrap this + # dict in the appropriate schema + if_true = if_true.to_dict() + elif isinstance(if_true, str): + if_true = {"shorthand": if_true} + if_true.update(kwargs) + condition.update(if_true) + + if isinstance(if_false, core.SchemaBase): + # For the selection, the channel definitions all allow selections + # already. So use this SchemaBase wrapper if possible. + selection = if_false.copy() + selection.condition = condition + elif isinstance(if_false, str): + selection = {"condition": condition, "shorthand": if_false} + selection.update(kwargs) + else: + selection = dict(condition=condition, **if_false) + + return selection + + +# -------------------------------------------------------------------- +# Top-level objects + + +class TopLevelMixin(mixins.ConfigMethodMixin): + """Mixin for top-level chart objects such as Chart, LayeredChart, etc.""" + + _class_is_valid_at_instantiation = False + + def to_dict(self, *args, **kwargs): + """Convert the chart to a dictionary suitable for JSON export""" + # We make use of three context markers: + # - 'data' points to the data that should be referenced for column type + # inference. + # - '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. + # - 'datasets' is a dict of named datasets that should be inserted + # in the top-level object + + # note: not a deep copy because we want datasets and data arguments to + # be passed by reference + context = kwargs.get("context", {}).copy() + context.setdefault("datasets", {}) + is_top_level = context.get("top_level", True) + + copy = self.copy(deep=False) + original_data = getattr(copy, "data", Undefined) + copy.data = _prepare_data(original_data, context) + + if original_data is not Undefined: + context["data"] = original_data + + # remaining to_dict calls are not at top level + 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) + + # TODO: following entries are added after validation. Should they be validated? + 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 + + # apply theme from theme registry + the_theme = themes.get() + dct = utils.update_nested(the_theme(), dct, copy=True) + + # update datasets + if context["datasets"]: + dct.setdefault("datasets", {}).update(context["datasets"]) + + return dct + + def to_html( + self, + base_url="https://cdn.jsdelivr.net/npm/", + output_div="vis", + embed_options=None, + json_kwds=None, + fullhtml=True, + requirejs=False, + ): + return utils.spec_to_html( + self.to_dict(), + mode="vega-lite", + vegalite_version=VEGALITE_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vega_version=VEGA_VERSION, + base_url=base_url, + output_div=output_div, + embed_options=embed_options, + json_kwds=json_kwds, + fullhtml=fullhtml, + requirejs=requirejs, + ) + + @utils.deprecation.deprecated( + "Chart.savechart is deprecated in favor of Chart.save" + ) + def savechart(self, fp, format=None, **kwargs): + """Save a chart to file in a variety of formats + + Supported formats are json, html, png, svg + + 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']. + If not specified, the format will be determined from the filename. + **kwargs : + Additional keyword arguments are passed to the output method + associated with the specified format. + + """ + return self.save(fp, format=None, **kwargs) + + def save( + self, + fp, + format=None, + override_data_transformer=True, + scale_factor=1.0, + vegalite_version=VEGALITE_VERSION, + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + **kwargs, + ): + """Save a chart to file in a variety of formats + + 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']. + 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 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. + Default is 1.0 + **kwargs : + Additional keyword arguments are passed to the output method + associated with the specified format. + + """ + from ...utils.save import save + + kwds = dict( + chart=self, + fp=fp, + format=format, + scale_factor=scale_factor, + vegalite_version=vegalite_version, + vega_version=vega_version, + vegaembed_version=vegaembed_version, + **kwargs, + ) + + # By default we override the data transformer. This makes it so + # that save() will succeed even for large datasets that would + # normally trigger a MaxRowsError + if override_data_transformer: + with data_transformers.disable_max_rows(): + result = save(**kwds) + else: + result = save(**kwds) + return result + + # Fallback for when rendering fails; the full repr is too long to be + # useful in nearly all cases. + def __repr__(self): + return "alt.{}(...)".format(self.__class__.__name__) + + # Layering and stacking + def __add__(self, other): + if not isinstance(other, TopLevelMixin): + raise ValueError("Only Chart objects can be layered.") + return layer(self, other) + + def __and__(self, other): + if not isinstance(other, TopLevelMixin): + raise ValueError("Only Chart objects can be concatenated.") + return vconcat(self, other) + + def __or__(self, other): + if not isinstance(other, TopLevelMixin): + raise ValueError("Only Chart objects can be concatenated.") + return hconcat(self, other) + + 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 + column using `alt.repeat('row')` and `alt.repeat('column')`. + + 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_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. + + Argument names and types are the same as class initialization. + """ + copy = self.copy(deep=False) + for key, val in kwargs.items(): + if key == "selection" and isinstance(val, Selection): + # For backward compatibility with old selection interface. + setattr(copy, key, {val.name: val.selection}) + else: + # Don't validate data, because it hasn't been processed. + if key != "data": + self.validate_property(key, val) + setattr(copy, key, val) + 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, + reflectX=Undefined, + reflectY=Undefined, + rotate=Undefined, + scale=Undefined, + spacing=Undefined, + tilt=Undefined, + translate=Undefined, + **kwds, + ): + """Add a geographic projection to the chart. + + This is generally used either with ``mark_geoshape`` or with the + ``latitude``/``longitude`` encodings. + + Available projection types are + ['albers', 'albersUsa', 'azimuthalEqualArea', 'azimuthalEquidistant', + 'conicConformal', 'conicEqualArea', 'conicEquidistant', 'equalEarth', 'equirectangular', + 'gnomonic', 'identity', 'mercator', 'orthographic', 'stereographic', 'transverseMercator'] + + Attributes + ---------- + type : ProjectionType + 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](https://vega.github.io/vega-lite/docs/projection.html#projection-types). + + **Default value:** `mercator` + center : List(float) + Sets the projection’s center to the specified center, a two-element array of + longitude and latitude in degrees. + + **Default value:** `[0, 0]` + clipAngle : float + Sets 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 : List(List(float)) + Sets 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 : float + + distance : float + + fraction : float + + lobes : float + + parallel : float + + precision : Mapping(required=[length]) + Sets 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 : float + + ratio : float + + reflectX : boolean + + reflectY : boolean + + rotate : List(float) + Sets 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 : float + Sets the projection's scale (zoom) value, overriding automatic fitting. + + spacing : float + + tilt : float + + translate : List(float) + Sets the projection's translation (pan) value, overriding automatic fitting. + + """ + projection = core.Projection( + center=center, + clipAngle=clipAngle, + clipExtent=clipExtent, + coefficient=coefficient, + distance=distance, + fraction=fraction, + lobes=lobes, + parallel=parallel, + precision=precision, + radius=radius, + ratio=ratio, + reflectX=reflectX, + reflectY=reflectY, + rotate=rotate, + scale=scale, + spacing=spacing, + tilt=tilt, + translate=translate, + type=type, + **kwds, + ) + return self.properties(projection=projection) + + def _add_transform(self, *transforms): + """Copy the chart and add specified transforms to chart.transform""" + copy = self.copy(deep=["transform"]) + if copy.transform is Undefined: + copy.transform = [] + copy.transform.extend(transforms) + return copy + + def transform_aggregate(self, aggregate=Undefined, groupby=Undefined, **kwds): + """ + Add an AggregateTransform to the schema. + + Parameters + ---------- + aggregate : List(:class:`AggregatedFieldDef`) + Array of objects that define fields to aggregate. + groupby : List(string) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + **kwds : + additional keywords are converted to aggregates using standard + shorthand parsing. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + Examples + -------- + The aggregate transform allows you to specify transforms directly using + the same shorthand syntax as used in encodings: + + >>> import altair as alt + >>> chart1 = alt.Chart().transform_aggregate( + ... mean_acc='mean(Acceleration)', + ... groupby=['Origin'] + ... ) + >>> print(chart1.transform[0].to_json()) # doctest: +NORMALIZE_WHITESPACE + { + "aggregate": [ + { + "as": "mean_acc", + "field": "Acceleration", + "op": "mean" + } + ], + "groupby": [ + "Origin" + ] + } + + It also supports including AggregatedFieldDef instances or dicts directly, + so you can create the above transform like this: + + >>> chart2 = alt.Chart().transform_aggregate( + ... [alt.AggregatedFieldDef(field='Acceleration', op='mean', + ... **{'as': 'mean_acc'})], + ... groupby=['Origin'] + ... ) + >>> chart2.transform == chart1.transform + True + + See Also + -------- + alt.AggregateTransform : underlying transform object + + """ + if aggregate is Undefined: + aggregate = [] + for key, val in kwds.items(): + parsed = utils.parse_shorthand(val) + dct = { + "as": key, + "field": parsed.get("field", Undefined), + "op": parsed.get("aggregate", Undefined), + } + aggregate.append(core.AggregatedFieldDef(**dct)) + return self._add_transform( + core.AggregateTransform(aggregate=aggregate, groupby=groupby) + ) + + def transform_bin(self, as_=Undefined, field=Undefined, bin=True, **kwargs): + """ + Add a BinTransform to the schema. + + Parameters + ---------- + as_ : anyOf(string, List(string)) + The output fields at which to write the start and end bin values. + bin : anyOf(boolean, :class:`BinParams`) + An object indicating bin properties, or simply ``true`` for using default bin + parameters. + field : string + The data field to bin. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + Examples + -------- + >>> import altair as alt + >>> chart = alt.Chart().transform_bin("x_binned", "x") + >>> chart.transform[0] + BinTransform({ + as: 'x_binned', + bin: True, + field: 'x' + }) + + >>> chart = alt.Chart().transform_bin("x_binned", "x", + ... bin=alt.Bin(maxbins=10)) + >>> chart.transform[0] + BinTransform({ + as: 'x_binned', + bin: BinParams({ + maxbins: 10 + }), + field: 'x' + }) + + See Also + -------- + alt.BinTransform : underlying transform object + + """ + if as_ is not Undefined: + if "as" in kwargs: + raise ValueError( + "transform_bin: both 'as_' and 'as' passed as arguments." + ) + kwargs["as"] = as_ + kwargs["bin"] = bin + kwargs["field"] = field + return self._add_transform(core.BinTransform(**kwargs)) + + def transform_calculate(self, as_=Undefined, calculate=Undefined, **kwargs): + """ + Add a CalculateTransform to the schema. + + Parameters + ---------- + as_ : string + The field for storing the computed formula value. + calculate : string or alt.expr expression + A `expression `__ + string. Use the variable ``datum`` to refer to the current data object. + **kwargs + transforms can also be passed by keyword argument; see Examples + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + Examples + -------- + >>> import altair as alt + >>> from altair import datum, expr + + >>> chart = alt.Chart().transform_calculate(y = 2 * expr.sin(datum.x)) + >>> chart.transform[0] + CalculateTransform({ + as: 'y', + calculate: (2 * sin(datum.x)) + }) + + It's also possible to pass the ``CalculateTransform`` arguments directly: + + >>> kwds = {'as': 'y', 'calculate': '2 * sin(datum.x)'} + >>> chart = alt.Chart().transform_calculate(**kwds) + >>> chart.transform[0] + CalculateTransform({ + as: 'y', + calculate: '2 * sin(datum.x)' + }) + + As the first form is easier to write and understand, that is the + recommended method. + + See Also + -------- + alt.CalculateTransform : underlying transform object + """ + if as_ is Undefined: + as_ = kwargs.pop("as", Undefined) + else: + if "as" in kwargs: + raise ValueError( + "transform_calculate: both 'as_' and 'as' passed as arguments." + ) + if as_ is not Undefined or calculate is not Undefined: + dct = {"as": as_, "calculate": calculate} + self = self._add_transform(core.CalculateTransform(**dct)) + for as_, calculate in kwargs.items(): + dct = {"as": as_, "calculate": calculate} + self = self._add_transform(core.CalculateTransform(**dct)) + return self + + def transform_impute( + self, + impute, + key, + frame=Undefined, + groupby=Undefined, + keyvals=Undefined, + method=Undefined, + value=Undefined, + ): + """ + Add an ImputeTransform to the schema. + + Parameters + ---------- + impute : string + The data field for which the missing values should be imputed. + key : string + 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)) + 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 + rows preceding or following the current data object. For example, the value ``[-5, + 5]`` indicates that the window should include five objects preceding and five + objects following the current object. + **Default value:** : ``[null, null]`` indicating that the window includes all + objects. + groupby : List(string) + 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`) + Defines the key values that should be considered for imputation. + An array of key values or an object defining a `number sequence + `__. + If provided, this will be used in addition to the key values observed within the + input data. If not provided, the values will be derived from all unique values of + the ``key`` field. For ``impute`` in ``encoding``, the key field is the x-field if + the y-field is imputed, or vice versa. + If there is no impute grouping, this property *must* be specified. + method : :class:`ImputeMethod` + The imputation method to use for the field value of imputed data objects. + One of ``value``, ``mean``, ``median``, ``max`` or ``min``. + **Default value:** ``"value"`` + value : Mapping(required=[]) + The field value to use when the imputation ``method`` is ``"value"``. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.ImputeTransform : underlying transform object + """ + return self._add_transform( + core.ImputeTransform( + impute=impute, + key=key, + frame=frame, + groupby=groupby, + keyvals=keyvals, + method=method, + value=value, + ) + ) + + def transform_joinaggregate( + self, joinaggregate=Undefined, groupby=Undefined, **kwargs + ): + """ + Add a JoinAggregateTransform to the schema. + + Parameters + ---------- + joinaggregate : List(:class:`JoinAggregateFieldDef`) + The definition of the fields in the join aggregate, and what calculations to use. + groupby : List(string) + The data fields for partitioning the data objects into separate groups. If + unspecified, all data points will be in a single group. + **kwargs + joinaggregates can also be passed by keyword argument; see Examples. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + Examples + -------- + >>> import altair as alt + >>> chart = alt.Chart().transform_joinaggregate(x='sum(y)') + >>> chart.transform[0] + JoinAggregateTransform({ + joinaggregate: [JoinAggregateFieldDef({ + as: 'x', + field: 'y', + op: 'sum' + })] + }) + + See Also + -------- + alt.JoinAggregateTransform : underlying transform object + """ + if joinaggregate is Undefined: + joinaggregate = [] + for key, val in kwargs.items(): + parsed = utils.parse_shorthand(val) + dct = { + "as": key, + "field": parsed.get("field", Undefined), + "op": parsed.get("aggregate", Undefined), + } + joinaggregate.append(core.JoinAggregateFieldDef(**dct)) + return self._add_transform( + core.JoinAggregateTransform(joinaggregate=joinaggregate, groupby=groupby) + ) + + def transform_filter(self, filter, **kwargs): + """ + Add a FilterTransform to the schema. + + Parameters + ---------- + filter : a filter expression or :class:`LogicalOperandPredicate` + The `filter` property must be one of the predicate definitions: + (1) a string or alt.expr expression + (2) a range predicate + (3) a selection predicate + (4) a logical operand combining (1)-(3) + (5) a Selection object + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.FilterTransform : underlying transform object + + """ + if isinstance(filter, Selection): + filter = {"selection": filter.name} + elif isinstance(filter, core.SelectionOperand): + filter = {"selection": filter} + return self._add_transform(core.FilterTransform(filter=filter, **kwargs)) + + def transform_flatten(self, flatten, as_=Undefined): + """Add a FlattenTransform to the schema. + + Parameters + ---------- + flatten : List(string) + 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(string) + The output field names for extracted array values. + **Default value:** The field name of the corresponding array field + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.FlattenTransform : underlying transform object + """ + return self._add_transform( + core.FlattenTransform(flatten=flatten, **{"as": as_}) + ) + + def transform_fold(self, fold, as_=Undefined): + """Add a FoldTransform to the schema. + + Parameters + ---------- + fold : List(string) + An array of data fields indicating the properties to fold. + as : [string, string] + The output field names for the key and value properties produced by the fold + transform. Default: ``["key", "value"]`` + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.FoldTransform : underlying transform object + """ + return self._add_transform(core.FoldTransform(fold=fold, **{"as": as_})) + + def transform_lookup( + self, + as_=Undefined, + from_=Undefined, + lookup=Undefined, + default=Undefined, + **kwargs, + ): + """Add a LookupTransform to the schema + + Attributes + ---------- + as_ : anyOf(string, List(string)) + The field or fields for storing the computed formula value. + If ``from.fields`` is specified, the transform will use the same names for ``as``. + If ``from.fields`` is not specified, ``as`` has to be a string and we put the whole + object into the data under the specified name. + from_ : :class:`LookupData` + Secondary data reference. + lookup : string + Key in primary data source. + default : string + The default value to use if lookup fails. **Default value:** ``null`` + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.LookupTransform : underlying transform object + """ + if as_ is not Undefined: + if "as" in kwargs: + raise ValueError( + "transform_lookup: both 'as_' and 'as' passed as arguments." + ) + kwargs["as"] = as_ + if from_ is not Undefined: + if "from" in kwargs: + raise ValueError( + "transform_lookup: both 'from_' and 'from' passed as arguments." + ) + kwargs["from"] = from_ + kwargs["lookup"] = lookup + kwargs["default"] = default + return self._add_transform(core.LookupTransform(**kwargs)) + + def transform_sample(self, sample=1000): + """ + Add a SampleTransform to the schema. + + Parameters + ---------- + sample : float + The maximum number of data objects to include in the sample. Default: 1000. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.SampleTransform : underlying transform object + """ + return self._add_transform(core.SampleTransform(sample)) + + def transform_stack(self, as_, stack, groupby, offset=Undefined, sort=Undefined): + """ + Add a StackTransform to the schema. + + Parameters + ---------- + as_ : anyOf(string, List(string)) + 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(eg."val") is provided, the end field will be "val_end". + stack : string + The field which is stacked. + groupby : List(string) + The data fields to group by. + offset : enum('zero', 'center', 'normalize') + Mode for stacking marks. Default: 'zero'. + sort : List(:class:`SortField`) + Field that determines the order of leaves in the stacked charts. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.StackTransform : underlying transform object + """ + return self._add_transform( + core.StackTransform( + stack=stack, groupby=groupby, offset=offset, sort=sort, **{"as": as_} + ) + ) + + def transform_timeunit( + self, as_=Undefined, field=Undefined, timeUnit=Undefined, **kwargs + ): + """ + Add a TimeUnitTransform to the schema. + + Parameters + ---------- + as_ : string + The output field to write the timeUnit value. + field : string + The data field to apply time unit. + timeUnit : :class:`TimeUnit` + The timeUnit. + **kwargs + transforms can also be passed by keyword argument; see Examples + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + Examples + -------- + >>> import altair as alt + >>> from altair import datum, expr + + >>> chart = alt.Chart().transform_timeunit(month='month(date)') + >>> chart.transform[0] + TimeUnitTransform({ + as: 'month', + field: 'date', + timeUnit: 'month' + }) + + It's also possible to pass the ``TimeUnitTransform`` arguments directly; + this is most useful in cases where the desired field name is not a + valid python identifier: + + >>> kwds = {'as': 'month', 'timeUnit': 'month', 'field': 'The Month'} + >>> chart = alt.Chart().transform_timeunit(**kwds) + >>> chart.transform[0] + TimeUnitTransform({ + as: 'month', + field: 'The Month', + timeUnit: 'month' + }) + + As the first form is easier to write and understand, that is the + recommended method. + + See Also + -------- + alt.TimeUnitTransform : underlying transform object + + """ + if as_ is Undefined: + as_ = kwargs.pop("as", Undefined) + else: + if "as" in kwargs: + raise ValueError( + "transform_timeunit: both 'as_' and 'as' passed as arguments." + ) + if as_ is not Undefined: + dct = {"as": as_, "timeUnit": timeUnit, "field": field} + self = self._add_transform(core.TimeUnitTransform(**dct)) + for as_, shorthand in kwargs.items(): + dct = utils.parse_shorthand( + shorthand, + parse_timeunits=True, + parse_aggregates=False, + parse_types=False, + ) + dct.pop("type", None) + dct["as"] = as_ + if "timeUnit" not in dct: + raise ValueError("'{}' must include a valid timeUnit".format(shorthand)) + self = self._add_transform(core.TimeUnitTransform(**dct)) + return self + + def transform_window( + self, + window=Undefined, + frame=Undefined, + groupby=Undefined, + ignorePeers=Undefined, + sort=Undefined, + **kwargs, + ): + """Add a WindowTransform to the schema + + Parameters + ---------- + window : List(:class:`WindowFieldDef`) + The definition of the fields in the window, and what calculations to use. + frame : List(anyOf(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 + following the current data object. The default value is ``[null, 0]``, indicating + that the sliding window includes the current object and all preceding objects. The + value ``[-5, 5]`` indicates that the window should include five objects preceding + and five objects following the current object. Finally, ``[null, null]`` indicates + that the window frame should always include all data objects. The only operators + affected are the aggregation operations and the ``first_value``, ``last_value``, and + ``nth_value`` window operations. The other window operations are not affected by + this. + + **Default value:** : ``[null, 0]`` (includes the current object and all preceding + objects) + groupby : List(string) + The data fields for partitioning the data objects into separate windows. If + unspecified, all data points will be in a single group. + ignorePeers : boolean + Indicates if the sliding window frame should ignore peer values. (Peer values are + those 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 defined by offset values only. This setting only affects those operations + that depend on the window frame, namely aggregation operations and the first_value, + last_value, and nth_value window operations. + + **Default value:** ``false`` + sort : List(:class:`SortField`) + 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`` ). + **kwargs + transforms can also be passed by keyword argument; see Examples + + Examples + -------- + A cumulative line chart + + >>> import altair as alt + >>> import numpy as np + >>> import pandas as pd + >>> data = pd.DataFrame({'x': np.arange(100), + ... 'y': np.random.randn(100)}) + >>> chart = alt.Chart(data).mark_line().encode( + ... x='x:Q', + ... y='ycuml:Q' + ... ).transform_window( + ... ycuml='sum(y)' + ... ) + >>> chart.transform[0] + WindowTransform({ + window: [WindowFieldDef({ + as: 'ycuml', + field: 'y', + op: 'sum' + })] + }) + + """ + if kwargs: + if window is Undefined: + window = [] + for as_, shorthand in kwargs.items(): + kwds = {"as": as_} + kwds.update( + utils.parse_shorthand( + shorthand, + parse_aggregates=False, + parse_window_ops=True, + parse_timeunits=False, + parse_types=False, + ) + ) + window.append(core.WindowFieldDef(**kwds)) + + return self._add_transform( + core.WindowTransform( + window=window, + frame=frame, + groupby=groupby, + ignorePeers=ignorePeers, + sort=sort, + ) + ) + + # Display-related methods + + def _repr_mimebundle_(self, include=None, exclude=None): + """Return a MIME bundle for display in Jupyter frontends.""" + # Catch errors explicitly to get around issues in Jupyter frontend + # see https://github.com/ipython/ipython/issues/11038 + try: + dct = self.to_dict() + except Exception: + utils.display_traceback(in_ipython=True) + return {} + else: + return renderers.get()(dct) + + 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 + + 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, + **kwargs, + ): + """Open a browser window and display a rendering of the chart + + Parameters + ---------- + html : string + HTML to serve + ip : string (default = '127.0.0.1') + ip address at which the HTML will be served. + port : int (default = 8888) + the port at which to serve the HTML + n_retries : int (default = 50) + the number of nearby ports to search if the specified port + is already in use. + files : dictionary (optional) + dictionary of extra content to serve + jupyter_warning : bool (optional) + if True (default), then print a warning if this is used + within the Jupyter notebook + open_browser : bool (optional) + if True (default), then open a web browser to the given HTML + http_server : class (optional) + optionally specify an HTTPServer class to use for showing the + figure. The default is Python's basic HTTPServer. + **kwargs : + additional keyword arguments passed to the save() method + + """ + from ...utils.server import serve + + html = io.StringIO() + self.save(html, format="html", **kwargs) + html.seek(0) + + serve( + html.read(), + ip=ip, + port=port, + n_retries=n_retries, + files=files, + jupyter_warning=jupyter_warning, + open_browser=open_browser, + http_server=http_server, + ) + + @utils.use_signature(core.Resolve) + def _set_resolve(self, **kwargs): + """Copy the chart and update the resolve property with kwargs""" + if not hasattr(self, "resolve"): + raise ValueError( + "{} object has no attribute " "'resolve'".format(self.__class__) + ) + copy = self.copy(deep=["resolve"]) + if copy.resolve is Undefined: + copy.resolve = core.Resolve() + for key, val in kwargs.items(): + copy.resolve[key] = val + return copy + + @utils.use_signature(core.AxisResolveMap) + def resolve_axis(self, *args, **kwargs): + return self._set_resolve(axis=core.AxisResolveMap(*args, **kwargs)) + + @utils.use_signature(core.LegendResolveMap) + def resolve_legend(self, *args, **kwargs): + return self._set_resolve(legend=core.LegendResolveMap(*args, **kwargs)) + + @utils.use_signature(core.ScaleResolveMap) + def resolve_scale(self, *args, **kwargs): + return self._set_resolve(scale=core.ScaleResolveMap(*args, **kwargs)) + + +class _EncodingMixin(object): + @utils.use_signature(core.FacetedEncoding) + def encode(self, *args, **kwargs): + # 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() if v is not Undefined} + + # update with the new encodings, and apply them to the copy + encoding.update(kwargs) + copy.encoding = core.FacetedEncoding(**encoding) + return copy + + 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: + if self.data is Undefined: + raise ValueError( + "Facet charts require data to be specified at the top level." + ) + self = self.copy(deep=False) + data, self.data = self.data, Undefined + + if facet_specified: + if isinstance(facet, str): + facet = channels.Facet(facet) + else: + facet = FacetMapping(row=row, column=column) + + return FacetChart(spec=self, facet=facet, data=data, columns=columns, **kwargs) + + +class Chart( + TopLevelMixin, _EncodingMixin, mixins.MarkMethodMixin, core.TopLevelUnitSpec +): + """Create a basic Altair/Vega-Lite chart. + + Although it is possible to set all Chart properties as constructor attributes, + it is more idiomatic to use methods such as ``mark_point()``, ``encode()``, + ``transform_filter()``, ``properties()``, etc. See Altair's documentation + for details and examples: http://altair-viz.github.io/. + + Attributes + ---------- + data : Data + An object describing the data source + mark : AnyMark + A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, + `"line"`, * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a + MarkDef object. + encoding : FacetedEncoding + A key-value mapping between encoding channels and definition of fields. + autosize : anyOf(AutosizeType, AutoSizeParams) + Sets 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. `"fit"` is only supported for single and + layered views that don't use `rangeStep`. __Default value__: `pad` + background : string + CSS color property to use as the background of visualization. + + **Default value:** none (transparent) + config : Config + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + description : string + Description of this mark for commenting purpose. + height : float + The height of a visualization. + name : string + Name of the visualization for later reference. + padding : Padding + 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` + projection : Projection + An object defining properties of geographic projection. Works with `"geoshape"` + marks and `"point"` or `"line"` marks that have a channel (one or more of `"X"`, + `"X2"`, `"Y"`, `"Y2"`) with type `"latitude"`, or `"longitude"`. + selection : Mapping(required=[]) + A key-value mapping between selection names and definitions. + title : anyOf(string, TitleParams) + Title for the plot. + transform : List(Transform) + An array of data transformations such as filter and new field calculation. + width : float + The width of a visualization. + """ + + def __init__( + self, + data=Undefined, + encoding=Undefined, + mark=Undefined, + width=Undefined, + height=Undefined, + **kwargs, + ): + super(Chart, self).__init__( + data=data, + encoding=encoding, + mark=mark, + width=width, + height=height, + **kwargs, + ) + + @classmethod + def from_dict(cls, dct, validate=True): + """Construct class from a dictionary representation + + Parameters + ---------- + dct : dictionary + The dict from which to construct the class + validate : boolean + If True (default), then validate the input against the schema. + + Returns + ------- + obj : Chart object + The wrapped schema + + Raises + ------ + jsonschema.ValidationError : + if validate=True and dct does not conform to the schema + """ + for class_ in TopLevelMixin.__subclasses__(): + if class_ is Chart: + class_ = super(Chart, cls) + try: + return class_.from_dict(dct, validate=validate) + except jsonschema.ValidationError: + pass + + # 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 + + Parameters + ---------- + name : string + The selection name to use for the axes scales. This name should be + unique among all selections within the chart. + bind_x : boolean, default True + If true, then bind the interactive scales to the x-axis + bind_y : boolean, default True + If true, then bind the interactive scales to the y-axis + + Returns + ------- + chart : + copy of self, with interactive axes added + + """ + encodings = [] + if bind_x: + encodings.append("x") + if bind_y: + encodings.append("y") + return self.add_selection( + selection_interval(bind="scales", encodings=encodings) + ) + + +def _check_if_valid_subspec(spec, classname): + """Check if the spec is a valid sub-spec. + + If it is not, then raise a ValueError + """ + err = ( + 'Objects with "{0}" attribute cannot be used within {1}. ' + "Consider defining the {0} attribute in the {1} object instead." + ) + + if not isinstance(spec, (core.SchemaBase, dict)): + raise ValueError("Only chart objects can be used in {0}.".format(classname)) + for attr in TOPLEVEL_ONLY_KEYS: + if isinstance(spec, core.SchemaBase): + val = getattr(spec, attr, Undefined) + else: + val = spec.get(attr, Undefined) + if val is not Undefined: + raise ValueError(err.format(attr, classname)) + + +def _check_if_can_be_layered(spec): + """Check if the spec can be layered.""" + + def _get(spec, attr): + if isinstance(spec, core.SchemaBase): + return spec._get(attr) + else: + return spec.get(attr, Undefined) + + encoding = _get(spec, "encoding") + 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.") + 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.") + if isinstance(spec, FacetChart) or _get(spec, "facet") is not Undefined: + raise ValueError("Faceted charts cannot be layered.") + if isinstance(spec, RepeatChart) or _get(spec, "repeat") is not Undefined: + raise ValueError("Repeat charts cannot be layered.") + if isinstance(spec, ConcatChart) or _get(spec, "concat") is not Undefined: + raise ValueError("Concatenated charts cannot be layered.") + if isinstance(spec, HConcatChart) or _get(spec, "hconcat") is not Undefined: + raise ValueError("Concatenated charts cannot be layered.") + if isinstance(spec, VConcatChart) or _get(spec, "vconcat") is not Undefined: + raise ValueError("Concatenated charts cannot be layered.") + + +@utils.use_signature(core.TopLevelRepeatSpec) +class RepeatChart(TopLevelMixin, core.TopLevelRepeatSpec): + """A chart repeated across rows and columns with small changes""" + + def __init__(self, data=Undefined, spec=Undefined, repeat=Undefined, **kwargs): + _check_if_valid_subspec(spec, "RepeatChart") + super(RepeatChart, self).__init__(data=data, spec=spec, repeat=repeat, **kwargs) + + def interactive(self, name=None, bind_x=True, bind_y=True): + """Make chart axes scales interactive + + Parameters + ---------- + name : string + The selection name to use for the axes scales. This name should be + unique among all selections within the chart. + bind_x : boolean, default True + If true, then bind the interactive scales to the x-axis + bind_y : boolean, default True + If true, then bind the interactive scales to the y-axis + + Returns + ------- + chart : + copy of self, with interactive axes added + + """ + copy = self.copy(deep=False) + 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 + + The output of this should be passed to the ``field`` attribute of + a channel. + + Parameters + ---------- + repeater : {'row'|'column'|'repeat'} + The repeater to tie the field to. Default is 'repeat'. + + Returns + ------- + repeat : RepeatRef object + """ + if repeater not in ["row", "column", "repeat"]: + raise ValueError("repeater must be one of ['row', 'column', 'repeat']") + return core.RepeatRef(repeat=repeater) + + +@utils.use_signature(core.TopLevelConcatSpec) +class ConcatChart(TopLevelMixin, core.TopLevelConcatSpec): + """A chart with horizontally-concatenated facets""" + + def __init__(self, data=Undefined, concat=(), columns=Undefined, **kwargs): + # TODO: move common data to top level? + for spec in concat: + _check_if_valid_subspec(spec, "ConcatChart") + super(ConcatChart, self).__init__( + data=data, concat=list(concat), columns=columns, **kwargs + ) + self.data, self.concat = _combine_subchart_data(self.data, self.concat) + + def __ior__(self, other): + _check_if_valid_subspec(other, "ConcatChart") + self.concat.append(other) + self.data, self.concat = _combine_subchart_data(self.data, self.concat) + return self + + def __or__(self, other): + copy = self.copy(deep=["concat"]) + 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""" + return ConcatChart(concat=charts, **kwargs) + + +@utils.use_signature(core.TopLevelHConcatSpec) +class HConcatChart(TopLevelMixin, core.TopLevelHConcatSpec): + """A chart with horizontally-concatenated facets""" + + def __init__(self, data=Undefined, hconcat=(), **kwargs): + # TODO: move common data to top level? + for spec in hconcat: + _check_if_valid_subspec(spec, "HConcatChart") + super(HConcatChart, self).__init__(data=data, hconcat=list(hconcat), **kwargs) + self.data, self.hconcat = _combine_subchart_data(self.data, self.hconcat) + + def __ior__(self, other): + _check_if_valid_subspec(other, "HConcatChart") + self.hconcat.append(other) + self.data, self.hconcat = _combine_subchart_data(self.data, self.hconcat) + return self + + def __or__(self, other): + copy = self.copy(deep=["hconcat"]) + 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""" + return HConcatChart(hconcat=charts, **kwargs) + + +@utils.use_signature(core.TopLevelVConcatSpec) +class VConcatChart(TopLevelMixin, core.TopLevelVConcatSpec): + """A chart with vertically-concatenated facets""" + + def __init__(self, data=Undefined, vconcat=(), **kwargs): + # TODO: move common data to top level? + for spec in vconcat: + _check_if_valid_subspec(spec, "VConcatChart") + super(VConcatChart, self).__init__(data=data, vconcat=list(vconcat), **kwargs) + self.data, self.vconcat = _combine_subchart_data(self.data, self.vconcat) + + def __iand__(self, other): + _check_if_valid_subspec(other, "VConcatChart") + self.vconcat.append(other) + self.data, self.vconcat = _combine_subchart_data(self.data, self.vconcat) + return self + + def __and__(self, other): + copy = self.copy(deep=["vconcat"]) + 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""" + return VConcatChart(vconcat=charts, **kwargs) + + +@utils.use_signature(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? + # TODO: check for conflicting interaction + for spec in layer: + _check_if_valid_subspec(spec, "LayerChart") + _check_if_can_be_layered(spec) + super(LayerChart, self).__init__(data=data, layer=list(layer), **kwargs) + self.data, self.layer = _combine_subchart_data(self.data, self.layer) + + def __iadd__(self, other): + _check_if_valid_subspec(other, "LayerChart") + _check_if_can_be_layered(other) + self.layer.append(other) + self.data, self.layer = _combine_subchart_data(self.data, self.layer) + return self + + def __add__(self, other): + copy = self.copy(deep=["layer"]) + copy += other + return copy + + def add_layers(self, *layers): + copy = self.copy(deep=["layer"]) + for layer in layers: + copy += layer + return copy + + def interactive(self, name=None, bind_x=True, bind_y=True): + """Make chart axes scales interactive + + Parameters + ---------- + name : string + The selection name to use for the axes scales. This name should be + unique among all selections within the chart. + bind_x : boolean, default True + If true, then bind the interactive scales to the x-axis + bind_y : boolean, default True + If true, then bind the interactive scales to the y-axis + + Returns + ------- + chart : + copy of self, with interactive axes added + + """ + if not self.layer: + raise ValueError( + "LayerChart: cannot call interactive() until a " "layer is defined" + ) + copy = self.copy(deep=["layer"]) + 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[0] = copy.layer[0].add_selection(*selections) + return copy + + +def layer(*charts, **kwargs): + """layer multiple charts""" + return LayerChart(layer=charts, **kwargs) + + +@utils.use_signature(core.TopLevelFacetSpec) +class FacetChart(TopLevelMixin, core.TopLevelFacetSpec): + """A Chart with layers within a single panel""" + + def __init__(self, data=Undefined, spec=Undefined, facet=Undefined, **kwargs): + _check_if_valid_subspec(spec, "FacetChart") + super(FacetChart, self).__init__(data=data, spec=spec, facet=facet, **kwargs) + + def interactive(self, name=None, bind_x=True, bind_y=True): + """Make chart axes scales interactive + + Parameters + ---------- + name : string + The selection name to use for the axes scales. This name should be + unique among all selections within the chart. + bind_x : boolean, default True + If true, then bind the interactive scales to the x-axis + bind_y : boolean, default True + If true, then bind the interactive scales to the y-axis + + Returns + ------- + chart : + copy of self, with interactive axes added + + """ + copy = self.copy(deep=False) + 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 + + Parameters + ---------- + url : string + An URL from which to load the data set. + + feature : string + 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. + + **kwargs : + additional keywords passed to TopoDataFormat + """ + return core.UrlData( + url=url, format=core.TopoDataFormat(type="topojson", feature=feature, **kwargs) + ) + + +def _combine_subchart_data(data, subcharts): + def remove_data(subchart): + if subchart.data is not Undefined: + subchart = subchart.copy() + subchart.data = Undefined + return subchart + + if not subcharts: + # No subcharts = nothing to do. + pass + elif data is Undefined: + # Top level has no data; all subchart data must + # be identical to proceed. + subdata = subcharts[0].data + if subdata is not Undefined and all(c.data is subdata for c in subcharts): + data = subdata + subcharts = [remove_data(c) for c in subcharts] + else: + # Top level has data; subchart data must be either + # undefined or identical to proceed. + if all(c.data is Undefined or c.data is data for c in subcharts): + subcharts = [remove_data(c) for c in subcharts] + + return data, subcharts + + +@utils.use_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) + + +@utils.use_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) + + +def sphere(): + """Sphere generator.""" + return core.SphereGenerator(sphere=True) diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/data.py b/runtime/Lib/site-packages/altair/vegalite/v3/data.py new file mode 100644 index 0000000000000000000000000000000000000000..dcc8a0e7deefce36eea9208e9b5f5f90795bb7aa --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/data.py @@ -0,0 +1,43 @@ +from ..data import ( + MaxRowsError, + curry, + default_data_transformer, + limit_rows, + pipe, + sample, + to_csv, + to_json, + to_values, + DataTransformerRegistry, +) + + +# ============================================================================== +# VegaLite 3 data transformers +# ============================================================================== + + +ENTRY_POINT_GROUP = "altair.vegalite.v3.data_transformer" # type: str + + +data_transformers = DataTransformerRegistry( + entry_point_group=ENTRY_POINT_GROUP +) # type: DataTransformerRegistry +data_transformers.register("default", default_data_transformer) +data_transformers.register("json", to_json) +data_transformers.register("csv", to_csv) +data_transformers.enable("default") + + +__all__ = ( + "MaxRowsError", + "curry", + "default_data_transformer", + "limit_rows", + "pipe", + "sample", + "to_csv", + "to_json", + "to_values", + "data_transformers", +) diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/display.py b/runtime/Lib/site-packages/altair/vegalite/v3/display.py new file mode 100644 index 0000000000000000000000000000000000000000..91967310a56018c73f43990eea2040bafa485151 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/display.py @@ -0,0 +1,146 @@ +import os + +from ...utils.mimebundle import spec_to_mimebundle +from ..display import Displayable +from ..display import default_renderer_base +from ..display import json_renderer_base +from ..display import RendererRegistry +from ..display import HTMLRenderer + +from .schema import SCHEMA_VERSION + +VEGALITE_VERSION = SCHEMA_VERSION.lstrip("v") +VEGA_VERSION = "5" +VEGAEMBED_VERSION = "5" + + +# ============================================================================== +# VegaLite v3 renderer logic +# ============================================================================== + + +# The MIME type for Vega-Lite 3.x releases. +VEGALITE_MIME_TYPE = "application/vnd.vegalite.v3+json" # type: str + +# 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. +ENTRY_POINT_GROUP = "altair.vegalite.v3.renderer" # type: str + +# The display message when rendering fails +DEFAULT_DISPLAY = """\ + + +If you see this message, it means the renderer has not been properly enabled +for the frontend that you are using. For more information, see +https://altair-viz.github.io/user_guide/troubleshooting.html +""" + +renderers = RendererRegistry(entry_point_group=ENTRY_POINT_GROUP) + +here = os.path.dirname(os.path.realpath(__file__)) + + +def default_renderer(spec, **metadata): + return default_renderer_base(spec, VEGALITE_MIME_TYPE, DEFAULT_DISPLAY, **metadata) + + +def json_renderer(spec, **metadata): + return json_renderer_base(spec, DEFAULT_DISPLAY, **metadata) + + +def png_renderer(spec, **metadata): + return spec_to_mimebundle( + spec, + format="png", + mode="vega-lite", + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vegalite_version=VEGALITE_VERSION, + **metadata, + ) + + +def svg_renderer(spec, **metadata): + return spec_to_mimebundle( + spec, + format="svg", + mode="vega-lite", + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vegalite_version=VEGALITE_VERSION, + **metadata, + ) + + +colab_renderer = HTMLRenderer( + mode="vega-lite", + fullhtml=True, + requirejs=False, + output_div="altair-viz", + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vegalite_version=VEGALITE_VERSION, +) + +zeppelin_renderer = HTMLRenderer( + mode="vega-lite", + fullhtml=True, + requirejs=False, + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vegalite_version=VEGALITE_VERSION, +) + +kaggle_renderer = HTMLRenderer( + mode="vega-lite", + fullhtml=False, + requirejs=True, + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vegalite_version=VEGALITE_VERSION, +) + +html_renderer = HTMLRenderer( + mode="vega-lite", + template="universal", + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vegalite_version=VEGALITE_VERSION, +) + +renderers.register("default", default_renderer) +renderers.register("html", html_renderer) +renderers.register("jupyterlab", default_renderer) +renderers.register("nteract", default_renderer) +renderers.register("colab", colab_renderer) +renderers.register("kaggle", kaggle_renderer) +renderers.register("json", json_renderer) +renderers.register("png", png_renderer) +renderers.register("svg", svg_renderer) +renderers.register("zeppelin", zeppelin_renderer) +renderers.enable("default") + + +class VegaLite(Displayable): + """An IPython/Jupyter display class for rendering VegaLite 3.""" + + renderers = renderers + schema_path = (__name__, "schema/vega-lite-schema.json") + + +def vegalite(spec, validate=True): + """Render and optionally validate a VegaLite 3 spec. + + This will use the currently enabled renderer to render the spec. + + Parameters + ========== + spec: dict + A fully compliant VegaLite 3 spec, with the data portion fully processed. + validate: bool + Should the spec be validated against the VegaLite 3 schema? + """ + from IPython.display import display + + display(VegaLite(spec, validate=validate)) diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/schema/__init__.py b/runtime/Lib/site-packages/altair/vegalite/v3/schema/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..519d8959a155ade58d861915e66010066f993462 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/schema/__init__.py @@ -0,0 +1,5 @@ +# flake8: noqa +from .core import * +from .channels import * +SCHEMA_VERSION = 'v3.4.0' +SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v3.4.0.json' diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/schema/channels.py b/runtime/Lib/site-packages/altair/vegalite/v3/schema/channels.py new file mode 100644 index 0000000000000000000000000000000000000000..26432fa41aa87fe145344c88615c373457943521 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/schema/channels.py @@ -0,0 +1,5324 @@ +# The contents of this file are automatically written by +# tools/generate_schema_wrapper.py. Do not modify directly. + +from . import core +import pandas as pd +from altair.utils.schemapi import Undefined +from altair.utils import parse_shorthand + + +class FieldChannelMixin(object): + def to_dict(self, validate=True, ignore=(), context=None): + context = context or {} + shorthand = self._get('shorthand') + field = self._get('field') + + if shorthand is not Undefined and field is not Undefined: + 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] + + 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 + 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) + elif not (type_in_shorthand or type_defined_explicitly): + if isinstance(context.get('data', None), pd.DataFrame): + raise ValueError("{} encoding field is specified without a type; " + "the type cannot be inferred because it does not " + "match any column in the data.".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)) + else: + # Shorthand is not a string; we pass the definition to field, + # and do not do any parsing. + parsed = {'field': shorthand} + + # 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, + context=context + ) + + +class ValueChannelMixin(object): + def to_dict(self, validate=True, ignore=(), context=None): + context = context or {} + condition = getattr(self, 'condition', Undefined) + 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) + + +class DatumChannelMixin(object): + def to_dict(self, validate=True, ignore=(), context=None): + context = context or {} + datum = getattr(self, 'datum', Undefined) + 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) + + +class Color(FieldChannelMixin, core.StringFieldDefWithCondition): + """Color schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalStringValueDef`, + List(:class:`ConditionalStringValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + title=Undefined, type=Undefined, **kwds): + super(Color, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class ColorValue(ValueChannelMixin, core.StringValueDefWithCondition): + """ColorValue schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ConditionalStringValueDef`, + List(:class:`ConditionalStringValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _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) + + +class Column(FieldChannelMixin, core.FacetFieldDef): + """Column schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + header : :class:`Header` + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + **kwds): + super(Column, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + header=header, sort=sort, timeUnit=timeUnit, title=title, + type=type, **kwds) + + +class Detail(FieldChannelMixin, core.FieldDefWithoutScale): + """Detail schema wrapper + + Mapping(required=[shorthand]) + Definition object for a data field, its type and transformation of an encoding channel. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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): + super(Detail, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class Facet(FieldChannelMixin, core.FacetFieldDef): + """Facet schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + header : :class:`Header` + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + **kwds): + super(Facet, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + header=header, sort=sort, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class Fill(FieldChannelMixin, core.StringFieldDefWithCondition): + """Fill schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalStringValueDef`, + List(:class:`ConditionalStringValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + title=Undefined, type=Undefined, **kwds): + super(Fill, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class FillValue(ValueChannelMixin, core.StringValueDefWithCondition): + """FillValue schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ConditionalStringValueDef`, + List(:class:`ConditionalStringValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _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) + + +class FillOpacity(FieldChannelMixin, core.NumericFieldDefWithCondition): + """FillOpacity schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalNumberValueDef`, + List(:class:`ConditionalNumberValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + title=Undefined, type=Undefined, **kwds): + super(FillOpacity, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class FillOpacityValue(ValueChannelMixin, core.NumericValueDefWithCondition): + """FillOpacityValue schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ConditionalNumberValueDef`, + List(:class:`ConditionalNumberValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "fillOpacity" + + def __init__(self, value, condition=Undefined, **kwds): + super(FillOpacityValue, self).__init__(value=value, condition=condition, **kwds) + + +class Href(FieldChannelMixin, core.TextFieldDefWithCondition): + """Href schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDef`, List(:class:`ConditionalValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + format : string + The text formatting pattern for labels of guides (axes, legends, headers) and text + marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. + * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : enum('number', 'time') + The format type for labels ( ``"number"`` or ``"time"`` ). + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without + ``timeUnit``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + title=Undefined, type=Undefined, **kwds): + super(Href, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, + condition=condition, field=field, format=format, + formatType=formatType, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class HrefValue(ValueChannelMixin, core.TextValueDefWithCondition): + """HrefValue schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalTextFieldDef`, :class:`ConditionalValueDef`, + List(:class:`ConditionalValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : :class:`Value` + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _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) + + +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. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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): + super(Key, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class Latitude(FieldChannelMixin, core.LatLongFieldDef): + """Latitude schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 2) If both field definition's ``title`` and axis, header, or legend ``title`` are + defined, axis/header/legend title will be used. + type : enum('quantitative') + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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): + super(Latitude, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class LatitudeValue(ValueChannelMixin, core.NumberValueDef): + """LatitudeValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value of an encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + 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) + + +class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): + """Latitude2 schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, **kwds): + super(Latitude2, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class Latitude2Value(ValueChannelMixin, core.NumberValueDef): + """Latitude2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value of an encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" 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) + + +class Longitude(FieldChannelMixin, core.LatLongFieldDef): + """Longitude schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 2) If both field definition's ``title`` and axis, header, or legend ``title`` are + defined, axis/header/legend title will be used. + type : enum('quantitative') + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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): + super(Longitude, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class LongitudeValue(ValueChannelMixin, core.NumberValueDef): + """LongitudeValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value of an encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + 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) + + +class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): + """Longitude2 schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, **kwds): + super(Longitude2, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class Longitude2Value(ValueChannelMixin, core.NumberValueDef): + """Longitude2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value of an encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" 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) + + +class Opacity(FieldChannelMixin, core.NumericFieldDefWithCondition): + """Opacity schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalNumberValueDef`, + List(:class:`ConditionalNumberValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + title=Undefined, type=Undefined, **kwds): + super(Opacity, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class OpacityValue(ValueChannelMixin, core.NumericValueDefWithCondition): + """OpacityValue schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ConditionalNumberValueDef`, + List(:class:`ConditionalNumberValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _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) + + +class Order(FieldChannelMixin, core.OrderFieldDef): + """Order schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + sort : :class:`SortOrder` + The sort order. One of ``"ascending"`` (default) or ``"descending"``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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): + super(Order, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class OrderValue(ValueChannelMixin, core.NumberValueDef): + """OrderValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value of an encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + 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) + + +class Row(FieldChannelMixin, core.FacetFieldDef): + """Row schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + header : :class:`Header` + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + **kwds): + super(Row, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + header=header, sort=sort, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class Shape(FieldChannelMixin, core.ShapeFieldDefWithCondition): + """Shape schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalStringValueDef`, + List(:class:`ConditionalStringValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + title=Undefined, type=Undefined, **kwds): + super(Shape, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class ShapeValue(ValueChannelMixin, core.ShapeValueDefWithCondition): + """ShapeValue schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldDefTypeForShape`, + :class:`ConditionalStringValueDef`, List(:class:`ConditionalStringValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _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) + + +class Size(FieldChannelMixin, core.NumericFieldDefWithCondition): + """Size schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalNumberValueDef`, + List(:class:`ConditionalNumberValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + title=Undefined, type=Undefined, **kwds): + super(Size, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class SizeValue(ValueChannelMixin, core.NumericValueDefWithCondition): + """SizeValue schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ConditionalNumberValueDef`, + List(:class:`ConditionalNumberValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _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) + + +class Stroke(FieldChannelMixin, core.StringFieldDefWithCondition): + """Stroke schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalStringValueDef`, + List(:class:`ConditionalStringValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + title=Undefined, type=Undefined, **kwds): + super(Stroke, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class StrokeValue(ValueChannelMixin, core.StringValueDefWithCondition): + """StrokeValue schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ConditionalStringValueDef`, + List(:class:`ConditionalStringValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _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) + + +class StrokeOpacity(FieldChannelMixin, core.NumericFieldDefWithCondition): + """StrokeOpacity schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalNumberValueDef`, + List(:class:`ConditionalNumberValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + title=Undefined, type=Undefined, **kwds): + super(StrokeOpacity, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, + condition=condition, field=field, legend=legend, + scale=scale, sort=sort, timeUnit=timeUnit, title=title, + type=type, **kwds) + + +class StrokeOpacityValue(ValueChannelMixin, core.NumericValueDefWithCondition): + """StrokeOpacityValue schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ConditionalNumberValueDef`, + List(:class:`ConditionalNumberValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "strokeOpacity" + + def __init__(self, value, condition=Undefined, **kwds): + super(StrokeOpacityValue, self).__init__(value=value, condition=condition, **kwds) + + +class StrokeWidth(FieldChannelMixin, core.NumericFieldDefWithCondition): + """StrokeWidth schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalNumberValueDef`, + List(:class:`ConditionalNumberValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + title=Undefined, type=Undefined, **kwds): + super(StrokeWidth, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class StrokeWidthValue(ValueChannelMixin, core.NumericValueDefWithCondition): + """StrokeWidthValue schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ConditionalNumberValueDef`, + List(:class:`ConditionalNumberValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "strokeWidth" + + def __init__(self, value, condition=Undefined, **kwds): + super(StrokeWidthValue, self).__init__(value=value, condition=condition, **kwds) + + +class Text(FieldChannelMixin, core.TextFieldDefWithCondition): + """Text schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDef`, List(:class:`ConditionalValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + format : string + The text formatting pattern for labels of guides (axes, legends, headers) and text + marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. + * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : enum('number', 'time') + The format type for labels ( ``"number"`` or ``"time"`` ). + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without + ``timeUnit``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + title=Undefined, type=Undefined, **kwds): + super(Text, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, + condition=condition, field=field, format=format, + formatType=formatType, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class TextValue(ValueChannelMixin, core.TextValueDefWithCondition): + """TextValue schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalTextFieldDef`, :class:`ConditionalValueDef`, + List(:class:`ConditionalValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : :class:`Value` + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _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) + + +class Tooltip(FieldChannelMixin, core.TextFieldDefWithCondition): + """Tooltip schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDef`, List(:class:`ConditionalValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + format : string + The text formatting pattern for labels of guides (axes, legends, headers) and text + marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. + * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : enum('number', 'time') + The format type for labels ( ``"number"`` or ``"time"`` ). + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without + ``timeUnit``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + title=Undefined, type=Undefined, **kwds): + super(Tooltip, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, + condition=condition, field=field, format=format, + formatType=formatType, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class TooltipValue(ValueChannelMixin, core.TextValueDefWithCondition): + """TooltipValue schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalTextFieldDef`, :class:`ConditionalValueDef`, + List(:class:`ConditionalValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : :class:`Value` + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _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) + + +class X(FieldChannelMixin, core.PositionFieldDef): + """X schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + axis : anyOf(:class:`Axis`, None) + An object defining properties of axis's gridlines, ticks and labels. + If ``null``, the axis for the encoding channel will be removed. + + **Default value:** If undefined, default `axis properties + `__ are applied. + + **See also:** `axis `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + impute : :class:`ImputeParams` + 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 the + ``Impute`` Operation. + + **See also:** `impute `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + stack : anyOf(:class:`StackOffset`, None, boolean) + Type of stacking offset if the field should be stacked. + ``stack`` is only applicable for ``x`` and ``y`` 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: + + + * ``"zero"`` or `true`: stacking with baseline offset at zero value of the scale + (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). + * ``"normalize"`` - stacking with normalized domain (for creating `normalized + stacked bar and area charts + `__. + :raw-html:`
    ` + - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). + * ``null`` or ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar`` or ``area`` ; + (2) the stacked measure channel (x or y) has a linear scale; + (3) At least one of non-position channels mapped to an unaggregated field that is + different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(X, self).__init__(shorthand=shorthand, aggregate=aggregate, axis=axis, bin=bin, + field=field, impute=impute, scale=scale, sort=sort, stack=stack, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class XValue(ValueChannelMixin, core.XValueDef): + """XValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value of an encoding channel. + + Attributes + ---------- + + value : anyOf(float, enum('width')) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" 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) + + +class X2(FieldChannelMixin, core.SecondaryFieldDef): + """X2 schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, **kwds): + super(X2, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class X2Value(ValueChannelMixin, core.XValueDef): + """X2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value of an encoding channel. + + Attributes + ---------- + + value : anyOf(float, enum('width')) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" 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) + + +class XError(FieldChannelMixin, core.SecondaryFieldDef): + """XError schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, **kwds): + super(XError, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class XErrorValue(ValueChannelMixin, core.NumberValueDef): + """XErrorValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value of an encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" 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) + + +class XError2(FieldChannelMixin, core.SecondaryFieldDef): + """XError2 schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, **kwds): + super(XError2, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class XError2Value(ValueChannelMixin, core.NumberValueDef): + """XError2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value of an encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" 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) + + +class Y(FieldChannelMixin, core.PositionFieldDef): + """Y schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + axis : anyOf(:class:`Axis`, None) + An object defining properties of axis's gridlines, ticks and labels. + If ``null``, the axis for the encoding channel will be removed. + + **Default value:** If undefined, default `axis properties + `__ are applied. + + **See also:** `axis `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + impute : :class:`ImputeParams` + 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 the + ``Impute`` Operation. + + **See also:** `impute `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + stack : anyOf(:class:`StackOffset`, None, boolean) + Type of stacking offset if the field should be stacked. + ``stack`` is only applicable for ``x`` and ``y`` 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: + + + * ``"zero"`` or `true`: stacking with baseline offset at zero value of the scale + (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). + * ``"normalize"`` - stacking with normalized domain (for creating `normalized + stacked bar and area charts + `__. + :raw-html:`
    ` + - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). + * ``null`` or ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar`` or ``area`` ; + (2) the stacked measure channel (x or y) has a linear scale; + (3) At least one of non-position channels mapped to an unaggregated field that is + different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _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, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Y, self).__init__(shorthand=shorthand, aggregate=aggregate, axis=axis, bin=bin, + field=field, impute=impute, scale=scale, sort=sort, stack=stack, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class YValue(ValueChannelMixin, core.YValueDef): + """YValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value of an encoding channel. + + Attributes + ---------- + + value : anyOf(float, enum('height')) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" 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) + + +class Y2(FieldChannelMixin, core.SecondaryFieldDef): + """Y2 schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, **kwds): + super(Y2, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class Y2Value(ValueChannelMixin, core.YValueDef): + """Y2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value of an encoding channel. + + Attributes + ---------- + + value : anyOf(float, enum('height')) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" 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) + + +class YError(FieldChannelMixin, core.SecondaryFieldDef): + """YError schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, **kwds): + super(YError, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class YErrorValue(ValueChannelMixin, core.NumberValueDef): + """YErrorValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value of an encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" 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) + + +class YError2(FieldChannelMixin, core.SecondaryFieldDef): + """YError2 schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, **kwds): + super(YError2, self).__init__(shorthand=shorthand, aggregate=aggregate, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class YError2Value(ValueChannelMixin, core.NumberValueDef): + """YError2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value of an encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" 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) diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/schema/core.py b/runtime/Lib/site-packages/altair/vegalite/v3/schema/core.py new file mode 100644 index 0000000000000000000000000000000000000000..7c101a7cc372bdc572f483732e26a0860762fcdc --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/schema/core.py @@ -0,0 +1,16039 @@ +# The contents of this file are automatically written by +# tools/generate_schema_wrapper.py. Do not modify directly. + +from altair.utils.schemapi import SchemaBase, Undefined, _subclasses + +import pkgutil +import json + +def load_schema(): + """Load the json schema associated with this module's functions""" + return json.loads(pkgutil.get_data(__name__, 'vega-lite-schema.json').decode('utf-8')) + + +class VegaLiteSchema(SchemaBase): + _rootschema = load_schema() + @classmethod + def _default_wrapper_classes(cls): + return _subclasses(VegaLiteSchema) + + +class Root(VegaLiteSchema): + """Root schema wrapper + + anyOf(:class:`TopLevelUnitSpec`, :class:`TopLevelFacetSpec`, :class:`TopLevelLayerSpec`, + :class:`TopLevelRepeatSpec`, :class:`TopLevelConcatSpec`, :class:`TopLevelVConcatSpec`, + :class:`TopLevelHConcatSpec`) + 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): + super(Root, self).__init__(*args, **kwds) + + +class Aggregate(VegaLiteSchema): + """Aggregate schema wrapper + + anyOf(:class:`AggregateOp`, :class:`ArgmaxDef`, :class:`ArgminDef`) + """ + _schema = {'$ref': '#/definitions/Aggregate'} + + def __init__(self, *args, **kwds): + super(Aggregate, self).__init__(*args, **kwds) + + +class AggregateOp(Aggregate): + """AggregateOp schema wrapper + + enum('argmax', 'argmin', 'average', 'count', 'distinct', 'max', 'mean', 'median', 'min', + 'missing', 'q1', 'q3', 'ci0', 'ci1', 'stderr', 'stdev', 'stdevp', 'sum', 'valid', 'values', + 'variance', 'variancep') + """ + _schema = {'$ref': '#/definitions/AggregateOp'} + + def __init__(self, *args): + super(AggregateOp, self).__init__(*args) + + +class AggregatedFieldDef(VegaLiteSchema): + """AggregatedFieldDef schema wrapper + + Mapping(required=[op, as]) + + Attributes + ---------- + + op : :class:`AggregateOp` + The aggregation operation to apply to the fields (e.g., sum, average or count). + See the `full list of supported aggregation operations + `__ + for more information. + field : :class:`FieldName` + The data field for which to compute aggregate function. This is required for all + aggregation operations except ``"count"``. + as : :class:`FieldName` + The output field names to use for each aggregated field. + """ + _schema = {'$ref': '#/definitions/AggregatedFieldDef'} + + def __init__(self, op=Undefined, field=Undefined, **kwds): + super(AggregatedFieldDef, self).__init__(op=op, field=field, **kwds) + + +class Align(VegaLiteSchema): + """Align schema wrapper + + enum('left', 'center', 'right') + """ + _schema = {'$ref': '#/definitions/Align'} + + def __init__(self, *args): + super(Align, self).__init__(*args) + + +class AnyMark(VegaLiteSchema): + """AnyMark schema wrapper + + anyOf(:class:`CompositeMark`, :class:`CompositeMarkDef`, :class:`Mark`, :class:`MarkDef`) + """ + _schema = {'$ref': '#/definitions/AnyMark'} + + def __init__(self, *args, **kwds): + super(AnyMark, self).__init__(*args, **kwds) + + +class AreaConfig(VegaLiteSchema): + """AreaConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : :class:`Align` + The horizontal alignment of the text. One of ``"left"``, ``"right"``, ``"center"``. + angle : float + The rotation angle of the text, in degrees. + baseline : :class:`TextBaseline` + The vertical alignment of the text. One of ``"top"``, ``"middle"``, ``"bottom"``. + + **Default value:** ``"middle"`` + color : :class:`Color` + Default color. Note that ``fill`` and ``stroke`` have higher precedence than + ``color`` and will override ``color``. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** This property cannot be used in a `style config + `__. + cornerRadius : float + The radius in pixels of rounded rectangle corners. + + **Default value:** ``0`` + cursor : :class:`Cursor` + The mouse cursor used over the mark. Any valid `CSS cursor type + `__ can be used. + dir : :class:`Dir` + 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 : 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 : 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 : string + The ellipsis string for text truncated in response to the limit parameter. + + **Default value:** ``"…"`` + fill : :class:`Color` + Default Fill Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + fillOpacity : float + The fill opacity (value between [0,1]). + + **Default value:** ``1`` + filled : boolean + Whether the mark's color should be used as fill color instead of stroke color. + + **Default value:** ``false`` for ``point``, ``line`` and ``rule`` ; otherwise, + ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : string + The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). + fontSize : float + The font size, in pixels. + fontStyle : :class:`FontStyle` + The font style (e.g., ``"italic"`` ). + fontWeight : :class:`FontWeight` + 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 : float + Height of the marks. + href : string + A URL to load upon mouse click. If defined, the mark acts as a hyperlink. + interpolate : :class:`Interpolate` + The line interpolation method to use for line and area marks. One of the following: + + + * ``"linear"`` : piecewise linear segments, as in a polyline. + * ``"linear-closed"`` : close the linear segments to form a polygon. + * ``"step"`` : alternate between horizontal and vertical segments, as in a step + function. + * ``"step-before"`` : alternate between vertical and horizontal segments, as in a + step function. + * ``"step-after"`` : alternate between horizontal and vertical segments, as in a + step function. + * ``"basis"`` : a B-spline, with control point duplication on the ends. + * ``"basis-open"`` : an open B-spline; may not intersect the start or end. + * ``"basis-closed"`` : a closed B-spline, as in a loop. + * ``"cardinal"`` : a Cardinal spline, with control point duplication on the ends. + * ``"cardinal-open"`` : an open Cardinal spline; may not intersect the start or end, + but will intersect other control points. + * ``"cardinal-closed"`` : a closed Cardinal spline, as in a loop. + * ``"bundle"`` : equivalent to basis, except the tension parameter is used to + straighten the spline. + * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. + limit : 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`) + A flag for overlaying line on top of area marks, or an object defining the + properties of the overlayed lines. + + + If this value is an empty object ( ``{}`` ) or ``true``, lines with default + properties will be used. + + If this value is ``false``, no lines would be automatically added to area marks. + + **Default value:** ``false``. + opacity : 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. + The value is either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + 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. + point : anyOf(boolean, :class:`OverlayMarkDef`, enum('transparent')) + A flag for overlaying points on top of line or area marks, or an object defining the + properties of the overlayed points. + + + If this property is ``"transparent"``, transparent points will be used (for + enhancing tooltips and selections). + + If this property is an empty object ( ``{}`` ) or ``true``, filled points with + default properties will be used. + + If this property is ``false``, no points would be automatically added to line or + area marks. + + **Default value:** ``false``. + radius : float + Polar coordinate radial offset, in pixels, of the text label from the origin + determined by the ``x`` and ``y`` properties. + shape : string + Shape of the point marks. 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 + `__ (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.) + + **Default value:** ``"circle"`` + size : float + Default size for marks. + + + * For ``point`` / ``circle`` / ``square``, this represents the pixel area of the + marks. For example: in the case of circles, the radius is determined in part by + the square root of the size value. + * For ``bar``, this represents the band size of the bar, in pixels. + * For ``text``, this represents the font size, in pixels. + + **Default value:** ``30`` for point, circle, square marks; ``rangeStep`` - 1 for bar + marks with discrete dimensions; ``5`` for bar marks with continuous dimensions; + ``11`` for text marks. + stroke : :class:`Color` + Default Stroke Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + strokeCap : :class:`StrokeCap` + The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or + ``"square"``. + + **Default value:** ``"square"`` + strokeDash : List(float) + An array of alternating stroke, space lengths for creating dashed or dotted lines. + strokeDashOffset : float + The offset (in pixels) into which to begin drawing with the stroke dash array. + strokeJoin : :class:`StrokeJoin` + The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. + + **Default value:** ``"miter"`` + strokeMiterLimit : float + The miter limit at which to bevel a line join. + strokeOpacity : float + The stroke opacity (value between [0,1]). + + **Default value:** ``1`` + strokeWidth : float + The stroke width, in pixels. + tension : float + Depending on the interpolation type, sets the tension parameter (for line and area + marks). + text : string + Placeholder text if the ``text`` channel is not specified + theta : float + Polar coordinate angle, in radians, of the text label from the origin determined by + 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 : anyOf(:class:`Value`, :class:`TooltipContent`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``{"content": "encoding"}``, then all fields from ``encoding`` + will be used. + * If ``tooltip`` is ``{"content": "data"}``, then all fields that appear in the + highlighted data point will be used. + * If set to ``null``, then no tooltip will be used. + width : float + Width of the marks. + x : anyOf(float, enum('width')) + 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, enum('width')) + 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, enum('height')) + 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, enum('width')) + 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, baseline=Undefined, color=Undefined, + cornerRadius=Undefined, cursor=Undefined, dir=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, interpolate=Undefined, limit=Undefined, + line=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, point=Undefined, + radius=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, + strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, + strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, tension=Undefined, text=Undefined, theta=Undefined, + tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, + y2=Undefined, **kwds): + super(AreaConfig, self).__init__(align=align, angle=angle, baseline=baseline, color=color, + cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, + dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, + filled=filled, font=font, fontSize=fontSize, + fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, line=line, + opacity=opacity, order=order, orient=orient, point=point, + radius=radius, shape=shape, size=size, stroke=stroke, + strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, tension=tension, text=text, + theta=theta, tooltip=tooltip, width=width, x=x, x2=x2, y=y, + y2=y2, **kwds) + + +class ArgmaxDef(Aggregate): + """ArgmaxDef schema wrapper + + Mapping(required=[argmax]) + + Attributes + ---------- + + argmax : string + + """ + _schema = {'$ref': '#/definitions/ArgmaxDef'} + + def __init__(self, argmax=Undefined, **kwds): + super(ArgmaxDef, self).__init__(argmax=argmax, **kwds) + + +class ArgminDef(Aggregate): + """ArgminDef schema wrapper + + Mapping(required=[argmin]) + + Attributes + ---------- + + argmin : string + + """ + _schema = {'$ref': '#/definitions/ArgminDef'} + + def __init__(self, argmin=Undefined, **kwds): + super(ArgminDef, self).__init__(argmin=argmin, **kwds) + + +class AutoSizeParams(VegaLiteSchema): + """AutoSizeParams schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + contains : enum('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 + added. In contrast, the ``"padding"`` setting includes the padding within the view + size calculations, such that the width and height settings indicate the **total** + intended size of the view. + + **Default value** : ``"content"`` + resize : boolean + A boolean flag indicating if autosize layout should be re-calculated on every view + update. + + **Default value** : ``false`` + type : :class:`AutosizeType` + The sizing format type. One of ``"pad"``, ``"fit"`` or ``"none"``. See the `autosize + type `__ documentation for + descriptions of each. + + **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) + + +class AutosizeType(VegaLiteSchema): + """AutosizeType schema wrapper + + enum('pad', 'fit', 'none') + """ + _schema = {'$ref': '#/definitions/AutosizeType'} + + def __init__(self, *args): + super(AutosizeType, self).__init__(*args) + + +class Axis(VegaLiteSchema): + """Axis schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + bandPosition : 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`` + domain : boolean + A boolean flag indicating if the domain (the axis baseline) should be included as + part of the axis. + + **Default value:** ``true`` + domainColor : :class:`Color` + Color of axis domain line. + + **Default value:** ``"gray"``. + domainDash : List(float) + An array of alternating [stroke, space] lengths for dashed domain lines. + domainDashOffset : float + The pixel offset at which to start drawing with the domain dash array. + domainOpacity : float + Opacity of the axis domain line. + domainWidth : float + Stroke width of axis domain line + + **Default value:** ``1`` + format : string + The text formatting pattern for labels of guides (axes, legends, headers) and text + marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. + * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : enum('number', 'time') + The format type for labels ( ``"number"`` or ``"time"`` ). + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without + ``timeUnit``. + grid : boolean + A boolean flag indicating if grid lines should be included as part of the axis + + **Default value:** ``true`` for `continuous scales + `__ that are not + binned; otherwise, ``false``. + gridColor : :class:`Color` + Color of gridlines. + + **Default value:** ``"lightGray"``. + gridDash : List(float) + An array of alternating [stroke, space] lengths for dashed grid lines. + gridDashOffset : float + The pixel offset at which to start drawing with the grid dash array. + gridOpacity : float + The stroke opacity of grid (value between [0,1]) + + **Default value:** ``1`` + gridWidth : float + The grid width, in pixels. + + **Default value:** ``1`` + labelAlign : :class:`Align` + Horizontal text alignment of axis tick labels, overriding the default setting for + the current axis orientation. + labelAngle : float + The rotation angle of the axis labels. + + **Default value:** ``-90`` for nominal and ordinal fields; ``0`` otherwise. + labelBaseline : :class:`TextBaseline` + Vertical text baseline of axis tick labels, overriding the default setting for the + current axis orientation. Can be ``"top"``, ``"middle"``, ``"bottom"``, or + ``"alphabetic"``. + labelBound : anyOf(float, boolean) + 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 + number, it specifies the pixel tolerance: the maximum amount by which a label + bounding box may exceed the axis range. + + **Default value:** ``false``. + labelColor : :class:`Color` + The color of the tick label, can be in hex color code or regular color name. + labelFlush : anyOf(boolean, 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 + applied instead. If this property is a number, it also indicates the number of + pixels by which to offset the first and last labels; for example, a value of 2 will + flush-align the first and last labels and also push them 2 pixels outward from the + center of the axis. The additional adjustment can sometimes help the labels better + visually group with corresponding axis ticks. + + **Default value:** ``true`` for axis of a continuous x-scale. Otherwise, ``false``. + labelFlushOffset : 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 : string + The font of the tick label. + labelFontSize : float + The font size of the label, in pixels. + labelFontStyle : :class:`FontStyle` + Font style of the title. + labelFontWeight : :class:`FontWeight` + Font weight of axis tick labels. + labelLimit : float + Maximum allowed pixel width of axis tick labels. + + **Default value:** ``180`` + labelOpacity : float + The opacity of the labels. + labelOverlap : :class:`LabelOverlap` + 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 + axes). If set to ``"greedy"``, a linear scan of the labels is performed, removing + any labels that overlaps with the last visible label (this often works better for + log-scaled axes). + + **Default value:** ``true`` for non-nominal fields with non-log scales; ``"greedy"`` + for log scales; otherwise ``false``. + labelPadding : float + The padding, in pixels, between axis and text labels. + + **Default value:** ``2`` + labelSeparation : 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 + A boolean flag indicating if labels should be included as part of the axis. + + **Default value:** ``true``. + maxExtent : 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 : 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 : 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 + `__ 's + ``offset`` ( ``0`` by default) + orient : :class:`AxisOrient` + 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 : 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`` + tickColor : :class:`Color` + The color of the axis's tick. + + **Default value:** ``"gray"`` + tickCount : 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. + tickDash : List(float) + An array of alternating [stroke, space] lengths for dashed tick mark lines. + tickDashOffset : float + The pixel offset at which to start drawing with the tick mark dash array. + tickExtra : boolean + 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 : 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. + + **Default value** : ``undefined`` + tickOffset : float + Position offset in pixels to apply to ticks, labels, and gridlines. + tickOpacity : float + Opacity of the ticks. + tickRound : boolean + Boolean flag indicating if pixel position values should be rounded to the nearest + integer. + + **Default value:** ``true`` + tickSize : float + The size in pixels of axis ticks. + + **Default value:** ``5`` + tickWidth : float + The width, in pixels, of ticks. + + **Default value:** ``1`` + ticks : boolean + Boolean value that determines whether the axis should include ticks. + + **Default value:** ``true`` + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 2) If both field definition's ``title`` and axis, header, or legend ``title`` are + defined, axis/header/legend title will be used. + titleAlign : :class:`Align` + Horizontal text alignment of axis titles. + titleAnchor : :class:`TitleAnchor` + Text anchor position for placing axis titles. + titleAngle : float + Angle in degrees of axis titles. + titleBaseline : :class:`TextBaseline` + Vertical text baseline for axis titles. + titleColor : :class:`Color` + Color of the title, can be in hex color code or regular color name. + titleFont : string + Font of the title. (e.g., ``"Helvetica Neue"`` ). + titleFontSize : float + Font size of the title. + titleFontStyle : :class:`FontStyle` + Font style of the title. + titleFontWeight : :class:`FontWeight` + 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 : float + Maximum allowed pixel width of axis titles. + titleOpacity : float + Opacity of the axis title. + titlePadding : float + The padding, in pixels, between title and axis. + titleX : float + X-coordinate of the axis title relative to the axis group. + titleY : float + Y-coordinate of the axis title relative to the axis group. + values : anyOf(List(float), List(string), List(boolean), List(:class:`DateTime`)) + 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 should be drawn behind all chart elements. + To put them in front, use ``"zindex = 1"``. + + **Default value:** ``1`` (in front of the marks) for actual axis and ``0`` (behind + the marks) for grids. + """ + _schema = {'$ref': '#/definitions/Axis'} + + def __init__(self, bandPosition=Undefined, domain=Undefined, domainColor=Undefined, + domainDash=Undefined, domainDashOffset=Undefined, domainOpacity=Undefined, + domainWidth=Undefined, format=Undefined, formatType=Undefined, grid=Undefined, + gridColor=Undefined, gridDash=Undefined, gridDashOffset=Undefined, + gridOpacity=Undefined, gridWidth=Undefined, labelAlign=Undefined, labelAngle=Undefined, + labelBaseline=Undefined, labelBound=Undefined, labelColor=Undefined, + labelFlush=Undefined, labelFlushOffset=Undefined, labelFont=Undefined, + labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, + labelLimit=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, + labelPadding=Undefined, labelSeparation=Undefined, labels=Undefined, + maxExtent=Undefined, minExtent=Undefined, offset=Undefined, orient=Undefined, + position=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, + titleOpacity=Undefined, titlePadding=Undefined, titleX=Undefined, titleY=Undefined, + values=Undefined, zindex=Undefined, **kwds): + super(Axis, self).__init__(bandPosition=bandPosition, domain=domain, domainColor=domainColor, + domainDash=domainDash, domainDashOffset=domainDashOffset, + domainOpacity=domainOpacity, domainWidth=domainWidth, format=format, + formatType=formatType, grid=grid, gridColor=gridColor, + gridDash=gridDash, gridDashOffset=gridDashOffset, + gridOpacity=gridOpacity, gridWidth=gridWidth, labelAlign=labelAlign, + labelAngle=labelAngle, labelBaseline=labelBaseline, + labelBound=labelBound, labelColor=labelColor, labelFlush=labelFlush, + labelFlushOffset=labelFlushOffset, labelFont=labelFont, + labelFontSize=labelFontSize, labelFontStyle=labelFontStyle, + labelFontWeight=labelFontWeight, labelLimit=labelLimit, + labelOpacity=labelOpacity, labelOverlap=labelOverlap, + labelPadding=labelPadding, labelSeparation=labelSeparation, + labels=labels, maxExtent=maxExtent, minExtent=minExtent, + offset=offset, orient=orient, position=position, 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, titleOpacity=titleOpacity, + titlePadding=titlePadding, titleX=titleX, titleY=titleY, + values=values, zindex=zindex, **kwds) + + +class AxisConfig(VegaLiteSchema): + """AxisConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + bandPosition : 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`` + domain : boolean + A boolean flag indicating if the domain (the axis baseline) should be included as + part of the axis. + + **Default value:** ``true`` + domainColor : :class:`Color` + Color of axis domain line. + + **Default value:** ``"gray"``. + domainDash : List(float) + An array of alternating [stroke, space] lengths for dashed domain lines. + domainDashOffset : float + The pixel offset at which to start drawing with the domain dash array. + domainOpacity : float + Opacity of the axis domain line. + domainWidth : float + Stroke width of axis domain line + + **Default value:** ``1`` + grid : boolean + A boolean flag indicating if grid lines should be included as part of the axis + + **Default value:** ``true`` for `continuous scales + `__ that are not + binned; otherwise, ``false``. + gridColor : :class:`Color` + Color of gridlines. + + **Default value:** ``"lightGray"``. + gridDash : List(float) + An array of alternating [stroke, space] lengths for dashed grid lines. + gridDashOffset : float + The pixel offset at which to start drawing with the grid dash array. + gridOpacity : float + The stroke opacity of grid (value between [0,1]) + + **Default value:** ``1`` + gridWidth : float + The grid width, in pixels. + + **Default value:** ``1`` + labelAlign : :class:`Align` + Horizontal text alignment of axis tick labels, overriding the default setting for + the current axis orientation. + labelAngle : float + The rotation angle of the axis labels. + + **Default value:** ``-90`` for nominal and ordinal fields; ``0`` otherwise. + labelBaseline : :class:`TextBaseline` + Vertical text baseline of axis tick labels, overriding the default setting for the + current axis orientation. Can be ``"top"``, ``"middle"``, ``"bottom"``, or + ``"alphabetic"``. + labelBound : anyOf(float, boolean) + 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 + number, it specifies the pixel tolerance: the maximum amount by which a label + bounding box may exceed the axis range. + + **Default value:** ``false``. + labelColor : :class:`Color` + The color of the tick label, can be in hex color code or regular color name. + labelFlush : anyOf(boolean, 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 + applied instead. If this property is a number, it also indicates the number of + pixels by which to offset the first and last labels; for example, a value of 2 will + flush-align the first and last labels and also push them 2 pixels outward from the + center of the axis. The additional adjustment can sometimes help the labels better + visually group with corresponding axis ticks. + + **Default value:** ``true`` for axis of a continuous x-scale. Otherwise, ``false``. + labelFlushOffset : 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 : string + The font of the tick label. + labelFontSize : float + The font size of the label, in pixels. + labelFontStyle : :class:`FontStyle` + Font style of the title. + labelFontWeight : :class:`FontWeight` + Font weight of axis tick labels. + labelLimit : float + Maximum allowed pixel width of axis tick labels. + + **Default value:** ``180`` + labelOpacity : float + The opacity of the labels. + labelOverlap : :class:`LabelOverlap` + 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 + axes). If set to ``"greedy"``, a linear scan of the labels is performed, removing + any labels that overlaps with the last visible label (this often works better for + log-scaled axes). + + **Default value:** ``true`` for non-nominal fields with non-log scales; ``"greedy"`` + for log scales; otherwise ``false``. + labelPadding : float + The padding, in pixels, between axis and text labels. + + **Default value:** ``2`` + labelSeparation : 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 + A boolean flag indicating if labels should be included as part of the axis. + + **Default value:** ``true``. + maxExtent : 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 : 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. + orient : :class:`AxisOrient` + 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. + shortTimeLabels : boolean + Whether month names and weekday names should be abbreviated. + + **Default value:** ``false`` + tickColor : :class:`Color` + The color of the axis's tick. + + **Default value:** ``"gray"`` + tickDash : List(float) + An array of alternating [stroke, space] lengths for dashed tick mark lines. + tickDashOffset : float + The pixel offset at which to start drawing with the tick mark dash array. + tickExtra : boolean + 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``. + tickOffset : float + Position offset in pixels to apply to ticks, labels, and gridlines. + tickOpacity : float + Opacity of the ticks. + tickRound : boolean + Boolean flag indicating if pixel position values should be rounded to the nearest + integer. + + **Default value:** ``true`` + tickSize : float + The size in pixels of axis ticks. + + **Default value:** ``5`` + tickWidth : float + The width, in pixels, of ticks. + + **Default value:** ``1`` + ticks : boolean + Boolean value that determines whether the axis should include ticks. + + **Default value:** ``true`` + title : None + Set to null to disable title for the axis, legend, or header. + titleAlign : :class:`Align` + Horizontal text alignment of axis titles. + titleAnchor : :class:`TitleAnchor` + Text anchor position for placing axis titles. + titleAngle : float + Angle in degrees of axis titles. + titleBaseline : :class:`TextBaseline` + Vertical text baseline for axis titles. + titleColor : :class:`Color` + Color of the title, can be in hex color code or regular color name. + titleFont : string + Font of the title. (e.g., ``"Helvetica Neue"`` ). + titleFontSize : float + Font size of the title. + titleFontStyle : :class:`FontStyle` + Font style of the title. + titleFontWeight : :class:`FontWeight` + 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 : float + Maximum allowed pixel width of axis titles. + titleOpacity : float + Opacity of the axis title. + titlePadding : float + The padding, in pixels, between title and axis. + titleX : float + X-coordinate of the axis title relative to the axis group. + titleY : float + Y-coordinate of the axis title relative to the axis group. + """ + _schema = {'$ref': '#/definitions/AxisConfig'} + + def __init__(self, bandPosition=Undefined, domain=Undefined, domainColor=Undefined, + domainDash=Undefined, domainDashOffset=Undefined, domainOpacity=Undefined, + domainWidth=Undefined, grid=Undefined, gridColor=Undefined, gridDash=Undefined, + gridDashOffset=Undefined, gridOpacity=Undefined, gridWidth=Undefined, + labelAlign=Undefined, labelAngle=Undefined, labelBaseline=Undefined, + labelBound=Undefined, labelColor=Undefined, labelFlush=Undefined, + labelFlushOffset=Undefined, labelFont=Undefined, labelFontSize=Undefined, + labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, + labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, + labelSeparation=Undefined, labels=Undefined, maxExtent=Undefined, minExtent=Undefined, + orient=Undefined, shortTimeLabels=Undefined, tickColor=Undefined, tickDash=Undefined, + tickDashOffset=Undefined, tickExtra=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, titleOpacity=Undefined, + titlePadding=Undefined, titleX=Undefined, titleY=Undefined, **kwds): + super(AxisConfig, self).__init__(bandPosition=bandPosition, domain=domain, + domainColor=domainColor, domainDash=domainDash, + domainDashOffset=domainDashOffset, domainOpacity=domainOpacity, + domainWidth=domainWidth, grid=grid, gridColor=gridColor, + gridDash=gridDash, gridDashOffset=gridDashOffset, + gridOpacity=gridOpacity, gridWidth=gridWidth, + labelAlign=labelAlign, labelAngle=labelAngle, + labelBaseline=labelBaseline, labelBound=labelBound, + labelColor=labelColor, labelFlush=labelFlush, + labelFlushOffset=labelFlushOffset, labelFont=labelFont, + labelFontSize=labelFontSize, labelFontStyle=labelFontStyle, + labelFontWeight=labelFontWeight, labelLimit=labelLimit, + labelOpacity=labelOpacity, labelOverlap=labelOverlap, + labelPadding=labelPadding, labelSeparation=labelSeparation, + labels=labels, maxExtent=maxExtent, minExtent=minExtent, + orient=orient, shortTimeLabels=shortTimeLabels, + tickColor=tickColor, tickDash=tickDash, + tickDashOffset=tickDashOffset, tickExtra=tickExtra, + 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, titleOpacity=titleOpacity, + titlePadding=titlePadding, titleX=titleX, titleY=titleY, **kwds) + + +class AxisOrient(VegaLiteSchema): + """AxisOrient schema wrapper + + enum('top', 'bottom', 'left', 'right') + """ + _schema = {'$ref': '#/definitions/AxisOrient'} + + def __init__(self, *args): + super(AxisOrient, self).__init__(*args) + + +class AxisResolveMap(VegaLiteSchema): + """AxisResolveMap schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + x : :class:`ResolveMode` + + y : :class:`ResolveMode` + + """ + _schema = {'$ref': '#/definitions/AxisResolveMap'} + + def __init__(self, x=Undefined, y=Undefined, **kwds): + super(AxisResolveMap, self).__init__(x=x, y=y, **kwds) + + +class BaseLegendLayout(VegaLiteSchema): + """BaseLegendLayout schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + anchor : :class:`TitleAnchor` + The anchor point for legend orient group layout. + bounds : :class:`LayoutBounds` + The bounds calculation to use for legend orient group layout. + center : anyOf(boolean, :class:`SignalRef`) + A flag to center legends within a shared orient group. + direction : anyOf(:class:`Orientation`, :class:`SignalRef`) + The layout direction for legend orient group layout. + margin : anyOf(float, :class:`SignalRef`) + The pixel margin between legends within a orient group. + offset : anyOf(float, :class:`SignalRef`) + The pixel offset from the chart body for a legend orient group. + """ + _schema = {'$ref': '#/definitions/BaseLegendLayout'} + + def __init__(self, anchor=Undefined, bounds=Undefined, center=Undefined, direction=Undefined, + margin=Undefined, offset=Undefined, **kwds): + super(BaseLegendLayout, self).__init__(anchor=anchor, bounds=bounds, center=center, + direction=direction, margin=margin, offset=offset, **kwds) + + +class BaseMarkConfig(VegaLiteSchema): + """BaseMarkConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : :class:`Align` + The horizontal alignment of the text. One of ``"left"``, ``"right"``, ``"center"``. + angle : float + The rotation angle of the text, in degrees. + baseline : :class:`TextBaseline` + The vertical alignment of the text. One of ``"top"``, ``"middle"``, ``"bottom"``. + + **Default value:** ``"middle"`` + cornerRadius : float + The radius in pixels of rounded rectangle corners. + + **Default value:** ``0`` + cursor : :class:`Cursor` + The mouse cursor used over the mark. Any valid `CSS cursor type + `__ can be used. + dir : :class:`Dir` + 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 : 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 : 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 : string + The ellipsis string for text truncated in response to the limit parameter. + + **Default value:** ``"…"`` + fill : :class:`Color` + Default Fill Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + fillOpacity : float + The fill opacity (value between [0,1]). + + **Default value:** ``1`` + font : string + The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). + fontSize : float + The font size, in pixels. + fontStyle : :class:`FontStyle` + The font style (e.g., ``"italic"`` ). + fontWeight : :class:`FontWeight` + 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 : float + Height of the marks. + href : string + A URL to load upon mouse click. If defined, the mark acts as a hyperlink. + interpolate : :class:`Interpolate` + The line interpolation method to use for line and area marks. One of the following: + + + * ``"linear"`` : piecewise linear segments, as in a polyline. + * ``"linear-closed"`` : close the linear segments to form a polygon. + * ``"step"`` : alternate between horizontal and vertical segments, as in a step + function. + * ``"step-before"`` : alternate between vertical and horizontal segments, as in a + step function. + * ``"step-after"`` : alternate between horizontal and vertical segments, as in a + step function. + * ``"basis"`` : a B-spline, with control point duplication on the ends. + * ``"basis-open"`` : an open B-spline; may not intersect the start or end. + * ``"basis-closed"`` : a closed B-spline, as in a loop. + * ``"cardinal"`` : a Cardinal spline, with control point duplication on the ends. + * ``"cardinal-open"`` : an open Cardinal spline; may not intersect the start or end, + but will intersect other control points. + * ``"cardinal-closed"`` : a closed Cardinal spline, as in a loop. + * ``"bundle"`` : equivalent to basis, except the tension parameter is used to + straighten the spline. + * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. + limit : 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 + opacity : 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. + orient : :class:`Orientation` + The orientation of a non-stacked bar, tick, area, and line charts. + The value is either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + 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. + radius : float + Polar coordinate radial offset, in pixels, of the text label from the origin + determined by the ``x`` and ``y`` properties. + shape : string + Shape of the point marks. 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 + `__ (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.) + + **Default value:** ``"circle"`` + size : float + The pixel area each the point/circle/square. + For example: in the case of circles, the radius is determined in part by the square + root of the size value. + + **Default value:** ``30`` + stroke : :class:`Color` + Default Stroke Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + strokeCap : :class:`StrokeCap` + The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or + ``"square"``. + + **Default value:** ``"square"`` + strokeDash : List(float) + An array of alternating stroke, space lengths for creating dashed or dotted lines. + strokeDashOffset : float + The offset (in pixels) into which to begin drawing with the stroke dash array. + strokeJoin : :class:`StrokeJoin` + The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. + + **Default value:** ``"miter"`` + strokeMiterLimit : float + The miter limit at which to bevel a line join. + strokeOpacity : float + The stroke opacity (value between [0,1]). + + **Default value:** ``1`` + strokeWidth : float + The stroke width, in pixels. + tension : float + Depending on the interpolation type, sets the tension parameter (for line and area + marks). + text : string + Placeholder text if the ``text`` channel is not specified + theta : float + Polar coordinate angle, in radians, of the text label from the origin determined by + 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 : Any + The tooltip text to show upon mouse hover. + width : float + Width of the marks. + x : anyOf(float, enum('width')) + 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, enum('width')) + 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, enum('height')) + 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, enum('width')) + 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/BaseMarkConfig'} + + def __init__(self, align=Undefined, angle=Undefined, baseline=Undefined, cornerRadius=Undefined, + cursor=Undefined, dir=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, + fill=Undefined, fillOpacity=Undefined, font=Undefined, fontSize=Undefined, + fontStyle=Undefined, fontWeight=Undefined, height=Undefined, href=Undefined, + interpolate=Undefined, limit=Undefined, opacity=Undefined, orient=Undefined, + radius=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, + strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, + strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, tension=Undefined, text=Undefined, theta=Undefined, + tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, + y2=Undefined, **kwds): + super(BaseMarkConfig, self).__init__(align=align, angle=angle, baseline=baseline, + cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, + dy=dy, ellipsis=ellipsis, fill=fill, + fillOpacity=fillOpacity, font=font, fontSize=fontSize, + fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, + opacity=opacity, orient=orient, radius=radius, shape=shape, + size=size, stroke=stroke, strokeCap=strokeCap, + strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + tension=tension, text=text, theta=theta, tooltip=tooltip, + width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + +class BaseTitleConfig(VegaLiteSchema): + """BaseTitleConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : :class:`Align` + + anchor : :class:`TitleAnchor` + 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. + angle : float + Angle in degrees of title text. + baseline : :class:`TextBaseline` + Vertical text baseline for title text. One of ``"top"``, ``"middle"``, ``"bottom"``, + or ``"alphabetic"``. + color : :class:`Color` + Text color for title text. + dx : float + Delta offset for title text x-coordinate. + dy : float + Delta offset for title text y-coordinate. + font : string + Font name for title text. + fontSize : float + Font size in pixels for title text. + + **Default value:** ``10``. + fontStyle : :class:`FontStyle` + Font style for title text. + fontWeight : :class:`FontWeight` + 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 : :class:`TitleFrame` + 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 : float + The maximum allowed length in pixels of legend labels. + offset : float + The orthogonal offset in pixels by which to displace the title from its position + along the edge of the chart. + orient : :class:`TitleOrient` + Default title orientation ( ``"top"``, ``"bottom"``, ``"left"``, or ``"right"`` ) + """ + _schema = {'$ref': '#/definitions/BaseTitleConfig'} + + def __init__(self, align=Undefined, anchor=Undefined, angle=Undefined, baseline=Undefined, + color=Undefined, dx=Undefined, dy=Undefined, font=Undefined, fontSize=Undefined, + fontStyle=Undefined, fontWeight=Undefined, frame=Undefined, limit=Undefined, + offset=Undefined, orient=Undefined, **kwds): + super(BaseTitleConfig, self).__init__(align=align, anchor=anchor, angle=angle, + baseline=baseline, color=color, dx=dx, dy=dy, font=font, + fontSize=fontSize, fontStyle=fontStyle, + fontWeight=fontWeight, frame=frame, limit=limit, + offset=offset, orient=orient, **kwds) + + +class BinParams(VegaLiteSchema): + """BinParams schema wrapper + + Mapping(required=[]) + Binning properties or boolean flag for determining whether to bin data or not. + + Attributes + ---------- + + anchor : float + A value in the binned domain at which to anchor the bins, shifting the bin + boundaries if necessary to ensure that a boundary aligns with the anchor value. + + **Default Value:** the minimum bin extent value + base : float + The number base to use for automatic bin determination (default is base 10). + + **Default value:** ``10`` + binned : boolean + When set to true, Vega-Lite treats the input data as already binned. + divide : List(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 + method can check if bin sizes of 2 (= 10/5), 5 (= 10/2), or 1 (= 10/(5*2)) might + also satisfy the given constraints. + + **Default value:** ``[5, 2]`` + extent : List(float) + A two-element ( ``[min, max]`` ) array indicating the range of desired bin values. + maxbins : float + Maximum number of bins. + + **Default value:** ``6`` for ``row``, ``column`` and ``shape`` channels; ``10`` for + other channels + minstep : float + A minimum allowable step size (particularly useful for integer values). + nice : boolean + If true (the default), attempts to make the bin boundaries use human-friendly + boundaries, such as multiples of ten. + step : float + An exact step size to use between bins. + + **Note:** If provided, options such as maxbins will be ignored. + steps : List(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) + + +class Binding(VegaLiteSchema): + """Binding schema wrapper + + anyOf(:class:`BindCheckbox`, :class:`BindRadioSelect`, :class:`BindRange`, + :class:`InputBinding`) + """ + _schema = {'$ref': '#/definitions/Binding'} + + def __init__(self, *args, **kwds): + super(Binding, self).__init__(*args, **kwds) + + +class BindCheckbox(Binding): + """BindCheckbox schema wrapper + + Mapping(required=[input]) + + Attributes + ---------- + + input : enum('checkbox') + + debounce : float + + element : :class:`Element` + + name : string + + type : string + + """ + _schema = {'$ref': '#/definitions/BindCheckbox'} + + def __init__(self, input=Undefined, debounce=Undefined, element=Undefined, name=Undefined, + type=Undefined, **kwds): + super(BindCheckbox, self).__init__(input=input, debounce=debounce, element=element, name=name, + type=type, **kwds) + + +class BindRadioSelect(Binding): + """BindRadioSelect schema wrapper + + Mapping(required=[input, options]) + + Attributes + ---------- + + input : enum('radio', 'select') + + options : List(Any) + + debounce : float + + element : :class:`Element` + + name : string + + type : string + + """ + _schema = {'$ref': '#/definitions/BindRadioSelect'} + + def __init__(self, input=Undefined, options=Undefined, debounce=Undefined, element=Undefined, + name=Undefined, type=Undefined, **kwds): + super(BindRadioSelect, self).__init__(input=input, options=options, debounce=debounce, + element=element, name=name, type=type, **kwds) + + +class BindRange(Binding): + """BindRange schema wrapper + + Mapping(required=[input]) + + Attributes + ---------- + + input : enum('range') + + debounce : float + + element : :class:`Element` + + max : float + + min : float + + name : string + + step : float + + type : string + + """ + _schema = {'$ref': '#/definitions/BindRange'} + + def __init__(self, input=Undefined, debounce=Undefined, element=Undefined, max=Undefined, + min=Undefined, name=Undefined, step=Undefined, type=Undefined, **kwds): + super(BindRange, self).__init__(input=input, debounce=debounce, element=element, max=max, + min=min, name=name, step=step, type=type, **kwds) + + +class BoxPlotConfig(VegaLiteSchema): + """BoxPlotConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + box : anyOf(boolean, :class:`MarkConfig`) + + extent : anyOf(enum('min-max'), float) + The extent of the whiskers. Available options include: + + + * ``"min-max"`` : min and max are the lower and upper whiskers respectively. + * A number representing multiple of the interquartile range. This number will be + multiplied by the IQR to determine whisker boundary, which spans from the smallest + data to the largest data within the range *[Q1 - k * IQR, Q3 + k * IQR]* where + *Q1* and *Q3* are the first and third quartiles while *IQR* is the interquartile + range ( *Q3-Q1* ). + + **Default value:** ``1.5``. + median : anyOf(boolean, :class:`MarkConfig`) + + outliers : anyOf(boolean, :class:`MarkConfig`) + + rule : anyOf(boolean, :class:`MarkConfig`) + + size : float + Size of the box and median tick of a box plot + ticks : anyOf(boolean, :class:`MarkConfig`) + + """ + _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) + + +class BrushConfig(VegaLiteSchema): + """BrushConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + fill : :class:`Color` + The fill color of the interval mark. + + **Default value:** ``#333333`` + fillOpacity : float + The fill opacity of the interval mark (a value between 0 and 1). + + **Default value:** ``0.125`` + stroke : :class:`Color` + The stroke color of the interval mark. + + **Default value:** ``#ffffff`` + strokeDash : List(float) + An array of alternating stroke and space lengths, + for creating dashed or dotted lines. + strokeDashOffset : float + The offset (in pixels) with which to begin drawing the stroke dash array. + strokeOpacity : float + The stroke opacity of the interval mark (a value between 0 and 1). + strokeWidth : float + The stroke width of the interval mark. + """ + _schema = {'$ref': '#/definitions/BrushConfig'} + + def __init__(self, fill=Undefined, fillOpacity=Undefined, stroke=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, **kwds): + super(BrushConfig, self).__init__(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) + """ + _schema = {'$ref': '#/definitions/Color'} + + def __init__(self, *args, **kwds): + super(Color, self).__init__(*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', + 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', + 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', + 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', + 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', + 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', + 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', + 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', + 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', + 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', + 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', + 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', + 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', + 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', + 'whitesmoke', 'yellowgreen', 'rebeccapurple') + """ + _schema = {'$ref': '#/definitions/ColorName'} + + def __init__(self, *args): + super(ColorName, self).__init__(*args) + + +class CompositeMark(AnyMark): + """CompositeMark schema wrapper + + anyOf(:class:`BoxPlot`, :class:`ErrorBar`, :class:`ErrorBand`) + """ + _schema = {'$ref': '#/definitions/CompositeMark'} + + def __init__(self, *args, **kwds): + super(CompositeMark, self).__init__(*args, **kwds) + + +class BoxPlot(CompositeMark): + """BoxPlot schema wrapper + + enum('boxplot') + """ + _schema = {'$ref': '#/definitions/BoxPlot'} + + def __init__(self, *args): + super(BoxPlot, self).__init__(*args) + + +class CompositeMarkDef(AnyMark): + """CompositeMarkDef schema wrapper + + anyOf(:class:`BoxPlotDef`, :class:`ErrorBarDef`, :class:`ErrorBandDef`) + """ + _schema = {'$ref': '#/definitions/CompositeMarkDef'} + + def __init__(self, *args, **kwds): + super(CompositeMarkDef, self).__init__(*args, **kwds) + + +class BoxPlotDef(CompositeMarkDef): + """BoxPlotDef schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`BoxPlot` + 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:`MarkConfig`) + + clip : boolean + Whether a composite mark be clipped to the enclosing group’s width and height. + color : :class:`Color` + Default color. Note that ``fill`` and ``stroke`` have higher precedence than + ``color`` and will override ``color``. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** This property cannot be used in a `style config + `__. + extent : anyOf(enum('min-max'), float) + The extent of the whiskers. Available options include: + + + * ``"min-max"`` : min and max are the lower and upper whiskers respectively. + * A number representing multiple of the interquartile range. This number will be + multiplied by the IQR to determine whisker boundary, which spans from the smallest + data to the largest data within the range *[Q1 - k * IQR, Q3 + k * IQR]* where + *Q1* and *Q3* are the first and third quartiles while *IQR* is the interquartile + range ( *Q3-Q1* ). + + **Default value:** ``1.5``. + median : anyOf(boolean, :class:`MarkConfig`) + + opacity : float + The opacity (value between [0,1]) of the mark. + orient : :class:`Orientation` + 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:`MarkConfig`) + + rule : anyOf(boolean, :class:`MarkConfig`) + + size : float + Size of the box and median tick of a box plot + ticks : anyOf(boolean, :class:`MarkConfig`) + + """ + _schema = {'$ref': '#/definitions/BoxPlotDef'} + + def __init__(self, type=Undefined, box=Undefined, clip=Undefined, color=Undefined, extent=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, + median=median, opacity=opacity, orient=orient, + outliers=outliers, rule=rule, size=size, ticks=ticks, **kwds) + + +class CompositionConfig(VegaLiteSchema): + """CompositionConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to + ``hconcat`` (for ``concat`` ) and to using the ``column`` channel (for ``facet`` and + ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) + and to using the ``row`` channel (for ``facet`` and ``repeat`` ). + spacing : float + The default spacing in pixels between composed sub-views. + + **Default value** : ``20`` + """ + _schema = {'$ref': '#/definitions/CompositionConfig'} + + def __init__(self, columns=Undefined, spacing=Undefined, **kwds): + super(CompositionConfig, self).__init__(columns=columns, spacing=spacing, **kwds) + + +class ConditionalMarkPropFieldDef(VegaLiteSchema): + """ConditionalMarkPropFieldDef schema wrapper + + anyOf(:class:`ConditionalPredicateMarkPropFieldDef`, + :class:`ConditionalSelectionMarkPropFieldDef`) + """ + _schema = {'$ref': '#/definitions/ConditionalMarkPropFieldDef'} + + def __init__(self, *args, **kwds): + super(ConditionalMarkPropFieldDef, self).__init__(*args, **kwds) + + +class ConditionalMarkPropFieldDefTypeForShape(VegaLiteSchema): + """ConditionalMarkPropFieldDefTypeForShape schema wrapper + + anyOf(:class:`ConditionalPredicateMarkPropFieldDefTypeForShape`, + :class:`ConditionalSelectionMarkPropFieldDefTypeForShape`) + """ + _schema = {'$ref': '#/definitions/ConditionalMarkPropFieldDef'} + + def __init__(self, *args, **kwds): + super(ConditionalMarkPropFieldDefTypeForShape, self).__init__(*args, **kwds) + + +class ConditionalNumberValueDef(VegaLiteSchema): + """ConditionalNumberValueDef schema wrapper + + anyOf(:class:`ConditionalPredicateNumberValueDef`, + :class:`ConditionalSelectionNumberValueDef`) + """ + _schema = {'$ref': '#/definitions/ConditionalNumberValueDef'} + + def __init__(self, *args, **kwds): + super(ConditionalNumberValueDef, self).__init__(*args, **kwds) + + +class ConditionalPredicateMarkPropFieldDef(ConditionalMarkPropFieldDef): + """ConditionalPredicateMarkPropFieldDef schema wrapper + + Mapping(required=[test, type]) + + Attributes + ---------- + + test : :class:`LogicalOperandPredicate` + Predicate for triggering the condition + type : :class:`StandardType` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/ConditionalPredicate'} + + def __init__(self, test=Undefined, type=Undefined, aggregate=Undefined, bin=Undefined, + field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, + title=Undefined, **kwds): + super(ConditionalPredicateMarkPropFieldDef, self).__init__(test=test, type=type, + aggregate=aggregate, bin=bin, + field=field, legend=legend, + scale=scale, sort=sort, + timeUnit=timeUnit, title=title, + **kwds) + + +class ConditionalPredicateMarkPropFieldDefTypeForShape(ConditionalMarkPropFieldDefTypeForShape): + """ConditionalPredicateMarkPropFieldDefTypeForShape schema wrapper + + Mapping(required=[test, type]) + + Attributes + ---------- + + test : :class:`LogicalOperandPredicate` + Predicate for triggering the condition + type : :class:`TypeForShape` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/ConditionalPredicate>'} + + def __init__(self, test=Undefined, type=Undefined, aggregate=Undefined, bin=Undefined, + field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, + title=Undefined, **kwds): + super(ConditionalPredicateMarkPropFieldDefTypeForShape, self).__init__(test=test, type=type, + aggregate=aggregate, + bin=bin, field=field, + legend=legend, + scale=scale, sort=sort, + timeUnit=timeUnit, + title=title, **kwds) + + +class ConditionalPredicateNumberValueDef(ConditionalNumberValueDef): + """ConditionalPredicateNumberValueDef schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`LogicalOperandPredicate` + Predicate for triggering the condition + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateNumberValueDef, self).__init__(test=test, value=value, **kwds) + + +class ConditionalSelectionMarkPropFieldDef(ConditionalMarkPropFieldDef): + """ConditionalSelectionMarkPropFieldDef schema wrapper + + Mapping(required=[selection, type]) + + Attributes + ---------- + + selection : :class:`SelectionOperand` + A `selection name `__, or a + series of `composed selections + `__. + type : :class:`StandardType` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/ConditionalSelection'} + + def __init__(self, selection=Undefined, type=Undefined, aggregate=Undefined, bin=Undefined, + field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, + title=Undefined, **kwds): + super(ConditionalSelectionMarkPropFieldDef, self).__init__(selection=selection, type=type, + aggregate=aggregate, bin=bin, + field=field, legend=legend, + scale=scale, sort=sort, + timeUnit=timeUnit, title=title, + **kwds) + + +class ConditionalSelectionMarkPropFieldDefTypeForShape(ConditionalMarkPropFieldDefTypeForShape): + """ConditionalSelectionMarkPropFieldDefTypeForShape schema wrapper + + Mapping(required=[selection, type]) + + Attributes + ---------- + + selection : :class:`SelectionOperand` + A `selection name `__, or a + series of `composed selections + `__. + type : :class:`TypeForShape` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/ConditionalSelection>'} + + def __init__(self, selection=Undefined, type=Undefined, aggregate=Undefined, bin=Undefined, + field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, + title=Undefined, **kwds): + super(ConditionalSelectionMarkPropFieldDefTypeForShape, self).__init__(selection=selection, + type=type, + aggregate=aggregate, + bin=bin, field=field, + legend=legend, + scale=scale, sort=sort, + timeUnit=timeUnit, + title=title, **kwds) + + +class ConditionalSelectionNumberValueDef(ConditionalNumberValueDef): + """ConditionalSelectionNumberValueDef schema wrapper + + Mapping(required=[selection, value]) + + Attributes + ---------- + + selection : :class:`SelectionOperand` + A `selection name `__, or a + series of `composed selections + `__. + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalSelection'} + + def __init__(self, selection=Undefined, value=Undefined, **kwds): + super(ConditionalSelectionNumberValueDef, self).__init__(selection=selection, value=value, + **kwds) + + +class ConditionalStringValueDef(VegaLiteSchema): + """ConditionalStringValueDef schema wrapper + + anyOf(:class:`ConditionalPredicateStringValueDef`, + :class:`ConditionalSelectionStringValueDef`) + """ + _schema = {'$ref': '#/definitions/ConditionalStringValueDef'} + + def __init__(self, *args, **kwds): + super(ConditionalStringValueDef, self).__init__(*args, **kwds) + + +class ConditionalPredicateStringValueDef(ConditionalStringValueDef): + """ConditionalPredicateStringValueDef schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`LogicalOperandPredicate` + Predicate for triggering the condition + value : anyOf(string, None) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateStringValueDef, self).__init__(test=test, value=value, **kwds) + + +class ConditionalSelectionStringValueDef(ConditionalStringValueDef): + """ConditionalSelectionStringValueDef schema wrapper + + Mapping(required=[selection, value]) + + Attributes + ---------- + + selection : :class:`SelectionOperand` + A `selection name `__, or a + series of `composed selections + `__. + value : anyOf(string, None) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalSelection'} + + def __init__(self, selection=Undefined, value=Undefined, **kwds): + super(ConditionalSelectionStringValueDef, self).__init__(selection=selection, value=value, + **kwds) + + +class ConditionalTextFieldDef(VegaLiteSchema): + """ConditionalTextFieldDef schema wrapper + + anyOf(:class:`ConditionalPredicateTextFieldDef`, :class:`ConditionalSelectionTextFieldDef`) + """ + _schema = {'$ref': '#/definitions/ConditionalTextFieldDef'} + + def __init__(self, *args, **kwds): + super(ConditionalTextFieldDef, self).__init__(*args, **kwds) + + +class ConditionalPredicateTextFieldDef(ConditionalTextFieldDef): + """ConditionalPredicateTextFieldDef schema wrapper + + Mapping(required=[test, type]) + + Attributes + ---------- + + test : :class:`LogicalOperandPredicate` + Predicate for triggering the condition + type : :class:`StandardType` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + format : string + The text formatting pattern for labels of guides (axes, legends, headers) and text + marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. + * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : enum('number', 'time') + The format type for labels ( ``"number"`` or ``"time"`` ). + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without + ``timeUnit``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/ConditionalPredicate'} + + def __init__(self, test=Undefined, type=Undefined, aggregate=Undefined, bin=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, timeUnit=Undefined, + title=Undefined, **kwds): + super(ConditionalPredicateTextFieldDef, self).__init__(test=test, type=type, + aggregate=aggregate, bin=bin, + field=field, format=format, + formatType=formatType, timeUnit=timeUnit, + title=title, **kwds) + + +class ConditionalSelectionTextFieldDef(ConditionalTextFieldDef): + """ConditionalSelectionTextFieldDef schema wrapper + + Mapping(required=[selection, type]) + + Attributes + ---------- + + selection : :class:`SelectionOperand` + A `selection name `__, or a + series of `composed selections + `__. + type : :class:`StandardType` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + format : string + The text formatting pattern for labels of guides (axes, legends, headers) and text + marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. + * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : enum('number', 'time') + The format type for labels ( ``"number"`` or ``"time"`` ). + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without + ``timeUnit``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/ConditionalSelection'} + + def __init__(self, selection=Undefined, type=Undefined, aggregate=Undefined, bin=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, timeUnit=Undefined, + title=Undefined, **kwds): + super(ConditionalSelectionTextFieldDef, self).__init__(selection=selection, type=type, + aggregate=aggregate, bin=bin, + field=field, format=format, + formatType=formatType, timeUnit=timeUnit, + title=title, **kwds) + + +class ConditionalValueDef(VegaLiteSchema): + """ConditionalValueDef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDef`, :class:`ConditionalSelectionValueDef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDef(ConditionalValueDef): + """ConditionalPredicateValueDef schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`LogicalOperandPredicate` + Predicate for triggering the condition + value : :class:`Value` + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDef, self).__init__(test=test, value=value, **kwds) + + +class ConditionalSelectionValueDef(ConditionalValueDef): + """ConditionalSelectionValueDef schema wrapper + + Mapping(required=[selection, value]) + + Attributes + ---------- + + selection : :class:`SelectionOperand` + A `selection name `__, or a + series of `composed selections + `__. + value : :class:`Value` + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalSelection'} + + def __init__(self, selection=Undefined, value=Undefined, **kwds): + super(ConditionalSelectionValueDef, self).__init__(selection=selection, value=value, **kwds) + + +class Config(VegaLiteSchema): + """Config schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + area : :class:`AreaConfig` + Area-Specific Config + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + Sets 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. + ``"fit"`` is only supported for single and layered views that don't use + ``rangeStep``. + + **Default value** : ``pad`` + axis : :class:`AxisConfig` + Axis configuration, which determines default properties for all ``x`` and ``y`` + `axes `__. For a full list of axis + configuration options, please see the `corresponding section of the axis + documentation `__. + axisBand : :class:`AxisConfig` + Specific axis config for axes with "band" scales. + axisBottom : :class:`AxisConfig` + Specific axis config for x-axis along the bottom edge of the chart. + axisLeft : :class:`AxisConfig` + Specific axis config for y-axis along the left edge of the chart. + axisRight : :class:`AxisConfig` + Specific axis config for y-axis along the right edge of the chart. + axisTop : :class:`AxisConfig` + Specific axis config for x-axis along the top edge of the chart. + axisX : :class:`AxisConfig` + X-axis specific config. + axisY : :class:`AxisConfig` + Y-axis specific config. + background : string + CSS color property to use as the background of the whole Vega-Lite view + + **Default value:** none (transparent) + bar : :class:`RectConfig` + Bar-Specific Config + boxplot : :class:`BoxPlotConfig` + Box Config + circle : :class:`MarkConfig` + Circle-Specific Config + concat : :class:`CompositionConfig` + Default configuration for all concatenation view composition operators ( ``concat``, + ``hconcat``, and ``vconcat`` ) + countTitle : string + Default axis and legend title for count fields. + + **Default value:** ``'Count of Records``. + errorband : :class:`ErrorBandConfig` + ErrorBand Config + errorbar : :class:`ErrorBarConfig` + ErrorBar Config + facet : :class:`CompositionConfig` + Default configuration for the ``facet`` view composition operator + fieldTitle : enum('verbal', 'functional', 'plain') + Defines how Vega-Lite generates title for fields. There are three possible styles: + + + * ``"verbal"`` (Default) - displays function in a verbal style (e.g., "Sum of + field", "Year-month of date", "field (binned)"). + * ``"function"`` - displays function using parentheses and capitalized texts (e.g., + "SUM(field)", "YEARMONTH(date)", "BIN(field)"). + * ``"plain"`` - displays only the field name without functions (e.g., "field", + "date", "field"). + geoshape : :class:`MarkConfig` + Geoshape-Specific Config + header : :class:`HeaderConfig` + Header configuration, which determines default properties for all `headers + `__. + + For a full list of header configuration options, please see the `corresponding + section of in the header documentation + `__. + headerColumn : :class:`HeaderConfig` + Header configuration, which determines default properties for column `headers + `__. + + For a full list of header configuration options, please see the `corresponding + section of in the header documentation + `__. + headerFacet : :class:`HeaderConfig` + Header configuration, which determines default properties for non-row/column facet + `headers `__. + + For a full list of header configuration options, please see the `corresponding + section of in the header documentation + `__. + headerRow : :class:`HeaderConfig` + Header configuration, which determines default properties for row `headers + `__. + + For a full list of header configuration options, please see the `corresponding + section of in the header documentation + `__. + invalidValues : enum('filter', None) + Defines how Vega-Lite should handle invalid values ( ``null`` and ``NaN`` ). + + + * If set to ``"filter"`` (default), all data items with null values will be skipped + (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. + legend : :class:`LegendConfig` + Legend configuration, which determines default properties for all `legends + `__. For a full list of legend + configuration options, please see the `corresponding section of in the legend + documentation `__. + line : :class:`LineConfig` + Line-Specific Config + mark : :class:`MarkConfig` + Mark Config + numberFormat : string + D3 Number format for guide labels and text marks. For example "s" for SI units. Use + `D3's number format pattern `__. + padding : :class:`Padding` + 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`` + point : :class:`MarkConfig` + Point-Specific Config + projection : :class:`ProjectionConfig` + Projection configuration, which determines default properties for all `projections + `__. For a full list of + projection configuration options, please see the `corresponding section of the + projection documentation + `__. + range : :class:`RangeConfig` + 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 + `__. + rect : :class:`RectConfig` + Rect-Specific Config + repeat : :class:`CompositionConfig` + Default configuration for the ``repeat`` view composition operator + rule : :class:`MarkConfig` + Rule-Specific Config + scale : :class:`ScaleConfig` + Scale configuration determines default properties for all `scales + `__. For a full list of scale + configuration options, please see the `corresponding section of the scale + documentation `__. + selection : :class:`SelectionConfig` + An object hash for defining default properties for each type of selections. + square : :class:`MarkConfig` + Square-Specific Config + stack : :class:`StackOffset` + Default stack offset for stackable mark. + style : :class:`StyleConfigIndex` + An object hash that defines key-value mappings to determine default properties for + marks with a given `style + `__. The keys represent + styles names; the values have to be valid `mark configuration objects + `__. + text : :class:`TextConfig` + Text-Specific Config + tick : :class:`TickConfig` + Tick-Specific Config + timeFormat : string + 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 format each label automatically so this + config would not affect axes. + title : :class:`TitleConfig` + Title configuration, which determines default properties for all `titles + `__. For a full list of title + configuration options, please see the `corresponding section of the title + documentation `__. + trail : :class:`LineConfig` + Trail-Specific Config + view : :class:`ViewConfig` + Default properties for `single view plots + `__. + """ + _schema = {'$ref': '#/definitions/Config'} + + def __init__(self, area=Undefined, autosize=Undefined, axis=Undefined, axisBand=Undefined, + axisBottom=Undefined, axisLeft=Undefined, axisRight=Undefined, axisTop=Undefined, + axisX=Undefined, axisY=Undefined, background=Undefined, bar=Undefined, + boxplot=Undefined, circle=Undefined, concat=Undefined, countTitle=Undefined, + errorband=Undefined, errorbar=Undefined, facet=Undefined, fieldTitle=Undefined, + geoshape=Undefined, header=Undefined, headerColumn=Undefined, headerFacet=Undefined, + headerRow=Undefined, invalidValues=Undefined, legend=Undefined, line=Undefined, + mark=Undefined, numberFormat=Undefined, padding=Undefined, point=Undefined, + projection=Undefined, range=Undefined, rect=Undefined, repeat=Undefined, + rule=Undefined, scale=Undefined, selection=Undefined, square=Undefined, + stack=Undefined, style=Undefined, text=Undefined, tick=Undefined, timeFormat=Undefined, + title=Undefined, trail=Undefined, view=Undefined, **kwds): + super(Config, self).__init__(area=area, autosize=autosize, axis=axis, axisBand=axisBand, + axisBottom=axisBottom, axisLeft=axisLeft, axisRight=axisRight, + axisTop=axisTop, axisX=axisX, axisY=axisY, background=background, + bar=bar, boxplot=boxplot, circle=circle, concat=concat, + countTitle=countTitle, errorband=errorband, errorbar=errorbar, + facet=facet, fieldTitle=fieldTitle, geoshape=geoshape, + header=header, headerColumn=headerColumn, headerFacet=headerFacet, + headerRow=headerRow, invalidValues=invalidValues, legend=legend, + line=line, mark=mark, numberFormat=numberFormat, padding=padding, + point=point, projection=projection, range=range, rect=rect, + repeat=repeat, rule=rule, scale=scale, selection=selection, + square=square, stack=stack, style=style, text=text, tick=tick, + timeFormat=timeFormat, title=title, 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') + """ + _schema = {'$ref': '#/definitions/Cursor'} + + def __init__(self, *args): + super(Cursor, self).__init__(*args) + + +class Data(VegaLiteSchema): + """Data schema wrapper + + anyOf(:class:`DataSource`, :class:`Generator`) + """ + _schema = {'$ref': '#/definitions/Data'} + + def __init__(self, *args, **kwds): + super(Data, self).__init__(*args, **kwds) + + +class DataFormat(VegaLiteSchema): + """DataFormat schema wrapper + + anyOf(:class:`CsvDataFormat`, :class:`DsvDataFormat`, :class:`JsonDataFormat`, + :class:`TopoDataFormat`) + """ + _schema = {'$ref': '#/definitions/DataFormat'} + + def __init__(self, *args, **kwds): + super(DataFormat, self).__init__(*args, **kwds) + + +class CsvDataFormat(DataFormat): + """CsvDataFormat schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + parse : anyOf(:class:`Parse`, 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 name, and the value to the + desired data type (one of ``"number"``, ``"boolean"``, ``"date"``, or null (do not + parse the field)). + For example, ``"parse": {"modified_on": "date"}`` parses the ``modified_on`` field + in each input record a Date value. + + For ``"date"``, we parse data based using Javascript's `Date.parse() + `__. + For Specific date formats can be provided (e.g., ``{foo: "date:'%m%d%Y'"}`` ), using + the `d3-time-format syntax `__. + UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). + See more about `UTC time + `__ + type : enum('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): + super(CsvDataFormat, self).__init__(parse=parse, type=type, **kwds) + + +class DataSource(Data): + """DataSource schema wrapper + + anyOf(:class:`UrlData`, :class:`InlineData`, :class:`NamedData`) + """ + _schema = {'$ref': '#/definitions/DataSource'} + + def __init__(self, *args, **kwds): + super(DataSource, self).__init__(*args, **kwds) + + +class Datasets(VegaLiteSchema): + """Datasets schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Datasets'} + + def __init__(self, **kwds): + super(Datasets, self).__init__(**kwds) + + +class Day(VegaLiteSchema): + """Day schema wrapper + + float + """ + _schema = {'$ref': '#/definitions/Day'} + + def __init__(self, *args): + super(Day, self).__init__(*args) + + +class DictInlineDataset(VegaLiteSchema): + """DictInlineDataset schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Dict'} + + def __init__(self, **kwds): + super(DictInlineDataset, self).__init__(**kwds) + + +class Dir(VegaLiteSchema): + """Dir schema wrapper + + enum('ltr', 'rtl') + """ + _schema = {'$ref': '#/definitions/Dir'} + + def __init__(self, *args): + super(Dir, self).__init__(*args) + + +class DsvDataFormat(DataFormat): + """DsvDataFormat schema wrapper + + Mapping(required=[delimiter]) + + Attributes + ---------- + + delimiter : string + 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) + 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 name, and the value to the + desired data type (one of ``"number"``, ``"boolean"``, ``"date"``, or null (do not + parse the field)). + For example, ``"parse": {"modified_on": "date"}`` parses the ``modified_on`` field + in each input record a Date value. + + For ``"date"``, we parse data based using Javascript's `Date.parse() + `__. + For Specific date formats can be provided (e.g., ``{foo: "date:'%m%d%Y'"}`` ), using + the `d3-time-format syntax `__. + UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). + See more about `UTC time + `__ + type : enum('dsv') + 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) + + +class Element(VegaLiteSchema): + """Element schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/Element'} + + def __init__(self, *args): + super(Element, self).__init__(*args) + + +class Encoding(VegaLiteSchema): + """Encoding schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + color : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + 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 + `__ '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. If either ``fill`` or ``stroke`` channel + is specified, ``color`` channel will be ignored. + 2) See the scale documentation for more information about customizing `color scheme + `__. + detail : anyOf(:class:`FieldDefWithoutScale`, List(:class:`FieldDefWithoutScale`)) + 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 : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + Fill color of the marks. + **Default value:** If undefined, the default color depends on `mark config + `__ 's ``color`` property. + + *Note:* When using ``fill`` channel, ``color`` channel will be ignored. To customize + both fill and stroke, please use ``fill`` and ``stroke`` channels (not ``fill`` and + ``color`` ). + fillOpacity : anyOf(:class:`NumericFieldDefWithCondition`, + :class:`NumericValueDefWithCondition`) + Fill opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's ``fillOpacity`` + property. + href : anyOf(:class:`TextFieldDefWithCondition`, :class:`TextValueDefWithCondition`) + A URL to load upon mouse click. + key : :class:`FieldDefWithoutScale` + 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 : anyOf(:class:`LatLongFieldDef`, :class:`NumberValueDef`) + Latitude position of geographically projected marks. + latitude2 : anyOf(:class:`SecondaryFieldDef`, :class:`NumberValueDef`) + Latitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, + ``"rect"``, and ``"rule"``. + longitude : anyOf(:class:`LatLongFieldDef`, :class:`NumberValueDef`) + Longitude position of geographically projected marks. + longitude2 : anyOf(:class:`SecondaryFieldDef`, :class:`NumberValueDef`) + Longitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, + ``"rect"``, and ``"rule"``. + opacity : anyOf(:class:`NumericFieldDefWithCondition`, + :class:`NumericValueDefWithCondition`) + Opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's ``opacity`` property. + order : anyOf(:class:`OrderFieldDef`, List(:class:`OrderFieldDef`), :class:`NumberValueDef`) + Order of the marks. + + + * For stacked marks, this ``order`` channel encodes `stack 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 + `__. + 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. + shape : anyOf(:class:`ShapeFieldDefWithCondition`, :class:`ShapeValueDefWithCondition`) + 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 + `__ (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 + `__ 's ``shape`` + property. ( ``"circle"`` if unset.) + size : anyOf(:class:`NumericFieldDefWithCondition`, :class:`NumericValueDefWithCondition`) + 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 : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + Stroke color of the marks. + **Default value:** If undefined, the default color depends on `mark config + `__ 's ``color`` property. + + *Note:* When using ``stroke`` channel, ``color`` channel will be ignored. To + customize both stroke and fill, please use ``stroke`` and ``fill`` channels (not + ``stroke`` and ``color`` ). + strokeOpacity : anyOf(:class:`NumericFieldDefWithCondition`, + :class:`NumericValueDefWithCondition`) + Stroke opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's ``strokeOpacity`` + property. + strokeWidth : anyOf(:class:`NumericFieldDefWithCondition`, + :class:`NumericValueDefWithCondition`) + Stroke width of the marks. + + **Default value:** If undefined, the default stroke width depends on `mark config + `__ 's ``strokeWidth`` + property. + text : anyOf(:class:`TextFieldDefWithCondition`, :class:`TextValueDefWithCondition`) + Text of the ``text`` mark. + tooltip : anyOf(:class:`TextFieldDefWithCondition`, :class:`TextValueDefWithCondition`, + List(:class:`TextFieldDef`), None) + The tooltip text to show upon mouse hover. + x : anyOf(:class:`PositionFieldDef`, :class:`XValueDef`) + 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(:class:`SecondaryFieldDef`, :class:`XValueDef`) + 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:`NumberValueDef`) + Error value of x coordinates for error specified ``"errorbar"`` and ``"errorband"``. + xError2 : anyOf(:class:`SecondaryFieldDef`, :class:`NumberValueDef`) + Secondary error value of x coordinates for error specified ``"errorbar"`` and + ``"errorband"``. + y : anyOf(:class:`PositionFieldDef`, :class:`YValueDef`) + 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(:class:`SecondaryFieldDef`, :class:`YValueDef`) + 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:`NumberValueDef`) + Error value of y coordinates for error specified ``"errorbar"`` and ``"errorband"``. + yError2 : anyOf(:class:`SecondaryFieldDef`, :class:`NumberValueDef`) + Secondary error value of y coordinates for error specified ``"errorbar"`` and + ``"errorband"``. + """ + _schema = {'$ref': '#/definitions/Encoding'} + + def __init__(self, color=Undefined, detail=Undefined, fill=Undefined, fillOpacity=Undefined, + href=Undefined, key=Undefined, latitude=Undefined, latitude2=Undefined, + longitude=Undefined, longitude2=Undefined, opacity=Undefined, order=Undefined, + shape=Undefined, size=Undefined, stroke=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, text=Undefined, tooltip=Undefined, x=Undefined, x2=Undefined, + xError=Undefined, xError2=Undefined, y=Undefined, y2=Undefined, yError=Undefined, + yError2=Undefined, **kwds): + super(Encoding, self).__init__(color=color, detail=detail, fill=fill, fillOpacity=fillOpacity, + href=href, key=key, latitude=latitude, latitude2=latitude2, + longitude=longitude, longitude2=longitude2, opacity=opacity, + order=order, shape=shape, size=size, stroke=stroke, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, text=text, + tooltip=tooltip, x=x, x2=x2, xError=xError, xError2=xError2, y=y, + y2=y2, yError=yError, yError2=yError2, **kwds) + + +class ErrorBand(CompositeMark): + """ErrorBand schema wrapper + + enum('errorband') + """ + _schema = {'$ref': '#/definitions/ErrorBand'} + + def __init__(self, *args): + super(ErrorBand, self).__init__(*args) + + +class ErrorBandConfig(VegaLiteSchema): + """ErrorBandConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : anyOf(boolean, :class:`MarkConfig`) + + borders : anyOf(boolean, :class:`MarkConfig`) + + extent : :class:`ErrorBarExtent` + The extent of the band. Available options include: + + + * ``"ci"`` : Extend the band to the confidence interval of the mean. + * ``"stderr"`` : The size of band are set to the value of standard error, extending + from the mean. + * ``"stdev"`` : The size of band are set to the value of standard deviation, + extending from the mean. + * ``"iqr"`` : Extend the band to the q1 and q3. + + **Default value:** ``"stderr"``. + interpolate : :class:`Interpolate` + The line interpolation method for the error band. One of the following: + + + * ``"linear"`` : piecewise linear segments, as in a polyline. + * ``"linear-closed"`` : close the linear segments to form a polygon. + * ``"step"`` : a piecewise constant function (a step function) consisting of + alternating horizontal and vertical lines. The y-value changes at the midpoint of + each pair of adjacent x-values. + * ``"step-before"`` : a piecewise constant function (a step function) consisting of + alternating horizontal and vertical lines. The y-value changes before the x-value. + * ``"step-after"`` : a piecewise constant function (a step function) consisting of + alternating horizontal and vertical lines. The y-value changes after the x-value. + * ``"basis"`` : a B-spline, with control point duplication on the ends. + * ``"basis-open"`` : an open B-spline; may not intersect the start or end. + * ``"basis-closed"`` : a closed B-spline, as in a loop. + * ``"cardinal"`` : a Cardinal spline, with control point duplication on the ends. + * ``"cardinal-open"`` : an open Cardinal spline; may not intersect the start or end, + but will intersect other control points. + * ``"cardinal-closed"`` : a closed Cardinal spline, as in a loop. + * ``"bundle"`` : equivalent to basis, except the tension parameter is used to + straighten the spline. + * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. + 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) + + +class ErrorBandDef(CompositeMarkDef): + """ErrorBandDef schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`ErrorBand` + 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:`MarkConfig`) + + borders : anyOf(boolean, :class:`MarkConfig`) + + clip : boolean + Whether a composite mark be clipped to the enclosing group’s width and height. + color : :class:`Color` + Default color. Note that ``fill`` and ``stroke`` have higher precedence than + ``color`` and will override ``color``. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** This property cannot be used in a `style config + `__. + extent : :class:`ErrorBarExtent` + The extent of the band. Available options include: + + + * ``"ci"`` : Extend the band to the confidence interval of the mean. + * ``"stderr"`` : The size of band are set to the value of standard error, extending + from the mean. + * ``"stdev"`` : The size of band are set to the value of standard deviation, + extending from the mean. + * ``"iqr"`` : Extend the band to the q1 and q3. + + **Default value:** ``"stderr"``. + interpolate : :class:`Interpolate` + The line interpolation method for the error band. One of the following: + + + * ``"linear"`` : piecewise linear segments, as in a polyline. + * ``"linear-closed"`` : close the linear segments to form a polygon. + * ``"step"`` : a piecewise constant function (a step function) consisting of + alternating horizontal and vertical lines. The y-value changes at the midpoint of + each pair of adjacent x-values. + * ``"step-before"`` : a piecewise constant function (a step function) consisting of + alternating horizontal and vertical lines. The y-value changes before the x-value. + * ``"step-after"`` : a piecewise constant function (a step function) consisting of + alternating horizontal and vertical lines. The y-value changes after the x-value. + * ``"basis"`` : a B-spline, with control point duplication on the ends. + * ``"basis-open"`` : an open B-spline; may not intersect the start or end. + * ``"basis-closed"`` : a closed B-spline, as in a loop. + * ``"cardinal"`` : a Cardinal spline, with control point duplication on the ends. + * ``"cardinal-open"`` : an open Cardinal spline; may not intersect the start or end, + but will intersect other control points. + * ``"cardinal-closed"`` : a closed Cardinal spline, as in a loop. + * ``"bundle"`` : equivalent to basis, except the tension parameter is used to + straighten the spline. + * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. + opacity : float + The opacity (value between [0,1]) of the mark. + orient : :class:`Orientation` + 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) + + +class ErrorBar(CompositeMark): + """ErrorBar schema wrapper + + enum('errorbar') + """ + _schema = {'$ref': '#/definitions/ErrorBar'} + + def __init__(self, *args): + super(ErrorBar, self).__init__(*args) + + +class ErrorBarConfig(VegaLiteSchema): + """ErrorBarConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + extent : :class:`ErrorBarExtent` + The extent of the rule. Available options include: + + + * ``"ci"`` : Extend the rule to the confidence interval of the mean. + * ``"stderr"`` : The size of rule are set to the value of standard error, extending + from the mean. + * ``"stdev"`` : The size of rule are set to the value of standard deviation, + extending from the mean. + * ``"iqr"`` : Extend the rule to the q1 and q3. + + **Default value:** ``"stderr"``. + rule : anyOf(boolean, :class:`MarkConfig`) + + ticks : anyOf(boolean, :class:`MarkConfig`) + + """ + _schema = {'$ref': '#/definitions/ErrorBarConfig'} + + def __init__(self, extent=Undefined, rule=Undefined, ticks=Undefined, **kwds): + super(ErrorBarConfig, self).__init__(extent=extent, rule=rule, ticks=ticks, **kwds) + + +class ErrorBarDef(CompositeMarkDef): + """ErrorBarDef schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`ErrorBar` + 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 + Whether a composite mark be clipped to the enclosing group’s width and height. + color : :class:`Color` + Default color. Note that ``fill`` and ``stroke`` have higher precedence than + ``color`` and will override ``color``. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** This property cannot be used in a `style config + `__. + extent : :class:`ErrorBarExtent` + The extent of the rule. Available options include: + + + * ``"ci"`` : Extend the rule to the confidence interval of the mean. + * ``"stderr"`` : The size of rule are set to the value of standard error, extending + from the mean. + * ``"stdev"`` : The size of rule are set to the value of standard deviation, + extending from the mean. + * ``"iqr"`` : Extend the rule to the q1 and q3. + + **Default value:** ``"stderr"``. + opacity : float + The opacity (value between [0,1]) of the mark. + orient : :class:`Orientation` + 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:`MarkConfig`) + + ticks : anyOf(boolean, :class:`MarkConfig`) + + """ + _schema = {'$ref': '#/definitions/ErrorBarDef'} + + def __init__(self, type=Undefined, clip=Undefined, color=Undefined, extent=Undefined, + opacity=Undefined, orient=Undefined, rule=Undefined, ticks=Undefined, **kwds): + super(ErrorBarDef, self).__init__(type=type, clip=clip, color=color, extent=extent, + opacity=opacity, orient=orient, rule=rule, ticks=ticks, **kwds) + + +class ErrorBarExtent(VegaLiteSchema): + """ErrorBarExtent schema wrapper + + enum('ci', 'iqr', 'stderr', 'stdev') + """ + _schema = {'$ref': '#/definitions/ErrorBarExtent'} + + def __init__(self, *args): + super(ErrorBarExtent, self).__init__(*args) + + +class EventStream(VegaLiteSchema): + """EventStream schema wrapper + + Any + """ + _schema = {'$ref': '#/definitions/EventStream'} + + def __init__(self, *args, **kwds): + super(EventStream, self).__init__(*args, **kwds) + + +class FacetFieldDef(VegaLiteSchema): + """FacetFieldDef schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`StandardType` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + header : :class:`Header` + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/FacetFieldDef'} + + def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, + header=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(FacetFieldDef, self).__init__(type=type, aggregate=aggregate, bin=bin, field=field, + header=header, sort=sort, timeUnit=timeUnit, title=title, + **kwds) + + +class FacetMapping(VegaLiteSchema): + """FacetMapping schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + column : :class:`FacetFieldDef` + A field definition for the horizontal facet of trellis plots. + row : :class:`FacetFieldDef` + A field definition for the vertical facet of trellis plots. + """ + _schema = {'$ref': '#/definitions/FacetMapping'} + + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(FacetMapping, self).__init__(column=column, row=row, **kwds) + + +class FacetedEncoding(VegaLiteSchema): + """FacetedEncoding schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + color : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + 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 + `__ '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. If either ``fill`` or ``stroke`` channel + is specified, ``color`` channel will be ignored. + 2) See the scale documentation for more information about customizing `color scheme + `__. + column : :class:`FacetFieldDef` + A field definition for the horizontal facet of trellis plots. + detail : anyOf(:class:`FieldDefWithoutScale`, List(:class:`FieldDefWithoutScale`)) + 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:`FacetFieldDef` + A field definition for the (flexible) facet of trellis plots. + + If either ``row`` or ``column`` is specified, this channel will be ignored. + fill : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + Fill color of the marks. + **Default value:** If undefined, the default color depends on `mark config + `__ 's ``color`` property. + + *Note:* When using ``fill`` channel, ``color`` channel will be ignored. To customize + both fill and stroke, please use ``fill`` and ``stroke`` channels (not ``fill`` and + ``color`` ). + fillOpacity : anyOf(:class:`NumericFieldDefWithCondition`, + :class:`NumericValueDefWithCondition`) + Fill opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's ``fillOpacity`` + property. + href : anyOf(:class:`TextFieldDefWithCondition`, :class:`TextValueDefWithCondition`) + A URL to load upon mouse click. + key : :class:`FieldDefWithoutScale` + 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 : anyOf(:class:`LatLongFieldDef`, :class:`NumberValueDef`) + Latitude position of geographically projected marks. + latitude2 : anyOf(:class:`SecondaryFieldDef`, :class:`NumberValueDef`) + Latitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, + ``"rect"``, and ``"rule"``. + longitude : anyOf(:class:`LatLongFieldDef`, :class:`NumberValueDef`) + Longitude position of geographically projected marks. + longitude2 : anyOf(:class:`SecondaryFieldDef`, :class:`NumberValueDef`) + Longitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, + ``"rect"``, and ``"rule"``. + opacity : anyOf(:class:`NumericFieldDefWithCondition`, + :class:`NumericValueDefWithCondition`) + Opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's ``opacity`` property. + order : anyOf(:class:`OrderFieldDef`, List(:class:`OrderFieldDef`), :class:`NumberValueDef`) + Order of the marks. + + + * For stacked marks, this ``order`` channel encodes `stack 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 + `__. + 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. + row : :class:`FacetFieldDef` + A field definition for the vertical facet of trellis plots. + shape : anyOf(:class:`ShapeFieldDefWithCondition`, :class:`ShapeValueDefWithCondition`) + 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 + `__ (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 + `__ 's ``shape`` + property. ( ``"circle"`` if unset.) + size : anyOf(:class:`NumericFieldDefWithCondition`, :class:`NumericValueDefWithCondition`) + 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 : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + Stroke color of the marks. + **Default value:** If undefined, the default color depends on `mark config + `__ 's ``color`` property. + + *Note:* When using ``stroke`` channel, ``color`` channel will be ignored. To + customize both stroke and fill, please use ``stroke`` and ``fill`` channels (not + ``stroke`` and ``color`` ). + strokeOpacity : anyOf(:class:`NumericFieldDefWithCondition`, + :class:`NumericValueDefWithCondition`) + Stroke opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's ``strokeOpacity`` + property. + strokeWidth : anyOf(:class:`NumericFieldDefWithCondition`, + :class:`NumericValueDefWithCondition`) + Stroke width of the marks. + + **Default value:** If undefined, the default stroke width depends on `mark config + `__ 's ``strokeWidth`` + property. + text : anyOf(:class:`TextFieldDefWithCondition`, :class:`TextValueDefWithCondition`) + Text of the ``text`` mark. + tooltip : anyOf(:class:`TextFieldDefWithCondition`, :class:`TextValueDefWithCondition`, + List(:class:`TextFieldDef`), None) + The tooltip text to show upon mouse hover. + x : anyOf(:class:`PositionFieldDef`, :class:`XValueDef`) + 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(:class:`SecondaryFieldDef`, :class:`XValueDef`) + 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:`NumberValueDef`) + Error value of x coordinates for error specified ``"errorbar"`` and ``"errorband"``. + xError2 : anyOf(:class:`SecondaryFieldDef`, :class:`NumberValueDef`) + Secondary error value of x coordinates for error specified ``"errorbar"`` and + ``"errorband"``. + y : anyOf(:class:`PositionFieldDef`, :class:`YValueDef`) + 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(:class:`SecondaryFieldDef`, :class:`YValueDef`) + 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:`NumberValueDef`) + Error value of y coordinates for error specified ``"errorbar"`` and ``"errorband"``. + yError2 : anyOf(:class:`SecondaryFieldDef`, :class:`NumberValueDef`) + Secondary error value of y coordinates for error specified ``"errorbar"`` and + ``"errorband"``. + """ + _schema = {'$ref': '#/definitions/FacetedEncoding'} + + def __init__(self, color=Undefined, column=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, row=Undefined, shape=Undefined, size=Undefined, + stroke=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, text=Undefined, + tooltip=Undefined, x=Undefined, x2=Undefined, xError=Undefined, xError2=Undefined, + y=Undefined, y2=Undefined, yError=Undefined, yError2=Undefined, **kwds): + super(FacetedEncoding, self).__init__(color=color, column=column, detail=detail, facet=facet, + fill=fill, fillOpacity=fillOpacity, href=href, key=key, + latitude=latitude, latitude2=latitude2, + longitude=longitude, longitude2=longitude2, + opacity=opacity, order=order, row=row, shape=shape, + size=size, stroke=stroke, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, text=text, tooltip=tooltip, x=x, + x2=x2, xError=xError, xError2=xError2, y=y, y2=y2, + yError=yError, yError2=yError2, **kwds) + + +class Field(VegaLiteSchema): + """Field schema wrapper + + anyOf(:class:`FieldName`, :class:`RepeatRef`) + """ + _schema = {'$ref': '#/definitions/Field'} + + def __init__(self, *args, **kwds): + super(Field, self).__init__(*args, **kwds) + + +class FieldDefWithConditionMarkPropFieldDefTypeForShapestringnull(VegaLiteSchema): + """FieldDefWithConditionMarkPropFieldDefTypeForShapestringnull schema wrapper + + Mapping(required=[type]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + type : :class:`TypeForShape` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalStringValueDef`, + List(:class:`ConditionalStringValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/FieldDefWithCondition,(string|null)>'} + + def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, + title=Undefined, **kwds): + super(FieldDefWithConditionMarkPropFieldDefTypeForShapestringnull, self).__init__(type=type, + aggregate=aggregate, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, + sort=sort, + timeUnit=timeUnit, + title=title, + **kwds) + + +class FieldDefWithConditionMarkPropFieldDefnumber(VegaLiteSchema): + """FieldDefWithConditionMarkPropFieldDefnumber schema wrapper + + Mapping(required=[type]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + type : :class:`StandardType` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalNumberValueDef`, + List(:class:`ConditionalNumberValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/FieldDefWithCondition'} + + def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, + title=Undefined, **kwds): + super(FieldDefWithConditionMarkPropFieldDefnumber, self).__init__(type=type, + aggregate=aggregate, bin=bin, + condition=condition, + field=field, legend=legend, + scale=scale, sort=sort, + timeUnit=timeUnit, + title=title, **kwds) + + +class FieldDefWithConditionMarkPropFieldDefstringnull(VegaLiteSchema): + """FieldDefWithConditionMarkPropFieldDefstringnull schema wrapper + + Mapping(required=[type]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + type : :class:`StandardType` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalStringValueDef`, + List(:class:`ConditionalStringValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/FieldDefWithCondition'} + + def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, + title=Undefined, **kwds): + super(FieldDefWithConditionMarkPropFieldDefstringnull, self).__init__(type=type, + aggregate=aggregate, + bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, sort=sort, + timeUnit=timeUnit, + title=title, **kwds) + + +class FieldDefWithConditionTextFieldDefValue(VegaLiteSchema): + """FieldDefWithConditionTextFieldDefValue schema wrapper + + Mapping(required=[type]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + type : :class:`StandardType` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDef`, List(:class:`ConditionalValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + format : string + The text formatting pattern for labels of guides (axes, legends, headers) and text + marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. + * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : enum('number', 'time') + The format type for labels ( ``"number"`` or ``"time"`` ). + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without + ``timeUnit``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/FieldDefWithCondition'} + + def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, timeUnit=Undefined, + title=Undefined, **kwds): + super(FieldDefWithConditionTextFieldDefValue, self).__init__(type=type, aggregate=aggregate, + bin=bin, condition=condition, + field=field, format=format, + formatType=formatType, + timeUnit=timeUnit, title=title, + **kwds) + + +class FieldDefWithoutScale(VegaLiteSchema): + """FieldDefWithoutScale schema wrapper + + Mapping(required=[type]) + Definition object for a data field, its type and transformation of an encoding channel. + + Attributes + ---------- + + type : :class:`StandardType` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/FieldDefWithoutScale'} + + def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, **kwds): + super(FieldDefWithoutScale, self).__init__(type=type, aggregate=aggregate, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class FieldName(Field): + """FieldName schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/FieldName'} + + def __init__(self, *args): + super(FieldName, self).__init__(*args) + + +class FontStyle(VegaLiteSchema): + """FontStyle schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/FontStyle'} + + def __init__(self, *args): + super(FontStyle, self).__init__(*args) + + +class FontWeight(VegaLiteSchema): + """FontWeight schema wrapper + + enum('normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900) + """ + _schema = {'$ref': '#/definitions/FontWeight'} + + def __init__(self, *args): + super(FontWeight, self).__init__(*args) + + +class Generator(Data): + """Generator schema wrapper + + anyOf(:class:`SequenceGenerator`, :class:`SphereGenerator`, :class:`GraticuleGenerator`) + """ + _schema = {'$ref': '#/definitions/Generator'} + + def __init__(self, *args, **kwds): + super(Generator, self).__init__(*args, **kwds) + + +class GenericUnitSpecEncodingAnyMark(VegaLiteSchema): + """GenericUnitSpecEncodingAnyMark schema wrapper + + Mapping(required=[mark]) + Base interface for a unit (single-view) specification. + + Attributes + ---------- + + mark : :class:`AnyMark` + A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, + ``"tick"``, ``"line"``, + ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and ``"text"`` ) or a `mark + definition object `__. + data : anyOf(:class:`Data`, 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 of this mark for commenting purpose. + encoding : :class:`Encoding` + A key-value mapping between encoding channels and definition of fields. + height : float + The height of a visualization. + + **Default value:** + + + * If a view's `autosize + `__ type is ``"fit"`` or + its y-channel has a `continuous scale + `__, the height will + be the value of `config.view.height + `__. + * For y-axis with a band or point scale: if `rangeStep + `__ is a numeric value or + unspecified, the height is `determined by the range step, paddings, and the + cardinality of the field mapped to y-channel + `__. Otherwise, if the + ``rangeStep`` is ``null``, the height will be the value of `config.view.height + `__. + * If no field is mapped to ``y`` channel, the ``height`` will be the value of + ``rangeStep``. + + **Note** : For plots with `row and column channels + `__, this represents the + height of a single view. + + **See also:** The documentation for `width and height + `__ contains more examples. + name : string + Name of the visualization for later reference. + projection : :class:`Projection` + 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. + selection : Mapping(required=[]) + A key-value mapping between selection names and definitions. + title : anyOf(string, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + view : :class:`ViewBackground` + An object defining the view background's fill and stroke. + + **Default value:** none (transparent) + width : float + The width of a visualization. + + **Default value:** This will be determined by the following rules: + + + * If a view's `autosize + `__ type is ``"fit"`` or + its x-channel has a `continuous scale + `__, the width will + be the value of `config.view.width + `__. + * For x-axis with a band or point scale: if `rangeStep + `__ is a numeric value or + unspecified, the width is `determined by the range step, paddings, and the + cardinality of the field mapped to x-channel + `__. Otherwise, if the + ``rangeStep`` is ``null``, the width will be the value of `config.view.width + `__. + * If no field is mapped to ``x`` channel, the ``width`` will be the value of + `config.scale.textXRangeStep + `__ for + ``text`` mark and the value of ``rangeStep`` for other marks. + + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view. + + **See also:** The documentation for `width and height + `__ contains more examples. + """ + _schema = {'$ref': '#/definitions/GenericUnitSpec'} + + def __init__(self, mark=Undefined, data=Undefined, description=Undefined, encoding=Undefined, + height=Undefined, name=Undefined, projection=Undefined, selection=Undefined, + title=Undefined, transform=Undefined, view=Undefined, width=Undefined, **kwds): + super(GenericUnitSpecEncodingAnyMark, self).__init__(mark=mark, data=data, + description=description, encoding=encoding, + height=height, name=name, + projection=projection, selection=selection, + title=title, transform=transform, + view=view, width=width, **kwds) + + +class GraticuleGenerator(Generator): + """GraticuleGenerator schema wrapper + + Mapping(required=[graticule]) + + Attributes + ---------- + + graticule : anyOf(enum(True), :class:`GraticuleParams`) + Generate graticule GeoJSON data for geographic reference lines. + name : string + Provide a placeholder name and bind data at runtime. + """ + _schema = {'$ref': '#/definitions/GraticuleGenerator'} + + def __init__(self, graticule=Undefined, name=Undefined, **kwds): + super(GraticuleGenerator, self).__init__(graticule=graticule, name=name, **kwds) + + +class GraticuleParams(VegaLiteSchema): + """GraticuleParams schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + extent : List(List(float)) + Sets both the major and minor extents to the same values. + extentMajor : List(List(float)) + The major extent of the graticule as a two-element array of coordinates. + extentMinor : List(List(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 : List(float) + Sets both the major and minor step angles to the same values. + stepMajor : List(float) + The major step angles of the graticule. + + **Default value:** ``[90, 360]`` + stepMinor : List(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) + + +class Header(VegaLiteSchema): + """Header schema wrapper + + Mapping(required=[]) + Headers of row / column channels for faceted plots. + + Attributes + ---------- + + format : string + The text formatting pattern for labels of guides (axes, legends, headers) and text + marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. + * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : enum('number', 'time') + The format type for labels ( ``"number"`` or ``"time"`` ). + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without + ``timeUnit``. + labelAlign : :class:`Align` + Horizontal text alignment of header labels. + labelAnchor : :class:`TitleAnchor` + 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. + labelAngle : float + The rotation angle of the header labels. + + **Default value:** ``0`` for column header, ``-90`` for row header. + labelColor : :class:`Color` + The color of the header label, can be in hex color code or regular color name. + labelFont : string + The font of the header label. + labelFontSize : float + The font size of the header label, in pixels. + labelFontStyle : :class:`FontStyle` + The font style of the header label. + labelLimit : 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 + labelOrient : :class:`Orient` + The orientation of the header label. One of ``"top"``, ``"bottom"``, ``"left"`` or + ``"right"``. + labelPadding : float + The padding, in pixel, between facet header's label and the plot. + + **Default value:** ``10`` + labels : boolean + A boolean flag indicating if labels should be included as part of the header. + + **Default value:** ``true``. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 2) If both field definition's ``title`` and axis, header, or legend ``title`` are + defined, axis/header/legend title will be used. + titleAlign : :class:`Align` + Horizontal text alignment (to the anchor) of header titles. + titleAnchor : :class:`TitleAnchor` + 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. + titleAngle : float + The rotation angle of the header title. + + **Default value:** ``0``. + titleBaseline : :class:`TextBaseline` + Vertical text baseline for the header title. One of ``"top"``, ``"bottom"``, + ``"middle"``. + + **Default value:** ``"middle"`` + titleColor : :class:`Color` + Color of the header title, can be in hex color code or regular color name. + titleFont : string + Font of the header title. (e.g., ``"Helvetica Neue"`` ). + titleFontSize : float + Font size of the header title. + titleFontStyle : :class:`FontStyle` + The font style of the header title. + titleFontWeight : :class:`FontWeight` + 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 : 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 + titleOrient : :class:`Orient` + The orientation of the header title. One of ``"top"``, ``"bottom"``, ``"left"`` or + ``"right"``. + titlePadding : 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, labelColor=Undefined, labelFont=Undefined, + labelFontSize=Undefined, labelFontStyle=Undefined, labelLimit=Undefined, + labelOrient=Undefined, labelPadding=Undefined, labels=Undefined, title=Undefined, + titleAlign=Undefined, titleAnchor=Undefined, titleAngle=Undefined, + titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, + titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, + titleLimit=Undefined, titleOrient=Undefined, titlePadding=Undefined, **kwds): + super(Header, self).__init__(format=format, formatType=formatType, labelAlign=labelAlign, + labelAnchor=labelAnchor, labelAngle=labelAngle, + labelColor=labelColor, labelFont=labelFont, + labelFontSize=labelFontSize, labelFontStyle=labelFontStyle, + labelLimit=labelLimit, labelOrient=labelOrient, + labelPadding=labelPadding, labels=labels, title=title, + titleAlign=titleAlign, titleAnchor=titleAnchor, + titleAngle=titleAngle, titleBaseline=titleBaseline, + titleColor=titleColor, titleFont=titleFont, + titleFontSize=titleFontSize, titleFontStyle=titleFontStyle, + titleFontWeight=titleFontWeight, titleLimit=titleLimit, + titleOrient=titleOrient, titlePadding=titlePadding, **kwds) + + +class HeaderConfig(VegaLiteSchema): + """HeaderConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + format : string + The text formatting pattern for labels of guides (axes, legends, headers) and text + marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. + * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : enum('number', 'time') + The format type for labels ( ``"number"`` or ``"time"`` ). + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without + ``timeUnit``. + labelAlign : :class:`Align` + Horizontal text alignment of header labels. + labelAnchor : :class:`TitleAnchor` + 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. + labelAngle : float + The rotation angle of the header labels. + + **Default value:** ``0`` for column header, ``-90`` for row header. + labelColor : :class:`Color` + The color of the header label, can be in hex color code or regular color name. + labelFont : string + The font of the header label. + labelFontSize : float + The font size of the header label, in pixels. + labelFontStyle : :class:`FontStyle` + The font style of the header label. + labelLimit : 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 + labelOrient : :class:`Orient` + The orientation of the header label. One of ``"top"``, ``"bottom"``, ``"left"`` or + ``"right"``. + labelPadding : float + The padding, in pixel, between facet header's label and the plot. + + **Default value:** ``10`` + labels : boolean + A boolean flag indicating if labels should be included as part of the header. + + **Default value:** ``true``. + shortTimeLabels : boolean + Whether month names and weekday names should be abbreviated. + + **Default value:** ``false`` + title : None + Set to null to disable title for the axis, legend, or header. + titleAlign : :class:`Align` + Horizontal text alignment (to the anchor) of header titles. + titleAnchor : :class:`TitleAnchor` + 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. + titleAngle : float + The rotation angle of the header title. + + **Default value:** ``0``. + titleBaseline : :class:`TextBaseline` + Vertical text baseline for the header title. One of ``"top"``, ``"bottom"``, + ``"middle"``. + + **Default value:** ``"middle"`` + titleColor : :class:`Color` + Color of the header title, can be in hex color code or regular color name. + titleFont : string + Font of the header title. (e.g., ``"Helvetica Neue"`` ). + titleFontSize : float + Font size of the header title. + titleFontStyle : :class:`FontStyle` + The font style of the header title. + titleFontWeight : :class:`FontWeight` + 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 : 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 + titleOrient : :class:`Orient` + The orientation of the header title. One of ``"top"``, ``"bottom"``, ``"left"`` or + ``"right"``. + titlePadding : 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, labelColor=Undefined, labelFont=Undefined, + labelFontSize=Undefined, labelFontStyle=Undefined, labelLimit=Undefined, + labelOrient=Undefined, labelPadding=Undefined, labels=Undefined, + shortTimeLabels=Undefined, title=Undefined, titleAlign=Undefined, + titleAnchor=Undefined, titleAngle=Undefined, titleBaseline=Undefined, + titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, + titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, + titleOrient=Undefined, titlePadding=Undefined, **kwds): + super(HeaderConfig, self).__init__(format=format, formatType=formatType, labelAlign=labelAlign, + labelAnchor=labelAnchor, labelAngle=labelAngle, + labelColor=labelColor, labelFont=labelFont, + labelFontSize=labelFontSize, labelFontStyle=labelFontStyle, + labelLimit=labelLimit, labelOrient=labelOrient, + labelPadding=labelPadding, labels=labels, + shortTimeLabels=shortTimeLabels, title=title, + titleAlign=titleAlign, titleAnchor=titleAnchor, + titleAngle=titleAngle, titleBaseline=titleBaseline, + titleColor=titleColor, titleFont=titleFont, + titleFontSize=titleFontSize, titleFontStyle=titleFontStyle, + titleFontWeight=titleFontWeight, titleLimit=titleLimit, + titleOrient=titleOrient, titlePadding=titlePadding, **kwds) + + +class HexColor(Color): + """HexColor schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/HexColor'} + + def __init__(self, *args): + super(HexColor, self).__init__(*args) + + +class ImputeMethod(VegaLiteSchema): + """ImputeMethod schema wrapper + + enum('value', 'median', 'max', 'min', 'mean') + """ + _schema = {'$ref': '#/definitions/ImputeMethod'} + + def __init__(self, *args): + super(ImputeMethod, self).__init__(*args) + + +class ImputeParams(VegaLiteSchema): + """ImputeParams schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + frame : List(anyOf(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 + rows preceding or following the current data object. For example, the value ``[-5, + 5]`` indicates that the window should include five objects preceding and five + objects following the current object. + + **Default value:** : ``[null, null]`` indicating that the window includes all + objects. + 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 + `__. + + If provided, this will be used in addition to the key values observed within the + input data. If not provided, the values will be derived from all unique values of + the ``key`` field. For ``impute`` in ``encoding``, the key field is the x-field if + the y-field is imputed, or vice versa. + + If there is no impute grouping, this property *must* be specified. + method : :class:`ImputeMethod` + The imputation method to use for the field value of imputed data objects. + One of ``value``, ``mean``, ``median``, ``max`` or ``min``. + + **Default value:** ``"value"`` + 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) + + +class ImputeSequence(VegaLiteSchema): + """ImputeSequence schema wrapper + + Mapping(required=[stop]) + + Attributes + ---------- + + stop : float + The ending value(exclusive) of the sequence. + start : float + The starting value of the sequence. + **Default value:** ``0`` + step : float + 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): + super(ImputeSequence, self).__init__(stop=stop, start=start, step=step, **kwds) + + +class InlineData(DataSource): + """InlineData schema wrapper + + Mapping(required=[values]) + + Attributes + ---------- + + values : :class:`InlineDataset` + 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` + An object that specifies the format for parsing the data. + name : string + 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) + + +class InlineDataset(VegaLiteSchema): + """InlineDataset schema wrapper + + anyOf(List(float), List(string), List(boolean), List(Mapping(required=[])), string, + Mapping(required=[])) + """ + _schema = {'$ref': '#/definitions/InlineDataset'} + + def __init__(self, *args, **kwds): + super(InlineDataset, self).__init__(*args, **kwds) + + +class InputBinding(Binding): + """InputBinding schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + autocomplete : string + + debounce : float + + element : :class:`Element` + + input : string + + name : string + + placeholder : string + + type : string + + """ + _schema = {'$ref': '#/definitions/InputBinding'} + + def __init__(self, autocomplete=Undefined, debounce=Undefined, element=Undefined, input=Undefined, + name=Undefined, placeholder=Undefined, type=Undefined, **kwds): + super(InputBinding, self).__init__(autocomplete=autocomplete, debounce=debounce, + element=element, input=input, name=name, + placeholder=placeholder, type=type, **kwds) + + +class Interpolate(VegaLiteSchema): + """Interpolate schema wrapper + + enum('linear', 'linear-closed', 'step', 'step-before', 'step-after', 'basis', 'basis-open', + 'basis-closed', 'cardinal', 'cardinal-open', 'cardinal-closed', 'bundle', 'monotone') + """ + _schema = {'$ref': '#/definitions/Interpolate'} + + def __init__(self, *args): + super(Interpolate, self).__init__(*args) + + +class IntervalSelectionConfig(VegaLiteSchema): + """IntervalSelectionConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + bind : enum('scales') + Establishes a two-way binding between the interval selection and the scales + used within the same view. This allows a user to interactively pan and + zoom the view. + + **See also:** `bind `__ + documentation. + clear : anyOf(:class:`EventStream`, boolean) + Clears the selection, emptying it of all values. Can be an + `EventStream `__ or ``false`` to + disable. + + **Default value:** ``dblclick``. + + **See also:** `clear `__ + documentation. + empty : enum('all', 'none') + By default, ``all`` data values are considered to lie within an empty selection. + When set to ``none``, empty selections contain no data values. + encodings : List(:class:`SingleDefUnitChannel`) + An array of encoding channels. The corresponding data field values + must match for a data tuple to fall within the selection. + + **See also:** `encodings `__ + documentation. + fields : List(:class:`FieldName`) + An array of field names whose values must match for a data tuple to + fall within the selection. + + **See also:** `fields `__ + documentation. + init : :class:`SelectionInitIntervalMapping` + Initialize the selection with a mapping between `projected channels or field names + `__ and arrays of + initial values. + + **See also:** `init `__ + documentation. + mark : :class:`BrushConfig` + 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 `__ + documentation. + on : :class:`EventStream` + A `Vega event stream `__ (object or + selector) that triggers the selection. + For interval selections, the event stream must specify a `start and end + `__. + resolve : :class:`SelectionResolution` + 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. + + **See also:** `resolve + `__ documentation. + translate : anyOf(string, boolean) + 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 `__ + which must include a start and end event to trigger continuous panning. + + **Default value:** ``true``, which corresponds to + ``[mousedown, window:mouseup] > window:mousemove!`` which corresponds to + clicks and dragging within an interval selection to reposition it. + + **See also:** `translate `__ + documentation. + zoom : anyOf(string, boolean) + When truthy, allows a user to interactively resize an interval selection. + Can be ``true``, ``false`` (to disable zooming), or a `Vega event stream + definition `__. Currently, + only ``wheel`` events are supported. + + **Default value:** ``true``, which corresponds to ``wheel!``. + + **See also:** `zoom `__ + documentation. + """ + _schema = {'$ref': '#/definitions/IntervalSelectionConfig'} + + def __init__(self, bind=Undefined, clear=Undefined, empty=Undefined, encodings=Undefined, + fields=Undefined, init=Undefined, mark=Undefined, on=Undefined, resolve=Undefined, + translate=Undefined, zoom=Undefined, **kwds): + super(IntervalSelectionConfig, self).__init__(bind=bind, clear=clear, empty=empty, + encodings=encodings, fields=fields, init=init, + mark=mark, on=on, resolve=resolve, + translate=translate, zoom=zoom, **kwds) + + +class JoinAggregateFieldDef(VegaLiteSchema): + """JoinAggregateFieldDef schema wrapper + + Mapping(required=[op, as]) + + Attributes + ---------- + + op : :class:`AggregateOp` + The aggregation operation to apply (e.g., sum, average or count). See the list of + all supported operations `here + `__. + field : :class:`FieldName` + 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` + The output name for the join aggregate operation. + """ + _schema = {'$ref': '#/definitions/JoinAggregateFieldDef'} + + def __init__(self, op=Undefined, field=Undefined, **kwds): + super(JoinAggregateFieldDef, self).__init__(op=op, field=field, **kwds) + + +class JsonDataFormat(DataFormat): + """JsonDataFormat schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + parse : anyOf(:class:`Parse`, 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 name, and the value to the + desired data type (one of ``"number"``, ``"boolean"``, ``"date"``, or null (do not + parse the field)). + For example, ``"parse": {"modified_on": "date"}`` parses the ``modified_on`` field + in each input record a Date value. + + For ``"date"``, we parse data based using Javascript's `Date.parse() + `__. + For Specific date formats can be provided (e.g., ``{foo: "date:'%m%d%Y'"}`` ), using + the `d3-time-format syntax `__. + UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). + See more about `UTC time + `__ + property : string + 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 : enum('json') + 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) + + +class LabelOverlap(VegaLiteSchema): + """LabelOverlap schema wrapper + + anyOf(boolean, enum('parity'), enum('greedy')) + """ + _schema = {'$ref': '#/definitions/LabelOverlap'} + + def __init__(self, *args, **kwds): + super(LabelOverlap, self).__init__(*args, **kwds) + + +class LatLongFieldDef(VegaLiteSchema): + """LatLongFieldDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 2) If both field definition's ``title`` and axis, header, or legend ``title`` are + defined, axis/header/legend title will be used. + type : enum('quantitative') + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + """ + _schema = {'$ref': '#/definitions/LatLongFieldDef'} + + def __init__(self, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, + title=Undefined, type=Undefined, **kwds): + super(LatLongFieldDef, self).__init__(aggregate=aggregate, bin=bin, field=field, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class LayoutAlign(VegaLiteSchema): + """LayoutAlign schema wrapper + + enum('all', 'each', 'none') + """ + _schema = {'$ref': '#/definitions/LayoutAlign'} + + def __init__(self, *args): + super(LayoutAlign, self).__init__(*args) + + +class LayoutBounds(VegaLiteSchema): + """LayoutBounds schema wrapper + + anyOf(enum('full'), enum('flush'), :class:`SignalRef`) + """ + _schema = {'$ref': '#/definitions/LayoutBounds'} + + def __init__(self, *args, **kwds): + super(LayoutBounds, self).__init__(*args, **kwds) + + +class Legend(VegaLiteSchema): + """Legend schema wrapper + + Mapping(required=[]) + Properties of a legend or boolean flag for determining whether to show it. + + Attributes + ---------- + + clipHeight : float + The height in pixels to clip symbol legend entries and limit their size. + columnPadding : float + The horizontal padding in pixels between symbol legend entries. + + **Default value:** ``10``. + columns : 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 : float + Corner radius for the full legend. + direction : :class:`Orientation` + The direction of the legend, one of ``"vertical"`` or ``"horizontal"``. + + **Default value:** + + + * For top-/bottom- ``orient`` ed legends, ``"horizontal"`` + * 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 : :class:`Color` + Background fill color for the full legend. + format : string + The text formatting pattern for labels of guides (axes, legends, headers) and text + marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. + * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : enum('number', 'time') + The format type for labels ( ``"number"`` or ``"time"`` ). + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without + ``timeUnit``. + gradientLength : 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 : float + Opacity of the color gradient. + gradientStrokeColor : :class:`Color` + The color of the gradient stroke, can be in hex color code or regular color name. + + **Default value:** ``"lightGray"``. + gradientStrokeWidth : float + The width of the gradient stroke, in pixels. + + **Default value:** ``0``. + gradientThickness : 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 : :class:`LayoutAlign` + 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 `__. + + **Default value:** ``"each"``. + labelAlign : :class:`Align` + The alignment of the legend label, can be left, center, or right. + labelBaseline : :class:`TextBaseline` + The position of the baseline of legend label, can be ``"top"``, ``"middle"``, + ``"bottom"``, or ``"alphabetic"``. + + **Default value:** ``"middle"``. + labelColor : :class:`Color` + The color of the legend label, can be in hex color code or regular color name. + labelFont : string + The font of the legend label. + labelFontSize : float + The font size of legend label. + + **Default value:** ``10``. + labelFontStyle : :class:`FontStyle` + The font style of legend label. + labelFontWeight : :class:`FontWeight` + The font weight of legend label. + labelLimit : float + Maximum allowed pixel width of legend tick labels. + + **Default value:** ``160``. + labelOffset : float + The offset of the legend label. + labelOpacity : float + Opacity of labels. + labelOverlap : :class:`LabelOverlap` + 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 + ``"greedy"``, a linear scan of the labels is performed, removing any label that + overlaps with the last visible label (this often works better for log-scaled axes). + + **Default value:** ``true``. + labelPadding : float + Padding in pixels between the legend and legend labels. + labelSeparation : 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 : float + Custom x-position for legend with orient "none". + legendY : float + Custom y-position for legend with orient "none". + offset : float + The offset in pixels by which to displace the legend from the data rectangle and + axes. + + **Default value:** ``18``. + orient : :class:`LegendOrient` + 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 : float + The padding between the border and content of the legend group. + + **Default value:** ``0``. + rowPadding : float + The vertical padding in pixels between symbol legend entries. + + **Default value:** ``2``. + strokeColor : :class:`Color` + Border stroke color for the full legend. + symbolDash : List(float) + An array of alternating [stroke, space] lengths for dashed symbol strokes. + symbolDashOffset : float + The pixel offset at which to start drawing with the symbol stroke dash array. + symbolFillColor : :class:`Color` + The color of the legend symbol, + symbolOffset : float + Horizontal pixel offset for legend symbols. + + **Default value:** ``0``. + symbolOpacity : float + Opacity of the legend symbols. + symbolSize : float + The size of the legend symbol, in pixels. + + **Default value:** ``100``. + symbolStrokeColor : :class:`Color` + Stroke color for legend symbols. + symbolStrokeWidth : float + The width of the symbol's stroke. + + **Default value:** ``1.5``. + symbolType : :class:`SymbolShape` + 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 + shapes ``arrow``, ``wedge``, or ``triangle``. Alternatively, a custom `SVG path + string `__ can be + provided. 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. + + **Default value:** ``"circle"``. + tickCount : float + The desired number of tick values for quantitative legends. + tickMinStep : 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(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 2) If both field definition's ``title`` and axis, header, or legend ``title`` are + defined, axis/header/legend title will be used. + titleAlign : :class:`Align` + Horizontal text alignment for legend titles. + + **Default value:** ``"left"``. + titleAnchor : :class:`TitleAnchor` + Text anchor position for placing legend titles. + titleBaseline : :class:`TextBaseline` + Vertical text baseline for legend titles. + + **Default value:** ``"top"``. + titleColor : :class:`Color` + The color of the legend title, can be in hex color code or regular color name. + titleFont : string + The font of the legend title. + titleFontSize : float + The font size of the legend title. + titleFontStyle : :class:`FontStyle` + The font style of the legend title. + titleFontWeight : :class:`FontWeight` + 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 : float + Maximum allowed pixel width of legend titles. + + **Default value:** ``180``. + titleOpacity : float + Opacity of the legend title. + titleOrient : :class:`Orient` + Orientation of the legend title. + titlePadding : float + The padding, in pixels, between title and legend. + + **Default value:** ``5``. + type : enum('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 : List(anyOf(float, string, boolean, :class:`DateTime`)) + 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, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, + cornerRadius=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, 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, 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, titleOpacity=Undefined, titleOrient=Undefined, + titlePadding=Undefined, type=Undefined, values=Undefined, zindex=Undefined, **kwds): + super(Legend, self).__init__(clipHeight=clipHeight, columnPadding=columnPadding, + columns=columns, cornerRadius=cornerRadius, 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, 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, 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, titleOpacity=titleOpacity, + titleOrient=titleOrient, titlePadding=titlePadding, type=type, + values=values, zindex=zindex, **kwds) + + +class LegendConfig(VegaLiteSchema): + """LegendConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + clipHeight : float + The height in pixels to clip symbol legend entries and limit their size. + columnPadding : float + The horizontal padding in pixels between symbol legend entries. + + **Default value:** ``10``. + columns : 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 : float + Corner radius for the full legend. + fillColor : :class:`Color` + Background fill color for the full legend. + gradientDirection : :class:`Orientation` + The default direction ( ``"horizontal"`` or ``"vertical"`` ) for gradient legends. + + **Default value:** ``"vertical"``. + gradientHorizontalMaxLength : float + Max legend length for a horizontal gradient when ``config.legend.gradientLength`` is + undefined. + + **Default value:** ``200`` + gradientHorizontalMinLength : float + Min legend length for a horizontal gradient when ``config.legend.gradientLength`` is + undefined. + + **Default value:** ``100`` + gradientLabelLimit : float + The maximum allowed length in pixels of color ramp gradient labels. + gradientLabelOffset : float + Vertical offset in pixels for color ramp gradient labels. + + **Default value:** ``2``. + gradientLength : 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 : float + Opacity of the color gradient. + gradientStrokeColor : :class:`Color` + The color of the gradient stroke, can be in hex color code or regular color name. + + **Default value:** ``"lightGray"``. + gradientStrokeWidth : float + The width of the gradient stroke, in pixels. + + **Default value:** ``0``. + gradientThickness : 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``. + gradientVerticalMaxLength : float + Max legend length for a vertical gradient when ``config.legend.gradientLength`` is + undefined. + + **Default value:** ``200`` + gradientVerticalMinLength : float + Min legend length for a vertical gradient when ``config.legend.gradientLength`` is + undefined. + + **Default value:** ``100`` + gridAlign : :class:`LayoutAlign` + 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 `__. + + **Default value:** ``"each"``. + labelAlign : :class:`Align` + The alignment of the legend label, can be left, center, or right. + labelBaseline : :class:`TextBaseline` + The position of the baseline of legend label, can be ``"top"``, ``"middle"``, + ``"bottom"``, or ``"alphabetic"``. + + **Default value:** ``"middle"``. + labelColor : :class:`Color` + The color of the legend label, can be in hex color code or regular color name. + labelFont : string + The font of the legend label. + labelFontSize : float + The font size of legend label. + + **Default value:** ``10``. + labelFontStyle : :class:`FontStyle` + The font style of legend label. + labelFontWeight : :class:`FontWeight` + The font weight of legend label. + labelLimit : float + Maximum allowed pixel width of legend tick labels. + + **Default value:** ``160``. + labelOffset : float + The offset of the legend label. + labelOpacity : float + Opacity of labels. + labelOverlap : :class:`LabelOverlap` + 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 + scan of the labels is performed, removing any label that overlaps with the last + visible label (this often works better for log-scaled axes). + + **Default value:** ``"greedy"`` for ``log scales otherwise`` true`. + labelPadding : float + Padding in pixels between the legend and legend labels. + labelSeparation : 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:`LegendLayout` + Legend orient group layout parameters. + legendX : float + Custom x-position for legend with orient "none". + legendY : float + Custom y-position for legend with orient "none". + offset : float + The offset in pixels by which to displace the legend from the data rectangle and + axes. + + **Default value:** ``18``. + orient : :class:`LegendOrient` + The orientation of the legend, which determines how the legend is positioned within + the scene. One of "left", "right", "top-left", "top-right", "bottom-left", + "bottom-right", "none". + + **Default value:** ``"right"`` + padding : float + The padding between the border and content of the legend group. + + **Default value:** ``0``. + rowPadding : float + The vertical padding in pixels between symbol legend entries. + + **Default value:** ``2``. + shortTimeLabels : boolean + Whether month names and weekday names should be abbreviated. + + **Default value:** ``false`` + strokeColor : :class:`Color` + Border stroke color for the full legend. + strokeDash : List(float) + Border stroke dash pattern for the full legend. + strokeWidth : float + Border stroke width for the full legend. + symbolBaseFillColor : :class:`Color` + Default fill color for legend symbols. Only applied if there is no ``"fill"`` scale + color encoding for the legend. + + **Default value:** ``"transparent"``. + symbolBaseStrokeColor : :class:`Color` + Default stroke color for legend symbols. Only applied if there is no ``"fill"`` + scale color encoding for the legend. + + **Default value:** ``"gray"``. + symbolDash : List(float) + An array of alternating [stroke, space] lengths for dashed symbol strokes. + symbolDashOffset : float + The pixel offset at which to start drawing with the symbol stroke dash array. + symbolDirection : :class:`Orientation` + The default direction ( ``"horizontal"`` or ``"vertical"`` ) for symbol legends. + + **Default value:** ``"vertical"``. + symbolFillColor : :class:`Color` + The color of the legend symbol, + symbolOffset : float + Horizontal pixel offset for legend symbols. + + **Default value:** ``0``. + symbolOpacity : float + Opacity of the legend symbols. + symbolSize : float + The size of the legend symbol, in pixels. + + **Default value:** ``100``. + symbolStrokeColor : :class:`Color` + Stroke color for legend symbols. + symbolStrokeWidth : float + The width of the symbol's stroke. + + **Default value:** ``1.5``. + symbolType : :class:`SymbolShape` + 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 + shapes ``arrow``, ``wedge``, or ``triangle``. Alternatively, a custom `SVG path + string `__ can be + provided. 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. + + **Default value:** ``"circle"``. + title : None + Set to null to disable title for the axis, legend, or header. + titleAlign : :class:`Align` + Horizontal text alignment for legend titles. + + **Default value:** ``"left"``. + titleAnchor : :class:`TitleAnchor` + Text anchor position for placing legend titles. + titleBaseline : :class:`TextBaseline` + Vertical text baseline for legend titles. + + **Default value:** ``"top"``. + titleColor : :class:`Color` + The color of the legend title, can be in hex color code or regular color name. + titleFont : string + The font of the legend title. + titleFontSize : float + The font size of the legend title. + titleFontStyle : :class:`FontStyle` + The font style of the legend title. + titleFontWeight : :class:`FontWeight` + 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 : float + Maximum allowed pixel width of legend titles. + + **Default value:** ``180``. + titleOpacity : float + Opacity of the legend title. + titleOrient : :class:`Orient` + Orientation of the legend title. + titlePadding : float + The padding, in pixels, between title and legend. + + **Default value:** ``5``. + """ + _schema = {'$ref': '#/definitions/LegendConfig'} + + def __init__(self, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, + cornerRadius=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, shortTimeLabels=Undefined, strokeColor=Undefined, + strokeDash=Undefined, strokeWidth=Undefined, symbolBaseFillColor=Undefined, + symbolBaseStrokeColor=Undefined, symbolDash=Undefined, symbolDashOffset=Undefined, + symbolDirection=Undefined, symbolFillColor=Undefined, symbolOffset=Undefined, + symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, + symbolStrokeWidth=Undefined, symbolType=Undefined, title=Undefined, + titleAlign=Undefined, titleAnchor=Undefined, titleBaseline=Undefined, + titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, + titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, + titleOpacity=Undefined, titleOrient=Undefined, titlePadding=Undefined, **kwds): + super(LegendConfig, self).__init__(clipHeight=clipHeight, columnPadding=columnPadding, + columns=columns, cornerRadius=cornerRadius, + 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, + shortTimeLabels=shortTimeLabels, strokeColor=strokeColor, + strokeDash=strokeDash, strokeWidth=strokeWidth, + symbolBaseFillColor=symbolBaseFillColor, + symbolBaseStrokeColor=symbolBaseStrokeColor, + symbolDash=symbolDash, symbolDashOffset=symbolDashOffset, + symbolDirection=symbolDirection, + symbolFillColor=symbolFillColor, symbolOffset=symbolOffset, + symbolOpacity=symbolOpacity, symbolSize=symbolSize, + symbolStrokeColor=symbolStrokeColor, + symbolStrokeWidth=symbolStrokeWidth, symbolType=symbolType, + title=title, titleAlign=titleAlign, titleAnchor=titleAnchor, + titleBaseline=titleBaseline, titleColor=titleColor, + titleFont=titleFont, titleFontSize=titleFontSize, + titleFontStyle=titleFontStyle, + titleFontWeight=titleFontWeight, titleLimit=titleLimit, + titleOpacity=titleOpacity, titleOrient=titleOrient, + titlePadding=titlePadding, **kwds) + + +class LegendLayout(VegaLiteSchema): + """LegendLayout schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + anchor : :class:`TitleAnchor` + The anchor point for legend orient group layout. + bottom : :class:`BaseLegendLayout` + + bounds : :class:`LayoutBounds` + The bounds calculation to use for legend orient group layout. + center : anyOf(boolean, :class:`SignalRef`) + A flag to center legends within a shared orient group. + direction : anyOf(:class:`Orientation`, :class:`SignalRef`) + The layout direction for legend orient group layout. + left : :class:`BaseLegendLayout` + + margin : anyOf(float, :class:`SignalRef`) + The pixel margin between legends within a orient group. + offset : anyOf(float, :class:`SignalRef`) + The pixel offset from the chart body for a legend orient group. + right : :class:`BaseLegendLayout` + + top : :class:`BaseLegendLayout` + + bottom-left : :class:`BaseLegendLayout` + + bottom-right : :class:`BaseLegendLayout` + + top-left : :class:`BaseLegendLayout` + + top-right : :class:`BaseLegendLayout` + + """ + _schema = {'$ref': '#/definitions/LegendLayout'} + + def __init__(self, anchor=Undefined, bottom=Undefined, bounds=Undefined, center=Undefined, + direction=Undefined, left=Undefined, margin=Undefined, offset=Undefined, + right=Undefined, top=Undefined, **kwds): + super(LegendLayout, self).__init__(anchor=anchor, bottom=bottom, bounds=bounds, center=center, + direction=direction, left=left, margin=margin, offset=offset, + right=right, top=top, **kwds) + + +class LegendOrient(VegaLiteSchema): + """LegendOrient schema wrapper + + enum('none', 'left', 'right', 'top', 'bottom', 'top-left', 'top-right', 'bottom-left', + 'bottom-right') + """ + _schema = {'$ref': '#/definitions/LegendOrient'} + + def __init__(self, *args): + super(LegendOrient, self).__init__(*args) + + +class LegendResolveMap(VegaLiteSchema): + """LegendResolveMap schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + color : :class:`ResolveMode` + + fill : :class:`ResolveMode` + + fillOpacity : :class:`ResolveMode` + + opacity : :class:`ResolveMode` + + shape : :class:`ResolveMode` + + size : :class:`ResolveMode` + + stroke : :class:`ResolveMode` + + strokeOpacity : :class:`ResolveMode` + + strokeWidth : :class:`ResolveMode` + + """ + _schema = {'$ref': '#/definitions/LegendResolveMap'} + + def __init__(self, color=Undefined, fill=Undefined, fillOpacity=Undefined, opacity=Undefined, + shape=Undefined, size=Undefined, stroke=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, **kwds): + super(LegendResolveMap, self).__init__(color=color, fill=fill, fillOpacity=fillOpacity, + opacity=opacity, shape=shape, size=size, stroke=stroke, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + **kwds) + + +class LineConfig(VegaLiteSchema): + """LineConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : :class:`Align` + The horizontal alignment of the text. One of ``"left"``, ``"right"``, ``"center"``. + angle : float + The rotation angle of the text, in degrees. + baseline : :class:`TextBaseline` + The vertical alignment of the text. One of ``"top"``, ``"middle"``, ``"bottom"``. + + **Default value:** ``"middle"`` + color : :class:`Color` + Default color. Note that ``fill`` and ``stroke`` have higher precedence than + ``color`` and will override ``color``. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** This property cannot be used in a `style config + `__. + cornerRadius : float + The radius in pixels of rounded rectangle corners. + + **Default value:** ``0`` + cursor : :class:`Cursor` + The mouse cursor used over the mark. Any valid `CSS cursor type + `__ can be used. + dir : :class:`Dir` + 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 : 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 : 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 : string + The ellipsis string for text truncated in response to the limit parameter. + + **Default value:** ``"…"`` + fill : :class:`Color` + Default Fill Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + fillOpacity : float + The fill opacity (value between [0,1]). + + **Default value:** ``1`` + filled : boolean + Whether the mark's color should be used as fill color instead of stroke color. + + **Default value:** ``false`` for ``point``, ``line`` and ``rule`` ; otherwise, + ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : string + The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). + fontSize : float + The font size, in pixels. + fontStyle : :class:`FontStyle` + The font style (e.g., ``"italic"`` ). + fontWeight : :class:`FontWeight` + 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 : float + Height of the marks. + href : string + A URL to load upon mouse click. If defined, the mark acts as a hyperlink. + interpolate : :class:`Interpolate` + The line interpolation method to use for line and area marks. One of the following: + + + * ``"linear"`` : piecewise linear segments, as in a polyline. + * ``"linear-closed"`` : close the linear segments to form a polygon. + * ``"step"`` : alternate between horizontal and vertical segments, as in a step + function. + * ``"step-before"`` : alternate between vertical and horizontal segments, as in a + step function. + * ``"step-after"`` : alternate between horizontal and vertical segments, as in a + step function. + * ``"basis"`` : a B-spline, with control point duplication on the ends. + * ``"basis-open"`` : an open B-spline; may not intersect the start or end. + * ``"basis-closed"`` : a closed B-spline, as in a loop. + * ``"cardinal"`` : a Cardinal spline, with control point duplication on the ends. + * ``"cardinal-open"`` : an open Cardinal spline; may not intersect the start or end, + but will intersect other control points. + * ``"cardinal-closed"`` : a closed Cardinal spline, as in a loop. + * ``"bundle"`` : equivalent to basis, except the tension parameter is used to + straighten the spline. + * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. + limit : 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 + opacity : 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. + The value is either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + 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. + point : anyOf(boolean, :class:`OverlayMarkDef`, enum('transparent')) + A flag for overlaying points on top of line or area marks, or an object defining the + properties of the overlayed points. + + + If this property is ``"transparent"``, transparent points will be used (for + enhancing tooltips and selections). + + If this property is an empty object ( ``{}`` ) or ``true``, filled points with + default properties will be used. + + If this property is ``false``, no points would be automatically added to line or + area marks. + + **Default value:** ``false``. + radius : float + Polar coordinate radial offset, in pixels, of the text label from the origin + determined by the ``x`` and ``y`` properties. + shape : string + Shape of the point marks. 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 + `__ (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.) + + **Default value:** ``"circle"`` + size : float + Default size for marks. + + + * For ``point`` / ``circle`` / ``square``, this represents the pixel area of the + marks. For example: in the case of circles, the radius is determined in part by + the square root of the size value. + * For ``bar``, this represents the band size of the bar, in pixels. + * For ``text``, this represents the font size, in pixels. + + **Default value:** ``30`` for point, circle, square marks; ``rangeStep`` - 1 for bar + marks with discrete dimensions; ``5`` for bar marks with continuous dimensions; + ``11`` for text marks. + stroke : :class:`Color` + Default Stroke Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + strokeCap : :class:`StrokeCap` + The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or + ``"square"``. + + **Default value:** ``"square"`` + strokeDash : List(float) + An array of alternating stroke, space lengths for creating dashed or dotted lines. + strokeDashOffset : float + The offset (in pixels) into which to begin drawing with the stroke dash array. + strokeJoin : :class:`StrokeJoin` + The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. + + **Default value:** ``"miter"`` + strokeMiterLimit : float + The miter limit at which to bevel a line join. + strokeOpacity : float + The stroke opacity (value between [0,1]). + + **Default value:** ``1`` + strokeWidth : float + The stroke width, in pixels. + tension : float + Depending on the interpolation type, sets the tension parameter (for line and area + marks). + text : string + Placeholder text if the ``text`` channel is not specified + theta : float + Polar coordinate angle, in radians, of the text label from the origin determined by + 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 : anyOf(:class:`Value`, :class:`TooltipContent`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``{"content": "encoding"}``, then all fields from ``encoding`` + will be used. + * If ``tooltip`` is ``{"content": "data"}``, then all fields that appear in the + highlighted data point will be used. + * If set to ``null``, then no tooltip will be used. + width : float + Width of the marks. + x : anyOf(float, enum('width')) + 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, enum('width')) + 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, enum('height')) + 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, enum('width')) + 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, baseline=Undefined, color=Undefined, + cornerRadius=Undefined, cursor=Undefined, dir=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, interpolate=Undefined, limit=Undefined, + opacity=Undefined, order=Undefined, orient=Undefined, point=Undefined, + radius=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, + strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, + strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, tension=Undefined, text=Undefined, theta=Undefined, + tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, + y2=Undefined, **kwds): + super(LineConfig, self).__init__(align=align, angle=angle, baseline=baseline, color=color, + cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, + dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, + filled=filled, font=font, fontSize=fontSize, + fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, + opacity=opacity, order=order, orient=orient, point=point, + radius=radius, shape=shape, size=size, stroke=stroke, + strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, tension=tension, text=text, + theta=theta, tooltip=tooltip, width=width, x=x, x2=x2, y=y, + y2=y2, **kwds) + + +class LogicalOperandPredicate(VegaLiteSchema): + """LogicalOperandPredicate schema wrapper + + anyOf(:class:`LogicalNotPredicate`, :class:`LogicalAndPredicate`, + :class:`LogicalOrPredicate`, :class:`Predicate`) + """ + _schema = {'$ref': '#/definitions/LogicalOperand'} + + def __init__(self, *args, **kwds): + super(LogicalOperandPredicate, self).__init__(*args, **kwds) + + +class LogicalAndPredicate(LogicalOperandPredicate): + """LogicalAndPredicate schema wrapper + + Mapping(required=[and]) + + Attributes + ---------- + + and : List(:class:`LogicalOperandPredicate`) + + """ + _schema = {'$ref': '#/definitions/LogicalAnd'} + + def __init__(self, **kwds): + super(LogicalAndPredicate, self).__init__(**kwds) + + +class LogicalNotPredicate(LogicalOperandPredicate): + """LogicalNotPredicate schema wrapper + + Mapping(required=[not]) + + Attributes + ---------- + + not : :class:`LogicalOperandPredicate` + + """ + _schema = {'$ref': '#/definitions/LogicalNot'} + + def __init__(self, **kwds): + super(LogicalNotPredicate, self).__init__(**kwds) + + +class LogicalOrPredicate(LogicalOperandPredicate): + """LogicalOrPredicate schema wrapper + + Mapping(required=[or]) + + Attributes + ---------- + + or : List(:class:`LogicalOperandPredicate`) + + """ + _schema = {'$ref': '#/definitions/LogicalOr'} + + def __init__(self, **kwds): + super(LogicalOrPredicate, self).__init__(**kwds) + + +class LookupData(VegaLiteSchema): + """LookupData schema wrapper + + Mapping(required=[data, key]) + + Attributes + ---------- + + data : :class:`Data` + Secondary data source to lookup in. + key : :class:`FieldName` + Key in data to lookup. + fields : List(:class:`FieldName`) + Fields in foreign data to lookup. + If not specified, the entire object is queried. + """ + _schema = {'$ref': '#/definitions/LookupData'} + + def __init__(self, data=Undefined, key=Undefined, fields=Undefined, **kwds): + super(LookupData, self).__init__(data=data, key=key, fields=fields, **kwds) + + +class Mark(AnyMark): + """Mark schema wrapper + + enum('area', 'bar', 'line', 'trail', 'point', 'text', 'tick', 'rect', 'rule', 'circle', + 'square', 'geoshape') + All types of primitive marks. + """ + _schema = {'$ref': '#/definitions/Mark'} + + def __init__(self, *args): + super(Mark, self).__init__(*args) + + +class MarkConfig(VegaLiteSchema): + """MarkConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : :class:`Align` + The horizontal alignment of the text. One of ``"left"``, ``"right"``, ``"center"``. + angle : float + The rotation angle of the text, in degrees. + baseline : :class:`TextBaseline` + The vertical alignment of the text. One of ``"top"``, ``"middle"``, ``"bottom"``. + + **Default value:** ``"middle"`` + color : :class:`Color` + Default color. Note that ``fill`` and ``stroke`` have higher precedence than + ``color`` and will override ``color``. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** This property cannot be used in a `style config + `__. + cornerRadius : float + The radius in pixels of rounded rectangle corners. + + **Default value:** ``0`` + cursor : :class:`Cursor` + The mouse cursor used over the mark. Any valid `CSS cursor type + `__ can be used. + dir : :class:`Dir` + 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 : 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 : 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 : string + The ellipsis string for text truncated in response to the limit parameter. + + **Default value:** ``"…"`` + fill : :class:`Color` + Default Fill Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + fillOpacity : float + The fill opacity (value between [0,1]). + + **Default value:** ``1`` + filled : boolean + Whether the mark's color should be used as fill color instead of stroke color. + + **Default value:** ``false`` for ``point``, ``line`` and ``rule`` ; otherwise, + ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : string + The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). + fontSize : float + The font size, in pixels. + fontStyle : :class:`FontStyle` + The font style (e.g., ``"italic"`` ). + fontWeight : :class:`FontWeight` + 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 : float + Height of the marks. + href : string + A URL to load upon mouse click. If defined, the mark acts as a hyperlink. + interpolate : :class:`Interpolate` + The line interpolation method to use for line and area marks. One of the following: + + + * ``"linear"`` : piecewise linear segments, as in a polyline. + * ``"linear-closed"`` : close the linear segments to form a polygon. + * ``"step"`` : alternate between horizontal and vertical segments, as in a step + function. + * ``"step-before"`` : alternate between vertical and horizontal segments, as in a + step function. + * ``"step-after"`` : alternate between horizontal and vertical segments, as in a + step function. + * ``"basis"`` : a B-spline, with control point duplication on the ends. + * ``"basis-open"`` : an open B-spline; may not intersect the start or end. + * ``"basis-closed"`` : a closed B-spline, as in a loop. + * ``"cardinal"`` : a Cardinal spline, with control point duplication on the ends. + * ``"cardinal-open"`` : an open Cardinal spline; may not intersect the start or end, + but will intersect other control points. + * ``"cardinal-closed"`` : a closed Cardinal spline, as in a loop. + * ``"bundle"`` : equivalent to basis, except the tension parameter is used to + straighten the spline. + * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. + limit : 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 + opacity : 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. + The value is either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + 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. + radius : float + Polar coordinate radial offset, in pixels, of the text label from the origin + determined by the ``x`` and ``y`` properties. + shape : string + Shape of the point marks. 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 + `__ (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.) + + **Default value:** ``"circle"`` + size : float + Default size for marks. + + + * For ``point`` / ``circle`` / ``square``, this represents the pixel area of the + marks. For example: in the case of circles, the radius is determined in part by + the square root of the size value. + * For ``bar``, this represents the band size of the bar, in pixels. + * For ``text``, this represents the font size, in pixels. + + **Default value:** ``30`` for point, circle, square marks; ``rangeStep`` - 1 for bar + marks with discrete dimensions; ``5`` for bar marks with continuous dimensions; + ``11`` for text marks. + stroke : :class:`Color` + Default Stroke Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + strokeCap : :class:`StrokeCap` + The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or + ``"square"``. + + **Default value:** ``"square"`` + strokeDash : List(float) + An array of alternating stroke, space lengths for creating dashed or dotted lines. + strokeDashOffset : float + The offset (in pixels) into which to begin drawing with the stroke dash array. + strokeJoin : :class:`StrokeJoin` + The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. + + **Default value:** ``"miter"`` + strokeMiterLimit : float + The miter limit at which to bevel a line join. + strokeOpacity : float + The stroke opacity (value between [0,1]). + + **Default value:** ``1`` + strokeWidth : float + The stroke width, in pixels. + tension : float + Depending on the interpolation type, sets the tension parameter (for line and area + marks). + text : string + Placeholder text if the ``text`` channel is not specified + theta : float + Polar coordinate angle, in radians, of the text label from the origin determined by + 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 : anyOf(:class:`Value`, :class:`TooltipContent`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``{"content": "encoding"}``, then all fields from ``encoding`` + will be used. + * If ``tooltip`` is ``{"content": "data"}``, then all fields that appear in the + highlighted data point will be used. + * If set to ``null``, then no tooltip will be used. + width : float + Width of the marks. + x : anyOf(float, enum('width')) + 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, enum('width')) + 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, enum('height')) + 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, enum('width')) + 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, baseline=Undefined, color=Undefined, + cornerRadius=Undefined, cursor=Undefined, dir=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, interpolate=Undefined, limit=Undefined, + opacity=Undefined, order=Undefined, orient=Undefined, radius=Undefined, + shape=Undefined, size=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, + tension=Undefined, text=Undefined, theta=Undefined, tooltip=Undefined, width=Undefined, + x=Undefined, x2=Undefined, y=Undefined, y2=Undefined, **kwds): + super(MarkConfig, self).__init__(align=align, angle=angle, baseline=baseline, color=color, + cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, + dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, + filled=filled, font=font, fontSize=fontSize, + fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, + opacity=opacity, order=order, orient=orient, radius=radius, + shape=shape, size=size, stroke=stroke, strokeCap=strokeCap, + strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + tension=tension, text=text, theta=theta, tooltip=tooltip, + width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + +class MarkDef(AnyMark): + """MarkDef schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`Mark` + 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 : :class:`Align` + The horizontal alignment of the text. One of ``"left"``, ``"right"``, ``"center"``. + angle : float + The rotation angle of the text, in degrees. + baseline : :class:`TextBaseline` + The vertical alignment of the text. One of ``"top"``, ``"middle"``, ``"bottom"``. + + **Default value:** ``"middle"`` + binSpacing : float + Offset between bars for binned field. Ideal value for this is either 0 (Preferred + by statisticians) or 1 (Vega-Lite Default, D3 example style). + + **Default value:** ``1`` + clip : boolean + Whether a mark be clipped to the enclosing group’s width and height. + color : :class:`Color` + Default color. Note that ``fill`` and ``stroke`` have higher precedence than + ``color`` and will override ``color``. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** This property cannot be used in a `style config + `__. + cornerRadius : float + The radius in pixels of rounded rectangle corners. + + **Default value:** ``0`` + cursor : :class:`Cursor` + The mouse cursor used over the mark. Any valid `CSS cursor type + `__ can be used. + dir : :class:`Dir` + 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 : 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 : 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 : string + The ellipsis string for text truncated in response to the limit parameter. + + **Default value:** ``"…"`` + fill : :class:`Color` + Default Fill Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + fillOpacity : float + The fill opacity (value between [0,1]). + + **Default value:** ``1`` + filled : boolean + Whether the mark's color should be used as fill color instead of stroke color. + + **Default value:** ``false`` for ``point``, ``line`` and ``rule`` ; otherwise, + ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : string + The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). + fontSize : float + The font size, in pixels. + fontStyle : :class:`FontStyle` + The font style (e.g., ``"italic"`` ). + fontWeight : :class:`FontWeight` + 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 : float + Height of the marks. + href : string + A URL to load upon mouse click. If defined, the mark acts as a hyperlink. + interpolate : :class:`Interpolate` + The line interpolation method to use for line and area marks. One of the following: + + + * ``"linear"`` : piecewise linear segments, as in a polyline. + * ``"linear-closed"`` : close the linear segments to form a polygon. + * ``"step"`` : alternate between horizontal and vertical segments, as in a step + function. + * ``"step-before"`` : alternate between vertical and horizontal segments, as in a + step function. + * ``"step-after"`` : alternate between horizontal and vertical segments, as in a + step function. + * ``"basis"`` : a B-spline, with control point duplication on the ends. + * ``"basis-open"`` : an open B-spline; may not intersect the start or end. + * ``"basis-closed"`` : a closed B-spline, as in a loop. + * ``"cardinal"`` : a Cardinal spline, with control point duplication on the ends. + * ``"cardinal-open"`` : an open Cardinal spline; may not intersect the start or end, + but will intersect other control points. + * ``"cardinal-closed"`` : a closed Cardinal spline, as in a loop. + * ``"bundle"`` : equivalent to basis, except the tension parameter is used to + straighten the spline. + * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. + limit : 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`) + A flag for overlaying line on top of area marks, or an object defining the + properties of the overlayed lines. + + + If this value is an empty object ( ``{}`` ) or ``true``, lines with default + properties will be used. + + If this value is ``false``, no lines would be automatically added to area marks. + + **Default value:** ``false``. + opacity : 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. + The value is either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + 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. + point : anyOf(boolean, :class:`OverlayMarkDef`, enum('transparent')) + A flag for overlaying points on top of line or area marks, or an object defining the + properties of the overlayed points. + + + If this property is ``"transparent"``, transparent points will be used (for + enhancing tooltips and selections). + + If this property is an empty object ( ``{}`` ) or ``true``, filled points with + default properties will be used. + + If this property is ``false``, no points would be automatically added to line or + area marks. + + **Default value:** ``false``. + radius : float + Polar coordinate radial offset, in pixels, of the text label from the origin + determined by the ``x`` and ``y`` properties. + shape : string + Shape of the point marks. 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 + `__ (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.) + + **Default value:** ``"circle"`` + size : float + Default size for marks. + + + * For ``point`` / ``circle`` / ``square``, this represents the pixel area of the + marks. For example: in the case of circles, the radius is determined in part by + the square root of the size value. + * For ``bar``, this represents the band size of the bar, in pixels. + * For ``text``, this represents the font size, in pixels. + + **Default value:** ``30`` for point, circle, square marks; ``rangeStep`` - 1 for bar + marks with discrete dimensions; ``5`` for bar marks with continuous dimensions; + ``11`` for text marks. + stroke : :class:`Color` + Default Stroke Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + strokeCap : :class:`StrokeCap` + The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or + ``"square"``. + + **Default value:** ``"square"`` + strokeDash : List(float) + An array of alternating stroke, space lengths for creating dashed or dotted lines. + strokeDashOffset : float + The offset (in pixels) into which to begin drawing with the stroke dash array. + strokeJoin : :class:`StrokeJoin` + The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. + + **Default value:** ``"miter"`` + strokeMiterLimit : float + The miter limit at which to bevel a line join. + strokeOpacity : float + The stroke opacity (value between [0,1]). + + **Default value:** ``1`` + strokeWidth : float + The stroke width, in pixels. + style : anyOf(string, List(string)) + 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 + `__. If style is an + array, later styles will override earlier styles. Any `mark properties + `__ explicitly + defined within the ``encoding`` will override a style default. + + **Default value:** The mark's name. For example, a bar mark will have style + ``"bar"`` by default. + **Note:** Any specified style will augment the default style. 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 : float + Depending on the interpolation type, sets the tension parameter (for line and area + marks). + text : string + Placeholder text if the ``text`` channel is not specified + theta : float + Polar coordinate angle, in radians, of the text label from the origin determined by + 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". + thickness : float + Thickness of the tick mark. + + **Default value:** ``1`` + tooltip : anyOf(:class:`Value`, :class:`TooltipContent`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``{"content": "encoding"}``, then all fields from ``encoding`` + will be used. + * If ``tooltip`` is ``{"content": "data"}``, then all fields that appear in the + highlighted data point will be used. + * If set to ``null``, then no tooltip will be used. + width : float + Width of the marks. + x : anyOf(float, enum('width')) + 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, enum('width')) + 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 : float + Offset for x2-position. + xOffset : float + Offset for x-position. + y : anyOf(float, enum('height')) + 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, enum('width')) + 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 : float + Offset for y2-position. + yOffset : float + Offset for y-position. + """ + _schema = {'$ref': '#/definitions/MarkDef'} + + def __init__(self, type=Undefined, align=Undefined, angle=Undefined, baseline=Undefined, + binSpacing=Undefined, clip=Undefined, color=Undefined, cornerRadius=Undefined, + cursor=Undefined, dir=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, interpolate=Undefined, limit=Undefined, line=Undefined, + opacity=Undefined, order=Undefined, orient=Undefined, point=Undefined, + radius=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, + strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, + strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, + theta=Undefined, thickness=Undefined, tooltip=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, baseline=baseline, + binSpacing=binSpacing, clip=clip, color=color, + cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, + filled=filled, font=font, fontSize=fontSize, fontStyle=fontStyle, + fontWeight=fontWeight, height=height, href=href, + interpolate=interpolate, limit=limit, line=line, opacity=opacity, + order=order, orient=orient, point=point, radius=radius, + shape=shape, size=size, stroke=stroke, strokeCap=strokeCap, + strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, style=style, + tension=tension, text=text, theta=theta, thickness=thickness, + tooltip=tooltip, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, + **kwds) + + +class Month(VegaLiteSchema): + """Month schema wrapper + + float + """ + _schema = {'$ref': '#/definitions/Month'} + + def __init__(self, *args): + super(Month, self).__init__(*args) + + +class MultiSelectionConfig(VegaLiteSchema): + """MultiSelectionConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + clear : anyOf(:class:`EventStream`, boolean) + Clears the selection, emptying it of all values. Can be an + `EventStream `__ or ``false`` to + disable. + + **Default value:** ``dblclick``. + + **See also:** `clear `__ + documentation. + empty : enum('all', 'none') + By default, ``all`` data values are considered to lie within an empty selection. + When set to ``none``, empty selections contain no data values. + encodings : List(:class:`SingleDefUnitChannel`) + An array of encoding channels. The corresponding data field values + must match for a data tuple to fall within the selection. + + **See also:** `encodings `__ + documentation. + fields : List(:class:`FieldName`) + An array of field names whose values must match for a data tuple to + fall within the selection. + + **See also:** `fields `__ + documentation. + init : anyOf(:class:`SelectionInitMapping`, List(:class:`SelectionInitMapping`)) + Initialize the selection with a mapping between `projected channels or field names + `__ and an initial + value (or array of values). + + **See also:** `init `__ + documentation. + nearest : boolean + When true, an invisible voronoi diagram is computed to accelerate discrete + selection. The data value *nearest* the mouse cursor is added to the selection. + + **See also:** `nearest `__ + documentation. + on : :class:`EventStream` + A `Vega event stream `__ (object or + selector) that triggers the selection. + For interval selections, the event stream must specify a `start and end + `__. + resolve : :class:`SelectionResolution` + 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. + + **See also:** `resolve + `__ documentation. + toggle : anyOf(string, boolean) + Controls whether data values should be toggled or only ever inserted into + multi selections. Can be ``true``, ``false`` (for insertion only), or a + `Vega expression `__. + + **Default value:** ``true``, which corresponds to ``event.shiftKey`` (i.e., + data values are toggled when a user interacts with the shift-key pressed). + + **See also:** `toggle `__ + documentation. + """ + _schema = {'$ref': '#/definitions/MultiSelectionConfig'} + + def __init__(self, clear=Undefined, empty=Undefined, encodings=Undefined, fields=Undefined, + init=Undefined, nearest=Undefined, on=Undefined, resolve=Undefined, toggle=Undefined, + **kwds): + super(MultiSelectionConfig, self).__init__(clear=clear, empty=empty, encodings=encodings, + fields=fields, init=init, nearest=nearest, on=on, + resolve=resolve, toggle=toggle, **kwds) + + +class NamedData(DataSource): + """NamedData schema wrapper + + Mapping(required=[name]) + + Attributes + ---------- + + name : string + Provide a placeholder name and bind data at runtime. + format : :class:`DataFormat` + An object that specifies the format for parsing the data. + """ + _schema = {'$ref': '#/definitions/NamedData'} + + def __init__(self, name=Undefined, format=Undefined, **kwds): + super(NamedData, self).__init__(name=name, format=format, **kwds) + + +class NiceTime(VegaLiteSchema): + """NiceTime schema wrapper + + enum('second', 'minute', 'hour', 'day', 'week', 'month', 'year') + """ + _schema = {'$ref': '#/definitions/NiceTime'} + + def __init__(self, *args): + super(NiceTime, self).__init__(*args) + + +class NumberValueDef(VegaLiteSchema): + """NumberValueDef schema wrapper + + Mapping(required=[value]) + Definition object for a constant value of an encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/NumberValueDef'} + + def __init__(self, value=Undefined, **kwds): + super(NumberValueDef, self).__init__(value=value, **kwds) + + +class NumericFieldDefWithCondition(VegaLiteSchema): + """NumericFieldDefWithCondition schema wrapper + + Mapping(required=[type]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + type : :class:`StandardType` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalNumberValueDef`, + List(:class:`ConditionalNumberValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/NumericFieldDefWithCondition'} + + def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, + title=Undefined, **kwds): + super(NumericFieldDefWithCondition, self).__init__(type=type, aggregate=aggregate, bin=bin, + condition=condition, field=field, + legend=legend, scale=scale, sort=sort, + timeUnit=timeUnit, title=title, **kwds) + + +class NumericValueDefWithCondition(VegaLiteSchema): + """NumericValueDefWithCondition schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ConditionalNumberValueDef`, + List(:class:`ConditionalNumberValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/NumericValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(NumericValueDefWithCondition, self).__init__(condition=condition, value=value, **kwds) + + +class OrderFieldDef(VegaLiteSchema): + """OrderFieldDef schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`StandardType` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + sort : :class:`SortOrder` + The sort order. One of ``"ascending"`` (default) or ``"descending"``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/OrderFieldDef'} + + def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, + sort=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(OrderFieldDef, self).__init__(type=type, aggregate=aggregate, bin=bin, field=field, + sort=sort, timeUnit=timeUnit, title=title, **kwds) + + +class Orient(VegaLiteSchema): + """Orient schema wrapper + + enum('left', 'right', 'top', 'bottom') + """ + _schema = {'$ref': '#/definitions/Orient'} + + def __init__(self, *args): + super(Orient, self).__init__(*args) + + +class Orientation(VegaLiteSchema): + """Orientation schema wrapper + + enum('horizontal', 'vertical') + """ + _schema = {'$ref': '#/definitions/Orientation'} + + def __init__(self, *args): + super(Orientation, self).__init__(*args) + + +class OverlayMarkDef(VegaLiteSchema): + """OverlayMarkDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : :class:`Align` + The horizontal alignment of the text. One of ``"left"``, ``"right"``, ``"center"``. + angle : float + The rotation angle of the text, in degrees. + baseline : :class:`TextBaseline` + The vertical alignment of the text. One of ``"top"``, ``"middle"``, ``"bottom"``. + + **Default value:** ``"middle"`` + clip : boolean + Whether a mark be clipped to the enclosing group’s width and height. + color : :class:`Color` + Default color. Note that ``fill`` and ``stroke`` have higher precedence than + ``color`` and will override ``color``. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** This property cannot be used in a `style config + `__. + cornerRadius : float + The radius in pixels of rounded rectangle corners. + + **Default value:** ``0`` + cursor : :class:`Cursor` + The mouse cursor used over the mark. Any valid `CSS cursor type + `__ can be used. + dir : :class:`Dir` + 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 : 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 : 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 : string + The ellipsis string for text truncated in response to the limit parameter. + + **Default value:** ``"…"`` + fill : :class:`Color` + Default Fill Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + fillOpacity : float + The fill opacity (value between [0,1]). + + **Default value:** ``1`` + filled : boolean + Whether the mark's color should be used as fill color instead of stroke color. + + **Default value:** ``false`` for ``point``, ``line`` and ``rule`` ; otherwise, + ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : string + The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). + fontSize : float + The font size, in pixels. + fontStyle : :class:`FontStyle` + The font style (e.g., ``"italic"`` ). + fontWeight : :class:`FontWeight` + 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 : float + Height of the marks. + href : string + A URL to load upon mouse click. If defined, the mark acts as a hyperlink. + interpolate : :class:`Interpolate` + The line interpolation method to use for line and area marks. One of the following: + + + * ``"linear"`` : piecewise linear segments, as in a polyline. + * ``"linear-closed"`` : close the linear segments to form a polygon. + * ``"step"`` : alternate between horizontal and vertical segments, as in a step + function. + * ``"step-before"`` : alternate between vertical and horizontal segments, as in a + step function. + * ``"step-after"`` : alternate between horizontal and vertical segments, as in a + step function. + * ``"basis"`` : a B-spline, with control point duplication on the ends. + * ``"basis-open"`` : an open B-spline; may not intersect the start or end. + * ``"basis-closed"`` : a closed B-spline, as in a loop. + * ``"cardinal"`` : a Cardinal spline, with control point duplication on the ends. + * ``"cardinal-open"`` : an open Cardinal spline; may not intersect the start or end, + but will intersect other control points. + * ``"cardinal-closed"`` : a closed Cardinal spline, as in a loop. + * ``"bundle"`` : equivalent to basis, except the tension parameter is used to + straighten the spline. + * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. + limit : 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 + opacity : 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. + The value is either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + 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. + radius : float + Polar coordinate radial offset, in pixels, of the text label from the origin + determined by the ``x`` and ``y`` properties. + shape : string + Shape of the point marks. 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 + `__ (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.) + + **Default value:** ``"circle"`` + size : float + Default size for marks. + + + * For ``point`` / ``circle`` / ``square``, this represents the pixel area of the + marks. For example: in the case of circles, the radius is determined in part by + the square root of the size value. + * For ``bar``, this represents the band size of the bar, in pixels. + * For ``text``, this represents the font size, in pixels. + + **Default value:** ``30`` for point, circle, square marks; ``rangeStep`` - 1 for bar + marks with discrete dimensions; ``5`` for bar marks with continuous dimensions; + ``11`` for text marks. + stroke : :class:`Color` + Default Stroke Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + strokeCap : :class:`StrokeCap` + The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or + ``"square"``. + + **Default value:** ``"square"`` + strokeDash : List(float) + An array of alternating stroke, space lengths for creating dashed or dotted lines. + strokeDashOffset : float + The offset (in pixels) into which to begin drawing with the stroke dash array. + strokeJoin : :class:`StrokeJoin` + The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. + + **Default value:** ``"miter"`` + strokeMiterLimit : float + The miter limit at which to bevel a line join. + strokeOpacity : float + The stroke opacity (value between [0,1]). + + **Default value:** ``1`` + strokeWidth : float + The stroke width, in pixels. + style : anyOf(string, List(string)) + 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 + `__. If style is an + array, later styles will override earlier styles. Any `mark properties + `__ explicitly + defined within the ``encoding`` will override a style default. + + **Default value:** The mark's name. For example, a bar mark will have style + ``"bar"`` by default. + **Note:** Any specified style will augment the default style. 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 : float + Depending on the interpolation type, sets the tension parameter (for line and area + marks). + text : string + Placeholder text if the ``text`` channel is not specified + theta : float + Polar coordinate angle, in radians, of the text label from the origin determined by + 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 : anyOf(:class:`Value`, :class:`TooltipContent`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``{"content": "encoding"}``, then all fields from ``encoding`` + will be used. + * If ``tooltip`` is ``{"content": "data"}``, then all fields that appear in the + highlighted data point will be used. + * If set to ``null``, then no tooltip will be used. + width : float + Width of the marks. + x : anyOf(float, enum('width')) + 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, enum('width')) + 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 : float + Offset for x2-position. + xOffset : float + Offset for x-position. + y : anyOf(float, enum('height')) + 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, enum('width')) + 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 : float + Offset for y2-position. + yOffset : float + Offset for y-position. + """ + _schema = {'$ref': '#/definitions/OverlayMarkDef'} + + def __init__(self, align=Undefined, angle=Undefined, baseline=Undefined, clip=Undefined, + color=Undefined, cornerRadius=Undefined, cursor=Undefined, dir=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, interpolate=Undefined, + limit=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, + radius=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, + strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, + strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, style=Undefined, tension=Undefined, text=Undefined, + theta=Undefined, tooltip=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, baseline=baseline, clip=clip, + color=color, cornerRadius=cornerRadius, cursor=cursor, + dir=dir, dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, + fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, + fontWeight=fontWeight, height=height, href=href, + interpolate=interpolate, limit=limit, opacity=opacity, + order=order, orient=orient, radius=radius, shape=shape, + size=size, stroke=stroke, strokeCap=strokeCap, + strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + style=style, tension=tension, text=text, theta=theta, + tooltip=tooltip, 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=[])) + """ + _schema = {'$ref': '#/definitions/Padding'} + + def __init__(self, *args, **kwds): + super(Padding, self).__init__(*args, **kwds) + + +class Parse(VegaLiteSchema): + """Parse schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Parse'} + + def __init__(self, **kwds): + super(Parse, self).__init__(**kwds) + + +class ParseValue(VegaLiteSchema): + """ParseValue schema wrapper + + anyOf(None, string, enum('string'), enum('boolean'), enum('date'), enum('number')) + """ + _schema = {'$ref': '#/definitions/ParseValue'} + + def __init__(self, *args, **kwds): + super(ParseValue, self).__init__(*args, **kwds) + + +class PartsMixinsBoxPlotPart(VegaLiteSchema): + """PartsMixinsBoxPlotPart schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + box : anyOf(boolean, :class:`MarkConfig`) + + median : anyOf(boolean, :class:`MarkConfig`) + + outliers : anyOf(boolean, :class:`MarkConfig`) + + rule : anyOf(boolean, :class:`MarkConfig`) + + ticks : anyOf(boolean, :class:`MarkConfig`) + + """ + _schema = {'$ref': '#/definitions/PartsMixins'} + + def __init__(self, box=Undefined, median=Undefined, outliers=Undefined, rule=Undefined, + ticks=Undefined, **kwds): + super(PartsMixinsBoxPlotPart, self).__init__(box=box, median=median, outliers=outliers, + rule=rule, ticks=ticks, **kwds) + + +class PartsMixinsErrorBandPart(VegaLiteSchema): + """PartsMixinsErrorBandPart schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : anyOf(boolean, :class:`MarkConfig`) + + borders : anyOf(boolean, :class:`MarkConfig`) + + """ + _schema = {'$ref': '#/definitions/PartsMixins'} + + def __init__(self, band=Undefined, borders=Undefined, **kwds): + super(PartsMixinsErrorBandPart, self).__init__(band=band, borders=borders, **kwds) + + +class PartsMixinsErrorBarPart(VegaLiteSchema): + """PartsMixinsErrorBarPart schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + rule : anyOf(boolean, :class:`MarkConfig`) + + ticks : anyOf(boolean, :class:`MarkConfig`) + + """ + _schema = {'$ref': '#/definitions/PartsMixins'} + + def __init__(self, rule=Undefined, ticks=Undefined, **kwds): + super(PartsMixinsErrorBarPart, self).__init__(rule=rule, ticks=ticks, **kwds) + + +class PositionFieldDef(VegaLiteSchema): + """PositionFieldDef schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`StandardType` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + axis : anyOf(:class:`Axis`, None) + An object defining properties of axis's gridlines, ticks and labels. + If ``null``, the axis for the encoding channel will be removed. + + **Default value:** If undefined, default `axis properties + `__ are applied. + + **See also:** `axis `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + impute : :class:`ImputeParams` + 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 the + ``Impute`` Operation. + + **See also:** `impute `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + stack : anyOf(:class:`StackOffset`, None, boolean) + Type of stacking offset if the field should be stacked. + ``stack`` is only applicable for ``x`` and ``y`` 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: + + + * ``"zero"`` or `true`: stacking with baseline offset at zero value of the scale + (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). + * ``"normalize"`` - stacking with normalized domain (for creating `normalized + stacked bar and area charts + `__. + :raw-html:`
    ` + - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). + * ``null`` or ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar`` or ``area`` ; + (2) the stacked measure channel (x or y) has a linear scale; + (3) At least one of non-position channels mapped to an unaggregated field that is + different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/PositionFieldDef'} + + def __init__(self, type=Undefined, aggregate=Undefined, axis=Undefined, bin=Undefined, + field=Undefined, impute=Undefined, scale=Undefined, sort=Undefined, stack=Undefined, + timeUnit=Undefined, title=Undefined, **kwds): + super(PositionFieldDef, self).__init__(type=type, aggregate=aggregate, axis=axis, bin=bin, + field=field, impute=impute, scale=scale, sort=sort, + stack=stack, timeUnit=timeUnit, title=title, **kwds) + + +class Predicate(LogicalOperandPredicate): + """Predicate schema wrapper + + anyOf(:class:`FieldEqualPredicate`, :class:`FieldRangePredicate`, + :class:`FieldOneOfPredicate`, :class:`FieldLTPredicate`, :class:`FieldGTPredicate`, + :class:`FieldLTEPredicate`, :class:`FieldGTEPredicate`, :class:`FieldValidPredicate`, + :class:`SelectionPredicate`, string) + """ + _schema = {'$ref': '#/definitions/Predicate'} + + def __init__(self, *args, **kwds): + super(Predicate, self).__init__(*args, **kwds) + + +class FieldEqualPredicate(Predicate): + """FieldEqualPredicate schema wrapper + + Mapping(required=[equal, field]) + + Attributes + ---------- + + equal : anyOf(string, float, boolean, :class:`DateTime`) + The value that the field should be equal to. + field : :class:`FieldName` + Field to be filtered. + timeUnit : :class:`TimeUnit` + Time unit for the field to be filtered. + """ + _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) + + +class FieldGTEPredicate(Predicate): + """FieldGTEPredicate schema wrapper + + Mapping(required=[field, gte]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be filtered. + gte : anyOf(string, float, :class:`DateTime`) + The value that the field should be greater than or equals to. + timeUnit : :class:`TimeUnit` + Time unit for the field to be filtered. + """ + _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) + + +class FieldGTPredicate(Predicate): + """FieldGTPredicate schema wrapper + + Mapping(required=[field, gt]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be filtered. + gt : anyOf(string, float, :class:`DateTime`) + The value that the field should be greater than. + timeUnit : :class:`TimeUnit` + Time unit for the field to be filtered. + """ + _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) + + +class FieldLTEPredicate(Predicate): + """FieldLTEPredicate schema wrapper + + Mapping(required=[field, lte]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be filtered. + lte : anyOf(string, float, :class:`DateTime`) + The value that the field should be less than or equals to. + timeUnit : :class:`TimeUnit` + Time unit for the field to be filtered. + """ + _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) + + +class FieldLTPredicate(Predicate): + """FieldLTPredicate schema wrapper + + Mapping(required=[field, lt]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be filtered. + lt : anyOf(string, float, :class:`DateTime`) + The value that the field should be less than. + timeUnit : :class:`TimeUnit` + Time unit for the field to be filtered. + """ + _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) + + +class FieldOneOfPredicate(Predicate): + """FieldOneOfPredicate schema wrapper + + Mapping(required=[field, oneOf]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be filtered. + oneOf : anyOf(List(string), List(float), List(boolean), List(:class:`DateTime`)) + A set of values that the ``field`` 's value should be a member of, + for a data item included in the filtered data. + timeUnit : :class:`TimeUnit` + Time unit for the field to be filtered. + """ + _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) + + +class FieldRangePredicate(Predicate): + """FieldRangePredicate schema wrapper + + Mapping(required=[field, range]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be filtered. + range : List(anyOf(float, :class:`DateTime`, None)) + An array of inclusive minimum and maximum values + for a field value of a data item to be included in the filtered data. + timeUnit : :class:`TimeUnit` + Time unit for the field to be filtered. + """ + _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) + + +class FieldValidPredicate(Predicate): + """FieldValidPredicate schema wrapper + + Mapping(required=[field, valid]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be filtered. + valid : boolean + If set to true the field's value has to be valid, meaning both not ``null`` and not + `NaN + `__. + timeUnit : :class:`TimeUnit` + Time unit for the field to be filtered. + """ + _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) + + +class Projection(VegaLiteSchema): + """Projection schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + center : List(float) + Sets the projection’s center to the specified center, a two-element array of + longitude and latitude in degrees. + + **Default value:** ``[0, 0]`` + clipAngle : float + Sets the projection’s clipping circle radius to the specified angle in degrees. If + ``null``, switches to `antimeridian `__ cutting + rather than small-circle clipping. + clipExtent : List(List(float)) + Sets 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 : float + + distance : float + + fraction : float + + lobes : float + + parallel : float + + precision : float + Sets the threshold for the projection’s `adaptive resampling + `__ to the specified value in pixels. This + value corresponds to the `Douglas–Peucker distance + `__. + If precision is not specified, returns the projection’s current resampling precision + which defaults to ``√0.5 ≅ 0.70710…``. + radius : float + + ratio : float + + reflectX : boolean + + reflectY : boolean + + rotate : List(float) + Sets 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 : float + Sets the projection's scale (zoom) value, overriding automatic fitting. + spacing : float + + tilt : float + + translate : List(float) + Sets the projection's translation (pan) value, overriding automatic fitting. + type : :class:`ProjectionType` + 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 + `__. + + **Default value:** ``mercator`` + """ + _schema = {'$ref': '#/definitions/Projection'} + + def __init__(self, center=Undefined, clipAngle=Undefined, clipExtent=Undefined, + coefficient=Undefined, distance=Undefined, fraction=Undefined, lobes=Undefined, + parallel=Undefined, precision=Undefined, radius=Undefined, ratio=Undefined, + reflectX=Undefined, reflectY=Undefined, rotate=Undefined, scale=Undefined, + spacing=Undefined, tilt=Undefined, translate=Undefined, type=Undefined, **kwds): + super(Projection, self).__init__(center=center, clipAngle=clipAngle, clipExtent=clipExtent, + coefficient=coefficient, distance=distance, fraction=fraction, + lobes=lobes, parallel=parallel, precision=precision, + radius=radius, ratio=ratio, reflectX=reflectX, + reflectY=reflectY, rotate=rotate, scale=scale, spacing=spacing, + tilt=tilt, translate=translate, type=type, **kwds) + + +class ProjectionConfig(VegaLiteSchema): + """ProjectionConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + center : List(float) + Sets the projection’s center to the specified center, a two-element array of + longitude and latitude in degrees. + + **Default value:** ``[0, 0]`` + clipAngle : float + Sets the projection’s clipping circle radius to the specified angle in degrees. If + ``null``, switches to `antimeridian `__ cutting + rather than small-circle clipping. + clipExtent : List(List(float)) + Sets 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 : float + + distance : float + + fraction : float + + lobes : float + + parallel : float + + precision : float + Sets the threshold for the projection’s `adaptive resampling + `__ to the specified value in pixels. This + value corresponds to the `Douglas–Peucker distance + `__. + If precision is not specified, returns the projection’s current resampling precision + which defaults to ``√0.5 ≅ 0.70710…``. + radius : float + + ratio : float + + reflectX : boolean + + reflectY : boolean + + rotate : List(float) + Sets 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 : float + Sets the projection's scale (zoom) value, overriding automatic fitting. + spacing : float + + tilt : float + + translate : List(float) + Sets the projection's translation (pan) value, overriding automatic fitting. + type : :class:`ProjectionType` + 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 + `__. + + **Default value:** ``mercator`` + """ + _schema = {'$ref': '#/definitions/ProjectionConfig'} + + def __init__(self, center=Undefined, clipAngle=Undefined, clipExtent=Undefined, + coefficient=Undefined, distance=Undefined, fraction=Undefined, lobes=Undefined, + parallel=Undefined, precision=Undefined, radius=Undefined, ratio=Undefined, + reflectX=Undefined, reflectY=Undefined, rotate=Undefined, scale=Undefined, + spacing=Undefined, tilt=Undefined, translate=Undefined, type=Undefined, **kwds): + super(ProjectionConfig, self).__init__(center=center, clipAngle=clipAngle, + clipExtent=clipExtent, coefficient=coefficient, + distance=distance, fraction=fraction, lobes=lobes, + parallel=parallel, precision=precision, radius=radius, + ratio=ratio, reflectX=reflectX, reflectY=reflectY, + rotate=rotate, scale=scale, spacing=spacing, tilt=tilt, + translate=translate, type=type, **kwds) + + +class ProjectionType(VegaLiteSchema): + """ProjectionType schema wrapper + + enum('albers', 'albersUsa', 'azimuthalEqualArea', 'azimuthalEquidistant', 'conicConformal', + 'conicEqualArea', 'conicEquidistant', 'equirectangular', 'gnomonic', 'identity', 'mercator', + 'naturalEarth1', 'orthographic', 'stereographic', 'transverseMercator') + """ + _schema = {'$ref': '#/definitions/ProjectionType'} + + def __init__(self, *args): + super(ProjectionType, self).__init__(*args) + + +class RangeConfig(VegaLiteSchema): + """RangeConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + category : anyOf(List(string), :class:`SchemeConfig`) + Default range for *nominal* (categorical) fields. + diverging : anyOf(List(string), :class:`SchemeConfig`) + Default range for diverging *quantitative* fields. + heatmap : anyOf(List(string), :class:`SchemeConfig`) + Default range for *quantitative* heatmaps. + ordinal : anyOf(List(string), :class:`SchemeConfig`) + Default range for *ordinal* fields. + ramp : anyOf(List(string), :class:`SchemeConfig`) + Default range for *quantitative* and *temporal* fields. + symbol : List(string) + Default range palette for the ``shape`` channel. + """ + _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) + + +class RangeConfigValue(VegaLiteSchema): + """RangeConfigValue schema wrapper + + anyOf(List(anyOf(float, string)), :class:`SchemeConfig`, Mapping(required=[step])) + """ + _schema = {'$ref': '#/definitions/RangeConfigValue'} + + def __init__(self, *args, **kwds): + super(RangeConfigValue, self).__init__(*args, **kwds) + + +class RectConfig(VegaLiteSchema): + """RectConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : :class:`Align` + The horizontal alignment of the text. One of ``"left"``, ``"right"``, ``"center"``. + angle : float + The rotation angle of the text, in degrees. + baseline : :class:`TextBaseline` + The vertical alignment of the text. One of ``"top"``, ``"middle"``, ``"bottom"``. + + **Default value:** ``"middle"`` + binSpacing : float + Offset between bars for binned field. Ideal value for this is either 0 (Preferred + by statisticians) or 1 (Vega-Lite Default, D3 example style). + + **Default value:** ``1`` + color : :class:`Color` + Default color. Note that ``fill`` and ``stroke`` have higher precedence than + ``color`` and will override ``color``. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** This property cannot be used in a `style config + `__. + continuousBandSize : float + The default size of the bars on continuous scales. + + **Default value:** ``5`` + cornerRadius : float + The radius in pixels of rounded rectangle corners. + + **Default value:** ``0`` + cursor : :class:`Cursor` + The mouse cursor used over the mark. Any valid `CSS cursor type + `__ can be used. + dir : :class:`Dir` + 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 : float + The default size of the bars with discrete dimensions. If unspecified, the default + size is ``bandSize-1``, + which provides 1 pixel offset between bars. + dx : 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 : 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 : string + The ellipsis string for text truncated in response to the limit parameter. + + **Default value:** ``"…"`` + fill : :class:`Color` + Default Fill Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + fillOpacity : float + The fill opacity (value between [0,1]). + + **Default value:** ``1`` + filled : boolean + Whether the mark's color should be used as fill color instead of stroke color. + + **Default value:** ``false`` for ``point``, ``line`` and ``rule`` ; otherwise, + ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : string + The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). + fontSize : float + The font size, in pixels. + fontStyle : :class:`FontStyle` + The font style (e.g., ``"italic"`` ). + fontWeight : :class:`FontWeight` + 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 : float + Height of the marks. + href : string + A URL to load upon mouse click. If defined, the mark acts as a hyperlink. + interpolate : :class:`Interpolate` + The line interpolation method to use for line and area marks. One of the following: + + + * ``"linear"`` : piecewise linear segments, as in a polyline. + * ``"linear-closed"`` : close the linear segments to form a polygon. + * ``"step"`` : alternate between horizontal and vertical segments, as in a step + function. + * ``"step-before"`` : alternate between vertical and horizontal segments, as in a + step function. + * ``"step-after"`` : alternate between horizontal and vertical segments, as in a + step function. + * ``"basis"`` : a B-spline, with control point duplication on the ends. + * ``"basis-open"`` : an open B-spline; may not intersect the start or end. + * ``"basis-closed"`` : a closed B-spline, as in a loop. + * ``"cardinal"`` : a Cardinal spline, with control point duplication on the ends. + * ``"cardinal-open"`` : an open Cardinal spline; may not intersect the start or end, + but will intersect other control points. + * ``"cardinal-closed"`` : a closed Cardinal spline, as in a loop. + * ``"bundle"`` : equivalent to basis, except the tension parameter is used to + straighten the spline. + * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. + limit : 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 + opacity : 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. + The value is either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + 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. + radius : float + Polar coordinate radial offset, in pixels, of the text label from the origin + determined by the ``x`` and ``y`` properties. + shape : string + Shape of the point marks. 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 + `__ (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.) + + **Default value:** ``"circle"`` + size : float + Default size for marks. + + + * For ``point`` / ``circle`` / ``square``, this represents the pixel area of the + marks. For example: in the case of circles, the radius is determined in part by + the square root of the size value. + * For ``bar``, this represents the band size of the bar, in pixels. + * For ``text``, this represents the font size, in pixels. + + **Default value:** ``30`` for point, circle, square marks; ``rangeStep`` - 1 for bar + marks with discrete dimensions; ``5`` for bar marks with continuous dimensions; + ``11`` for text marks. + stroke : :class:`Color` + Default Stroke Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + strokeCap : :class:`StrokeCap` + The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or + ``"square"``. + + **Default value:** ``"square"`` + strokeDash : List(float) + An array of alternating stroke, space lengths for creating dashed or dotted lines. + strokeDashOffset : float + The offset (in pixels) into which to begin drawing with the stroke dash array. + strokeJoin : :class:`StrokeJoin` + The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. + + **Default value:** ``"miter"`` + strokeMiterLimit : float + The miter limit at which to bevel a line join. + strokeOpacity : float + The stroke opacity (value between [0,1]). + + **Default value:** ``1`` + strokeWidth : float + The stroke width, in pixels. + tension : float + Depending on the interpolation type, sets the tension parameter (for line and area + marks). + text : string + Placeholder text if the ``text`` channel is not specified + theta : float + Polar coordinate angle, in radians, of the text label from the origin determined by + 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 : anyOf(:class:`Value`, :class:`TooltipContent`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``{"content": "encoding"}``, then all fields from ``encoding`` + will be used. + * If ``tooltip`` is ``{"content": "data"}``, then all fields that appear in the + highlighted data point will be used. + * If set to ``null``, then no tooltip will be used. + width : float + Width of the marks. + x : anyOf(float, enum('width')) + 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, enum('width')) + 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, enum('height')) + 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, enum('width')) + 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, baseline=Undefined, binSpacing=Undefined, + color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, + cursor=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, interpolate=Undefined, + limit=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, + radius=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, + strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, + strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, tension=Undefined, text=Undefined, theta=Undefined, + tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, + y2=Undefined, **kwds): + super(RectConfig, self).__init__(align=align, angle=angle, baseline=baseline, + binSpacing=binSpacing, color=color, + continuousBandSize=continuousBandSize, + cornerRadius=cornerRadius, cursor=cursor, 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, interpolate=interpolate, limit=limit, + opacity=opacity, order=order, orient=orient, radius=radius, + shape=shape, size=size, stroke=stroke, strokeCap=strokeCap, + strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + tension=tension, text=text, theta=theta, tooltip=tooltip, + width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + +class RepeatMapping(VegaLiteSchema): + """RepeatMapping schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + column : List(string) + An array of fields to be repeated horizontally. + row : List(string) + An array of fields to be repeated vertically. + """ + _schema = {'$ref': '#/definitions/RepeatMapping'} + + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(RepeatMapping, self).__init__(column=column, row=row, **kwds) + + +class RepeatRef(Field): + """RepeatRef schema wrapper + + Mapping(required=[repeat]) + A ValueDef with optional Condition + Reference to a repeated value. + + Attributes + ---------- + + repeat : enum('row', 'column', 'repeat') + + """ + _schema = {'$ref': '#/definitions/RepeatRef'} + + def __init__(self, repeat=Undefined, **kwds): + super(RepeatRef, self).__init__(repeat=repeat, **kwds) + + +class Resolve(VegaLiteSchema): + """Resolve schema wrapper + + Mapping(required=[]) + 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. + + Attributes + ---------- + + axis : :class:`AxisResolveMap` + + legend : :class:`LegendResolveMap` + + scale : :class:`ScaleResolveMap` + + """ + _schema = {'$ref': '#/definitions/Resolve'} + + def __init__(self, axis=Undefined, legend=Undefined, scale=Undefined, **kwds): + super(Resolve, self).__init__(axis=axis, legend=legend, scale=scale, **kwds) + + +class ResolveMode(VegaLiteSchema): + """ResolveMode schema wrapper + + enum('independent', 'shared') + """ + _schema = {'$ref': '#/definitions/ResolveMode'} + + def __init__(self, *args): + super(ResolveMode, self).__init__(*args) + + +class RowColLayoutAlign(VegaLiteSchema): + """RowColLayoutAlign schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + column : :class:`LayoutAlign` + + row : :class:`LayoutAlign` + + """ + _schema = {'$ref': '#/definitions/RowCol'} + + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(RowColLayoutAlign, self).__init__(column=column, row=row, **kwds) + + +class RowColboolean(VegaLiteSchema): + """RowColboolean schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + column : boolean + + row : boolean + + """ + _schema = {'$ref': '#/definitions/RowCol'} + + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(RowColboolean, self).__init__(column=column, row=row, **kwds) + + +class RowColnumber(VegaLiteSchema): + """RowColnumber schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + column : float + + row : float + + """ + _schema = {'$ref': '#/definitions/RowCol'} + + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(RowColnumber, self).__init__(column=column, row=row, **kwds) + + +class Scale(VegaLiteSchema): + """Scale schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : 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 + steps should be centered within the range. A value of ``0`` or ``1`` may be used to + shift the bands to one side, say to position them adjacent to an axis. + + **Default value:** ``0.5`` + base : float + The logarithm base of the ``log`` scale (default ``10`` ). + bins : List(float) + 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 : boolean + 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 + `__ 's ``clamp`` ( + ``true`` by default). + constant : float + A constant determining the slope of the symlog function around zero. Only used for + ``symlog`` scales. + + **Default value:** ``1`` + domain : anyOf(List(float), List(string), List(boolean), List(:class:`DateTime`), + enum('unaggregated'), :class:`SelectionDomain`) + Customized domain values. + + For *quantitative* fields, ``domain`` can take the form of a two-element array with + minimum and maximum values. `Piecewise scales + `__ can be created by + providing a ``domain`` with more than two entries. + If the input field is aggregated, ``domain`` can also be a string value + ``"unaggregated"``, indicating that the domain should include the raw data values + prior to the aggregation. + + For *temporal* fields, ``domain`` can be a two-element array minimum and maximum + values, in the form of either timestamps or the `DateTime definition objects + `__. + + For *ordinal* and *nominal* fields, ``domain`` can be an array that lists valid + input values. + + The ``selection`` property can be used to `interactively determine + `__ the scale + domain. + exponent : float + The exponent of the ``pow`` scale. + interpolate : anyOf(:class:`ScaleInterpolate`, :class:`ScaleInterpolateParams`) + 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 + ``rgb``, ``hsl``, ``hsl-long``, ``lab``, ``hcl``, ``hcl-long``, ``cubehelix`` and + ``cubehelix-long`` ('-long' variants use longer paths in polar coordinate spaces). + If object-valued, this property accepts an object with a string-valued *type* + property and an optional numeric *gamma* property applicable to rgb and cubehelix + interpolators. For more, see the `d3-interpolate documentation + `__. + + + * **Default value:** ``hcl`` + nice : anyOf(boolean, float, :class:`NiceTime`, Mapping(required=[interval, step])) + 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 + irregular. For example, for a domain of *[0.201479…, 0.996679…]*, a nice domain + might be *[0.2, 1.0]*. + + For quantitative scales such as linear, ``nice`` can be either a boolean flag or a + number. If ``nice`` is a number, it will represent a desired tick count. This allows + greater control over the step size used to extend the bounds, guaranteeing that the + returned ticks will exactly cover the domain. + + For temporal fields with time and utc scales, the ``nice`` value can be a string + indicating the desired time interval. Legal values are ``"millisecond"``, + ``"second"``, ``"minute"``, ``"hour"``, ``"day"``, ``"week"``, ``"month"``, and + ``"year"``. Alternatively, ``time`` and ``utc`` scales can accept an object-valued + interval specifier of the form ``{"interval": "month", "step": 3}``, which includes + a desired number of interval steps. Here, the domain would snap to quarter (Jan, + Apr, Jul, Oct) boundaries. + + **Default value:** ``true`` for unbinned *quantitative* fields; ``false`` otherwise. + padding : float + For * `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 + function as intended. Padding adjustment is performed prior to all other + adjustments, including the effects of the  ``zero``,  ``nice``,  ``domainMin``, and + ``domainMax``  properties. + + For * `band `__ * scales, + shortcut for setting ``paddingInner`` and ``paddingOuter`` to the same value. + + For * `point `__ * scales, + alias for ``paddingOuter``. + + **Default value:** For *continuous* scales, derived from the `scale config + `__ 's + ``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 : 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]. + + For point scale, this property is invalid as point scales do not have internal band + widths (only step sizes between bands). + + **Default value:** derived from the `scale config + `__ 's + ``bandPaddingInner``. + paddingOuter : 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]. + + **Default value:** derived from the `scale 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(List(float), List(string), string) + The range of the scale. One of: + + + A string indicating a `pre-defined named scale range + `__ (e.g., example, + ``"symbol"``, or ``"diverging"`` ). + + For `continuous scales + `__, two-element array + indicating minimum and maximum values, or an array with more than two entries for + specifying a `piecewise scale + `__. + + For `discrete `__ and + `discretizing `__ + scales, an array of desired output values. + + **Notes:** + + 1) For color scales you can also specify a color `scheme + `__ instead of ``range``. + + 2) Any directly specified ``range`` for ``x`` and ``y`` channels will be ignored. + Range can be customized via the view's corresponding `size + `__ ( ``width`` and ``height`` ) or + via `range steps and paddings properties <#range-step>`__ for `band <#band>`__ and + `point <#point>`__ scales. + rangeStep : anyOf(float, None) + The distance between the starts of adjacent bands or points in `band + `__ and `point + `__ scales. + + If ``rangeStep`` is ``null`` or if the view contains the scale's corresponding `size + `__ ( ``width`` for ``x`` scales + and ``height`` for ``y`` scales), ``rangeStep`` will be automatically determined to + fit the size of the view. + + **Default value:** derived the `scale config + `__ 's + ``textXRangeStep`` ( ``90`` by default) for x-scales of ``text`` marks and + ``rangeStep`` ( ``21`` by default) for x-scales of other marks and y-scales. + + **Warning** : If ``rangeStep`` is ``null`` and the cardinality of the scale's domain + is higher than ``width`` or ``height``, the rangeStep might become less than one + pixel and the mark might not appear correctly. + round : boolean + If ``true``, rounds numeric output values to integers. This can be helpful for + snapping to the pixel grid. + + **Default value:** ``false``. + scheme : anyOf(string, :class:`SchemeParams`) + A string indicating a color `scheme + `__ name (e.g., + ``"category10"`` or ``"blues"`` ) or a `scheme parameter object + `__. + + Discrete color schemes may be used with `discrete + `__ or `discretizing + `__ scales. + Continuous color schemes are intended for use with color scales. + + For the full list of supported schemes, please refer to the `Vega Scheme + `__ reference. + type : :class:`ScaleType` + The type of scale. Vega-Lite supports the following categories of scale types: + + 1) `Continuous Scales + `__ -- mapping + continuous domains to continuous output ranges ( `"linear" + `__, `"pow" + `__, `"sqrt" + `__, `"symlog" + `__, `"log" + `__, `"time" + `__, `"utc" + `__. + + 2) `Discrete Scales `__ + -- mapping discrete domains to discrete ( `"ordinal" + `__ ) or continuous ( + `"band" `__ and `"point" + `__ ) output ranges. + + 3) `Discretizing Scales + `__ -- mapping + continuous domains to discrete output ranges `"bin-ordinal" + `__, `"quantile" + `__, `"quantize" + `__ and `"threshold" + `__. + + **Default value:** please see the `scale type table + `__. + zero : boolean + 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 + binned and no custom ``domain`` is provided; ``false`` otherwise. + + **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, exponent=Undefined, interpolate=Undefined, + nice=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, + range=Undefined, rangeStep=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, exponent=exponent, interpolate=interpolate, + nice=nice, padding=padding, paddingInner=paddingInner, + paddingOuter=paddingOuter, range=range, rangeStep=rangeStep, + round=round, scheme=scheme, type=type, zero=zero, **kwds) + + +class ScaleConfig(VegaLiteSchema): + """ScaleConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + bandPaddingInner : float + Default inner padding for ``x`` and ``y`` band-ordinal scales. + + **Default value:** + + + * ``barBandPaddingInner`` for bar marks ( ``0.1`` by default) + * ``rectBandPaddingInner`` for rect and other marks ( ``0`` by default) + bandPaddingOuter : float + Default outer padding for ``x`` and ``y`` band-ordinal scales. + + **Default value:** ``paddingInner/2`` (which makes *width/height = number of unique + values * step* ) + barBandPaddingInner : float + Default inner padding for ``x`` and ``y`` band-ordinal scales of ``"bar"`` marks. + + **Default value:** ``0.1`` + barBandPaddingOuter : float + Default outer padding for ``x`` and ``y`` band-ordinal scales of ``"bar"`` marks. + If not specified, by default, band scale's paddingOuter is paddingInner/2. + clamp : boolean + If true, values that exceed the data domain are clamped to either the minimum or + maximum range value + continuousPadding : float + Default padding for continuous scales. + + **Default:** ``5`` for continuous x-scale of a vertical bar and continuous y-scale + of a horizontal bar.; ``0`` otherwise. + maxBandSize : float + The default max value for mapping quantitative fields to bar's size/bandSize. + + If undefined (default), we will use the scale's ``rangeStep`` - 1. + maxFontSize : float + The default max value for mapping quantitative fields to text's size/fontSize. + + **Default value:** ``40`` + maxOpacity : float + Default max opacity for mapping a field to opacity. + + **Default value:** ``0.8`` + maxSize : float + Default max value for point size scale. + maxStrokeWidth : float + Default max strokeWidth for the scale of strokeWidth for rule and line marks and of + size for trail marks. + + **Default value:** ``4`` + minBandSize : float + The default min value for mapping quantitative fields to bar and tick's + size/bandSize scale with zero=false. + + **Default value:** ``2`` + minFontSize : float + The default min value for mapping quantitative fields to tick's size/fontSize scale + with zero=false + + **Default value:** ``8`` + minOpacity : float + Default minimum opacity for mapping a field to opacity. + + **Default value:** ``0.3`` + minSize : float + Default minimum value for point size scale with zero=false. + + **Default value:** ``9`` + minStrokeWidth : float + Default minimum strokeWidth for the scale of strokeWidth for rule and line marks and + of size for trail marks with zero=false. + + **Default value:** ``1`` + pointPadding : float + Default outer padding for ``x`` and ``y`` point-ordinal scales. + + **Default value:** ``0.5`` (which makes *width/height = number of unique values * + step* ) + quantileCount : float + Default range cardinality for `quantile + `__ scale. + + **Default value:** ``4`` + quantizeCount : float + Default range cardinality for `quantize + `__ scale. + + **Default value:** ``4`` + rangeStep : anyOf(float, None) + Default range step for band and point scales of (1) the ``y`` channel + and (2) the ``x`` channel when the mark is not ``text``. + + **Default value:** ``20`` + rectBandPaddingInner : float + Default inner padding for ``x`` and ``y`` band-ordinal scales of ``"rect"`` marks. + + **Default value:** ``0`` + rectBandPaddingOuter : float + Default outer padding for ``x`` and ``y`` band-ordinal scales of ``"rect"`` marks. + If not specified, by default, band scale's paddingOuter is paddingInner/2. + round : boolean + 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.) + textXRangeStep : float + Default range step for ``x`` band and point scales of text marks. + + **Default value:** ``90`` + useUnaggregatedDomain : boolean + Use the source data range before aggregation as scale domain instead of aggregated + data for aggregate axis. + + This is equivalent to setting ``domain`` to ``"unaggregate"`` for aggregated + *quantitative* fields by default. + + This property only works with aggregate functions that produce values within the raw + data domain ( ``"mean"``, ``"average"``, ``"median"``, ``"q1"``, ``"q3"``, + ``"min"``, ``"max"`` ). For other aggregations that produce values outside of the + raw data domain (e.g. ``"count"``, ``"sum"`` ), this property is ignored. + + **Default value:** ``false`` + """ + _schema = {'$ref': '#/definitions/ScaleConfig'} + + def __init__(self, bandPaddingInner=Undefined, bandPaddingOuter=Undefined, + barBandPaddingInner=Undefined, barBandPaddingOuter=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, pointPadding=Undefined, quantileCount=Undefined, + quantizeCount=Undefined, rangeStep=Undefined, rectBandPaddingInner=Undefined, + rectBandPaddingOuter=Undefined, round=Undefined, textXRangeStep=Undefined, + useUnaggregatedDomain=Undefined, **kwds): + super(ScaleConfig, self).__init__(bandPaddingInner=bandPaddingInner, + bandPaddingOuter=bandPaddingOuter, + barBandPaddingInner=barBandPaddingInner, + barBandPaddingOuter=barBandPaddingOuter, clamp=clamp, + continuousPadding=continuousPadding, maxBandSize=maxBandSize, + maxFontSize=maxFontSize, maxOpacity=maxOpacity, + maxSize=maxSize, maxStrokeWidth=maxStrokeWidth, + minBandSize=minBandSize, minFontSize=minFontSize, + minOpacity=minOpacity, minSize=minSize, + minStrokeWidth=minStrokeWidth, pointPadding=pointPadding, + quantileCount=quantileCount, quantizeCount=quantizeCount, + rangeStep=rangeStep, + rectBandPaddingInner=rectBandPaddingInner, + rectBandPaddingOuter=rectBandPaddingOuter, round=round, + textXRangeStep=textXRangeStep, + useUnaggregatedDomain=useUnaggregatedDomain, **kwds) + + +class ScaleInterpolate(VegaLiteSchema): + """ScaleInterpolate schema wrapper + + enum('rgb', 'lab', 'hcl', 'hsl', 'hsl-long', 'hcl-long', 'cubehelix', 'cubehelix-long') + """ + _schema = {'$ref': '#/definitions/ScaleInterpolate'} + + def __init__(self, *args): + super(ScaleInterpolate, self).__init__(*args) + + +class ScaleInterpolateParams(VegaLiteSchema): + """ScaleInterpolateParams schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('rgb', 'cubehelix', 'cubehelix-long') + + gamma : float + + """ + _schema = {'$ref': '#/definitions/ScaleInterpolateParams'} + + def __init__(self, type=Undefined, gamma=Undefined, **kwds): + super(ScaleInterpolateParams, self).__init__(type=type, gamma=gamma, **kwds) + + +class ScaleResolveMap(VegaLiteSchema): + """ScaleResolveMap schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + color : :class:`ResolveMode` + + fill : :class:`ResolveMode` + + fillOpacity : :class:`ResolveMode` + + opacity : :class:`ResolveMode` + + shape : :class:`ResolveMode` + + size : :class:`ResolveMode` + + stroke : :class:`ResolveMode` + + strokeOpacity : :class:`ResolveMode` + + strokeWidth : :class:`ResolveMode` + + x : :class:`ResolveMode` + + y : :class:`ResolveMode` + + """ + _schema = {'$ref': '#/definitions/ScaleResolveMap'} + + def __init__(self, color=Undefined, fill=Undefined, fillOpacity=Undefined, opacity=Undefined, + shape=Undefined, size=Undefined, stroke=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, x=Undefined, y=Undefined, **kwds): + super(ScaleResolveMap, self).__init__(color=color, fill=fill, fillOpacity=fillOpacity, + opacity=opacity, shape=shape, size=size, stroke=stroke, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, x=x, + y=y, **kwds) + + +class ScaleType(VegaLiteSchema): + """ScaleType schema wrapper + + enum('linear', 'log', 'pow', 'sqrt', 'symlog', 'time', 'utc', 'quantile', 'quantize', + 'threshold', 'bin-ordinal', 'ordinal', 'point', 'band') + """ + _schema = {'$ref': '#/definitions/ScaleType'} + + def __init__(self, *args): + super(ScaleType, self).__init__(*args) + + +class SchemeConfig(RangeConfigValue): + """SchemeConfig schema wrapper + + Mapping(required=[scheme]) + + Attributes + ---------- + + scheme : string + + count : float + + extent : List(float) + + """ + _schema = {'$ref': '#/definitions/SchemeConfig'} + + def __init__(self, scheme=Undefined, count=Undefined, extent=Undefined, **kwds): + super(SchemeConfig, self).__init__(scheme=scheme, count=count, extent=extent, **kwds) + + +class SchemeParams(VegaLiteSchema): + """SchemeParams schema wrapper + + Mapping(required=[name]) + + Attributes + ---------- + + name : string + 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 + `__ reference. + count : float + 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) + 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) + + +class SecondaryFieldDef(VegaLiteSchema): + """SecondaryFieldDef schema wrapper + + Mapping(required=[]) + 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``. + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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, bin=Undefined, field=Undefined, timeUnit=Undefined, + title=Undefined, **kwds): + super(SecondaryFieldDef, self).__init__(aggregate=aggregate, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class SelectionConfig(VegaLiteSchema): + """SelectionConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + interval : :class:`IntervalSelectionConfig` + The default definition for an `interval + `__ selection. All + properties and transformations + for an interval selection definition (except ``type`` ) may be specified here. + + For instance, setting ``interval`` to ``{"translate": false}`` disables the ability + to move + interval selections by default. + multi : :class:`MultiSelectionConfig` + The default definition for a `multi + `__ selection. All + properties and transformations + for a multi selection definition (except ``type`` ) may be specified here. + + For instance, setting ``multi`` to ``{"toggle": "event.altKey"}`` adds additional + values to + multi selections when clicking with the alt-key pressed by default. + single : :class:`SingleSelectionConfig` + The default definition for a `single + `__ selection. All + properties and transformations + for a single selection definition (except ``type`` ) may be specified here. + + For instance, setting ``single`` to ``{"on": "dblclick"}`` populates single + selections on double-click by default. + """ + _schema = {'$ref': '#/definitions/SelectionConfig'} + + def __init__(self, interval=Undefined, multi=Undefined, single=Undefined, **kwds): + super(SelectionConfig, self).__init__(interval=interval, multi=multi, single=single, **kwds) + + +class SelectionDef(VegaLiteSchema): + """SelectionDef schema wrapper + + anyOf(:class:`SingleSelection`, :class:`MultiSelection`, :class:`IntervalSelection`) + """ + _schema = {'$ref': '#/definitions/SelectionDef'} + + def __init__(self, *args, **kwds): + super(SelectionDef, self).__init__(*args, **kwds) + + +class IntervalSelection(SelectionDef): + """IntervalSelection schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('interval') + Determines the default event processing and data query for the selection. Vega-Lite + currently supports three selection types: + + + * ``single`` -- to select a single discrete data value on ``click``. + * ``multi`` -- to select multiple discrete data value; 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 : enum('scales') + Establishes a two-way binding between the interval selection and the scales + used within the same view. This allows a user to interactively pan and + zoom the view. + + **See also:** `bind `__ + documentation. + clear : anyOf(:class:`EventStream`, boolean) + Clears the selection, emptying it of all values. Can be an + `EventStream `__ or ``false`` to + disable. + + **Default value:** ``dblclick``. + + **See also:** `clear `__ + documentation. + empty : enum('all', 'none') + By default, ``all`` data values are considered to lie within an empty selection. + When set to ``none``, empty selections contain no data values. + encodings : List(:class:`SingleDefUnitChannel`) + An array of encoding channels. The corresponding data field values + must match for a data tuple to fall within the selection. + + **See also:** `encodings `__ + documentation. + fields : List(:class:`FieldName`) + An array of field names whose values must match for a data tuple to + fall within the selection. + + **See also:** `fields `__ + documentation. + init : :class:`SelectionInitIntervalMapping` + Initialize the selection with a mapping between `projected channels or field names + `__ and arrays of + initial values. + + **See also:** `init `__ + documentation. + mark : :class:`BrushConfig` + 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 `__ + documentation. + on : :class:`EventStream` + A `Vega event stream `__ (object or + selector) that triggers the selection. + For interval selections, the event stream must specify a `start and end + `__. + resolve : :class:`SelectionResolution` + 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. + + **See also:** `resolve + `__ documentation. + translate : anyOf(string, boolean) + 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 `__ + which must include a start and end event to trigger continuous panning. + + **Default value:** ``true``, which corresponds to + ``[mousedown, window:mouseup] > window:mousemove!`` which corresponds to + clicks and dragging within an interval selection to reposition it. + + **See also:** `translate `__ + documentation. + zoom : anyOf(string, boolean) + When truthy, allows a user to interactively resize an interval selection. + Can be ``true``, ``false`` (to disable zooming), or a `Vega event stream + definition `__. Currently, + only ``wheel`` events are supported. + + **Default value:** ``true``, which corresponds to ``wheel!``. + + **See also:** `zoom `__ + documentation. + """ + _schema = {'$ref': '#/definitions/IntervalSelection'} + + def __init__(self, type=Undefined, bind=Undefined, clear=Undefined, empty=Undefined, + encodings=Undefined, fields=Undefined, init=Undefined, mark=Undefined, on=Undefined, + resolve=Undefined, translate=Undefined, zoom=Undefined, **kwds): + super(IntervalSelection, self).__init__(type=type, bind=bind, clear=clear, empty=empty, + encodings=encodings, fields=fields, init=init, + mark=mark, on=on, resolve=resolve, translate=translate, + zoom=zoom, **kwds) + + +class MultiSelection(SelectionDef): + """MultiSelection schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('multi') + Determines the default event processing and data query for the selection. Vega-Lite + currently supports three selection types: + + + * ``single`` -- to select a single discrete data value on ``click``. + * ``multi`` -- to select multiple discrete data value; 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:`EventStream`, boolean) + Clears the selection, emptying it of all values. Can be an + `EventStream `__ or ``false`` to + disable. + + **Default value:** ``dblclick``. + + **See also:** `clear `__ + documentation. + empty : enum('all', 'none') + By default, ``all`` data values are considered to lie within an empty selection. + When set to ``none``, empty selections contain no data values. + encodings : List(:class:`SingleDefUnitChannel`) + An array of encoding channels. The corresponding data field values + must match for a data tuple to fall within the selection. + + **See also:** `encodings `__ + documentation. + fields : List(:class:`FieldName`) + An array of field names whose values must match for a data tuple to + fall within the selection. + + **See also:** `fields `__ + documentation. + init : anyOf(:class:`SelectionInitMapping`, List(:class:`SelectionInitMapping`)) + Initialize the selection with a mapping between `projected channels or field names + `__ and an initial + value (or array of values). + + **See also:** `init `__ + documentation. + nearest : boolean + When true, an invisible voronoi diagram is computed to accelerate discrete + selection. The data value *nearest* the mouse cursor is added to the selection. + + **See also:** `nearest `__ + documentation. + on : :class:`EventStream` + A `Vega event stream `__ (object or + selector) that triggers the selection. + For interval selections, the event stream must specify a `start and end + `__. + resolve : :class:`SelectionResolution` + 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. + + **See also:** `resolve + `__ documentation. + toggle : anyOf(string, boolean) + Controls whether data values should be toggled or only ever inserted into + multi selections. Can be ``true``, ``false`` (for insertion only), or a + `Vega expression `__. + + **Default value:** ``true``, which corresponds to ``event.shiftKey`` (i.e., + data values are toggled when a user interacts with the shift-key pressed). + + **See also:** `toggle `__ + documentation. + """ + _schema = {'$ref': '#/definitions/MultiSelection'} + + def __init__(self, type=Undefined, clear=Undefined, empty=Undefined, encodings=Undefined, + fields=Undefined, init=Undefined, nearest=Undefined, on=Undefined, resolve=Undefined, + toggle=Undefined, **kwds): + super(MultiSelection, self).__init__(type=type, clear=clear, empty=empty, encodings=encodings, + fields=fields, init=init, nearest=nearest, on=on, + resolve=resolve, toggle=toggle, **kwds) + + +class SelectionDomain(VegaLiteSchema): + """SelectionDomain schema wrapper + + anyOf(Mapping(required=[selection]), Mapping(required=[selection])) + """ + _schema = {'$ref': '#/definitions/SelectionDomain'} + + def __init__(self, *args, **kwds): + super(SelectionDomain, self).__init__(*args, **kwds) + + +class SelectionInit(VegaLiteSchema): + """SelectionInit schema wrapper + + anyOf(boolean, float, string, :class:`DateTime`) + """ + _schema = {'$ref': '#/definitions/SelectionInit'} + + def __init__(self, *args, **kwds): + super(SelectionInit, self).__init__(*args, **kwds) + + +class DateTime(SelectionInit): + """DateTime schema wrapper + + Mapping(required=[]) + 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. + + Attributes + ---------- + + date : float + Integer value representing the date from 1-31. + day : anyOf(:class:`Day`, string) + 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"`` ). :raw-html:`
    ` + **Warning:** A DateTime definition object with ``day`` ** should not be combined + with ``year``, ``quarter``, ``month``, or ``date``. + hours : float + Integer value representing the hour of a day from 0-23. + milliseconds : float + 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) + 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"`` ). + quarter : float + 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 + 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) + + +class SelectionInitInterval(VegaLiteSchema): + """SelectionInitInterval schema wrapper + + anyOf(List([boolean, boolean]), List([float, float]), List([string, string]), + List([:class:`DateTime`, :class:`DateTime`])) + """ + _schema = {'$ref': '#/definitions/SelectionInitInterval'} + + def __init__(self, *args, **kwds): + super(SelectionInitInterval, self).__init__(*args, **kwds) + + +class SelectionInitIntervalMapping(VegaLiteSchema): + """SelectionInitIntervalMapping schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/SelectionInitIntervalMapping'} + + def __init__(self, **kwds): + super(SelectionInitIntervalMapping, self).__init__(**kwds) + + +class SelectionInitMapping(VegaLiteSchema): + """SelectionInitMapping schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/SelectionInitMapping'} + + def __init__(self, **kwds): + super(SelectionInitMapping, self).__init__(**kwds) + + +class SelectionOperand(VegaLiteSchema): + """SelectionOperand schema wrapper + + anyOf(:class:`SelectionNot`, :class:`SelectionAnd`, :class:`SelectionOr`, string) + """ + _schema = {'$ref': '#/definitions/SelectionOperand'} + + def __init__(self, *args, **kwds): + super(SelectionOperand, self).__init__(*args, **kwds) + + +class SelectionAnd(SelectionOperand): + """SelectionAnd schema wrapper + + Mapping(required=[and]) + + Attributes + ---------- + + and : List(:class:`SelectionOperand`) + + """ + _schema = {'$ref': '#/definitions/SelectionAnd'} + + def __init__(self, **kwds): + super(SelectionAnd, self).__init__(**kwds) + + +class SelectionNot(SelectionOperand): + """SelectionNot schema wrapper + + Mapping(required=[not]) + + Attributes + ---------- + + not : :class:`SelectionOperand` + + """ + _schema = {'$ref': '#/definitions/SelectionNot'} + + def __init__(self, **kwds): + super(SelectionNot, self).__init__(**kwds) + + +class SelectionOr(SelectionOperand): + """SelectionOr schema wrapper + + Mapping(required=[or]) + + Attributes + ---------- + + or : List(:class:`SelectionOperand`) + + """ + _schema = {'$ref': '#/definitions/SelectionOr'} + + def __init__(self, **kwds): + super(SelectionOr, self).__init__(**kwds) + + +class SelectionPredicate(Predicate): + """SelectionPredicate schema wrapper + + Mapping(required=[selection]) + + Attributes + ---------- + + selection : :class:`SelectionOperand` + Filter using a selection name. + """ + _schema = {'$ref': '#/definitions/SelectionPredicate'} + + def __init__(self, selection=Undefined, **kwds): + super(SelectionPredicate, self).__init__(selection=selection, **kwds) + + +class SelectionResolution(VegaLiteSchema): + """SelectionResolution schema wrapper + + enum('global', 'union', 'intersect') + """ + _schema = {'$ref': '#/definitions/SelectionResolution'} + + def __init__(self, *args): + super(SelectionResolution, self).__init__(*args) + + +class SequenceGenerator(Generator): + """SequenceGenerator schema wrapper + + Mapping(required=[sequence]) + + Attributes + ---------- + + sequence : :class:`SequenceParams` + Generate a sequence of numbers. + name : string + Provide a placeholder name and bind data at runtime. + """ + _schema = {'$ref': '#/definitions/SequenceGenerator'} + + def __init__(self, sequence=Undefined, name=Undefined, **kwds): + super(SequenceGenerator, self).__init__(sequence=sequence, name=name, **kwds) + + +class SequenceParams(VegaLiteSchema): + """SequenceParams schema wrapper + + Mapping(required=[start, stop]) + + Attributes + ---------- + + start : float + The starting value of the sequence (inclusive). + stop : float + The ending value of the sequence (exclusive). + step : float + The step value between sequence entries. + + **Default value:** ``1`` + as : :class:`FieldName` + The name of the generated sequence field. + + **Default value:** ``"data"`` + """ + _schema = {'$ref': '#/definitions/SequenceParams'} + + def __init__(self, start=Undefined, stop=Undefined, step=Undefined, **kwds): + super(SequenceParams, self).__init__(start=start, stop=stop, step=step, **kwds) + + +class ShapeFieldDefWithCondition(VegaLiteSchema): + """ShapeFieldDefWithCondition schema wrapper + + Mapping(required=[type]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + type : :class:`TypeForShape` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalStringValueDef`, + List(:class:`ConditionalStringValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/ShapeFieldDefWithCondition'} + + def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, + title=Undefined, **kwds): + super(ShapeFieldDefWithCondition, self).__init__(type=type, aggregate=aggregate, bin=bin, + condition=condition, field=field, + legend=legend, scale=scale, sort=sort, + timeUnit=timeUnit, title=title, **kwds) + + +class ShapeValueDefWithCondition(VegaLiteSchema): + """ShapeValueDefWithCondition schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldDefTypeForShape`, + :class:`ConditionalStringValueDef`, List(:class:`ConditionalStringValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ShapeValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ShapeValueDefWithCondition, self).__init__(condition=condition, value=value, **kwds) + + +class SignalRef(LayoutBounds): + """SignalRef schema wrapper + + Mapping(required=[signal]) + + Attributes + ---------- + + signal : string + + """ + _schema = {'$ref': '#/definitions/SignalRef'} + + def __init__(self, signal=Undefined, **kwds): + super(SignalRef, self).__init__(signal=signal, **kwds) + + +class SingleDefUnitChannel(VegaLiteSchema): + """SingleDefUnitChannel schema wrapper + + enum('x', 'y', 'x2', 'y2', 'longitude', 'latitude', 'longitude2', 'latitude2', 'color', + 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity', 'strokeWidth', 'size', 'shape', + 'key', 'text', 'tooltip', 'href') + """ + _schema = {'$ref': '#/definitions/SingleDefUnitChannel'} + + def __init__(self, *args): + super(SingleDefUnitChannel, self).__init__(*args) + + +class SingleSelection(SelectionDef): + """SingleSelection schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('single') + Determines the default event processing and data query for the selection. Vega-Lite + currently supports three selection types: + + + * ``single`` -- to select a single discrete data value on ``click``. + * ``multi`` -- to select multiple discrete data value; 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=[])) + Establish a two-way binding between a single selection and input elements + (also known as dynamic query widgets). A binding takes the form of + Vega's `input element binding definition + `__ + or can be a mapping between projected field/encodings and binding definitions. + + **See also:** `bind `__ + documentation. + clear : anyOf(:class:`EventStream`, boolean) + Clears the selection, emptying it of all values. Can be an + `EventStream `__ or ``false`` to + disable. + + **Default value:** ``dblclick``. + + **See also:** `clear `__ + documentation. + empty : enum('all', 'none') + By default, ``all`` data values are considered to lie within an empty selection. + When set to ``none``, empty selections contain no data values. + encodings : List(:class:`SingleDefUnitChannel`) + An array of encoding channels. The corresponding data field values + must match for a data tuple to fall within the selection. + + **See also:** `encodings `__ + documentation. + fields : List(:class:`FieldName`) + An array of field names whose values must match for a data tuple to + fall within the selection. + + **See also:** `fields `__ + documentation. + init : :class:`SelectionInitMapping` + Initialize the selection with a mapping between `projected channels or field names + `__ and initial values. + + **See also:** `init `__ + documentation. + nearest : boolean + When true, an invisible voronoi diagram is computed to accelerate discrete + selection. The data value *nearest* the mouse cursor is added to the selection. + + **See also:** `nearest `__ + documentation. + on : :class:`EventStream` + A `Vega event stream `__ (object or + selector) that triggers the selection. + For interval selections, the event stream must specify a `start and end + `__. + resolve : :class:`SelectionResolution` + 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. + + **See also:** `resolve + `__ documentation. + """ + _schema = {'$ref': '#/definitions/SingleSelection'} + + def __init__(self, type=Undefined, bind=Undefined, clear=Undefined, empty=Undefined, + encodings=Undefined, fields=Undefined, init=Undefined, nearest=Undefined, on=Undefined, + resolve=Undefined, **kwds): + super(SingleSelection, self).__init__(type=type, bind=bind, clear=clear, empty=empty, + encodings=encodings, fields=fields, init=init, + nearest=nearest, on=on, resolve=resolve, **kwds) + + +class SingleSelectionConfig(VegaLiteSchema): + """SingleSelectionConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + bind : anyOf(:class:`Binding`, Mapping(required=[])) + Establish a two-way binding between a single selection and input elements + (also known as dynamic query widgets). A binding takes the form of + Vega's `input element binding definition + `__ + or can be a mapping between projected field/encodings and binding definitions. + + **See also:** `bind `__ + documentation. + clear : anyOf(:class:`EventStream`, boolean) + Clears the selection, emptying it of all values. Can be an + `EventStream `__ or ``false`` to + disable. + + **Default value:** ``dblclick``. + + **See also:** `clear `__ + documentation. + empty : enum('all', 'none') + By default, ``all`` data values are considered to lie within an empty selection. + When set to ``none``, empty selections contain no data values. + encodings : List(:class:`SingleDefUnitChannel`) + An array of encoding channels. The corresponding data field values + must match for a data tuple to fall within the selection. + + **See also:** `encodings `__ + documentation. + fields : List(:class:`FieldName`) + An array of field names whose values must match for a data tuple to + fall within the selection. + + **See also:** `fields `__ + documentation. + init : :class:`SelectionInitMapping` + Initialize the selection with a mapping between `projected channels or field names + `__ and initial values. + + **See also:** `init `__ + documentation. + nearest : boolean + When true, an invisible voronoi diagram is computed to accelerate discrete + selection. The data value *nearest* the mouse cursor is added to the selection. + + **See also:** `nearest `__ + documentation. + on : :class:`EventStream` + A `Vega event stream `__ (object or + selector) that triggers the selection. + For interval selections, the event stream must specify a `start and end + `__. + resolve : :class:`SelectionResolution` + 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. + + **See also:** `resolve + `__ documentation. + """ + _schema = {'$ref': '#/definitions/SingleSelectionConfig'} + + def __init__(self, bind=Undefined, clear=Undefined, empty=Undefined, encodings=Undefined, + fields=Undefined, init=Undefined, nearest=Undefined, on=Undefined, resolve=Undefined, + **kwds): + super(SingleSelectionConfig, self).__init__(bind=bind, clear=clear, empty=empty, + encodings=encodings, fields=fields, init=init, + nearest=nearest, on=on, resolve=resolve, **kwds) + + +class Sort(VegaLiteSchema): + """Sort schema wrapper + + anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, + :class:`SortByEncoding`, None) + """ + _schema = {'$ref': '#/definitions/Sort'} + + def __init__(self, *args, **kwds): + super(Sort, self).__init__(*args, **kwds) + + +class EncodingSortField(Sort): + """EncodingSortField schema wrapper + + Mapping(required=[]) + A sort definition for sorting a discrete scale in an encoding field definition. + + Attributes + ---------- + + field : :class:`Field` + The data `field `__ to sort by. + + **Default value:** If unspecified, defaults to the field specified in the outer data + reference. + op : :class:`AggregateOp` + An `aggregate operation + `__ to perform on the + field prior to sorting (e.g., ``"count"``, ``"mean"`` and ``"median"`` ). + An aggregation is required when there are multiple values of the sort field for each + encoded data field. + The input data objects will be aggregated, grouped by the encoded data field. + + For a full list of operations, please see the documentation for `aggregate + `__. + + **Default value:** ``"sum"`` for stacked plots. Otherwise, ``"mean"``. + order : anyOf(:class:`SortOrder`, 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): + 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`)) + """ + _schema = {'$ref': '#/definitions/SortArray'} + + def __init__(self, *args, **kwds): + super(SortArray, self).__init__(*args, **kwds) + + +class SortByEncoding(Sort): + """SortByEncoding schema wrapper + + Mapping(required=[encoding]) + + Attributes + ---------- + + encoding : :class:`SingleDefUnitChannel` + The `encoding channel + `__ to sort by (e.g., + ``"x"``, ``"y"`` ) + order : anyOf(:class:`SortOrder`, 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): + super(SortByEncoding, self).__init__(encoding=encoding, order=order, **kwds) + + +class SortField(VegaLiteSchema): + """SortField schema wrapper + + Mapping(required=[field]) + A sort definition for transform + + Attributes + ---------- + + field : :class:`FieldName` + The name of the field to sort. + order : anyOf(:class:`SortOrder`, 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): + super(SortField, self).__init__(field=field, order=order, **kwds) + + +class SortOrder(Sort): + """SortOrder schema wrapper + + enum('ascending', 'descending') + """ + _schema = {'$ref': '#/definitions/SortOrder'} + + def __init__(self, *args): + super(SortOrder, self).__init__(*args) + + +class Spec(VegaLiteSchema): + """Spec schema wrapper + + anyOf(:class:`FacetedUnitSpec`, :class:`LayerSpec`, :class:`FacetSpec`, :class:`RepeatSpec`, + :class:`ConcatSpec`, :class:`VConcatSpec`, :class:`HConcatSpec`) + Any specification in Vega-Lite. + """ + _schema = {'$ref': '#/definitions/Spec'} + + def __init__(self, *args, **kwds): + super(Spec, self).__init__(*args, **kwds) + + +class ConcatSpec(Spec): + """ConcatSpec schema wrapper + + Mapping(required=[concat]) + Base interface for a generalized concatenation specification. + + Attributes + ---------- + + concat : List(:class:`Spec`) + A list of views to be concatenated. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. + The supported string values are ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to + ``hconcat`` (for ``concat`` ) and to using the ``column`` channel (for ``facet`` and + ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 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) + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(string, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/ConcatSpec'} + + 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(ConcatSpec, 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): + """FacetSpec schema wrapper + + Mapping(required=[facet, spec]) + Base interface for a facet specification. + + Attributes + ---------- + + facet : anyOf(:class:`FacetFieldDef`, :class:`FacetMapping`) + Definition for how to facet the data. One of: + 1) `a field definition for faceting the plot by one field + `__ + 2) `An object that maps row and column channels to their field definitions + `__ + spec : anyOf(:class:`LayerSpec`, :class:`FacetedUnitSpec`) + A specification of the view that gets faceted. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. + The supported string values are ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to + ``hconcat`` (for ``concat`` ) and to using the ``column`` channel (for ``facet`` and + ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 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) + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(string, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + 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) + + +class FacetedUnitSpec(Spec): + """FacetedUnitSpec schema wrapper + + Mapping(required=[mark]) + Unit spec that can have a composite mark and row or column channels (shorthand for a facet + spec). + + Attributes + ---------- + + mark : :class:`AnyMark` + A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, + ``"tick"``, ``"line"``, + ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and ``"text"`` ) or a `mark + definition object `__. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. + The supported string values are ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to + ``hconcat`` (for ``concat`` ) and to using the ``column`` channel (for ``facet`` and + ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 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) + 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 of this mark for commenting purpose. + encoding : :class:`FacetedEncoding` + A key-value mapping between encoding channels and definition of fields. + height : float + The height of a visualization. + + **Default value:** + + + * If a view's `autosize + `__ type is ``"fit"`` or + its y-channel has a `continuous scale + `__, the height will + be the value of `config.view.height + `__. + * For y-axis with a band or point scale: if `rangeStep + `__ is a numeric value or + unspecified, the height is `determined by the range step, paddings, and the + cardinality of the field mapped to y-channel + `__. Otherwise, if the + ``rangeStep`` is ``null``, the height will be the value of `config.view.height + `__. + * If no field is mapped to ``y`` channel, the ``height`` will be the value of + ``rangeStep``. + + **Note** : For plots with `row and column channels + `__, this represents the + height of a single view. + + **See also:** The documentation for `width and height + `__ contains more examples. + name : string + Name of the visualization for later reference. + projection : :class:`Projection` + 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` + Scale, axis, and legend resolutions for view composition specifications. + selection : Mapping(required=[]) + A key-value mapping between selection names and definitions. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(string, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + view : :class:`ViewBackground` + An object defining the view background's fill and stroke. + + **Default value:** none (transparent) + width : float + The width of a visualization. + + **Default value:** This will be determined by the following rules: + + + * If a view's `autosize + `__ type is ``"fit"`` or + its x-channel has a `continuous scale + `__, the width will + be the value of `config.view.width + `__. + * For x-axis with a band or point scale: if `rangeStep + `__ is a numeric value or + unspecified, the width is `determined by the range step, paddings, and the + cardinality of the field mapped to x-channel + `__. Otherwise, if the + ``rangeStep`` is ``null``, the width will be the value of `config.view.width + `__. + * If no field is mapped to ``x`` channel, the ``width`` will be the value of + `config.scale.textXRangeStep + `__ for + ``text`` mark and the value of ``rangeStep`` for other marks. + + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view. + + **See also:** The documentation for `width and height + `__ contains more examples. + """ + _schema = {'$ref': '#/definitions/FacetedUnitSpec'} + + def __init__(self, mark=Undefined, align=Undefined, bounds=Undefined, center=Undefined, + columns=Undefined, data=Undefined, description=Undefined, encoding=Undefined, + height=Undefined, name=Undefined, projection=Undefined, resolve=Undefined, + selection=Undefined, spacing=Undefined, title=Undefined, transform=Undefined, + view=Undefined, width=Undefined, **kwds): + super(FacetedUnitSpec, self).__init__(mark=mark, align=align, bounds=bounds, center=center, + columns=columns, data=data, description=description, + encoding=encoding, height=height, name=name, + projection=projection, resolve=resolve, + selection=selection, spacing=spacing, title=title, + transform=transform, view=view, width=width, **kwds) + + +class HConcatSpec(Spec): + """HConcatSpec schema wrapper + + Mapping(required=[hconcat]) + Base interface for a horizontal concatenation specification. + + Attributes + ---------- + + hconcat : List(:class:`Spec`) + A list of views to be concatenated and put into a row. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : boolean + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + **Default value:** ``false`` + data : anyOf(:class:`Data`, 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + 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(string, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/HConcatSpec'} + + 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(HConcatSpec, 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): + """LayerSpec schema wrapper + + Mapping(required=[layer]) + A full layered plot specification, which may contains ``encoding`` and ``projection`` + properties that will be applied to underlying unit (single-view) specifications. + + Attributes + ---------- + + layer : List(anyOf(:class:`LayerSpec`, :class:`UnitSpec`)) + 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 `__ and place a layer + inside a facet. + data : anyOf(:class:`Data`, 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 of this mark for commenting purpose. + encoding : :class:`Encoding` + A shared key-value mapping between encoding channels and definition of fields in the + underlying layers. + height : float + The height of a visualization. + + **Default value:** + + + * If a view's `autosize + `__ type is ``"fit"`` or + its y-channel has a `continuous scale + `__, the height will + be the value of `config.view.height + `__. + * For y-axis with a band or point scale: if `rangeStep + `__ is a numeric value or + unspecified, the height is `determined by the range step, paddings, and the + cardinality of the field mapped to y-channel + `__. Otherwise, if the + ``rangeStep`` is ``null``, the height will be the value of `config.view.height + `__. + * If no field is mapped to ``y`` channel, the ``height`` will be the value of + ``rangeStep``. + + **Note** : For plots with `row and column channels + `__, this represents the + height of a single view. + + **See also:** The documentation for `width and height + `__ contains more examples. + name : string + Name of the visualization for later reference. + projection : :class:`Projection` + An object defining properties of the geographic projection shared by underlying + layers. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + title : anyOf(string, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + view : :class:`ViewBackground` + An object defining the view background's fill and stroke. + + **Default value:** none (transparent) + width : float + The width of a visualization. + + **Default value:** This will be determined by the following rules: + + + * If a view's `autosize + `__ type is ``"fit"`` or + its x-channel has a `continuous scale + `__, the width will + be the value of `config.view.width + `__. + * For x-axis with a band or point scale: if `rangeStep + `__ is a numeric value or + unspecified, the width is `determined by the range step, paddings, and the + cardinality of the field mapped to x-channel + `__. Otherwise, if the + ``rangeStep`` is ``null``, the width will be the value of `config.view.width + `__. + * If no field is mapped to ``x`` channel, the ``width`` will be the value of + `config.scale.textXRangeStep + `__ for + ``text`` mark and the value of ``rangeStep`` for other marks. + + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view. + + **See also:** The documentation for `width and height + `__ contains more examples. + """ + _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) + + +class RepeatSpec(Spec): + """RepeatSpec schema wrapper + + Mapping(required=[repeat, spec]) + Base interface for a repeat specification. + + Attributes + ---------- + + repeat : anyOf(List(string), :class:`RepeatMapping`) + 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 using ``{"repeat": "repeat"}`` + 2) An object that mapped ``"row"`` and/or ``"column"`` to the listed of 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:`Spec` + 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 ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to + ``hconcat`` (for ``concat`` ) and to using the ``column`` channel (for ``facet`` and + ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 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) + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(string, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/RepeatSpec'} + + 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(RepeatSpec, 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]) + + Attributes + ---------- + + sphere : anyOf(enum(True), Mapping(required=[])) + Generate sphere GeoJSON data for the full globe. + name : string + Provide a placeholder name and bind data at runtime. + """ + _schema = {'$ref': '#/definitions/SphereGenerator'} + + def __init__(self, sphere=Undefined, name=Undefined, **kwds): + super(SphereGenerator, self).__init__(sphere=sphere, name=name, **kwds) + + +class StackOffset(VegaLiteSchema): + """StackOffset schema wrapper + + enum('zero', 'center', 'normalize') + """ + _schema = {'$ref': '#/definitions/StackOffset'} + + def __init__(self, *args): + super(StackOffset, self).__init__(*args) + + +class StandardType(VegaLiteSchema): + """StandardType schema wrapper + + enum('quantitative', 'ordinal', 'temporal', 'nominal') + """ + _schema = {'$ref': '#/definitions/StandardType'} + + def __init__(self, *args): + super(StandardType, self).__init__(*args) + + +class StringFieldDefWithCondition(VegaLiteSchema): + """StringFieldDefWithCondition schema wrapper + + Mapping(required=[type]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + type : :class:`StandardType` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalStringValueDef`, + List(:class:`ConditionalStringValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/StringFieldDefWithCondition'} + + def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, + title=Undefined, **kwds): + super(StringFieldDefWithCondition, self).__init__(type=type, aggregate=aggregate, bin=bin, + condition=condition, field=field, + legend=legend, scale=scale, sort=sort, + timeUnit=timeUnit, title=title, **kwds) + + +class StringFieldDefWithConditionTypeForShape(VegaLiteSchema): + """StringFieldDefWithConditionTypeForShape schema wrapper + + Mapping(required=[type]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + type : :class:`TypeForShape` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalStringValueDef`, + List(:class:`ConditionalStringValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. + If ``null``, the legend for the encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: + + + * ``"ascending"`` or ``"descending"`` -- for sorting by the values' natural order in + Javascript. + * `A sort-by-encoding definition + `__ for sorting + by another encoding channel. (This type of sort definition is not available for + ``row`` and ``column`` channels.) + * `A sort field definition + `__ for sorting by + another field. + * `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values + in their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). + * ``null`` indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/StringFieldDefWithCondition'} + + def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, legend=Undefined, scale=Undefined, sort=Undefined, timeUnit=Undefined, + title=Undefined, **kwds): + super(StringFieldDefWithConditionTypeForShape, self).__init__(type=type, aggregate=aggregate, + bin=bin, condition=condition, + field=field, legend=legend, + scale=scale, sort=sort, + timeUnit=timeUnit, title=title, + **kwds) + + +class StringValueDefWithCondition(VegaLiteSchema): + """StringValueDefWithCondition schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ConditionalStringValueDef`, + List(:class:`ConditionalStringValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" 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) + + +class StringValueDefWithConditionTypeForShape(VegaLiteSchema): + """StringValueDefWithConditionTypeForShape schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldDefTypeForShape`, + :class:`ConditionalStringValueDef`, List(:class:`ConditionalStringValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/StringValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(StringValueDefWithConditionTypeForShape, self).__init__(condition=condition, value=value, + **kwds) + + +class StrokeCap(VegaLiteSchema): + """StrokeCap schema wrapper + + enum('butt', 'round', 'square') + """ + _schema = {'$ref': '#/definitions/StrokeCap'} + + def __init__(self, *args): + super(StrokeCap, self).__init__(*args) + + +class StrokeJoin(VegaLiteSchema): + """StrokeJoin schema wrapper + + enum('miter', 'round', 'bevel') + """ + _schema = {'$ref': '#/definitions/StrokeJoin'} + + def __init__(self, *args): + super(StrokeJoin, self).__init__(*args) + + +class StyleConfigIndex(VegaLiteSchema): + """StyleConfigIndex schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/StyleConfigIndex'} + + def __init__(self, **kwds): + super(StyleConfigIndex, self).__init__(**kwds) + + +class SymbolShape(VegaLiteSchema): + """SymbolShape schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/SymbolShape'} + + def __init__(self, *args): + super(SymbolShape, self).__init__(*args) + + +class TextBaseline(VegaLiteSchema): + """TextBaseline schema wrapper + + anyOf(enum('alphabetic'), :class:`Baseline`) + """ + _schema = {'$ref': '#/definitions/TextBaseline'} + + def __init__(self, *args, **kwds): + super(TextBaseline, self).__init__(*args, **kwds) + + +class Baseline(TextBaseline): + """Baseline schema wrapper + + enum('top', 'middle', 'bottom') + """ + _schema = {'$ref': '#/definitions/Baseline'} + + def __init__(self, *args): + super(Baseline, self).__init__(*args) + + +class TextConfig(VegaLiteSchema): + """TextConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : :class:`Align` + The horizontal alignment of the text. One of ``"left"``, ``"right"``, ``"center"``. + angle : float + The rotation angle of the text, in degrees. + baseline : :class:`TextBaseline` + The vertical alignment of the text. One of ``"top"``, ``"middle"``, ``"bottom"``. + + **Default value:** ``"middle"`` + color : :class:`Color` + Default color. Note that ``fill`` and ``stroke`` have higher precedence than + ``color`` and will override ``color``. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** This property cannot be used in a `style config + `__. + cornerRadius : float + The radius in pixels of rounded rectangle corners. + + **Default value:** ``0`` + cursor : :class:`Cursor` + The mouse cursor used over the mark. Any valid `CSS cursor type + `__ can be used. + dir : :class:`Dir` + 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 : 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 : 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 : string + The ellipsis string for text truncated in response to the limit parameter. + + **Default value:** ``"…"`` + fill : :class:`Color` + Default Fill Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + fillOpacity : float + The fill opacity (value between [0,1]). + + **Default value:** ``1`` + filled : boolean + Whether the mark's color should be used as fill color instead of stroke color. + + **Default value:** ``false`` for ``point``, ``line`` and ``rule`` ; otherwise, + ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : string + The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). + fontSize : float + The font size, in pixels. + fontStyle : :class:`FontStyle` + The font style (e.g., ``"italic"`` ). + fontWeight : :class:`FontWeight` + 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 : float + Height of the marks. + href : string + A URL to load upon mouse click. If defined, the mark acts as a hyperlink. + interpolate : :class:`Interpolate` + The line interpolation method to use for line and area marks. One of the following: + + + * ``"linear"`` : piecewise linear segments, as in a polyline. + * ``"linear-closed"`` : close the linear segments to form a polygon. + * ``"step"`` : alternate between horizontal and vertical segments, as in a step + function. + * ``"step-before"`` : alternate between vertical and horizontal segments, as in a + step function. + * ``"step-after"`` : alternate between horizontal and vertical segments, as in a + step function. + * ``"basis"`` : a B-spline, with control point duplication on the ends. + * ``"basis-open"`` : an open B-spline; may not intersect the start or end. + * ``"basis-closed"`` : a closed B-spline, as in a loop. + * ``"cardinal"`` : a Cardinal spline, with control point duplication on the ends. + * ``"cardinal-open"`` : an open Cardinal spline; may not intersect the start or end, + but will intersect other control points. + * ``"cardinal-closed"`` : a closed Cardinal spline, as in a loop. + * ``"bundle"`` : equivalent to basis, except the tension parameter is used to + straighten the spline. + * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. + limit : 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 + opacity : 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. + The value is either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + 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. + radius : float + Polar coordinate radial offset, in pixels, of the text label from the origin + determined by the ``x`` and ``y`` properties. + shape : string + Shape of the point marks. 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 + `__ (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.) + + **Default value:** ``"circle"`` + shortTimeLabels : boolean + Whether month names and weekday names should be abbreviated. + size : float + Default size for marks. + + + * For ``point`` / ``circle`` / ``square``, this represents the pixel area of the + marks. For example: in the case of circles, the radius is determined in part by + the square root of the size value. + * For ``bar``, this represents the band size of the bar, in pixels. + * For ``text``, this represents the font size, in pixels. + + **Default value:** ``30`` for point, circle, square marks; ``rangeStep`` - 1 for bar + marks with discrete dimensions; ``5`` for bar marks with continuous dimensions; + ``11`` for text marks. + stroke : :class:`Color` + Default Stroke Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + strokeCap : :class:`StrokeCap` + The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or + ``"square"``. + + **Default value:** ``"square"`` + strokeDash : List(float) + An array of alternating stroke, space lengths for creating dashed or dotted lines. + strokeDashOffset : float + The offset (in pixels) into which to begin drawing with the stroke dash array. + strokeJoin : :class:`StrokeJoin` + The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. + + **Default value:** ``"miter"`` + strokeMiterLimit : float + The miter limit at which to bevel a line join. + strokeOpacity : float + The stroke opacity (value between [0,1]). + + **Default value:** ``1`` + strokeWidth : float + The stroke width, in pixels. + tension : float + Depending on the interpolation type, sets the tension parameter (for line and area + marks). + text : string + Placeholder text if the ``text`` channel is not specified + theta : float + Polar coordinate angle, in radians, of the text label from the origin determined by + 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 : anyOf(:class:`Value`, :class:`TooltipContent`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``{"content": "encoding"}``, then all fields from ``encoding`` + will be used. + * If ``tooltip`` is ``{"content": "data"}``, then all fields that appear in the + highlighted data point will be used. + * If set to ``null``, then no tooltip will be used. + width : float + Width of the marks. + x : anyOf(float, enum('width')) + 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, enum('width')) + 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, enum('height')) + 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, enum('width')) + 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/TextConfig'} + + def __init__(self, align=Undefined, angle=Undefined, baseline=Undefined, color=Undefined, + cornerRadius=Undefined, cursor=Undefined, dir=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, interpolate=Undefined, limit=Undefined, + opacity=Undefined, order=Undefined, orient=Undefined, radius=Undefined, + shape=Undefined, shortTimeLabels=Undefined, size=Undefined, stroke=Undefined, + strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, + strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, tension=Undefined, text=Undefined, theta=Undefined, + tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, + y2=Undefined, **kwds): + super(TextConfig, self).__init__(align=align, angle=angle, baseline=baseline, color=color, + cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, + dy=dy, ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, + filled=filled, font=font, fontSize=fontSize, + fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, + opacity=opacity, order=order, orient=orient, radius=radius, + shape=shape, shortTimeLabels=shortTimeLabels, size=size, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, tension=tension, text=text, + theta=theta, tooltip=tooltip, width=width, x=x, x2=x2, y=y, + y2=y2, **kwds) + + +class TextFieldDef(VegaLiteSchema): + """TextFieldDef schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`StandardType` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + format : string + The text formatting pattern for labels of guides (axes, legends, headers) and text + marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. + * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : enum('number', 'time') + The format type for labels ( ``"number"`` or ``"time"`` ). + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without + ``timeUnit``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/TextFieldDef'} + + def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, + format=Undefined, formatType=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(TextFieldDef, self).__init__(type=type, aggregate=aggregate, bin=bin, field=field, + format=format, formatType=formatType, timeUnit=timeUnit, + title=title, **kwds) + + +class TextFieldDefWithCondition(VegaLiteSchema): + """TextFieldDefWithCondition schema wrapper + + Mapping(required=[type]) + A FieldDef with Condition :raw-html:`` + + Attributes + ---------- + + type : :class:`StandardType` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDef`, List(:class:`ConditionalValueDef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + format : string + The text formatting pattern for labels of guides (axes, legends, headers) and text + marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. + * If the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : enum('number', 'time') + The format type for labels ( ``"number"`` or ``"time"`` ). + + **Default value:** + + + * ``"time"`` for temporal fields and ordinal and nomimal fields with ``timeUnit``. + * ``"number"`` for quantitative fields as well as ordinal and nomimal fields without + ``timeUnit``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/TextFieldDefWithCondition'} + + def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, timeUnit=Undefined, + title=Undefined, **kwds): + super(TextFieldDefWithCondition, self).__init__(type=type, aggregate=aggregate, bin=bin, + condition=condition, field=field, format=format, + formatType=formatType, timeUnit=timeUnit, + title=title, **kwds) + + +class TextValueDefWithCondition(VegaLiteSchema): + """TextValueDefWithCondition schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalTextFieldDef`, :class:`ConditionalValueDef`, + List(:class:`ConditionalValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : :class:`Value` + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/TextValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(TextValueDefWithCondition, self).__init__(condition=condition, value=value, **kwds) + + +class TickConfig(VegaLiteSchema): + """TickConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : :class:`Align` + The horizontal alignment of the text. One of ``"left"``, ``"right"``, ``"center"``. + angle : float + The rotation angle of the text, in degrees. + bandSize : float + The width of the ticks. + + **Default value:** 3/4 of rangeStep. + baseline : :class:`TextBaseline` + The vertical alignment of the text. One of ``"top"``, ``"middle"``, ``"bottom"``. + + **Default value:** ``"middle"`` + color : :class:`Color` + Default color. Note that ``fill`` and ``stroke`` have higher precedence than + ``color`` and will override ``color``. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** This property cannot be used in a `style config + `__. + cornerRadius : float + The radius in pixels of rounded rectangle corners. + + **Default value:** ``0`` + cursor : :class:`Cursor` + The mouse cursor used over the mark. Any valid `CSS cursor type + `__ can be used. + dir : :class:`Dir` + 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 : 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 : 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 : string + The ellipsis string for text truncated in response to the limit parameter. + + **Default value:** ``"…"`` + fill : :class:`Color` + Default Fill Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + fillOpacity : float + The fill opacity (value between [0,1]). + + **Default value:** ``1`` + filled : boolean + Whether the mark's color should be used as fill color instead of stroke color. + + **Default value:** ``false`` for ``point``, ``line`` and ``rule`` ; otherwise, + ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : string + The typeface to set the text in (e.g., ``"Helvetica Neue"`` ). + fontSize : float + The font size, in pixels. + fontStyle : :class:`FontStyle` + The font style (e.g., ``"italic"`` ). + fontWeight : :class:`FontWeight` + 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 : float + Height of the marks. + href : string + A URL to load upon mouse click. If defined, the mark acts as a hyperlink. + interpolate : :class:`Interpolate` + The line interpolation method to use for line and area marks. One of the following: + + + * ``"linear"`` : piecewise linear segments, as in a polyline. + * ``"linear-closed"`` : close the linear segments to form a polygon. + * ``"step"`` : alternate between horizontal and vertical segments, as in a step + function. + * ``"step-before"`` : alternate between vertical and horizontal segments, as in a + step function. + * ``"step-after"`` : alternate between horizontal and vertical segments, as in a + step function. + * ``"basis"`` : a B-spline, with control point duplication on the ends. + * ``"basis-open"`` : an open B-spline; may not intersect the start or end. + * ``"basis-closed"`` : a closed B-spline, as in a loop. + * ``"cardinal"`` : a Cardinal spline, with control point duplication on the ends. + * ``"cardinal-open"`` : an open Cardinal spline; may not intersect the start or end, + but will intersect other control points. + * ``"cardinal-closed"`` : a closed Cardinal spline, as in a loop. + * ``"bundle"`` : equivalent to basis, except the tension parameter is used to + straighten the spline. + * ``"monotone"`` : cubic interpolation that preserves monotonicity in y. + limit : 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 + opacity : 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. + The value is either horizontal (default) or vertical. + + + * For bar, rule and tick, this determines whether the size of the bar and tick + should be applied to x or y dimension. + * For area, this property determines the orient property of the Vega output. + * For line and trail marks, this property determines the sort order of the points in + 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. + radius : float + Polar coordinate radial offset, in pixels, of the text label from the origin + determined by the ``x`` and ``y`` properties. + shape : string + Shape of the point marks. 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 + `__ (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.) + + **Default value:** ``"circle"`` + size : float + Default size for marks. + + + * For ``point`` / ``circle`` / ``square``, this represents the pixel area of the + marks. For example: in the case of circles, the radius is determined in part by + the square root of the size value. + * For ``bar``, this represents the band size of the bar, in pixels. + * For ``text``, this represents the font size, in pixels. + + **Default value:** ``30`` for point, circle, square marks; ``rangeStep`` - 1 for bar + marks with discrete dimensions; ``5`` for bar marks with continuous dimensions; + ``11`` for text marks. + stroke : :class:`Color` + Default Stroke Color. This has higher precedence than ``config.color`` + + **Default value:** (None) + strokeCap : :class:`StrokeCap` + The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or + ``"square"``. + + **Default value:** ``"square"`` + strokeDash : List(float) + An array of alternating stroke, space lengths for creating dashed or dotted lines. + strokeDashOffset : float + The offset (in pixels) into which to begin drawing with the stroke dash array. + strokeJoin : :class:`StrokeJoin` + The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. + + **Default value:** ``"miter"`` + strokeMiterLimit : float + The miter limit at which to bevel a line join. + strokeOpacity : float + The stroke opacity (value between [0,1]). + + **Default value:** ``1`` + strokeWidth : float + The stroke width, in pixels. + tension : float + Depending on the interpolation type, sets the tension parameter (for line and area + marks). + text : string + Placeholder text if the ``text`` channel is not specified + theta : float + Polar coordinate angle, in radians, of the text label from the origin determined by + 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". + thickness : float + Thickness of the tick mark. + + **Default value:** ``1`` + tooltip : anyOf(:class:`Value`, :class:`TooltipContent`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``{"content": "encoding"}``, then all fields from ``encoding`` + will be used. + * If ``tooltip`` is ``{"content": "data"}``, then all fields that appear in the + highlighted data point will be used. + * If set to ``null``, then no tooltip will be used. + width : float + Width of the marks. + x : anyOf(float, enum('width')) + 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, enum('width')) + 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, enum('height')) + 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, enum('width')) + 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, bandSize=Undefined, baseline=Undefined, + color=Undefined, cornerRadius=Undefined, cursor=Undefined, dir=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, interpolate=Undefined, + limit=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, + radius=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, + strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, + strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOpacity=Undefined, + strokeWidth=Undefined, tension=Undefined, text=Undefined, theta=Undefined, + thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, + y=Undefined, y2=Undefined, **kwds): + super(TickConfig, self).__init__(align=align, angle=angle, bandSize=bandSize, baseline=baseline, + color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, + dx=dx, dy=dy, ellipsis=ellipsis, fill=fill, + fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + height=height, href=href, interpolate=interpolate, limit=limit, + opacity=opacity, order=order, orient=orient, radius=radius, + shape=shape, size=size, stroke=stroke, strokeCap=strokeCap, + strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + tension=tension, text=text, theta=theta, thickness=thickness, + tooltip=tooltip, width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + +class TimeUnit(VegaLiteSchema): + """TimeUnit schema wrapper + + anyOf(:class:`SingleTimeUnit`, :class:`MultiTimeUnit`) + """ + _schema = {'$ref': '#/definitions/TimeUnit'} + + def __init__(self, *args, **kwds): + super(TimeUnit, self).__init__(*args, **kwds) + + +class MultiTimeUnit(TimeUnit): + """MultiTimeUnit schema wrapper + + anyOf(:class:`LocalMultiTimeUnit`, :class:`UtcMultiTimeUnit`) + """ + _schema = {'$ref': '#/definitions/MultiTimeUnit'} + + def __init__(self, *args, **kwds): + super(MultiTimeUnit, self).__init__(*args, **kwds) + + +class LocalMultiTimeUnit(MultiTimeUnit): + """LocalMultiTimeUnit schema wrapper + + enum('yearquarter', 'yearquartermonth', 'yearmonth', 'yearmonthdate', 'yearmonthdatehours', + 'yearmonthdatehoursminutes', 'yearmonthdatehoursminutesseconds', 'quartermonth', + 'monthdate', 'monthdatehours', 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', + 'secondsmilliseconds') + """ + _schema = {'$ref': '#/definitions/LocalMultiTimeUnit'} + + def __init__(self, *args): + super(LocalMultiTimeUnit, self).__init__(*args) + + +class SingleTimeUnit(TimeUnit): + """SingleTimeUnit schema wrapper + + anyOf(:class:`LocalSingleTimeUnit`, :class:`UtcSingleTimeUnit`) + """ + _schema = {'$ref': '#/definitions/SingleTimeUnit'} + + def __init__(self, *args, **kwds): + super(SingleTimeUnit, self).__init__(*args, **kwds) + + +class LocalSingleTimeUnit(SingleTimeUnit): + """LocalSingleTimeUnit schema wrapper + + enum('year', 'quarter', 'month', 'day', 'date', 'hours', 'minutes', 'seconds', + 'milliseconds') + """ + _schema = {'$ref': '#/definitions/LocalSingleTimeUnit'} + + def __init__(self, *args): + super(LocalSingleTimeUnit, self).__init__(*args) + + +class TitleAnchor(VegaLiteSchema): + """TitleAnchor schema wrapper + + enum(None, 'start', 'middle', 'end') + """ + _schema = {'$ref': '#/definitions/TitleAnchor'} + + def __init__(self, *args): + super(TitleAnchor, self).__init__(*args) + + +class TitleConfig(VegaLiteSchema): + """TitleConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : :class:`Align` + + anchor : :class:`TitleAnchor` + 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. + angle : float + Angle in degrees of title text. + baseline : :class:`TextBaseline` + Vertical text baseline for title text. One of ``"top"``, ``"middle"``, ``"bottom"``, + or ``"alphabetic"``. + color : :class:`Color` + Text color for title text. + dx : float + Delta offset for title text x-coordinate. + dy : float + Delta offset for title text y-coordinate. + font : string + Font name for title text. + fontSize : float + Font size in pixels for title text. + + **Default value:** ``10``. + fontStyle : :class:`FontStyle` + Font style for title text. + fontWeight : :class:`FontWeight` + 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 : :class:`TitleFrame` + 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 : float + The maximum allowed length in pixels of legend labels. + offset : float + The orthogonal offset in pixels by which to displace the title from its position + along the edge of the chart. + orient : :class:`TitleOrient` + Default title orientation ( ``"top"``, ``"bottom"``, ``"left"``, or ``"right"`` ) + """ + _schema = {'$ref': '#/definitions/TitleConfig'} + + def __init__(self, align=Undefined, anchor=Undefined, angle=Undefined, baseline=Undefined, + color=Undefined, dx=Undefined, dy=Undefined, font=Undefined, fontSize=Undefined, + fontStyle=Undefined, fontWeight=Undefined, frame=Undefined, limit=Undefined, + offset=Undefined, orient=Undefined, **kwds): + super(TitleConfig, self).__init__(align=align, anchor=anchor, angle=angle, baseline=baseline, + color=color, dx=dx, dy=dy, font=font, fontSize=fontSize, + fontStyle=fontStyle, fontWeight=fontWeight, frame=frame, + limit=limit, offset=offset, orient=orient, **kwds) + + +class TitleFrame(VegaLiteSchema): + """TitleFrame schema wrapper + + enum('bounds', 'group') + """ + _schema = {'$ref': '#/definitions/TitleFrame'} + + def __init__(self, *args): + super(TitleFrame, self).__init__(*args) + + +class TitleOrient(VegaLiteSchema): + """TitleOrient schema wrapper + + enum('none', 'left', 'right', 'top', 'bottom') + """ + _schema = {'$ref': '#/definitions/TitleOrient'} + + def __init__(self, *args): + super(TitleOrient, self).__init__(*args) + + +class TitleParams(VegaLiteSchema): + """TitleParams schema wrapper + + Mapping(required=[text]) + + Attributes + ---------- + + text : string + The title text. + align : :class:`Align` + + anchor : :class:`TitleAnchor` + 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. + + **Default value:** ``"middle"`` for `single + `__ and `layered + `__ views. + ``"start"`` for other composite views. + + **Note:** `For now `__, ``anchor`` is + only customizable only for `single + `__ and `layered + `__ views. For other composite + views, ``anchor`` is always ``"start"``. + angle : float + Angle in degrees of title text. + baseline : :class:`TextBaseline` + Vertical text baseline for title text. One of ``"top"``, ``"middle"``, ``"bottom"``, + or ``"alphabetic"``. + color : :class:`Color` + Text color for title text. + dx : float + Delta offset for title text x-coordinate. + dy : float + Delta offset for title text y-coordinate. + font : string + Font name for title text. + fontSize : float + Font size in pixels for title text. + + **Default value:** ``10``. + fontStyle : :class:`FontStyle` + Font style for title text. + fontWeight : :class:`FontWeight` + 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 : :class:`TitleFrame` + 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 : float + The maximum allowed length in pixels of legend labels. + offset : float + The orthogonal offset in pixels by which to displace the title from its position + along the edge of the chart. + orient : :class:`TitleOrient` + Default title orientation ( ``"top"``, ``"bottom"``, ``"left"``, or ``"right"`` ) + style : anyOf(string, List(string)) + A `mark style property `__ + to apply to the title text mark. + + **Default value:** ``"group-title"``. + zindex : 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/TitleParams'} + + def __init__(self, text=Undefined, align=Undefined, anchor=Undefined, angle=Undefined, + baseline=Undefined, color=Undefined, dx=Undefined, dy=Undefined, font=Undefined, + fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, frame=Undefined, + limit=Undefined, offset=Undefined, orient=Undefined, style=Undefined, zindex=Undefined, + **kwds): + super(TitleParams, self).__init__(text=text, align=align, anchor=anchor, angle=angle, + baseline=baseline, color=color, dx=dx, dy=dy, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, + frame=frame, limit=limit, offset=offset, orient=orient, + style=style, zindex=zindex, **kwds) + + +class TooltipContent(VegaLiteSchema): + """TooltipContent schema wrapper + + Mapping(required=[content]) + + Attributes + ---------- + + content : enum('encoding', 'data') + + """ + _schema = {'$ref': '#/definitions/TooltipContent'} + + def __init__(self, content=Undefined, **kwds): + super(TooltipContent, self).__init__(content=content, **kwds) + + +class TopLevelSpec(VegaLiteSchema): + """TopLevelSpec schema wrapper + + anyOf(:class:`TopLevelUnitSpec`, :class:`TopLevelFacetSpec`, :class:`TopLevelLayerSpec`, + :class:`TopLevelRepeatSpec`, :class:`TopLevelConcatSpec`, :class:`TopLevelVConcatSpec`, + :class:`TopLevelHConcatSpec`) + 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'} + + def __init__(self, *args, **kwds): + super(TopLevelSpec, self).__init__(*args, **kwds) + + +class TopLevelConcatSpec(TopLevelSpec): + """TopLevelConcatSpec schema wrapper + + Mapping(required=[concat]) + + Attributes + ---------- + + concat : List(:class:`Spec`) + A list of views to be concatenated. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. + The supported string values are ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + Sets 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. + ``"fit"`` is only supported for single and layered views that don't use + ``rangeStep``. + + **Default value** : ``pad`` + background : string + CSS color property to use as the background of the entire view. + + **Default value:** none (transparent) + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to + ``hconcat`` (for ``concat`` ) and to using the ``column`` channel (for ``facet`` and + ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 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` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + data : anyOf(:class:`Data`, 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` + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + padding : :class:`Padding` + 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`` + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(string, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : Mapping(required=[]) + 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 + URL to `JSON schema `__ for a Vega-Lite specification. + Unless you have a reason to change this, use + ``https://vega.github.io/schema/vega-lite/v3.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, 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, resolve=resolve, spacing=spacing, + title=title, transform=transform, usermeta=usermeta, + **kwds) + + +class TopLevelFacetSpec(TopLevelSpec): + """TopLevelFacetSpec schema wrapper + + Mapping(required=[data, facet, spec]) + + Attributes + ---------- + + data : anyOf(:class:`Data`, 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`) + Definition for how to facet the data. One of: + 1) `a field definition for faceting the plot by one field + `__ + 2) `An object that maps row and column channels to their field definitions + `__ + spec : anyOf(:class:`LayerSpec`, :class:`FacetedUnitSpec`) + A specification of the view that gets faceted. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. + The supported string values are ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + Sets 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. + ``"fit"`` is only supported for single and layered views that don't use + ``rangeStep``. + + **Default value** : ``pad`` + background : string + CSS color property to use as the background of the entire view. + + **Default value:** none (transparent) + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to + ``hconcat`` (for ``concat`` ) and to using the ``column`` channel (for ``facet`` and + ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 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` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + datasets : :class:`Datasets` + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + padding : :class:`Padding` + 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`` + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(string, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : Mapping(required=[]) + 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 + URL to `JSON schema `__ for a Vega-Lite specification. + Unless you have a reason to change this, use + ``https://vega.github.io/schema/vega-lite/v3.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, 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, resolve=resolve, spacing=spacing, + title=title, transform=transform, usermeta=usermeta, + **kwds) + + +class TopLevelHConcatSpec(TopLevelSpec): + """TopLevelHConcatSpec schema wrapper + + Mapping(required=[hconcat]) + + Attributes + ---------- + + hconcat : List(:class:`Spec`) + A list of views to be concatenated and put into a row. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + Sets 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. + ``"fit"`` is only supported for single and layered views that don't use + ``rangeStep``. + + **Default value** : ``pad`` + background : string + CSS color property to use as the background of the entire view. + + **Default value:** none (transparent) + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : boolean + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + **Default value:** ``false`` + config : :class:`Config` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + data : anyOf(:class:`Data`, 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` + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + padding : :class:`Padding` + 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`` + resolve : :class:`Resolve` + 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(string, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : Mapping(required=[]) + 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 + URL to `JSON schema `__ for a Vega-Lite specification. + Unless you have a reason to change this, use + ``https://vega.github.io/schema/vega-lite/v3.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, 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, + resolve=resolve, spacing=spacing, title=title, + transform=transform, usermeta=usermeta, **kwds) + + +class TopLevelLayerSpec(TopLevelSpec): + """TopLevelLayerSpec schema wrapper + + Mapping(required=[layer]) + + Attributes + ---------- + + layer : List(anyOf(:class:`LayerSpec`, :class:`UnitSpec`)) + 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 `__ and place a layer + inside a facet. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + Sets 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. + ``"fit"`` is only supported for single and layered views that don't use + ``rangeStep``. + + **Default value** : ``pad`` + background : string + CSS color property to use as the background of the entire view. + + **Default value:** none (transparent) + config : :class:`Config` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + data : anyOf(:class:`Data`, 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` + 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 of this mark for commenting purpose. + encoding : :class:`Encoding` + A shared key-value mapping between encoding channels and definition of fields in the + underlying layers. + height : float + The height of a visualization. + + **Default value:** + + + * If a view's `autosize + `__ type is ``"fit"`` or + its y-channel has a `continuous scale + `__, the height will + be the value of `config.view.height + `__. + * For y-axis with a band or point scale: if `rangeStep + `__ is a numeric value or + unspecified, the height is `determined by the range step, paddings, and the + cardinality of the field mapped to y-channel + `__. Otherwise, if the + ``rangeStep`` is ``null``, the height will be the value of `config.view.height + `__. + * If no field is mapped to ``y`` channel, the ``height`` will be the value of + ``rangeStep``. + + **Note** : For plots with `row and column channels + `__, this represents the + height of a single view. + + **See also:** The documentation for `width and height + `__ contains more examples. + name : string + Name of the visualization for later reference. + padding : :class:`Padding` + 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`` + projection : :class:`Projection` + An object defining properties of the geographic projection shared by underlying + layers. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + title : anyOf(string, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : Mapping(required=[]) + 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` + An object defining the view background's fill and stroke. + + **Default value:** none (transparent) + width : float + The width of a visualization. + + **Default value:** This will be determined by the following rules: + + + * If a view's `autosize + `__ type is ``"fit"`` or + its x-channel has a `continuous scale + `__, the width will + be the value of `config.view.width + `__. + * For x-axis with a band or point scale: if `rangeStep + `__ is a numeric value or + unspecified, the width is `determined by the range step, paddings, and the + cardinality of the field mapped to x-channel + `__. Otherwise, if the + ``rangeStep`` is ``null``, the width will be the value of `config.view.width + `__. + * If no field is mapped to ``x`` channel, the ``width`` will be the value of + `config.scale.textXRangeStep + `__ for + ``text`` mark and the value of ``rangeStep`` for other marks. + + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view. + + **See also:** The documentation for `width and height + `__ contains more examples. + $schema : string + URL to `JSON schema `__ for a Vega-Lite specification. + Unless you have a reason to change this, use + ``https://vega.github.io/schema/vega-lite/v3.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, 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, + projection=projection, resolve=resolve, title=title, + transform=transform, usermeta=usermeta, view=view, + width=width, **kwds) + + +class TopLevelRepeatSpec(TopLevelSpec): + """TopLevelRepeatSpec schema wrapper + + Mapping(required=[repeat, spec]) + + Attributes + ---------- + + repeat : anyOf(List(string), :class:`RepeatMapping`) + 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 using ``{"repeat": "repeat"}`` + 2) An object that mapped ``"row"`` and/or ``"column"`` to the listed of 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:`Spec` + 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 ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + Sets 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. + ``"fit"`` is only supported for single and layered views that don't use + ``rangeStep``. + + **Default value** : ``pad`` + background : string + CSS color property to use as the background of the entire view. + + **Default value:** none (transparent) + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to + ``hconcat`` (for ``concat`` ) and to using the ``column`` channel (for ``facet`` and + ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 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` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + data : anyOf(:class:`Data`, 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` + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + padding : :class:`Padding` + 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`` + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(string, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : Mapping(required=[]) + 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 + URL to `JSON schema `__ for a Vega-Lite specification. + Unless you have a reason to change this, use + ``https://vega.github.io/schema/vega-lite/v3.json``. Setting the ``$schema`` + property allows automatic validation and autocomplete in editors that support JSON + schema. + """ + _schema = {'$ref': '#/definitions/TopLevelRepeatSpec'} + + def __init__(self, repeat=Undefined, spec=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, resolve=Undefined, spacing=Undefined, + title=Undefined, transform=Undefined, usermeta=Undefined, **kwds): + super(TopLevelRepeatSpec, self).__init__(repeat=repeat, spec=spec, align=align, + autosize=autosize, background=background, + bounds=bounds, center=center, columns=columns, + config=config, data=data, datasets=datasets, + description=description, name=name, padding=padding, + resolve=resolve, spacing=spacing, title=title, + transform=transform, usermeta=usermeta, **kwds) + + +class TopLevelUnitSpec(TopLevelSpec): + """TopLevelUnitSpec schema wrapper + + Mapping(required=[data, mark]) + + Attributes + ---------- + + data : anyOf(:class:`Data`, 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` + A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, + ``"tick"``, ``"line"``, + ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and ``"text"`` ) or a `mark + definition object `__. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. + The supported string values are ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. + * For ``"each"``, subviews will be aligned into a clean grid structure, but each row + or column may be of variable size. + * For ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + Sets 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. + ``"fit"`` is only supported for single and layered views that don't use + ``rangeStep``. + + **Default value** : ``pad`` + background : string + CSS color property to use as the background of the entire view. + + **Default value:** none (transparent) + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to + ``hconcat`` (for ``concat`` ) and to using the ``column`` channel (for ``facet`` and + ``repeat`` ). + + **Note** : + + 1) This property is only for: + + + * the general (wrappable) ``concat`` operator (not ``hconcat`` / ``vconcat`` ) + * the ``facet`` and ``repeat`` operator with one field/repetition definition + (without row/column nesting) + + 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` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + datasets : :class:`Datasets` + 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 of this mark for commenting purpose. + encoding : :class:`FacetedEncoding` + A key-value mapping between encoding channels and definition of fields. + height : float + The height of a visualization. + + **Default value:** + + + * If a view's `autosize + `__ type is ``"fit"`` or + its y-channel has a `continuous scale + `__, the height will + be the value of `config.view.height + `__. + * For y-axis with a band or point scale: if `rangeStep + `__ is a numeric value or + unspecified, the height is `determined by the range step, paddings, and the + cardinality of the field mapped to y-channel + `__. Otherwise, if the + ``rangeStep`` is ``null``, the height will be the value of `config.view.height + `__. + * If no field is mapped to ``y`` channel, the ``height`` will be the value of + ``rangeStep``. + + **Note** : For plots with `row and column channels + `__, this represents the + height of a single view. + + **See also:** The documentation for `width and height + `__ contains more examples. + name : string + Name of the visualization for later reference. + padding : :class:`Padding` + 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`` + projection : :class:`Projection` + 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` + Scale, axis, and legend resolutions for view composition specifications. + selection : Mapping(required=[]) + A key-value mapping between selection names and definitions. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(string, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : Mapping(required=[]) + 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` + An object defining the view background's fill and stroke. + + **Default value:** none (transparent) + width : float + The width of a visualization. + + **Default value:** This will be determined by the following rules: + + + * If a view's `autosize + `__ type is ``"fit"`` or + its x-channel has a `continuous scale + `__, the width will + be the value of `config.view.width + `__. + * For x-axis with a band or point scale: if `rangeStep + `__ is a numeric value or + unspecified, the width is `determined by the range step, paddings, and the + cardinality of the field mapped to x-channel + `__. Otherwise, if the + ``rangeStep`` is ``null``, the width will be the value of `config.view.width + `__. + * If no field is mapped to ``x`` channel, the ``width`` will be the value of + `config.scale.textXRangeStep + `__ for + ``text`` mark and the value of ``rangeStep`` for other marks. + + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view. + + **See also:** The documentation for `width and height + `__ contains more examples. + $schema : string + URL to `JSON schema `__ for a Vega-Lite specification. + Unless you have a reason to change this, use + ``https://vega.github.io/schema/vega-lite/v3.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, columns=Undefined, + config=Undefined, datasets=Undefined, description=Undefined, encoding=Undefined, + height=Undefined, name=Undefined, padding=Undefined, projection=Undefined, + resolve=Undefined, selection=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, + columns=columns, config=config, datasets=datasets, + description=description, encoding=encoding, + height=height, name=name, padding=padding, + projection=projection, resolve=resolve, + selection=selection, spacing=spacing, title=title, + transform=transform, usermeta=usermeta, view=view, + width=width, **kwds) + + +class TopLevelVConcatSpec(TopLevelSpec): + """TopLevelVConcatSpec schema wrapper + + Mapping(required=[vconcat]) + + Attributes + ---------- + + vconcat : List(:class:`Spec`) + A list of views to be concatenated and put into a column. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + Sets 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. + ``"fit"`` is only supported for single and layered views that don't use + ``rangeStep``. + + **Default value** : ``pad`` + background : string + CSS color property to use as the background of the entire view. + + **Default value:** none (transparent) + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : boolean + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + **Default value:** ``false`` + config : :class:`Config` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + data : anyOf(:class:`Data`, 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` + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + padding : :class:`Padding` + 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`` + resolve : :class:`Resolve` + 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(string, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : Mapping(required=[]) + 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 + URL to `JSON schema `__ for a Vega-Lite specification. + Unless you have a reason to change this, use + ``https://vega.github.io/schema/vega-lite/v3.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, 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, + resolve=resolve, spacing=spacing, title=title, + transform=transform, usermeta=usermeta, **kwds) + + +class TopoDataFormat(DataFormat): + """TopoDataFormat schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + feature : string + 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 + 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) + 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 name, and the value to the + desired data type (one of ``"number"``, ``"boolean"``, ``"date"``, or null (do not + parse the field)). + For example, ``"parse": {"modified_on": "date"}`` parses the ``modified_on`` field + in each input record a Date value. + + For ``"date"``, we parse data based using Javascript's `Date.parse() + `__. + For Specific date formats can be provided (e.g., ``{foo: "date:'%m%d%Y'"}`` ), using + the `d3-time-format syntax `__. + UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). + See more about `UTC time + `__ + type : enum('topojson') + 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) + + +class Transform(VegaLiteSchema): + """Transform schema wrapper + + anyOf(:class:`AggregateTransform`, :class:`BinTransform`, :class:`CalculateTransform`, + :class:`FilterTransform`, :class:`FlattenTransform`, :class:`FoldTransform`, + :class:`ImputeTransform`, :class:`JoinAggregateTransform`, :class:`LookupTransform`, + :class:`TimeUnitTransform`, :class:`SampleTransform`, :class:`StackTransform`, + :class:`WindowTransform`) + """ + _schema = {'$ref': '#/definitions/Transform'} + + def __init__(self, *args, **kwds): + super(Transform, self).__init__(*args, **kwds) + + +class AggregateTransform(Transform): + """AggregateTransform schema wrapper + + Mapping(required=[aggregate]) + + Attributes + ---------- + + aggregate : List(:class:`AggregatedFieldDef`) + Array of objects that define fields to aggregate. + groupby : List(:class:`FieldName`) + 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) + + +class BinTransform(Transform): + """BinTransform schema wrapper + + Mapping(required=[bin, field, as]) + + Attributes + ---------- + + bin : anyOf(enum(True), :class:`BinParams`) + An object indicating bin properties, or simply ``true`` for using default bin + parameters. + field : :class:`FieldName` + The data field to bin. + as : anyOf(:class:`FieldName`, List(:class:`FieldName`)) + The output fields at which to write the start and end bin values. + """ + _schema = {'$ref': '#/definitions/BinTransform'} + + def __init__(self, bin=Undefined, field=Undefined, **kwds): + super(BinTransform, self).__init__(bin=bin, field=field, **kwds) + + +class CalculateTransform(Transform): + """CalculateTransform schema wrapper + + Mapping(required=[calculate, as]) + + Attributes + ---------- + + calculate : string + A `expression `__ + string. Use the variable ``datum`` to refer to the current data object. + as : :class:`FieldName` + The field for storing the computed formula value. + """ + _schema = {'$ref': '#/definitions/CalculateTransform'} + + def __init__(self, calculate=Undefined, **kwds): + super(CalculateTransform, self).__init__(calculate=calculate, **kwds) + + +class FilterTransform(Transform): + """FilterTransform schema wrapper + + Mapping(required=[filter]) + + Attributes + ---------- + + filter : :class:`LogicalOperandPredicate` + The ``filter`` property must be one of the predicate definitions: + + 1) an `expression `__ + string, + where ``datum`` can be used to refer to the current data object + + 2) one of the field predicates: `equal + `__, + `lt `__, + `lte `__, + `gt `__, + `gte `__, + `range `__, + `oneOf `__, + or `valid `__, + + 3) a `selection predicate + `__ + + 4) a logical operand that combines (1), (2), or (3). + """ + _schema = {'$ref': '#/definitions/FilterTransform'} + + def __init__(self, filter=Undefined, **kwds): + super(FilterTransform, self).__init__(filter=filter, **kwds) + + +class FlattenTransform(Transform): + """FlattenTransform schema wrapper + + Mapping(required=[flatten]) + + Attributes + ---------- + + flatten : List(:class:`FieldName`) + 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`) + 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): + super(FlattenTransform, self).__init__(flatten=flatten, **kwds) + + +class FoldTransform(Transform): + """FoldTransform schema wrapper + + Mapping(required=[fold]) + + Attributes + ---------- + + fold : List(:class:`FieldName`) + An array of data fields indicating the properties to fold. + as : List([:class:`FieldName`, :class:`FieldName`]) + 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): + super(FoldTransform, self).__init__(fold=fold, **kwds) + + +class ImputeTransform(Transform): + """ImputeTransform schema wrapper + + Mapping(required=[impute, key]) + + Attributes + ---------- + + impute : :class:`FieldName` + The data field for which the missing values should be imputed. + key : :class:`FieldName` + 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)) + 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 + rows preceding or following the current data object. For example, the value ``[-5, + 5]`` indicates that the window should include five objects preceding and five + objects following the current object. + + **Default value:** : ``[null, null]`` indicating that the window includes all + objects. + 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(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 + `__. + + If provided, this will be used in addition to the key values observed within the + input data. If not provided, the values will be derived from all unique values of + the ``key`` field. For ``impute`` in ``encoding``, the key field is the x-field if + the y-field is imputed, or vice versa. + + If there is no impute grouping, this property *must* be specified. + method : :class:`ImputeMethod` + The imputation method to use for the field value of imputed data objects. + One of ``value``, ``mean``, ``median``, ``max`` or ``min``. + + **Default value:** ``"value"`` + 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) + + +class JoinAggregateTransform(Transform): + """JoinAggregateTransform schema wrapper + + Mapping(required=[joinaggregate]) + + Attributes + ---------- + + joinaggregate : List(:class:`JoinAggregateFieldDef`) + The definition of the fields in the join aggregate, and what calculations to use. + groupby : List(:class:`FieldName`) + 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) + + +class LookupTransform(Transform): + """LookupTransform schema wrapper + + Mapping(required=[lookup, from]) + + Attributes + ---------- + + lookup : :class:`FieldName` + Key in primary data source. + default : string + The default value to use if lookup fails. + + **Default value:** ``null`` + as : anyOf(:class:`FieldName`, List(:class:`FieldName`)) + The field or fields for storing the computed formula value. + If ``from.fields`` is specified, the transform will use the same names for ``as``. + If ``from.fields`` is not specified, ``as`` has to be a string and we put the whole + object into the data under the specified name. + from : :class:`LookupData` + Secondary data reference. + """ + _schema = {'$ref': '#/definitions/LookupTransform'} + + def __init__(self, lookup=Undefined, default=Undefined, **kwds): + super(LookupTransform, self).__init__(lookup=lookup, default=default, **kwds) + + +class SampleTransform(Transform): + """SampleTransform schema wrapper + + Mapping(required=[sample]) + + Attributes + ---------- + + sample : float + The maximum number of data objects to include in the sample. + + **Default value:** ``1000`` + """ + _schema = {'$ref': '#/definitions/SampleTransform'} + + def __init__(self, sample=Undefined, **kwds): + super(SampleTransform, self).__init__(sample=sample, **kwds) + + +class StackTransform(Transform): + """StackTransform schema wrapper + + Mapping(required=[stack, groupby, as]) + + Attributes + ---------- + + groupby : List(:class:`FieldName`) + The data fields to group by. + stack : :class:`FieldName` + The field which is stacked. + offset : enum('zero', 'center', 'normalize') + Mode for stacking marks. + **Default value:** ``"zero"`` + sort : List(:class:`SortField`) + Field that determines the order of leaves in the stacked charts. + as : anyOf(:class:`FieldName`, List(:class:`FieldName`)) + 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(eg."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) + + +class TimeUnitTransform(Transform): + """TimeUnitTransform schema wrapper + + Mapping(required=[timeUnit, field, as]) + + Attributes + ---------- + + field : :class:`FieldName` + The data field to apply time unit. + timeUnit : :class:`TimeUnit` + The timeUnit. + as : :class:`FieldName` + The output field to write the timeUnit value. + """ + _schema = {'$ref': '#/definitions/TimeUnitTransform'} + + def __init__(self, field=Undefined, timeUnit=Undefined, **kwds): + super(TimeUnitTransform, self).__init__(field=field, timeUnit=timeUnit, **kwds) + + +class TypeForShape(VegaLiteSchema): + """TypeForShape schema wrapper + + enum('nominal', 'ordinal', 'geojson') + """ + _schema = {'$ref': '#/definitions/TypeForShape'} + + def __init__(self, *args): + super(TypeForShape, self).__init__(*args) + + +class TypedFieldDef(VegaLiteSchema): + """TypedFieldDef schema wrapper + + Mapping(required=[type]) + Definition object for a data field, its type and transformation of an encoding channel. + + Attributes + ---------- + + type : :class:`StandardType` + The encoded field's type of measurement ( ``"quantitative"``, ``"temporal"``, + ``"ordinal"``, or ``"nominal"`` ). + It can also be a ``"geojson"`` type for encoding `'geoshape' + `__. + + **Note:** + + + * 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`` ). + * 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. + * When using with `bin `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) + or `"ordinal" (for using an ordinal bin scale) + `__. + * When using with `timeUnit + `__, the ``type`` property + can be either ``"temporal"`` (for using a temporal scale) or `"ordinal" (for using + an ordinal scale) `__. + * When using with `aggregate + `__, 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", "type": "quantitative"}``. The ``"type"`` of the aggregate output + is ``"quantitative"``. + * Secondary channels (e.g., ``x2``, ``y2``, ``xError``, ``yError`` ) do not have + ``type`` as they have exactly the same type as their primary channels (e.g., + ``x``, ``y`` ). + + **See also:** `type `__ + documentation. + aggregate : :class:`Aggregate` + Aggregation function for the field + (e.g., ``mean``, ``sum``, ``median``, ``min``, ``max``, ``count`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + bin : anyOf(boolean, :class:`BinParams`, enum('binned'), None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** + 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access nested + objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). + If field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). + See more details about escaping in the `field documentation + `__. + 2) ``field`` is not required if ``aggregate`` is ``count``. + timeUnit : :class:`TimeUnit` + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. + or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + title : anyOf(string, 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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/TypedFieldDef'} + + def __init__(self, type=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, **kwds): + super(TypedFieldDef, self).__init__(type=type, aggregate=aggregate, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class UnitSpec(VegaLiteSchema): + """UnitSpec schema wrapper + + Mapping(required=[mark]) + Base interface for a unit (single-view) specification. + + Attributes + ---------- + + mark : :class:`AnyMark` + A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, + ``"tick"``, ``"line"``, + ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and ``"text"`` ) or a `mark + definition object `__. + data : anyOf(:class:`Data`, 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 of this mark for commenting purpose. + encoding : :class:`Encoding` + A key-value mapping between encoding channels and definition of fields. + height : float + The height of a visualization. + + **Default value:** + + + * If a view's `autosize + `__ type is ``"fit"`` or + its y-channel has a `continuous scale + `__, the height will + be the value of `config.view.height + `__. + * For y-axis with a band or point scale: if `rangeStep + `__ is a numeric value or + unspecified, the height is `determined by the range step, paddings, and the + cardinality of the field mapped to y-channel + `__. Otherwise, if the + ``rangeStep`` is ``null``, the height will be the value of `config.view.height + `__. + * If no field is mapped to ``y`` channel, the ``height`` will be the value of + ``rangeStep``. + + **Note** : For plots with `row and column channels + `__, this represents the + height of a single view. + + **See also:** The documentation for `width and height + `__ contains more examples. + name : string + Name of the visualization for later reference. + projection : :class:`Projection` + 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. + selection : Mapping(required=[]) + A key-value mapping between selection names and definitions. + title : anyOf(string, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + view : :class:`ViewBackground` + An object defining the view background's fill and stroke. + + **Default value:** none (transparent) + width : float + The width of a visualization. + + **Default value:** This will be determined by the following rules: + + + * If a view's `autosize + `__ type is ``"fit"`` or + its x-channel has a `continuous scale + `__, the width will + be the value of `config.view.width + `__. + * For x-axis with a band or point scale: if `rangeStep + `__ is a numeric value or + unspecified, the width is `determined by the range step, paddings, and the + cardinality of the field mapped to x-channel + `__. Otherwise, if the + ``rangeStep`` is ``null``, the width will be the value of `config.view.width + `__. + * If no field is mapped to ``x`` channel, the ``width`` will be the value of + `config.scale.textXRangeStep + `__ for + ``text`` mark and the value of ``rangeStep`` for other marks. + + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view. + + **See also:** The documentation for `width and height + `__ contains more examples. + """ + _schema = {'$ref': '#/definitions/UnitSpec'} + + def __init__(self, mark=Undefined, data=Undefined, description=Undefined, encoding=Undefined, + height=Undefined, name=Undefined, projection=Undefined, selection=Undefined, + title=Undefined, transform=Undefined, view=Undefined, width=Undefined, **kwds): + super(UnitSpec, self).__init__(mark=mark, data=data, description=description, encoding=encoding, + height=height, name=name, projection=projection, + selection=selection, title=title, transform=transform, view=view, + width=width, **kwds) + + +class UrlData(DataSource): + """UrlData schema wrapper + + Mapping(required=[url]) + + Attributes + ---------- + + url : string + 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` + An object that specifies the format for parsing the data. + name : string + Provide a placeholder name and bind data at runtime. + """ + _schema = {'$ref': '#/definitions/UrlData'} + + def __init__(self, url=Undefined, format=Undefined, name=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', + 'utcyearmonthdatehoursminutesseconds', 'utcquartermonth', 'utcmonthdate', + 'utcmonthdatehours', 'utchoursminutes', 'utchoursminutesseconds', 'utcminutesseconds', + 'utcsecondsmilliseconds') + """ + _schema = {'$ref': '#/definitions/UtcMultiTimeUnit'} + + def __init__(self, *args): + super(UtcMultiTimeUnit, self).__init__(*args) + + +class UtcSingleTimeUnit(SingleTimeUnit): + """UtcSingleTimeUnit schema wrapper + + enum('utcyear', 'utcquarter', 'utcmonth', 'utcday', 'utcdate', 'utchours', 'utcminutes', + 'utcseconds', 'utcmilliseconds') + """ + _schema = {'$ref': '#/definitions/UtcSingleTimeUnit'} + + def __init__(self, *args): + super(UtcSingleTimeUnit, self).__init__(*args) + + +class VConcatSpec(Spec): + """VConcatSpec schema wrapper + + Mapping(required=[vconcat]) + Base interface for a vertical concatenation specification. + + Attributes + ---------- + + vconcat : List(:class:`Spec`) + A list of views to be concatenated and put into a column. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. + * If set to ``flush``, only the specified width and height values for the sub-view + will be used. The ``flush`` setting can be useful when attempting to place + sub-plots without axes or legends into a uniform grid structure. + + **Default value:** ``"full"`` + center : boolean + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + **Default value:** ``false`` + data : anyOf(:class:`Data`, 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + 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(string, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/VConcatSpec'} + + 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(VConcatSpec, self).__init__(vconcat=vconcat, bounds=bounds, center=center, data=data, + description=description, name=name, resolve=resolve, + spacing=spacing, title=title, transform=transform, **kwds) + + +class Value(VegaLiteSchema): + """Value schema wrapper + + anyOf(float, string, boolean, None) + """ + _schema = {'$ref': '#/definitions/Value'} + + def __init__(self, *args): + super(Value, self).__init__(*args) + + +class ValueDefWithConditionMarkPropFieldDefTypeForShapestringnull(VegaLiteSchema): + """ValueDefWithConditionMarkPropFieldDefTypeForShapestringnull schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldDefTypeForShape`, + :class:`ConditionalStringValueDef`, List(:class:`ConditionalStringValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDefWithCondition,(string|null)>'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ValueDefWithConditionMarkPropFieldDefTypeForShapestringnull, self).__init__(condition=condition, + value=value, + **kwds) + + +class ValueDefWithConditionMarkPropFieldDefnumber(VegaLiteSchema): + """ValueDefWithConditionMarkPropFieldDefnumber schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ConditionalNumberValueDef`, + List(:class:`ConditionalNumberValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : float + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ValueDefWithConditionMarkPropFieldDefnumber, self).__init__(condition=condition, + value=value, **kwds) + + +class ValueDefWithConditionMarkPropFieldDefstringnull(VegaLiteSchema): + """ValueDefWithConditionMarkPropFieldDefstringnull schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldDef`, :class:`ConditionalStringValueDef`, + List(:class:`ConditionalStringValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ValueDefWithConditionMarkPropFieldDefstringnull, self).__init__(condition=condition, + value=value, **kwds) + + +class ValueDefWithConditionTextFieldDefValue(VegaLiteSchema): + """ValueDefWithConditionTextFieldDefValue schema wrapper + + Mapping(required=[]) + A ValueDef with Condition where either the condition or the value are + optional. + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalTextFieldDef`, :class:`ConditionalValueDef`, + List(:class:`ConditionalValueDef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : :class:`Value` + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ValueDefWithConditionTextFieldDefValue, self).__init__(condition=condition, value=value, + **kwds) + + +class ViewBackground(VegaLiteSchema): + """ViewBackground schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + cornerRadius : float + The radius in pixels of rounded rectangle corners. + + **Default value:** ``0`` + fill : anyOf(:class:`Color`, None) + The fill color. + + **Default value:** ``undefined`` + fillOpacity : float + The fill opacity (value between [0,1]). + + **Default value:** ``1`` + opacity : 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) + The stroke color. + + **Default value:** ``"#ddd"`` + strokeCap : :class:`StrokeCap` + The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or + ``"square"``. + + **Default value:** ``"square"`` + strokeDash : List(float) + An array of alternating stroke, space lengths for creating dashed or dotted lines. + strokeDashOffset : float + The offset (in pixels) into which to begin drawing with the stroke dash array. + strokeJoin : :class:`StrokeJoin` + The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. + + **Default value:** ``"miter"`` + strokeMiterLimit : float + The miter limit at which to bevel a line join. + strokeOpacity : float + The stroke opacity (value between [0,1]). + + **Default value:** ``1`` + strokeWidth : float + The stroke width, in pixels. + style : anyOf(string, List(string)) + 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 + `__. If style is an + array, later styles will override earlier styles. + + **Default value:** ``"cell"`` + **Note:** Any specified view background properties will augment the default style. + """ + _schema = {'$ref': '#/definitions/ViewBackground'} + + def __init__(self, cornerRadius=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, 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=[]) + + Attributes + ---------- + + clip : boolean + Whether the view should be clipped. + cornerRadius : float + The radius in pixels of rounded rectangle corners. + + **Default value:** ``0`` + fill : anyOf(:class:`Color`, None) + The fill color. + + **Default value:** ``undefined`` + fillOpacity : float + The fill opacity (value between [0,1]). + + **Default value:** ``1`` + height : float + The default height of the single plot or each plot in a trellis plot when the + visualization has a continuous (non-ordinal) y-scale with ``rangeStep`` = ``null``. + + **Default value:** ``200`` + opacity : 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) + The stroke color. + + **Default value:** ``"#ddd"`` + strokeCap : :class:`StrokeCap` + The stroke cap for line ending style. One of ``"butt"``, ``"round"``, or + ``"square"``. + + **Default value:** ``"square"`` + strokeDash : List(float) + An array of alternating stroke, space lengths for creating dashed or dotted lines. + strokeDashOffset : float + The offset (in pixels) into which to begin drawing with the stroke dash array. + strokeJoin : :class:`StrokeJoin` + The stroke line join method. One of ``"miter"``, ``"round"`` or ``"bevel"``. + + **Default value:** ``"miter"`` + strokeMiterLimit : float + The miter limit at which to bevel a line join. + strokeOpacity : float + The stroke opacity (value between [0,1]). + + **Default value:** ``1`` + strokeWidth : float + The stroke width, in pixels. + width : float + The default width of the single plot or each plot in a trellis plot when the + visualization has a continuous (non-ordinal) x-scale or ordinal x-scale with + ``rangeStep`` = ``null``. + + **Default value:** ``200`` + """ + _schema = {'$ref': '#/definitions/ViewConfig'} + + def __init__(self, clip=Undefined, cornerRadius=Undefined, fill=Undefined, fillOpacity=Undefined, + height=Undefined, opacity=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, + width=Undefined, **kwds): + super(ViewConfig, self).__init__(clip=clip, cornerRadius=cornerRadius, fill=fill, + fillOpacity=fillOpacity, height=height, opacity=opacity, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, width=width, **kwds) + + +class WindowFieldDef(VegaLiteSchema): + """WindowFieldDef schema wrapper + + Mapping(required=[op, as]) + + Attributes + ---------- + + op : anyOf(:class:`AggregateOp`, :class:`WindowOnlyOp`) + 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 `__. + field : :class:`FieldName` + 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``. + param : float + Parameter values for the window functions. Parameter values can be omitted for + operations that do not accept a parameter. + + See the list of all supported operations and their parameters `here + `__. + as : :class:`FieldName` + The output name for the window operation. + """ + _schema = {'$ref': '#/definitions/WindowFieldDef'} + + def __init__(self, op=Undefined, field=Undefined, param=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') + """ + _schema = {'$ref': '#/definitions/WindowOnlyOp'} + + def __init__(self, *args): + super(WindowOnlyOp, self).__init__(*args) + + +class WindowTransform(Transform): + """WindowTransform schema wrapper + + Mapping(required=[window]) + + Attributes + ---------- + + window : List(:class:`WindowFieldDef`) + The definition of the fields in the window, and what calculations to use. + frame : List(anyOf(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 + following the current data object. The default value is ``[null, 0]``, indicating + that the sliding window includes the current object and all preceding objects. The + value ``[-5, 5]`` indicates that the window should include five objects preceding + and five objects following the current object. Finally, ``[null, null]`` indicates + that the window frame should always include all data objects. If you this frame and + want to assign the same value to add objects, you can use the simpler `join + aggregate transform `__. + The only operators affected are the aggregation operations and the ``first_value``, + ``last_value``, and ``nth_value`` window operations. The other window operations are + not affected by this. + + **Default value:** : ``[null, 0]`` (includes the current object and all preceding + objects) + groupby : List(:class:`FieldName`) + The data fields for partitioning the data objects into separate windows. If + unspecified, all data points will be in a single window. + ignorePeers : boolean + 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 + defined by offset values only. This setting only affects those operations that + depend on the window frame, namely aggregation operations and the first_value, + last_value, and nth_value window operations. + + **Default value:** ``false`` + sort : List(:class:`SortField`) + 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) + + +class XValueDef(VegaLiteSchema): + """XValueDef schema wrapper + + Mapping(required=[value]) + Definition object for a constant value of an encoding channel. + + Attributes + ---------- + + value : anyOf(float, enum('width')) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/XValueDef'} + + def __init__(self, value=Undefined, **kwds): + super(XValueDef, self).__init__(value=value, **kwds) + + +class YValueDef(VegaLiteSchema): + """YValueDef schema wrapper + + Mapping(required=[value]) + Definition object for a constant value of an encoding channel. + + Attributes + ---------- + + value : anyOf(float, enum('height')) + A constant value in visual domain (e.g., ``"red"`` / "#0099ff" for color, values + between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/YValueDef'} + + def __init__(self, value=Undefined, **kwds): + super(YValueDef, self).__init__(value=value, **kwds) + diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/schema/mixins.py b/runtime/Lib/site-packages/altair/vegalite/v3/schema/mixins.py new file mode 100644 index 0000000000000000000000000000000000000000..0278d400da2c408c72325347adb180af001c1255 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/schema/mixins.py @@ -0,0 +1,807 @@ +# The contents of this file are automatically written by +# tools/generate_schema_wrapper.py. Do not modify directly. +from . import core +from altair.utils import use_signature +from altair.utils.schemapi import Undefined + + +class MarkMethodMixin(object): + """A mixin class that defines mark methods""" + + def mark_area(self, align=Undefined, angle=Undefined, baseline=Undefined, binSpacing=Undefined, + clip=Undefined, color=Undefined, cornerRadius=Undefined, cursor=Undefined, + dir=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, + interpolate=Undefined, limit=Undefined, line=Undefined, opacity=Undefined, + order=Undefined, orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, + size=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, + strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, + text=Undefined, theta=Undefined, thickness=Undefined, tooltip=Undefined, + width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, + y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): + """Set the chart's mark to 'area' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, + color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, line=line, opacity=opacity, + order=order, orient=orient, point=point, radius=radius, shape=shape, size=size, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, style=style, tension=tension, text=text, theta=theta, + thickness=thickness, tooltip=tooltip, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + 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, baseline=Undefined, binSpacing=Undefined, + clip=Undefined, color=Undefined, cornerRadius=Undefined, cursor=Undefined, + dir=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, + interpolate=Undefined, limit=Undefined, line=Undefined, opacity=Undefined, + order=Undefined, orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, + size=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, + strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, + text=Undefined, theta=Undefined, thickness=Undefined, tooltip=Undefined, + width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, + y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): + """Set the chart's mark to 'bar' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, + color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, line=line, opacity=opacity, + order=order, orient=orient, point=point, radius=radius, shape=shape, size=size, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, style=style, tension=tension, text=text, theta=theta, + thickness=thickness, tooltip=tooltip, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + 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_line(self, align=Undefined, angle=Undefined, baseline=Undefined, binSpacing=Undefined, + clip=Undefined, color=Undefined, cornerRadius=Undefined, cursor=Undefined, + dir=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, + interpolate=Undefined, limit=Undefined, line=Undefined, opacity=Undefined, + order=Undefined, orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, + size=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, + strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, + text=Undefined, theta=Undefined, thickness=Undefined, tooltip=Undefined, + width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, + y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): + """Set the chart's mark to 'line' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, + color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, line=line, opacity=opacity, + order=order, orient=orient, point=point, radius=radius, shape=shape, size=size, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, style=style, tension=tension, text=text, theta=theta, + thickness=thickness, tooltip=tooltip, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + 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_trail(self, align=Undefined, angle=Undefined, baseline=Undefined, binSpacing=Undefined, + clip=Undefined, color=Undefined, cornerRadius=Undefined, cursor=Undefined, + dir=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, + interpolate=Undefined, limit=Undefined, line=Undefined, opacity=Undefined, + order=Undefined, orient=Undefined, point=Undefined, radius=Undefined, + shape=Undefined, size=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, + style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, + thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'trail' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, + color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, line=line, opacity=opacity, + order=order, orient=orient, point=point, radius=radius, shape=shape, size=size, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, style=style, tension=tension, text=text, theta=theta, + thickness=thickness, tooltip=tooltip, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + 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_point(self, align=Undefined, angle=Undefined, baseline=Undefined, binSpacing=Undefined, + clip=Undefined, color=Undefined, cornerRadius=Undefined, cursor=Undefined, + dir=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, + interpolate=Undefined, limit=Undefined, line=Undefined, opacity=Undefined, + order=Undefined, orient=Undefined, point=Undefined, radius=Undefined, + shape=Undefined, size=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, + style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, + thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'point' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, + color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, line=line, opacity=opacity, + order=order, orient=orient, point=point, radius=radius, shape=shape, size=size, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, style=style, tension=tension, text=text, theta=theta, + thickness=thickness, tooltip=tooltip, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + 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_text(self, align=Undefined, angle=Undefined, baseline=Undefined, binSpacing=Undefined, + clip=Undefined, color=Undefined, cornerRadius=Undefined, cursor=Undefined, + dir=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, + interpolate=Undefined, limit=Undefined, line=Undefined, opacity=Undefined, + order=Undefined, orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, + size=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, + strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, + text=Undefined, theta=Undefined, thickness=Undefined, tooltip=Undefined, + width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, + y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): + """Set the chart's mark to 'text' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, + color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, line=line, opacity=opacity, + order=order, orient=orient, point=point, radius=radius, shape=shape, size=size, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, style=style, tension=tension, text=text, theta=theta, + thickness=thickness, tooltip=tooltip, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + 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, baseline=Undefined, binSpacing=Undefined, + clip=Undefined, color=Undefined, cornerRadius=Undefined, cursor=Undefined, + dir=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, + interpolate=Undefined, limit=Undefined, line=Undefined, opacity=Undefined, + order=Undefined, orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, + size=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, + strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, + text=Undefined, theta=Undefined, thickness=Undefined, tooltip=Undefined, + width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, + y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): + """Set the chart's mark to 'tick' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, + color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, line=line, opacity=opacity, + order=order, orient=orient, point=point, radius=radius, shape=shape, size=size, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, style=style, tension=tension, text=text, theta=theta, + thickness=thickness, tooltip=tooltip, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + 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_rect(self, align=Undefined, angle=Undefined, baseline=Undefined, binSpacing=Undefined, + clip=Undefined, color=Undefined, cornerRadius=Undefined, cursor=Undefined, + dir=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, + interpolate=Undefined, limit=Undefined, line=Undefined, opacity=Undefined, + order=Undefined, orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, + size=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, + strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, + text=Undefined, theta=Undefined, thickness=Undefined, tooltip=Undefined, + width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, + y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): + """Set the chart's mark to 'rect' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, + color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, line=line, opacity=opacity, + order=order, orient=orient, point=point, radius=radius, shape=shape, size=size, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, style=style, tension=tension, text=text, theta=theta, + thickness=thickness, tooltip=tooltip, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + 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, baseline=Undefined, binSpacing=Undefined, + clip=Undefined, color=Undefined, cornerRadius=Undefined, cursor=Undefined, + dir=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, + interpolate=Undefined, limit=Undefined, line=Undefined, opacity=Undefined, + order=Undefined, orient=Undefined, point=Undefined, radius=Undefined, shape=Undefined, + size=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, + strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, + strokeOpacity=Undefined, strokeWidth=Undefined, style=Undefined, tension=Undefined, + text=Undefined, theta=Undefined, thickness=Undefined, tooltip=Undefined, + width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, + y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): + """Set the chart's mark to 'rule' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, + color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, line=line, opacity=opacity, + order=order, orient=orient, point=point, radius=radius, shape=shape, size=size, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, style=style, tension=tension, text=text, theta=theta, + thickness=thickness, tooltip=tooltip, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + 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_circle(self, align=Undefined, angle=Undefined, baseline=Undefined, binSpacing=Undefined, + clip=Undefined, color=Undefined, cornerRadius=Undefined, cursor=Undefined, + dir=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, + interpolate=Undefined, limit=Undefined, line=Undefined, opacity=Undefined, + order=Undefined, orient=Undefined, point=Undefined, radius=Undefined, + shape=Undefined, size=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, + style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, + thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, + y2Offset=Undefined, yOffset=Undefined, **kwds): + """Set the chart's mark to 'circle' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, + color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, line=line, opacity=opacity, + order=order, orient=orient, point=point, radius=radius, shape=shape, size=size, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, style=style, tension=tension, text=text, theta=theta, + thickness=thickness, tooltip=tooltip, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + 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, baseline=Undefined, binSpacing=Undefined, + clip=Undefined, color=Undefined, cornerRadius=Undefined, cursor=Undefined, + dir=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, + interpolate=Undefined, limit=Undefined, line=Undefined, opacity=Undefined, + order=Undefined, orient=Undefined, point=Undefined, radius=Undefined, + shape=Undefined, size=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, + style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, + thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, + y2Offset=Undefined, yOffset=Undefined, **kwds): + """Set the chart's mark to 'square' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, + color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, line=line, opacity=opacity, + order=order, orient=orient, point=point, radius=radius, shape=shape, size=size, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, style=style, tension=tension, text=text, theta=theta, + thickness=thickness, tooltip=tooltip, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + 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, baseline=Undefined, binSpacing=Undefined, + clip=Undefined, color=Undefined, cornerRadius=Undefined, cursor=Undefined, + dir=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, + interpolate=Undefined, limit=Undefined, line=Undefined, opacity=Undefined, + order=Undefined, orient=Undefined, point=Undefined, radius=Undefined, + shape=Undefined, size=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, + style=Undefined, tension=Undefined, text=Undefined, theta=Undefined, + thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, + x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, + y2Offset=Undefined, yOffset=Undefined, **kwds): + """Set the chart's mark to 'geoshape' + + For information on additional arguments, see :class:`MarkDef` + """ + kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, + color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, + ellipsis=ellipsis, fill=fill, fillOpacity=fillOpacity, filled=filled, font=font, + fontSize=fontSize, fontStyle=fontStyle, fontWeight=fontWeight, height=height, + href=href, interpolate=interpolate, limit=limit, line=line, opacity=opacity, + order=order, orient=orient, point=point, radius=radius, shape=shape, size=size, + stroke=stroke, strokeCap=strokeCap, strokeDash=strokeDash, + strokeDashOffset=strokeDashOffset, strokeJoin=strokeJoin, + strokeMiterLimit=strokeMiterLimit, strokeOpacity=strokeOpacity, + strokeWidth=strokeWidth, style=style, tension=tension, text=text, theta=theta, + thickness=thickness, tooltip=tooltip, width=width, x=x, x2=x2, x2Offset=x2Offset, + xOffset=xOffset, y=y, y2=y2, y2Offset=y2Offset, yOffset=yOffset, **kwds) + copy = self.copy(deep=False) + 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, + median=Undefined, opacity=Undefined, orient=Undefined, outliers=Undefined, + rule=Undefined, size=Undefined, ticks=Undefined, **kwds): + """Set the chart's mark to 'boxplot' + + For information on additional arguments, see :class:`BoxPlotDef` + """ + kwds = dict(box=box, clip=clip, color=color, extent=extent, median=median, opacity=opacity, + orient=orient, outliers=outliers, rule=rule, size=size, ticks=ticks, **kwds) + copy = self.copy(deep=False) + 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, ticks=Undefined, **kwds): + """Set the chart's mark to 'errorbar' + + For information on additional arguments, see :class:`ErrorBarDef` + """ + kwds = dict(clip=clip, color=color, extent=extent, opacity=opacity, orient=orient, rule=rule, + ticks=ticks, **kwds) + copy = self.copy(deep=False) + 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): + """Set the chart's mark to 'errorband' + + For information on additional arguments, 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) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.ErrorBandDef(type="errorband", **kwds) + else: + copy.mark = "errorband" + return copy + + +class ConfigMethodMixin(object): + """A mixin class that defines config methods""" + + @use_signature(core.Config) + def configure(self, *args, **kwargs): + copy = self.copy(deep=False) + copy.config = core.Config(*args, **kwargs) + return copy + + @use_signature(core.AreaConfig) + def configure_area(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["area"] = core.AreaConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axis(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axis"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisBand(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisBand"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisBottom(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisBottom"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisLeft(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisLeft"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisRight(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisRight"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisTop(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisTop"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisX(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisX"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisY(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisY"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.RectConfig) + def configure_bar(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["bar"] = core.RectConfig(*args, **kwargs) + return copy + + @use_signature(core.BoxPlotConfig) + def configure_boxplot(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["boxplot"] = core.BoxPlotConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_circle(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["circle"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.CompositionConfig) + def configure_concat(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["concat"] = core.CompositionConfig(*args, **kwargs) + return copy + + @use_signature(core.ErrorBandConfig) + def configure_errorband(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["errorband"] = core.ErrorBandConfig(*args, **kwargs) + return copy + + @use_signature(core.ErrorBarConfig) + def configure_errorbar(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["errorbar"] = core.ErrorBarConfig(*args, **kwargs) + return copy + + @use_signature(core.CompositionConfig) + def configure_facet(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["facet"] = core.CompositionConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_geoshape(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["geoshape"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.HeaderConfig) + def configure_header(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["header"] = core.HeaderConfig(*args, **kwargs) + return copy + + @use_signature(core.HeaderConfig) + def configure_headerColumn(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["headerColumn"] = core.HeaderConfig(*args, **kwargs) + return copy + + @use_signature(core.HeaderConfig) + def configure_headerFacet(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["headerFacet"] = core.HeaderConfig(*args, **kwargs) + return copy + + @use_signature(core.HeaderConfig) + def configure_headerRow(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["headerRow"] = core.HeaderConfig(*args, **kwargs) + return copy + + @use_signature(core.LegendConfig) + def configure_legend(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["legend"] = core.LegendConfig(*args, **kwargs) + return copy + + @use_signature(core.LineConfig) + def configure_line(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["line"] = core.LineConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_mark(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["mark"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_point(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["point"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.ProjectionConfig) + def configure_projection(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["projection"] = core.ProjectionConfig(*args, **kwargs) + return copy + + @use_signature(core.RangeConfig) + def configure_range(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["range"] = core.RangeConfig(*args, **kwargs) + return copy + + @use_signature(core.RectConfig) + def configure_rect(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["rect"] = core.RectConfig(*args, **kwargs) + return copy + + @use_signature(core.CompositionConfig) + def configure_repeat(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["repeat"] = core.CompositionConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_rule(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["rule"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.ScaleConfig) + def configure_scale(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["scale"] = core.ScaleConfig(*args, **kwargs) + return copy + + @use_signature(core.SelectionConfig) + def configure_selection(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["selection"] = core.SelectionConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_square(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["square"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.TextConfig) + def configure_text(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["text"] = core.TextConfig(*args, **kwargs) + return copy + + @use_signature(core.TickConfig) + def configure_tick(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["tick"] = core.TickConfig(*args, **kwargs) + return copy + + @use_signature(core.TitleConfig) + def configure_title(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["title"] = core.TitleConfig(*args, **kwargs) + return copy + + @use_signature(core.LineConfig) + def configure_trail(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["trail"] = core.LineConfig(*args, **kwargs) + return copy + + @use_signature(core.ViewConfig) + def configure_view(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["view"] = core.ViewConfig(*args, **kwargs) + return copy \ No newline at end of file diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/schema/vega-lite-schema.json b/runtime/Lib/site-packages/altair/vegalite/v3/schema/vega-lite-schema.json new file mode 100644 index 0000000000000000000000000000000000000000..a5e60f818e891a9ec99ce74e60aec39a66be303e --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/schema/vega-lite-schema.json @@ -0,0 +1,13315 @@ +{ + "$ref": "#/definitions/TopLevelSpec", + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "Aggregate": { + "anyOf": [ + { + "$ref": "#/definitions/AggregateOp" + }, + { + "$ref": "#/definitions/ArgmaxDef" + }, + { + "$ref": "#/definitions/ArgminDef" + } + ] + }, + "AggregateOp": { + "enum": [ + "argmax", + "argmin", + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep" + ], + "type": "string" + }, + "AggregateTransform": { + "additionalProperties": false, + "properties": { + "aggregate": { + "description": "Array of objects that define fields to aggregate.", + "items": { + "$ref": "#/definitions/AggregatedFieldDef" + }, + "type": "array" + }, + "groupby": { + "description": "The data fields to group by. If not specified, a single group containing all data objects will be used.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + } + }, + "required": [ + "aggregate" + ], + "type": "object" + }, + "AggregatedFieldDef": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The output field names to use for each aggregated field." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "The data field for which to compute aggregate function. This is required for all aggregation operations except `\"count\"`." + }, + "op": { + "$ref": "#/definitions/AggregateOp", + "description": "The aggregation operation to apply to the fields (e.g., sum, average or count).\nSee the [full list of supported aggregation operations](https://vega.github.io/vega-lite/docs/aggregate.html#ops)\nfor more information." + } + }, + "required": [ + "op", + "as" + ], + "type": "object" + }, + "Align": { + "enum": [ + "left", + "center", + "right" + ], + "type": "string" + }, + "AnyMark": { + "anyOf": [ + { + "$ref": "#/definitions/CompositeMark" + }, + { + "$ref": "#/definitions/CompositeMarkDef" + }, + { + "$ref": "#/definitions/Mark" + }, + { + "$ref": "#/definitions/MarkDef" + } + ] + }, + "AreaConfig": { + "additionalProperties": false, + "properties": { + "align": { + "$ref": "#/definitions/Align", + "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`." + }, + "angle": { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + "baseline": { + "$ref": "#/definitions/TextBaseline", + "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`" + }, + "color": { + "$ref": "#/definitions/Color", + "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `color`.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config)." + }, + "cornerRadius": { + "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", + "type": "number" + }, + "cursor": { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + "dir": { + "$ref": "#/definitions/Dir", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + "dx": { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "dy": { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "ellipsis": { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + "fill": { + "$ref": "#/definitions/Color", + "description": "Default Fill Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for `point`, `line` and `rule`; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + "fontSize": { + "description": "The font size, in pixels.", + "type": "number" + }, + "fontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + "fontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "height": { + "description": "Height of the marks.", + "type": "number" + }, + "href": { + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", + "format": "uri", + "type": "string" + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "limit": { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit", + "type": "number" + }, + "line": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/OverlayMarkDef" + } + ], + "description": "A flag for overlaying line on top of area marks, or an object defining the properties of the overlayed lines.\n\n- If this value is an empty object (`{}`) or `true`, lines with default properties will be used.\n\n- If this value is `false`, no lines would be automatically added to area marks.\n\n__Default value:__ `false`." + }, + "opacity": { + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." + }, + "point": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/OverlayMarkDef" + }, + { + "enum": [ + "transparent" + ], + "type": "string" + } + ], + "description": "A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points.\n\n- If this property is `\"transparent\"`, transparent points will be used (for enhancing tooltips and selections).\n\n- If this property is an empty object (`{}`) or `true`, filled points with default properties will be used.\n\n- If this property is `false`, no points would be automatically added to line or area marks.\n\n__Default value:__ `false`." + }, + "radius": { + "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", + "minimum": 0, + "type": "number" + }, + "shape": { + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- 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.)\n\n__Default value:__ `\"circle\"`", + "type": "string" + }, + "size": { + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. For example: in the case of circles, the radius is determined in part by the square root of the size value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__ `30` for point, circle, square marks; `rangeStep` - 1 for bar marks with discrete dimensions; `5` for bar marks with continuous dimensions; `11` for text marks.", + "minimum": 0, + "type": "number" + }, + "stroke": { + "$ref": "#/definitions/Color", + "description": "Default Stroke Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "strokeCap": { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"square\"`" + }, + "strokeDash": { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "strokeDashOffset": { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + "strokeJoin": { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + "strokeMiterLimit": { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + "strokeOpacity": { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "strokeWidth": { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + "tension": { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "text": { + "description": "Placeholder text if the `text` channel is not specified", + "type": "string" + }, + "theta": { + "description": "Polar coordinate angle, in radians, of the text label from the origin determined by 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\".", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/Value" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null`, then no tooltip will be used." + }, + "width": { + "description": "Width of the marks.", + "type": "number" + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "height" + ], + "type": "string" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "ArgmaxDef": { + "additionalProperties": false, + "properties": { + "argmax": { + "type": "string" + } + }, + "required": [ + "argmax" + ], + "type": "object" + }, + "ArgminDef": { + "additionalProperties": false, + "properties": { + "argmin": { + "type": "string" + } + }, + "required": [ + "argmin" + ], + "type": "object" + }, + "AutoSizeParams": { + "additionalProperties": false, + "properties": { + "contains": { + "description": "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 added. In contrast, the `\"padding\"` setting includes the padding within the view size calculations, such that the width and height settings indicate the **total** intended size of the view.\n\n__Default value__: `\"content\"`", + "enum": [ + "content", + "padding" + ], + "type": "string" + }, + "resize": { + "description": "A boolean flag indicating if autosize layout should be re-calculated on every view update.\n\n__Default value__: `false`", + "type": "boolean" + }, + "type": { + "$ref": "#/definitions/AutosizeType", + "description": "The sizing format type. One of `\"pad\"`, `\"fit\"` or `\"none\"`. See the [autosize type](https://vega.github.io/vega-lite/docs/size.html#autosize) documentation for descriptions of each.\n\n__Default value__: `\"pad\"`" + } + }, + "type": "object" + }, + "AutosizeType": { + "enum": [ + "pad", + "fit", + "none" + ], + "type": "string" + }, + "Axis": { + "additionalProperties": false, + "properties": { + "bandPosition": { + "description": "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.\n\n __Default value:__ `0.5`", + "type": "number" + }, + "domain": { + "description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.\n\n__Default value:__ `true`", + "type": "boolean" + }, + "domainColor": { + "$ref": "#/definitions/Color", + "description": "Color of axis domain line.\n\n__Default value:__ `\"gray\"`." + }, + "domainDash": { + "description": "An array of alternating [stroke, space] lengths for dashed domain lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "domainDashOffset": { + "description": "The pixel offset at which to start drawing with the domain dash array.", + "type": "number" + }, + "domainOpacity": { + "description": "Opacity of the axis domain line.", + "type": "number" + }, + "domainWidth": { + "description": "Stroke width of axis domain line\n\n__Default value:__ `1`", + "type": "number" + }, + "format": { + "description": "The text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format.", + "type": "string" + }, + "formatType": { + "description": "The format type for labels (`\"number\"` or `\"time\"`).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", + "enum": [ + "number", + "time" + ], + "type": "string" + }, + "grid": { + "description": "A boolean flag indicating if grid lines should be included as part of the axis\n\n__Default value:__ `true` for [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous) that are not binned; otherwise, `false`.", + "type": "boolean" + }, + "gridColor": { + "$ref": "#/definitions/Color", + "description": "Color of gridlines.\n\n__Default value:__ `\"lightGray\"`." + }, + "gridDash": { + "description": "An array of alternating [stroke, space] lengths for dashed grid lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "gridDashOffset": { + "description": "The pixel offset at which to start drawing with the grid dash array.", + "type": "number" + }, + "gridOpacity": { + "description": "The stroke opacity of grid (value between [0,1])\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "gridWidth": { + "description": "The grid width, in pixels.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "labelAlign": { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment of axis tick labels, overriding the default setting for the current axis orientation." + }, + "labelAngle": { + "description": "The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + "labelBaseline": { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline of axis tick labels, overriding the default setting for the current axis orientation. Can be `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`." + }, + "labelBound": { + "description": "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 number, it specifies the pixel tolerance: the maximum amount by which a label bounding box may exceed the axis range.\n\n__Default value:__ `false`.", + "type": [ + "number", + "boolean" + ] + }, + "labelColor": { + "$ref": "#/definitions/Color", + "description": "The color of the tick label, can be in hex color code or regular color name." + }, + "labelFlush": { + "description": "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 applied instead. If this property is a number, it also indicates the number of pixels by which to offset the first and last labels; for example, a value of 2 will flush-align the first and last labels and also push them 2 pixels outward from the center of the axis. The additional adjustment can sometimes help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`.", + "type": [ + "boolean", + "number" + ] + }, + "labelFlushOffset": { + "description": "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.\n\n__Default value:__ `0`.", + "type": "number" + }, + "labelFont": { + "description": "The font of the tick label.", + "type": "string" + }, + "labelFontSize": { + "description": "The font size of the label, in pixels.", + "minimum": 0, + "type": "number" + }, + "labelFontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "Font style of the title." + }, + "labelFontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "Font weight of axis tick labels." + }, + "labelLimit": { + "description": "Maximum allowed pixel width of axis tick labels.\n\n__Default value:__ `180`", + "type": "number" + }, + "labelOpacity": { + "description": "The opacity of the labels.", + "type": "number" + }, + "labelOverlap": { + "$ref": "#/definitions/LabelOverlap", + "description": "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 axes). If set to `\"greedy\"`, a linear scan of the labels is performed, removing any labels that overlaps with the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true` for non-nominal fields with non-log scales; `\"greedy\"` for log scales; otherwise `false`." + }, + "labelPadding": { + "description": "The padding, in pixels, between axis and text labels.\n\n__Default value:__ `2`", + "type": "number" + }, + "labelSeparation": { + "description": "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.", + "type": "number" + }, + "labels": { + "description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.", + "type": "boolean" + }, + "maxExtent": { + "description": "The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles.\n\n__Default value:__ `undefined`.", + "type": "number" + }, + "minExtent": { + "description": "The minimum extent in pixels that axis ticks and labels should use. This determines a minimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis.", + "type": "number" + }, + "offset": { + "description": "The offset, in pixels, by which to displace the axis from the edge of the enclosing group or data rectangle.\n\n__Default value:__ derived from the [axis config](https://vega.github.io/vega-lite/docs/config.html#facet-scale-config)'s `offset` (`0` by default)", + "type": "number" + }, + "orient": { + "$ref": "#/definitions/AxisOrient", + "description": "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).\n\n__Default value:__ `\"bottom\"` for x-axes and `\"left\"` for y-axes." + }, + "position": { + "description": "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.\n\n__Default value__: `0`", + "type": "number" + }, + "tickColor": { + "$ref": "#/definitions/Color", + "description": "The color of the axis's tick.\n\n__Default value:__ `\"gray\"`" + }, + "tickCount": { + "description": "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.", + "type": "number" + }, + "tickDash": { + "description": "An array of alternating [stroke, space] lengths for dashed tick mark lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "tickDashOffset": { + "description": "The pixel offset at which to start drawing with the tick mark dash array.", + "type": "number" + }, + "tickExtra": { + "description": "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`.", + "type": "boolean" + }, + "tickMinStep": { + "description": "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.\n\n__Default value__: `undefined`", + "type": "number" + }, + "tickOffset": { + "description": "Position offset in pixels to apply to ticks, labels, and gridlines.", + "type": "number" + }, + "tickOpacity": { + "description": "Opacity of the ticks.", + "type": "number" + }, + "tickRound": { + "description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer.\n\n__Default value:__ `true`", + "type": "boolean" + }, + "tickSize": { + "description": "The size in pixels of axis ticks.\n\n__Default value:__ `5`", + "minimum": 0, + "type": "number" + }, + "tickWidth": { + "description": "The width, in pixels, of ticks.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "ticks": { + "description": "Boolean value that determines whether the axis should include ticks.\n\n__Default value:__ `true`", + "type": "boolean" + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "titleAlign": { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment of axis titles." + }, + "titleAnchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "Text anchor position for placing axis titles." + }, + "titleAngle": { + "description": "Angle in degrees of axis titles.", + "type": "number" + }, + "titleBaseline": { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline for axis titles." + }, + "titleColor": { + "$ref": "#/definitions/Color", + "description": "Color of the title, can be in hex color code or regular color name." + }, + "titleFont": { + "description": "Font of the title. (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + "titleFontSize": { + "description": "Font size of the title.", + "minimum": 0, + "type": "number" + }, + "titleFontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "Font style of the title." + }, + "titleFontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "Font weight of the title.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "titleLimit": { + "description": "Maximum allowed pixel width of axis titles.", + "minimum": 0, + "type": "number" + }, + "titleOpacity": { + "description": "Opacity of the axis title.", + "type": "number" + }, + "titlePadding": { + "description": "The padding, in pixels, between title and axis.", + "type": "number" + }, + "titleX": { + "description": "X-coordinate of the axis title relative to the axis group.", + "type": "number" + }, + "titleY": { + "description": "Y-coordinate of the axis title relative to the axis group.", + "type": "number" + }, + "values": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + } + ], + "description": "Explicitly set the visible axis tick values." + }, + "zindex": { + "description": "A non-negative integer indicating the z-index of the axis.\nIf zindex is 0, axes should be drawn behind all chart elements.\nTo put them in front, use `\"zindex = 1\"`.\n\n__Default value:__ `1` (in front of the marks) for actual axis and `0` (behind the marks) for grids.", + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "AxisConfig": { + "additionalProperties": false, + "properties": { + "bandPosition": { + "description": "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.\n\n __Default value:__ `0.5`", + "type": "number" + }, + "domain": { + "description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.\n\n__Default value:__ `true`", + "type": "boolean" + }, + "domainColor": { + "$ref": "#/definitions/Color", + "description": "Color of axis domain line.\n\n__Default value:__ `\"gray\"`." + }, + "domainDash": { + "description": "An array of alternating [stroke, space] lengths for dashed domain lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "domainDashOffset": { + "description": "The pixel offset at which to start drawing with the domain dash array.", + "type": "number" + }, + "domainOpacity": { + "description": "Opacity of the axis domain line.", + "type": "number" + }, + "domainWidth": { + "description": "Stroke width of axis domain line\n\n__Default value:__ `1`", + "type": "number" + }, + "grid": { + "description": "A boolean flag indicating if grid lines should be included as part of the axis\n\n__Default value:__ `true` for [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous) that are not binned; otherwise, `false`.", + "type": "boolean" + }, + "gridColor": { + "$ref": "#/definitions/Color", + "description": "Color of gridlines.\n\n__Default value:__ `\"lightGray\"`." + }, + "gridDash": { + "description": "An array of alternating [stroke, space] lengths for dashed grid lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "gridDashOffset": { + "description": "The pixel offset at which to start drawing with the grid dash array.", + "type": "number" + }, + "gridOpacity": { + "description": "The stroke opacity of grid (value between [0,1])\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "gridWidth": { + "description": "The grid width, in pixels.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "labelAlign": { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment of axis tick labels, overriding the default setting for the current axis orientation." + }, + "labelAngle": { + "description": "The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + "labelBaseline": { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline of axis tick labels, overriding the default setting for the current axis orientation. Can be `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`." + }, + "labelBound": { + "description": "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 number, it specifies the pixel tolerance: the maximum amount by which a label bounding box may exceed the axis range.\n\n__Default value:__ `false`.", + "type": [ + "number", + "boolean" + ] + }, + "labelColor": { + "$ref": "#/definitions/Color", + "description": "The color of the tick label, can be in hex color code or regular color name." + }, + "labelFlush": { + "description": "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 applied instead. If this property is a number, it also indicates the number of pixels by which to offset the first and last labels; for example, a value of 2 will flush-align the first and last labels and also push them 2 pixels outward from the center of the axis. The additional adjustment can sometimes help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`.", + "type": [ + "boolean", + "number" + ] + }, + "labelFlushOffset": { + "description": "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.\n\n__Default value:__ `0`.", + "type": "number" + }, + "labelFont": { + "description": "The font of the tick label.", + "type": "string" + }, + "labelFontSize": { + "description": "The font size of the label, in pixels.", + "minimum": 0, + "type": "number" + }, + "labelFontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "Font style of the title." + }, + "labelFontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "Font weight of axis tick labels." + }, + "labelLimit": { + "description": "Maximum allowed pixel width of axis tick labels.\n\n__Default value:__ `180`", + "type": "number" + }, + "labelOpacity": { + "description": "The opacity of the labels.", + "type": "number" + }, + "labelOverlap": { + "$ref": "#/definitions/LabelOverlap", + "description": "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 axes). If set to `\"greedy\"`, a linear scan of the labels is performed, removing any labels that overlaps with the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true` for non-nominal fields with non-log scales; `\"greedy\"` for log scales; otherwise `false`." + }, + "labelPadding": { + "description": "The padding, in pixels, between axis and text labels.\n\n__Default value:__ `2`", + "type": "number" + }, + "labelSeparation": { + "description": "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.", + "type": "number" + }, + "labels": { + "description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.", + "type": "boolean" + }, + "maxExtent": { + "description": "The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles.\n\n__Default value:__ `undefined`.", + "type": "number" + }, + "minExtent": { + "description": "The minimum extent in pixels that axis ticks and labels should use. This determines a minimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis.", + "type": "number" + }, + "orient": { + "$ref": "#/definitions/AxisOrient", + "description": "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).\n\n__Default value:__ `\"bottom\"` for x-axes and `\"left\"` for y-axes." + }, + "shortTimeLabels": { + "description": "Whether month names and weekday names should be abbreviated.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "tickColor": { + "$ref": "#/definitions/Color", + "description": "The color of the axis's tick.\n\n__Default value:__ `\"gray\"`" + }, + "tickDash": { + "description": "An array of alternating [stroke, space] lengths for dashed tick mark lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "tickDashOffset": { + "description": "The pixel offset at which to start drawing with the tick mark dash array.", + "type": "number" + }, + "tickExtra": { + "description": "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`.", + "type": "boolean" + }, + "tickOffset": { + "description": "Position offset in pixels to apply to ticks, labels, and gridlines.", + "type": "number" + }, + "tickOpacity": { + "description": "Opacity of the ticks.", + "type": "number" + }, + "tickRound": { + "description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer.\n\n__Default value:__ `true`", + "type": "boolean" + }, + "tickSize": { + "description": "The size in pixels of axis ticks.\n\n__Default value:__ `5`", + "minimum": 0, + "type": "number" + }, + "tickWidth": { + "description": "The width, in pixels, of ticks.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "ticks": { + "description": "Boolean value that determines whether the axis should include ticks.\n\n__Default value:__ `true`", + "type": "boolean" + }, + "title": { + "description": "Set to null to disable title for the axis, legend, or header.", + "type": "null" + }, + "titleAlign": { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment of axis titles." + }, + "titleAnchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "Text anchor position for placing axis titles." + }, + "titleAngle": { + "description": "Angle in degrees of axis titles.", + "type": "number" + }, + "titleBaseline": { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline for axis titles." + }, + "titleColor": { + "$ref": "#/definitions/Color", + "description": "Color of the title, can be in hex color code or regular color name." + }, + "titleFont": { + "description": "Font of the title. (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + "titleFontSize": { + "description": "Font size of the title.", + "minimum": 0, + "type": "number" + }, + "titleFontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "Font style of the title." + }, + "titleFontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "Font weight of the title.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "titleLimit": { + "description": "Maximum allowed pixel width of axis titles.", + "minimum": 0, + "type": "number" + }, + "titleOpacity": { + "description": "Opacity of the axis title.", + "type": "number" + }, + "titlePadding": { + "description": "The padding, in pixels, between title and axis.", + "type": "number" + }, + "titleX": { + "description": "X-coordinate of the axis title relative to the axis group.", + "type": "number" + }, + "titleY": { + "description": "Y-coordinate of the axis title relative to the axis group.", + "type": "number" + } + }, + "type": "object" + }, + "AxisOrient": { + "enum": [ + "top", + "bottom", + "left", + "right" + ], + "type": "string" + }, + "AxisResolveMap": { + "additionalProperties": false, + "properties": { + "x": { + "$ref": "#/definitions/ResolveMode" + }, + "y": { + "$ref": "#/definitions/ResolveMode" + } + }, + "type": "object" + }, + "BaseLegendLayout": { + "additionalProperties": false, + "properties": { + "anchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "The anchor point for legend orient group layout." + }, + "bounds": { + "$ref": "#/definitions/LayoutBounds", + "description": "The bounds calculation to use for legend orient group layout." + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/SignalRef" + } + ], + "description": "A flag to center legends within a shared orient group." + }, + "direction": { + "anyOf": [ + { + "$ref": "#/definitions/Orientation" + }, + { + "$ref": "#/definitions/SignalRef" + } + ], + "description": "The layout direction for legend orient group layout." + }, + "margin": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/SignalRef" + } + ], + "description": "The pixel margin between legends within a orient group." + }, + "offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/SignalRef" + } + ], + "description": "The pixel offset from the chart body for a legend orient group." + } + }, + "type": "object" + }, + "BaseMarkConfig": { + "additionalProperties": false, + "properties": { + "align": { + "$ref": "#/definitions/Align", + "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`." + }, + "angle": { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + "baseline": { + "$ref": "#/definitions/TextBaseline", + "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`" + }, + "cornerRadius": { + "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", + "type": "number" + }, + "cursor": { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + "dir": { + "$ref": "#/definitions/Dir", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + "dx": { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "dy": { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "ellipsis": { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + "fill": { + "$ref": "#/definitions/Color", + "description": "Default Fill Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "font": { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + "fontSize": { + "description": "The font size, in pixels.", + "type": "number" + }, + "fontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + "fontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "height": { + "description": "Height of the marks.", + "type": "number" + }, + "href": { + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", + "format": "uri", + "type": "string" + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "limit": { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit", + "type": "number" + }, + "opacity": { + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." + }, + "radius": { + "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", + "minimum": 0, + "type": "number" + }, + "shape": { + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- 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.)\n\n__Default value:__ `\"circle\"`", + "type": "string" + }, + "size": { + "description": "The pixel area each the point/circle/square.\nFor example: in the case of circles, the radius is determined in part by the square root of the size value.\n\n__Default value:__ `30`", + "minimum": 0, + "type": "number" + }, + "stroke": { + "$ref": "#/definitions/Color", + "description": "Default Stroke Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "strokeCap": { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"square\"`" + }, + "strokeDash": { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "strokeDashOffset": { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + "strokeJoin": { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + "strokeMiterLimit": { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + "strokeOpacity": { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "strokeWidth": { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + "tension": { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "text": { + "description": "Placeholder text if the `text` channel is not specified", + "type": "string" + }, + "theta": { + "description": "Polar coordinate angle, in radians, of the text label from the origin determined by 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\".", + "type": "number" + }, + "tooltip": { + "description": "The tooltip text to show upon mouse hover." + }, + "width": { + "description": "Width of the marks.", + "type": "number" + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "height" + ], + "type": "string" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "BaseTitleConfig": { + "additionalProperties": false, + "properties": { + "align": { + "$ref": "#/definitions/Align" + }, + "anchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "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." + }, + "angle": { + "description": "Angle in degrees of title text.", + "type": "number" + }, + "baseline": { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline for title text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`." + }, + "color": { + "$ref": "#/definitions/Color", + "description": "Text color for title text." + }, + "dx": { + "description": "Delta offset for title text x-coordinate.", + "type": "number" + }, + "dy": { + "description": "Delta offset for title text y-coordinate.", + "type": "number" + }, + "font": { + "description": "Font name for title text.", + "type": "string" + }, + "fontSize": { + "description": "Font size in pixels for title text.\n\n__Default value:__ `10`.", + "minimum": 0, + "type": "number" + }, + "fontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "Font style for title text." + }, + "fontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "Font weight for title text.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "frame": { + "$ref": "#/definitions/TitleFrame", + "description": "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": { + "description": "The maximum allowed length in pixels of legend labels.", + "minimum": 0, + "type": "number" + }, + "offset": { + "description": "The orthogonal offset in pixels by which to displace the title from its position along the edge of the chart.", + "type": "number" + }, + "orient": { + "$ref": "#/definitions/TitleOrient", + "description": "Default title orientation (`\"top\"`, `\"bottom\"`, `\"left\"`, or `\"right\"`)" + } + }, + "type": "object" + }, + "Baseline": { + "enum": [ + "top", + "middle", + "bottom" + ], + "type": "string" + }, + "BinParams": { + "additionalProperties": false, + "description": "Binning properties or boolean flag for determining whether to bin data or not.", + "properties": { + "anchor": { + "description": "A value in the binned domain at which to anchor the bins, shifting the bin boundaries if necessary to ensure that a boundary aligns with the anchor value.\n\n__Default Value:__ the minimum bin extent value", + "type": "number" + }, + "base": { + "description": "The number base to use for automatic bin determination (default is base 10).\n\n__Default value:__ `10`", + "type": "number" + }, + "binned": { + "description": "When set to true, Vega-Lite treats the input data as already binned.", + "type": "boolean" + }, + "divide": { + "description": "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 method can check if bin sizes of 2 (= 10/5), 5 (= 10/2), or 1 (= 10/(5*2)) might also satisfy the given constraints.\n\n__Default value:__ `[5, 2]`", + "items": { + "type": "number" + }, + "minItems": 1, + "type": "array" + }, + "extent": { + "description": "A two-element (`[min, max]`) array indicating the range of desired bin values.", + "items": { + "type": "number" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "maxbins": { + "description": "Maximum number of bins.\n\n__Default value:__ `6` for `row`, `column` and `shape` channels; `10` for other channels", + "minimum": 2, + "type": "number" + }, + "minstep": { + "description": "A minimum allowable step size (particularly useful for integer values).", + "type": "number" + }, + "nice": { + "description": "If true (the default), attempts to make the bin boundaries use human-friendly boundaries, such as multiples of ten.", + "type": "boolean" + }, + "step": { + "description": "An exact step size to use between bins.\n\n__Note:__ If provided, options such as maxbins will be ignored.", + "type": "number" + }, + "steps": { + "description": "An array of allowable step sizes to choose from.", + "items": { + "type": "number" + }, + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "BinTransform": { + "additionalProperties": false, + "properties": { + "as": { + "anyOf": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + } + ], + "description": "The output fields at which to write the start and end bin values." + }, + "bin": { + "anyOf": [ + { + "enum": [ + true + ], + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + } + ], + "description": "An object indicating bin properties, or simply `true` for using default bin parameters." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "The data field to bin." + } + }, + "required": [ + "bin", + "field", + "as" + ], + "type": "object" + }, + "BindCheckbox": { + "additionalProperties": false, + "properties": { + "debounce": { + "type": "number" + }, + "element": { + "$ref": "#/definitions/Element" + }, + "input": { + "enum": [ + "checkbox" + ], + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "input" + ], + "type": "object" + }, + "BindRadioSelect": { + "additionalProperties": false, + "properties": { + "debounce": { + "type": "number" + }, + "element": { + "$ref": "#/definitions/Element" + }, + "input": { + "enum": [ + "radio", + "select" + ], + "type": "string" + }, + "name": { + "type": "string" + }, + "options": { + "items": { + }, + "type": "array" + }, + "type": { + "type": "string" + } + }, + "required": [ + "input", + "options" + ], + "type": "object" + }, + "BindRange": { + "additionalProperties": false, + "properties": { + "debounce": { + "type": "number" + }, + "element": { + "$ref": "#/definitions/Element" + }, + "input": { + "enum": [ + "range" + ], + "type": "string" + }, + "max": { + "type": "number" + }, + "min": { + "type": "number" + }, + "name": { + "type": "string" + }, + "step": { + "type": "number" + }, + "type": { + "type": "string" + } + }, + "required": [ + "input" + ], + "type": "object" + }, + "Binding": { + "anyOf": [ + { + "$ref": "#/definitions/BindCheckbox" + }, + { + "$ref": "#/definitions/BindRadioSelect" + }, + { + "$ref": "#/definitions/BindRange" + }, + { + "$ref": "#/definitions/InputBinding" + } + ] + }, + "BoxPlot": { + "enum": [ + "boxplot" + ], + "type": "string" + }, + "BoxPlotConfig": { + "additionalProperties": false, + "properties": { + "box": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "extent": { + "anyOf": [ + { + "enum": [ + "min-max" + ], + "type": "string" + }, + { + "type": "number" + } + ], + "description": "The extent of the whiskers. Available options include:\n- `\"min-max\"`: min and max are the lower and upper whiskers respectively.\n- A number representing multiple of the interquartile range. This number will be multiplied by the IQR to determine whisker boundary, which spans from the smallest data to the largest data within the range _[Q1 - k * IQR, Q3 + k * IQR]_ where _Q1_ and _Q3_ are the first and third quartiles while _IQR_ is the interquartile range (_Q3-Q1_).\n\n__Default value:__ `1.5`." + }, + "median": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "outliers": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "rule": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "size": { + "description": "Size of the box and median tick of a box plot", + "type": "number" + }, + "ticks": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + } + }, + "type": "object" + }, + "BoxPlotDef": { + "additionalProperties": false, + "properties": { + "box": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "clip": { + "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", + "type": "boolean" + }, + "color": { + "$ref": "#/definitions/Color", + "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `color`.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config)." + }, + "extent": { + "anyOf": [ + { + "enum": [ + "min-max" + ], + "type": "string" + }, + { + "type": "number" + } + ], + "description": "The extent of the whiskers. Available options include:\n- `\"min-max\"`: min and max are the lower and upper whiskers respectively.\n- A number representing multiple of the interquartile range. This number will be multiplied by the IQR to determine whisker boundary, which spans from the smallest data to the largest data within the range _[Q1 - k * IQR, Q3 + k * IQR]_ where _Q1_ and _Q3_ are the first and third quartiles while _IQR_ is the interquartile range (_Q3-Q1_).\n\n__Default value:__ `1.5`." + }, + "median": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "opacity": { + "description": "The opacity (value between [0,1]) of the mark.", + "type": "number" + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "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.\n\n__Default value:__ `\"vertical\"`." + }, + "outliers": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "rule": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "size": { + "description": "Size of the box and median tick of a box plot", + "type": "number" + }, + "ticks": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "type": { + "$ref": "#/definitions/BoxPlot", + "description": "The mark type. This could a primitive mark type\n(one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`)\nor a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "BrushConfig": { + "additionalProperties": false, + "properties": { + "fill": { + "$ref": "#/definitions/Color", + "description": "The fill color of the interval mark.\n\n__Default value:__ `#333333`" + }, + "fillOpacity": { + "description": "The fill opacity of the interval mark (a value between 0 and 1).\n\n__Default value:__ `0.125`", + "type": "number" + }, + "stroke": { + "$ref": "#/definitions/Color", + "description": "The stroke color of the interval mark.\n\n__Default value:__ `#ffffff`" + }, + "strokeDash": { + "description": "An array of alternating stroke and space lengths,\nfor creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "strokeDashOffset": { + "description": "The offset (in pixels) with which to begin drawing the stroke dash array.", + "type": "number" + }, + "strokeOpacity": { + "description": "The stroke opacity of the interval mark (a value between 0 and 1).", + "type": "number" + }, + "strokeWidth": { + "description": "The stroke width of the interval mark.", + "type": "number" + } + }, + "type": "object" + }, + "CalculateTransform": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The field for storing the computed formula value." + }, + "calculate": { + "description": "A [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string. Use the variable `datum` to refer to the current data object.", + "type": "string" + } + }, + "required": [ + "calculate", + "as" + ], + "type": "object" + }, + "Color": { + "anyOf": [ + { + "$ref": "#/definitions/ColorName" + }, + { + "$ref": "#/definitions/HexColor" + }, + { + "type": "string" + } + ] + }, + "ColorName": { + "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", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple" + ], + "type": "string" + }, + "Encoding": { + "additionalProperties": false, + "properties": { + "color": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "Color of the marks – either fill or stroke color based on the `filled` property of mark definition.\nBy default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`,\n`\"text\"`, `\"trail\"`, `\"circle\"`, and `\"square\"` / stroke color for `\"line\"` and `\"point\"`.\n\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.\n\n_Note:_\n1) For fine-grained control over both fill and stroke colors of the marks, please use the `fill` and `stroke` channels. If either `fill` or `stroke` channel is specified, `color` channel will be ignored.\n2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme)." + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDefWithoutScale" + }, + { + "items": { + "$ref": "#/definitions/FieldDefWithoutScale" + }, + "type": "array" + } + ], + "description": "Additional levels of detail for grouping data in aggregate views and\nin line, trail, and area marks without mapping data to a specific visual channel." + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "Fill color of the marks.\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.\n\n_Note:_ When using `fill` channel, `color ` channel will be ignored. To customize both fill and stroke, please use `fill` and `stroke` channels (not `fill` and `color`)." + }, + "fillOpacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "description": "Fill opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `fillOpacity` property." + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/TextFieldDefWithCondition" + }, + { + "$ref": "#/definitions/TextValueDefWithCondition" + } + ], + "description": "A URL to load upon mouse click." + }, + "key": { + "$ref": "#/definitions/FieldDefWithoutScale", + "description": "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": { + "anyOf": [ + { + "$ref": "#/definitions/LatLongFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Latitude position of geographically projected marks." + }, + "latitude2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Latitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "longitude": { + "anyOf": [ + { + "$ref": "#/definitions/LatLongFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Longitude position of geographically projected marks." + }, + "longitude2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Longitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "opacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "description": "Opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `opacity` property." + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/OrderFieldDef" + }, + { + "items": { + "$ref": "#/definitions/OrderFieldDef" + }, + "type": "array" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Order of the marks.\n- For stacked marks, this `order` channel encodes [stack order](https://vega.github.io/vega-lite/docs/stack.html#order).\n- 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.\n- Otherwise, this `order` channel encodes layer order of the marks.\n\n__Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating additional aggregation grouping." + }, + "shape": { + "anyOf": [ + { + "$ref": "#/definitions/ShapeFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ShapeValueDefWithCondition" + } + ], + "description": "Shape of the mark.\n\n1. For `point` marks the supported values include:\n - plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n - the line symbol `\"stroke\"`\n - centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n - 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.)\n\n2. For `geoshape` marks it should be a field definition of the geojson data\n\n__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": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "description": "Size of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`. (Use `\"trail\"` instead of line with varying size)" + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "Stroke color of the marks.\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.\n\n_Note:_ When using `stroke` channel, `color ` channel will be ignored. To customize both stroke and fill, please use `stroke` and `fill` channels (not `stroke` and `color`)." + }, + "strokeOpacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "description": "Stroke opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `strokeOpacity` property." + }, + "strokeWidth": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "description": "Stroke width of the marks.\n\n__Default value:__ If undefined, the default stroke width depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `strokeWidth` property." + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/TextFieldDefWithCondition" + }, + { + "$ref": "#/definitions/TextValueDefWithCondition" + } + ], + "description": "Text of the `text` mark." + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/TextFieldDefWithCondition" + }, + { + "$ref": "#/definitions/TextValueDefWithCondition" + }, + { + "items": { + "$ref": "#/definitions/TextFieldDef" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "The tooltip text to show upon mouse hover." + }, + "x": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "xError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "xError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "y": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "yError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "yError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + } + }, + "type": "object" + }, + "CompositeMark": { + "anyOf": [ + { + "$ref": "#/definitions/BoxPlot" + }, + { + "$ref": "#/definitions/ErrorBar" + }, + { + "$ref": "#/definitions/ErrorBand" + } + ] + }, + "CompositeMarkDef": { + "anyOf": [ + { + "$ref": "#/definitions/BoxPlotDef" + }, + { + "$ref": "#/definitions/ErrorBarDef" + }, + { + "$ref": "#/definitions/ErrorBandDef" + } + ] + }, + "CompositionConfig": { + "additionalProperties": false, + "properties": { + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to\n`hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "spacing": { + "description": "The default spacing in pixels between composed sub-views.\n\n__Default value__: `20`", + "type": "number" + } + }, + "type": "object" + }, + "ConditionalMarkPropFieldDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate" + }, + { + "$ref": "#/definitions/ConditionalSelection" + } + ] + }, + "ConditionalMarkPropFieldDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalSelection>" + } + ] + }, + "ConditionalTextFieldDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate" + }, + { + "$ref": "#/definitions/ConditionalSelection" + } + ] + }, + "ConditionalStringValueDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate" + }, + { + "$ref": "#/definitions/ConditionalSelection" + } + ] + }, + "ConditionalValueDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate" + }, + { + "$ref": "#/definitions/ConditionalSelection" + } + ] + }, + "ConditionalNumberValueDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate" + }, + { + "$ref": "#/definitions/ConditionalSelection" + } + ] + }, + "ConditionalPredicate": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend.\nIf `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "test": { + "$ref": "#/definitions/LogicalOperand", + "description": "Predicate for triggering the condition" + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\n- 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`).\n- 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.\n- 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).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- 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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "test", + "type" + ], + "type": "object" + }, + "ConditionalPredicate>": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend.\nIf `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "test": { + "$ref": "#/definitions/LogicalOperand", + "description": "Predicate for triggering the condition" + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/TypeForShape", + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\n- 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`).\n- 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.\n- 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).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- 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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "test", + "type" + ], + "type": "object" + }, + "ConditionalPredicate": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "binned" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "format": { + "description": "The text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format.", + "type": "string" + }, + "formatType": { + "description": "The format type for labels (`\"number\"` or `\"time\"`).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", + "enum": [ + "number", + "time" + ], + "type": "string" + }, + "test": { + "$ref": "#/definitions/LogicalOperand", + "description": "Predicate for triggering the condition" + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\n- 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`).\n- 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.\n- 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).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- 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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "test", + "type" + ], + "type": "object" + }, + "ConditionalPredicate": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/LogicalOperand", + "description": "Predicate for triggering the condition" + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity).", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalPredicate": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/LogicalOperand", + "description": "Predicate for triggering the condition" + }, + "value": { + "$ref": "#/definitions/Value", + "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalPredicate": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/LogicalOperand", + "description": "Predicate for triggering the condition" + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity).", + "type": "number" + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalSelection": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend.\nIf `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "selection": { + "$ref": "#/definitions/SelectionOperand", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\n- 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`).\n- 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.\n- 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).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- 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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "selection", + "type" + ], + "type": "object" + }, + "ConditionalSelection>": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend.\nIf `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "selection": { + "$ref": "#/definitions/SelectionOperand", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/TypeForShape", + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\n- 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`).\n- 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.\n- 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).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- 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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "selection", + "type" + ], + "type": "object" + }, + "ConditionalSelection": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "binned" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "format": { + "description": "The text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format.", + "type": "string" + }, + "formatType": { + "description": "The format type for labels (`\"number\"` or `\"time\"`).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", + "enum": [ + "number", + "time" + ], + "type": "string" + }, + "selection": { + "$ref": "#/definitions/SelectionOperand", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\n- 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`).\n- 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.\n- 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).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- 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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "selection", + "type" + ], + "type": "object" + }, + "ConditionalSelection": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionOperand", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity).", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "selection", + "value" + ], + "type": "object" + }, + "ConditionalSelection": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionOperand", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "value": { + "$ref": "#/definitions/Value", + "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "selection", + "value" + ], + "type": "object" + }, + "ConditionalSelection": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionOperand", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity).", + "type": "number" + } + }, + "required": [ + "selection", + "value" + ], + "type": "object" + }, + "Config": { + "additionalProperties": false, + "properties": { + "area": { + "$ref": "#/definitions/AreaConfig", + "description": "Area-Specific Config" + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "Sets how the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`" + }, + "axis": { + "$ref": "#/definitions/AxisConfig", + "description": "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": { + "$ref": "#/definitions/AxisConfig", + "description": "Specific axis config for axes with \"band\" scales." + }, + "axisBottom": { + "$ref": "#/definitions/AxisConfig", + "description": "Specific axis config for x-axis along the bottom edge of the chart." + }, + "axisLeft": { + "$ref": "#/definitions/AxisConfig", + "description": "Specific axis config for y-axis along the left edge of the chart." + }, + "axisRight": { + "$ref": "#/definitions/AxisConfig", + "description": "Specific axis config for y-axis along the right edge of the chart." + }, + "axisTop": { + "$ref": "#/definitions/AxisConfig", + "description": "Specific axis config for x-axis along the top edge of the chart." + }, + "axisX": { + "$ref": "#/definitions/AxisConfig", + "description": "X-axis specific config." + }, + "axisY": { + "$ref": "#/definitions/AxisConfig", + "description": "Y-axis specific config." + }, + "background": { + "description": "CSS color property to use as the background of the whole Vega-Lite view\n\n__Default value:__ none (transparent)", + "type": "string" + }, + "bar": { + "$ref": "#/definitions/RectConfig", + "description": "Bar-Specific Config" + }, + "boxplot": { + "$ref": "#/definitions/BoxPlotConfig", + "description": "Box Config" + }, + "circle": { + "$ref": "#/definitions/MarkConfig", + "description": "Circle-Specific Config" + }, + "concat": { + "$ref": "#/definitions/CompositionConfig", + "description": "Default configuration for all concatenation view composition operators (`concat`, `hconcat`, and `vconcat`)" + }, + "countTitle": { + "description": "Default axis and legend title for count fields.\n\n__Default value:__ `'Count of Records`.", + "type": "string" + }, + "errorband": { + "$ref": "#/definitions/ErrorBandConfig", + "description": "ErrorBand Config" + }, + "errorbar": { + "$ref": "#/definitions/ErrorBarConfig", + "description": "ErrorBar Config" + }, + "facet": { + "$ref": "#/definitions/CompositionConfig", + "description": "Default configuration for the `facet` view composition operator" + }, + "fieldTitle": { + "description": "Defines how Vega-Lite generates title for fields. There are three possible styles:\n- `\"verbal\"` (Default) - displays function in a verbal style (e.g., \"Sum of field\", \"Year-month of date\", \"field (binned)\").\n- `\"function\"` - displays function using parentheses and capitalized texts (e.g., \"SUM(field)\", \"YEARMONTH(date)\", \"BIN(field)\").\n- `\"plain\"` - displays only the field name without functions (e.g., \"field\", \"date\", \"field\").", + "enum": [ + "verbal", + "functional", + "plain" + ], + "type": "string" + }, + "geoshape": { + "$ref": "#/definitions/MarkConfig", + "description": "Geoshape-Specific Config" + }, + "header": { + "$ref": "#/definitions/HeaderConfig", + "description": "Header configuration, which determines default properties for all [headers](https://vega.github.io/vega-lite/docs/header.html).\n\nFor 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": { + "$ref": "#/definitions/HeaderConfig", + "description": "Header configuration, which determines default properties for column [headers](https://vega.github.io/vega-lite/docs/header.html).\n\nFor 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": { + "$ref": "#/definitions/HeaderConfig", + "description": "Header configuration, which determines default properties for non-row/column facet [headers](https://vega.github.io/vega-lite/docs/header.html).\n\nFor 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": { + "$ref": "#/definitions/HeaderConfig", + "description": "Header configuration, which determines default properties for row [headers](https://vega.github.io/vega-lite/docs/header.html).\n\nFor 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)." + }, + "invalidValues": { + "description": "Defines how Vega-Lite should handle invalid values (`null` and `NaN`).\n- If set to `\"filter\"` (default), all data items with null values will be skipped (for line, trail, and area marks) or filtered (for other marks).\n- If `null`, all data items are included. In this case, invalid values will be interpreted as zeroes.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "legend": { + "$ref": "#/definitions/LegendConfig", + "description": "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": { + "$ref": "#/definitions/LineConfig", + "description": "Line-Specific Config" + }, + "mark": { + "$ref": "#/definitions/MarkConfig", + "description": "Mark Config" + }, + "numberFormat": { + "description": "D3 Number format for guide labels and text marks. For example \"s\" for SI units. Use [D3's number format pattern](https://github.com/d3/d3-format#locale_format).", + "type": "string" + }, + "padding": { + "$ref": "#/definitions/Padding", + "description": "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.\nIf 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.\n\n__Default value__: `5`" + }, + "point": { + "$ref": "#/definitions/MarkConfig", + "description": "Point-Specific Config" + }, + "projection": { + "$ref": "#/definitions/ProjectionConfig", + "description": "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": { + "$ref": "#/definitions/RangeConfig", + "description": "An object hash that defines default range arrays or schemes for using with scales.\nFor 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": { + "$ref": "#/definitions/RectConfig", + "description": "Rect-Specific Config" + }, + "repeat": { + "$ref": "#/definitions/CompositionConfig", + "description": "Default configuration for the `repeat` view composition operator" + }, + "rule": { + "$ref": "#/definitions/MarkConfig", + "description": "Rule-Specific Config" + }, + "scale": { + "$ref": "#/definitions/ScaleConfig", + "description": "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": { + "$ref": "#/definitions/SelectionConfig", + "description": "An object hash for defining default properties for each type of selections." + }, + "square": { + "$ref": "#/definitions/MarkConfig", + "description": "Square-Specific Config" + }, + "stack": { + "$ref": "#/definitions/StackOffset", + "description": "Default stack offset for stackable mark." + }, + "style": { + "$ref": "#/definitions/StyleConfigIndex", + "description": "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": { + "$ref": "#/definitions/TextConfig", + "description": "Text-Specific Config" + }, + "tick": { + "$ref": "#/definitions/TickConfig", + "description": "Tick-Specific Config" + }, + "timeFormat": { + "description": "Default time format for raw time values (without time units) in text marks, legend labels and header labels.\n\n__Default value:__ `\"%b %d, %Y\"`\n__Note:__ Axes automatically determine format each label automatically so this config would not affect axes.", + "type": "string" + }, + "title": { + "$ref": "#/definitions/TitleConfig", + "description": "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)." + }, + "trail": { + "$ref": "#/definitions/LineConfig", + "description": "Trail-Specific Config" + }, + "view": { + "$ref": "#/definitions/ViewConfig", + "description": "Default properties for [single view plots](https://vega.github.io/vega-lite/docs/spec.html#single)." + } + }, + "type": "object" + }, + "CsvDataFormat": { + "additionalProperties": false, + "properties": { + "parse": { + "anyOf": [ + { + "$ref": "#/definitions/Parse" + }, + { + "type": "null" + } + ], + "description": "If set to `null`, disable type inference based on the spec and only use type inference based on the data.\nAlternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `\"number\"`, `\"boolean\"`, `\"date\"`, or null (do not parse the field)).\nFor example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each input record a Date value.\n\nFor `\"date\"`, we parse data based using Javascript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).\nFor Specific date formats can be provided (e.g., `{foo: \"date:'%m%d%Y'\"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). 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": { + "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL.\nIf no extension is detected, `\"json\"` will be used by default.", + "enum": [ + "csv", + "tsv" + ], + "type": "string" + } + }, + "type": "object" + }, + "Cursor": { + "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" + ], + "type": "string" + }, + "Data": { + "anyOf": [ + { + "$ref": "#/definitions/DataSource" + }, + { + "$ref": "#/definitions/Generator" + } + ] + }, + "DataFormat": { + "anyOf": [ + { + "$ref": "#/definitions/CsvDataFormat" + }, + { + "$ref": "#/definitions/DsvDataFormat" + }, + { + "$ref": "#/definitions/JsonDataFormat" + }, + { + "$ref": "#/definitions/TopoDataFormat" + } + ] + }, + "DataSource": { + "anyOf": [ + { + "$ref": "#/definitions/UrlData" + }, + { + "$ref": "#/definitions/InlineData" + }, + { + "$ref": "#/definitions/NamedData" + } + ] + }, + "Datasets": { + "$ref": "#/definitions/Dict" + }, + "DateTime": { + "additionalProperties": false, + "description": "Object for defining datetime in Vega-Lite Filter.\nIf both month and quarter are provided, month has higher precedence.\n`day` cannot be combined with other date.\nWe accept string for month and day names.", + "properties": { + "date": { + "description": "Integer value representing the date from 1-31.", + "maximum": 31, + "minimum": 1, + "type": "number" + }, + "day": { + "anyOf": [ + { + "$ref": "#/definitions/Day" + }, + { + "type": "string" + } + ], + "description": "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\"`).
    **Warning:** A DateTime definition object with `day`** should not be combined with `year`, `quarter`, `month`, or `date`." + }, + "hours": { + "description": "Integer value representing the hour of a day from 0-23.", + "maximum": 23, + "minimum": 0, + "type": "number" + }, + "milliseconds": { + "description": "Integer value representing the millisecond segment of time.", + "maximum": 999, + "minimum": 0, + "type": "number" + }, + "minutes": { + "description": "Integer value representing the minute segment of time from 0-59.", + "maximum": 59, + "minimum": 0, + "type": "number" + }, + "month": { + "anyOf": [ + { + "$ref": "#/definitions/Month" + }, + { + "type": "string" + } + ], + "description": "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\"`)." + }, + "quarter": { + "description": "Integer value representing the quarter of the year (from 1-4).", + "maximum": 4, + "minimum": 1, + "type": "number" + }, + "seconds": { + "description": "Integer value representing the second segment (0-59) of a time value", + "maximum": 59, + "minimum": 0, + "type": "number" + }, + "utc": { + "description": "A boolean flag indicating if date time is in utc time. If false, the date time is in local time", + "type": "boolean" + }, + "year": { + "description": "Integer value representing the year.", + "type": "number" + } + }, + "type": "object" + }, + "Day": { + "maximum": 7, + "minimum": 1, + "type": "number" + }, + "Dict": { + "additionalProperties": { + "$ref": "#/definitions/InlineDataset" + }, + "type": "object" + }, + "Dir": { + "enum": [ + "ltr", + "rtl" + ], + "type": "string" + }, + "DsvDataFormat": { + "additionalProperties": false, + "properties": { + "delimiter": { + "description": "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.", + "maxLength": 1, + "minLength": 1, + "type": "string" + }, + "parse": { + "anyOf": [ + { + "$ref": "#/definitions/Parse" + }, + { + "type": "null" + } + ], + "description": "If set to `null`, disable type inference based on the spec and only use type inference based on the data.\nAlternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `\"number\"`, `\"boolean\"`, `\"date\"`, or null (do not parse the field)).\nFor example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each input record a Date value.\n\nFor `\"date\"`, we parse data based using Javascript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).\nFor Specific date formats can be provided (e.g., `{foo: \"date:'%m%d%Y'\"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). 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": { + "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL.\nIf no extension is detected, `\"json\"` will be used by default.", + "enum": [ + "dsv" + ], + "type": "string" + } + }, + "required": [ + "delimiter" + ], + "type": "object" + }, + "Element": { + "type": "string" + }, + "EncodingSortField": { + "additionalProperties": false, + "description": "A sort definition for sorting a discrete scale in an encoding field definition.", + "properties": { + "field": { + "$ref": "#/definitions/Field", + "description": "The data [field](https://vega.github.io/vega-lite/docs/field.html) to sort by.\n\n__Default value:__ If unspecified, defaults to the field specified in the outer data reference." + }, + "op": { + "$ref": "#/definitions/AggregateOp", + "description": "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\"`).\nAn aggregation is required when there are multiple values of the sort field for each encoded data field.\nThe input data objects will be aggregated, grouped by the encoded data field.\n\nFor a full list of operations, please see the documentation for [aggregate](https://vega.github.io/vega-lite/docs/aggregate.html#ops).\n\n__Default value:__ `\"sum\"` for stacked plots. Otherwise, `\"mean\"`." + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/SortOrder" + }, + { + "type": "null" + } + ], + "description": "The sort order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." + } + }, + "type": "object" + }, + "ErrorBand": { + "enum": [ + "errorband" + ], + "type": "string" + }, + "ErrorBandConfig": { + "additionalProperties": false, + "properties": { + "band": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "borders": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "extent": { + "$ref": "#/definitions/ErrorBarExtent", + "description": "The extent of the band. Available options include:\n- `\"ci\"`: Extend the band to the confidence interval of the mean.\n- `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method for the error band. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes at the midpoint of each pair of adjacent x-values.\n- `\"step-before\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes before the x-value.\n- `\"step-after\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes after the x-value.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "tension": { + "description": "The tension parameter for the interpolation type of the error band.", + "maximum": 1, + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "ErrorBandDef": { + "additionalProperties": false, + "properties": { + "band": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "borders": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "clip": { + "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", + "type": "boolean" + }, + "color": { + "$ref": "#/definitions/Color", + "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `color`.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config)." + }, + "extent": { + "$ref": "#/definitions/ErrorBarExtent", + "description": "The extent of the band. Available options include:\n- `\"ci\"`: Extend the band to the confidence interval of the mean.\n- `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method for the error band. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes at the midpoint of each pair of adjacent x-values.\n- `\"step-before\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes before the x-value.\n- `\"step-after\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes after the x-value.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "opacity": { + "description": "The opacity (value between [0,1]) of the mark.", + "type": "number" + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "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": { + "description": "The tension parameter for the interpolation type of the error band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "type": { + "$ref": "#/definitions/ErrorBand", + "description": "The mark type. This could a primitive mark type\n(one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`)\nor a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "ErrorBar": { + "enum": [ + "errorbar" + ], + "type": "string" + }, + "ErrorBarConfig": { + "additionalProperties": false, + "properties": { + "extent": { + "$ref": "#/definitions/ErrorBarExtent", + "description": "The extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + }, + "rule": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "ticks": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + } + }, + "type": "object" + }, + "ErrorBarDef": { + "additionalProperties": false, + "properties": { + "clip": { + "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", + "type": "boolean" + }, + "color": { + "$ref": "#/definitions/Color", + "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `color`.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config)." + }, + "extent": { + "$ref": "#/definitions/ErrorBarExtent", + "description": "The extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + }, + "opacity": { + "description": "The opacity (value between [0,1]) of the mark.", + "type": "number" + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "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": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "ticks": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "type": { + "$ref": "#/definitions/ErrorBar", + "description": "The mark type. This could a primitive mark type\n(one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`)\nor a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "ErrorBarExtent": { + "enum": [ + "ci", + "iqr", + "stderr", + "stdev" + ], + "type": "string" + }, + "EventStream": { + }, + "FacetFieldDef": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "header": { + "$ref": "#/definitions/Header", + "description": "An object defining properties of a facet's header." + }, + "sort": { + "anyOf": [ + { + "$ref": "#/definitions/SortArray" + }, + { + "$ref": "#/definitions/SortOrder" + }, + { + "$ref": "#/definitions/EncodingSortField" + }, + { + "type": "null" + } + ], + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\n- 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`).\n- 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.\n- 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).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- 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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "FacetMapping": { + "additionalProperties": false, + "properties": { + "column": { + "$ref": "#/definitions/FacetFieldDef", + "description": "A field definition for the horizontal facet of trellis plots." + }, + "row": { + "$ref": "#/definitions/FacetFieldDef", + "description": "A field definition for the vertical facet of trellis plots." + } + }, + "type": "object" + }, + "FacetedEncoding": { + "additionalProperties": false, + "properties": { + "color": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "Color of the marks – either fill or stroke color based on the `filled` property of mark definition.\nBy default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`,\n`\"text\"`, `\"trail\"`, `\"circle\"`, and `\"square\"` / stroke color for `\"line\"` and `\"point\"`.\n\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.\n\n_Note:_\n1) For fine-grained control over both fill and stroke colors of the marks, please use the `fill` and `stroke` channels. If either `fill` or `stroke` channel is specified, `color` channel will be ignored.\n2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme)." + }, + "column": { + "$ref": "#/definitions/FacetFieldDef", + "description": "A field definition for the horizontal facet of trellis plots." + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDefWithoutScale" + }, + { + "items": { + "$ref": "#/definitions/FieldDefWithoutScale" + }, + "type": "array" + } + ], + "description": "Additional levels of detail for grouping data in aggregate views and\nin line, trail, and area marks without mapping data to a specific visual channel." + }, + "facet": { + "$ref": "#/definitions/FacetFieldDef", + "description": "A field definition for the (flexible) facet of trellis plots.\n\nIf either `row` or `column` is specified, this channel will be ignored." + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "Fill color of the marks.\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.\n\n_Note:_ When using `fill` channel, `color ` channel will be ignored. To customize both fill and stroke, please use `fill` and `stroke` channels (not `fill` and `color`)." + }, + "fillOpacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "description": "Fill opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `fillOpacity` property." + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/TextFieldDefWithCondition" + }, + { + "$ref": "#/definitions/TextValueDefWithCondition" + } + ], + "description": "A URL to load upon mouse click." + }, + "key": { + "$ref": "#/definitions/FieldDefWithoutScale", + "description": "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": { + "anyOf": [ + { + "$ref": "#/definitions/LatLongFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Latitude position of geographically projected marks." + }, + "latitude2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Latitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "longitude": { + "anyOf": [ + { + "$ref": "#/definitions/LatLongFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Longitude position of geographically projected marks." + }, + "longitude2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Longitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "opacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "description": "Opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `opacity` property." + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/OrderFieldDef" + }, + { + "items": { + "$ref": "#/definitions/OrderFieldDef" + }, + "type": "array" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Order of the marks.\n- For stacked marks, this `order` channel encodes [stack order](https://vega.github.io/vega-lite/docs/stack.html#order).\n- 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.\n- Otherwise, this `order` channel encodes layer order of the marks.\n\n__Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating additional aggregation grouping." + }, + "row": { + "$ref": "#/definitions/FacetFieldDef", + "description": "A field definition for the vertical facet of trellis plots." + }, + "shape": { + "anyOf": [ + { + "$ref": "#/definitions/ShapeFieldDefWithCondition" + }, + { + "$ref": "#/definitions/ShapeValueDefWithCondition" + } + ], + "description": "Shape of the mark.\n\n1. For `point` marks the supported values include:\n - plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n - the line symbol `\"stroke\"`\n - centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n - 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.)\n\n2. For `geoshape` marks it should be a field definition of the geojson data\n\n__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": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "description": "Size of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`. (Use `\"trail\"` instead of line with varying size)" + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "Stroke color of the marks.\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `color` property.\n\n_Note:_ When using `stroke` channel, `color ` channel will be ignored. To customize both stroke and fill, please use `stroke` and `fill` channels (not `stroke` and `color`)." + }, + "strokeOpacity": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "description": "Stroke opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `strokeOpacity` property." + }, + "strokeWidth": { + "anyOf": [ + { + "$ref": "#/definitions/NumericFieldDefWithCondition" + }, + { + "$ref": "#/definitions/NumericValueDefWithCondition" + } + ], + "description": "Stroke width of the marks.\n\n__Default value:__ If undefined, the default stroke width depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark)'s `strokeWidth` property." + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/TextFieldDefWithCondition" + }, + { + "$ref": "#/definitions/TextValueDefWithCondition" + } + ], + "description": "Text of the `text` mark." + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/TextFieldDefWithCondition" + }, + { + "$ref": "#/definitions/TextValueDefWithCondition" + }, + { + "items": { + "$ref": "#/definitions/TextFieldDef" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "The tooltip text to show upon mouse hover." + }, + "x": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/XValueDef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "xError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "xError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "y": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/YValueDef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "yError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "yError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/NumberValueDef" + } + ], + "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + } + }, + "type": "object" + }, + "FacetedUnitSpec": { + "additionalProperties": false, + "description": "Unit spec that can have a composite mark and row or column channels (shorthand for a facet spec).", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns.\nThe supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to\n`hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/FacetedEncoding", + "description": "A key-value mapping between encoding channels and definition of fields." + }, + "height": { + "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\n\n__Note__: For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + }, + "mark": { + "$ref": "#/definitions/AnyMark", + "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "An object defining properties of geographic projection, which will be applied to `shape` path for `\"geoshape\"` marks\nand to `latitude` and `\"longitude\"` channels for other marks." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "selection": { + "additionalProperties": { + "$ref": "#/definitions/SelectionDef" + }, + "description": "A key-value mapping between selection names and definitions.", + "type": "object" + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent spacing values for rows and columns.\n\n__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": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its x-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the width is [determined by the range step, paddings, and the cardinality of the field mapped to x-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height) for `text` mark and the value of `rangeStep` for other marks.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + } + }, + "required": [ + "mark" + ], + "type": "object" + }, + "Field": { + "anyOf": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ] + }, + "FieldDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalStringValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalStringValueDef" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value)\nsince Vega-Lite only allows at most one encoded field per encoding channel." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend.\nIf `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\n- 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`).\n- 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.\n- 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).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- 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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "FieldDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalNumberValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalNumberValueDef" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value)\nsince Vega-Lite only allows at most one encoded field per encoding channel." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend.\nIf `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\n- 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`).\n- 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.\n- 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).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- 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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "FieldDefWithCondition,(string|null)>": { + "additionalProperties": false, + "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalStringValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalStringValueDef" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value)\nsince Vega-Lite only allows at most one encoded field per encoding channel." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend.\nIf `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/TypeForShape", + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\n- 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`).\n- 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.\n- 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).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- 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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "FieldDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition\n{\n condition: {value: ...},\n field: ...,\n ...\n}", + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "binned" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value)\nsince Vega-Lite only allows at most one encoded field per encoding channel." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "format": { + "description": "The text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format.", + "type": "string" + }, + "formatType": { + "description": "The format type for labels (`\"number\"` or `\"time\"`).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", + "enum": [ + "number", + "time" + ], + "type": "string" + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\n- 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`).\n- 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.\n- 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).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- 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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "FieldDefWithoutScale": { + "$ref": "#/definitions/TypedFieldDef", + "description": "Field Def without scale (and without bin: \"binned\" support)." + }, + "FieldEqualPredicate": { + "additionalProperties": false, + "properties": { + "equal": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/DateTime" + } + ], + "description": "The value that the field should be equal to." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be filtered." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, + "required": [ + "equal", + "field" + ], + "type": "object" + }, + "FieldGTEPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be filtered." + }, + "gte": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + } + ], + "description": "The value that the field should be greater than or equals to." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, + "required": [ + "field", + "gte" + ], + "type": "object" + }, + "FieldGTPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be filtered." + }, + "gt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + } + ], + "description": "The value that the field should be greater than." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, + "required": [ + "field", + "gt" + ], + "type": "object" + }, + "FieldLTEPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be filtered." + }, + "lte": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + } + ], + "description": "The value that the field should be less than or equals to." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, + "required": [ + "field", + "lte" + ], + "type": "object" + }, + "FieldLTPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be filtered." + }, + "lt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + } + ], + "description": "The value that the field should be less than." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, + "required": [ + "field", + "lt" + ], + "type": "object" + }, + "FieldName": { + "type": "string" + }, + "FieldOneOfPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be filtered." + }, + "oneOf": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + } + ], + "description": "A set of values that the `field`'s value should be a member of,\nfor a data item included in the filtered data." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, + "required": [ + "field", + "oneOf" + ], + "type": "object" + }, + "FieldRangePredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be filtered." + }, + "range": { + "description": "An array of inclusive minimum and maximum values\nfor a field value of a data item to be included in the filtered data.", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "type": "null" + } + ] + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + } + }, + "required": [ + "field", + "range" + ], + "type": "object" + }, + "FieldValidPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be filtered." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit for the field to be filtered." + }, + "valid": { + "description": "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).", + "type": "boolean" + } + }, + "required": [ + "field", + "valid" + ], + "type": "object" + }, + "FilterTransform": { + "additionalProperties": false, + "properties": { + "filter": { + "$ref": "#/definitions/LogicalOperand", + "description": "The `filter` property must be one of the predicate definitions:\n\n1) an [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string,\nwhere `datum` can be used to refer to the current data object\n\n2) one of the field predicates: [`equal`](https://vega.github.io/vega-lite/docs/filter.html#equal-predicate),\n[`lt`](https://vega.github.io/vega-lite/docs/filter.html#lt-predicate),\n[`lte`](https://vega.github.io/vega-lite/docs/filter.html#lte-predicate),\n[`gt`](https://vega.github.io/vega-lite/docs/filter.html#gt-predicate),\n[`gte`](https://vega.github.io/vega-lite/docs/filter.html#gte-predicate),\n[`range`](https://vega.github.io/vega-lite/docs/filter.html#range-predicate),\n[`oneOf`](https://vega.github.io/vega-lite/docs/filter.html#one-of-predicate),\nor [`valid`](https://vega.github.io/vega-lite/docs/filter.html#valid-predicate),\n\n3) a [selection predicate](https://vega.github.io/vega-lite/docs/filter.html#selection-predicate)\n\n4) a logical operand that combines (1), (2), or (3)." + } + }, + "required": [ + "filter" + ], + "type": "object" + }, + "FlattenTransform": { + "additionalProperties": false, + "properties": { + "as": { + "description": "The output field names for extracted array values.\n\n__Default value:__ The field name of the corresponding array field", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "flatten": { + "description": "An array of one or more data fields containing arrays to flatten.\nIf multiple fields are specified, their array values should have a parallel structure, ideally with the same length.\nIf the lengths of parallel arrays do not match,\nthe longest array will be used with `null` values added for missing entries.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + } + }, + "required": [ + "flatten" + ], + "type": "object" + }, + "FoldTransform": { + "additionalProperties": false, + "properties": { + "as": { + "description": "The output field names for the key and value properties produced by the fold transform.\n__Default value:__ `[\"key\", \"value\"]`", + "items": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "$ref": "#/definitions/FieldName" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "fold": { + "description": "An array of data fields indicating the properties to fold.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + } + }, + "required": [ + "fold" + ], + "type": "object" + }, + "FontStyle": { + "type": "string" + }, + "FontWeight": { + "enum": [ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900 + ], + "type": [ + "string", + "number" + ] + }, + "Generator": { + "anyOf": [ + { + "$ref": "#/definitions/SequenceGenerator" + }, + { + "$ref": "#/definitions/SphereGenerator" + }, + { + "$ref": "#/definitions/GraticuleGenerator" + } + ] + }, + "ConcatSpec": { + "additionalProperties": false, + "description": "Base interface for a generalized concatenation specification.", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns.\nThe supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to\n`hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "concat": { + "description": "A list of views to be concatenated.", + "items": { + "$ref": "#/definitions/Spec" + }, + "type": "array" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent spacing values for rows and columns.\n\n__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": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "concat" + ], + "type": "object" + }, + "FacetSpec": { + "additionalProperties": false, + "description": "Base interface for a facet specification.", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns.\nThe supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to\n`hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "facet": { + "anyOf": [ + { + "$ref": "#/definitions/FacetFieldDef" + }, + { + "$ref": "#/definitions/FacetMapping" + } + ], + "description": "Definition for how to facet the data. One of:\n1) [a field definition for faceting the plot by one field](https://vega.github.io/vega-lite/docs/facet.html#field-def)\n2) [An object that maps `row` and `column` channels to their field definitions](https://vega.github.io/vega-lite/docs/facet.html#mapping)" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent spacing values for rows and columns.\n\n__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)" + }, + "spec": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/FacetedUnitSpec" + } + ], + "description": "A specification of the view that gets faceted." + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "facet", + "spec" + ], + "type": "object" + }, + "HConcatSpec": { + "additionalProperties": false, + "description": "Base interface for a horizontal concatenation specification.", + "properties": { + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "hconcat": { + "description": "A list of views to be concatenated and put into a row.", + "items": { + "$ref": "#/definitions/Spec" + }, + "type": "array" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "hconcat" + ], + "type": "object" + }, + "RepeatSpec": { + "additionalProperties": false, + "description": "Base interface for a repeat specification.", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns.\nThe supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to\n`hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "repeat": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/definitions/RepeatMapping" + } + ], + "description": "Definition for fields to be repeated. One of:\n1) An array of fields to be repeated. If `\"repeat\"` is an array, the field can be referred using `{\"repeat\": \"repeat\"}`\n2) An object that mapped `\"row\"` and/or `\"column\"` to the listed of 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." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent spacing values for rows and columns.\n\n__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)" + }, + "spec": { + "$ref": "#/definitions/Spec", + "description": "A specification of the view that gets repeated." + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "repeat", + "spec" + ], + "type": "object" + }, + "Spec": { + "anyOf": [ + { + "$ref": "#/definitions/FacetedUnitSpec" + }, + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/FacetSpec" + }, + { + "$ref": "#/definitions/RepeatSpec" + }, + { + "$ref": "#/definitions/ConcatSpec" + }, + { + "$ref": "#/definitions/VConcatSpec" + }, + { + "$ref": "#/definitions/HConcatSpec" + } + ], + "description": "Any specification in Vega-Lite." + }, + "GenericUnitSpec": { + "additionalProperties": false, + "description": "Base interface for a unit (single-view) specification.", + "properties": { + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/Encoding", + "description": "A key-value mapping between encoding channels and definition of fields." + }, + "height": { + "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\n\n__Note__: For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + }, + "mark": { + "$ref": "#/definitions/AnyMark", + "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "An object defining properties of geographic projection, which will be applied to `shape` path for `\"geoshape\"` marks\nand to `latitude` and `\"longitude\"` channels for other marks." + }, + "selection": { + "additionalProperties": { + "$ref": "#/definitions/SelectionDef" + }, + "description": "A key-value mapping between selection names and definitions.", + "type": "object" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its x-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the width is [determined by the range step, paddings, and the cardinality of the field mapped to x-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height) for `text` mark and the value of `rangeStep` for other marks.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + } + }, + "required": [ + "mark" + ], + "type": "object" + }, + "VConcatSpec": { + "additionalProperties": false, + "description": "Base interface for a vertical concatenation specification.", + "properties": { + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "vconcat": { + "description": "A list of views to be concatenated and put into a column.", + "items": { + "$ref": "#/definitions/Spec" + }, + "type": "array" + } + }, + "required": [ + "vconcat" + ], + "type": "object" + }, + "GraticuleGenerator": { + "additionalProperties": false, + "properties": { + "graticule": { + "anyOf": [ + { + "enum": [ + true + ], + "type": "boolean" + }, + { + "$ref": "#/definitions/GraticuleParams" + } + ], + "description": "Generate graticule GeoJSON data for geographic reference lines." + }, + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + } + }, + "required": [ + "graticule" + ], + "type": "object" + }, + "GraticuleParams": { + "additionalProperties": false, + "properties": { + "extent": { + "description": "Sets both the major and minor extents to the same values.", + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array" + }, + "extentMajor": { + "description": "The major extent of the graticule as a two-element array of coordinates.", + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array" + }, + "extentMinor": { + "description": "The minor extent of the graticule as a two-element array of coordinates.", + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array" + }, + "precision": { + "description": "The precision of the graticule in degrees.\n\n__Default value:__ `2.5`", + "type": "number" + }, + "step": { + "description": "Sets both the major and minor step angles to the same values.", + "items": { + "type": "number" + }, + "type": "array" + }, + "stepMajor": { + "description": "The major step angles of the graticule.\n\n\n__Default value:__ `[90, 360]`", + "items": { + "type": "number" + }, + "type": "array" + }, + "stepMinor": { + "description": "The minor step angles of the graticule.\n\n__Default value:__ `[10, 10]`", + "items": { + "type": "number" + }, + "type": "array" + } + }, + "type": "object" + }, + "Header": { + "additionalProperties": false, + "description": "Headers of row / column channels for faceted plots.", + "properties": { + "format": { + "description": "The text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format.", + "type": "string" + }, + "formatType": { + "description": "The format type for labels (`\"number\"` or `\"time\"`).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", + "enum": [ + "number", + "time" + ], + "type": "string" + }, + "labelAlign": { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment of header labels." + }, + "labelAnchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "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." + }, + "labelAngle": { + "description": "The rotation angle of the header labels.\n\n__Default value:__ `0` for column header, `-90` for row header.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + "labelColor": { + "$ref": "#/definitions/Color", + "description": "The color of the header label, can be in hex color code or regular color name." + }, + "labelFont": { + "description": "The font of the header label.", + "type": "string" + }, + "labelFontSize": { + "description": "The font size of the header label, in pixels.", + "minimum": 0, + "type": "number" + }, + "labelFontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style of the header label." + }, + "labelLimit": { + "description": "The maximum length of the header label in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit", + "type": "number" + }, + "labelOrient": { + "$ref": "#/definitions/Orient", + "description": "The orientation of the header label. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`." + }, + "labelPadding": { + "description": "The padding, in pixel, between facet header's label and the plot.\n\n__Default value:__ `10`", + "type": "number" + }, + "labels": { + "description": "A boolean flag indicating if labels should be included as part of the header.\n\n__Default value:__ `true`.", + "type": "boolean" + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "titleAlign": { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment (to the anchor) of header titles." + }, + "titleAnchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "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." + }, + "titleAngle": { + "description": "The rotation angle of the header title.\n\n__Default value:__ `0`.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + "titleBaseline": { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline for the header title. One of `\"top\"`, `\"bottom\"`, `\"middle\"`.\n\n__Default value:__ `\"middle\"`" + }, + "titleColor": { + "$ref": "#/definitions/Color", + "description": "Color of the header title, can be in hex color code or regular color name." + }, + "titleFont": { + "description": "Font of the header title. (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + "titleFontSize": { + "description": "Font size of the header title.", + "minimum": 0, + "type": "number" + }, + "titleFontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style of the header title." + }, + "titleFontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "Font weight of the header title.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "titleLimit": { + "description": "The maximum length of the header title in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit", + "type": "number" + }, + "titleOrient": { + "$ref": "#/definitions/Orient", + "description": "The orientation of the header title. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`." + }, + "titlePadding": { + "description": "The padding, in pixel, between facet header's title and the label.\n\n__Default value:__ `10`", + "type": "number" + } + }, + "type": "object" + }, + "HeaderConfig": { + "additionalProperties": false, + "properties": { + "format": { + "description": "The text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format.", + "type": "string" + }, + "formatType": { + "description": "The format type for labels (`\"number\"` or `\"time\"`).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", + "enum": [ + "number", + "time" + ], + "type": "string" + }, + "labelAlign": { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment of header labels." + }, + "labelAnchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "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." + }, + "labelAngle": { + "description": "The rotation angle of the header labels.\n\n__Default value:__ `0` for column header, `-90` for row header.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + "labelColor": { + "$ref": "#/definitions/Color", + "description": "The color of the header label, can be in hex color code or regular color name." + }, + "labelFont": { + "description": "The font of the header label.", + "type": "string" + }, + "labelFontSize": { + "description": "The font size of the header label, in pixels.", + "minimum": 0, + "type": "number" + }, + "labelFontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style of the header label." + }, + "labelLimit": { + "description": "The maximum length of the header label in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit", + "type": "number" + }, + "labelOrient": { + "$ref": "#/definitions/Orient", + "description": "The orientation of the header label. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`." + }, + "labelPadding": { + "description": "The padding, in pixel, between facet header's label and the plot.\n\n__Default value:__ `10`", + "type": "number" + }, + "labels": { + "description": "A boolean flag indicating if labels should be included as part of the header.\n\n__Default value:__ `true`.", + "type": "boolean" + }, + "shortTimeLabels": { + "description": "Whether month names and weekday names should be abbreviated.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "title": { + "description": "Set to null to disable title for the axis, legend, or header.", + "type": "null" + }, + "titleAlign": { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment (to the anchor) of header titles." + }, + "titleAnchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "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." + }, + "titleAngle": { + "description": "The rotation angle of the header title.\n\n__Default value:__ `0`.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + "titleBaseline": { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline for the header title. One of `\"top\"`, `\"bottom\"`, `\"middle\"`.\n\n__Default value:__ `\"middle\"`" + }, + "titleColor": { + "$ref": "#/definitions/Color", + "description": "Color of the header title, can be in hex color code or regular color name." + }, + "titleFont": { + "description": "Font of the header title. (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + "titleFontSize": { + "description": "Font size of the header title.", + "minimum": 0, + "type": "number" + }, + "titleFontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style of the header title." + }, + "titleFontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "Font weight of the header title.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "titleLimit": { + "description": "The maximum length of the header title in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit", + "type": "number" + }, + "titleOrient": { + "$ref": "#/definitions/Orient", + "description": "The orientation of the header title. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`." + }, + "titlePadding": { + "description": "The padding, in pixel, between facet header's title and the label.\n\n__Default value:__ `10`", + "type": "number" + } + }, + "type": "object" + }, + "HexColor": { + "format": "color-hex", + "type": "string" + }, + "ImputeMethod": { + "enum": [ + "value", + "median", + "max", + "min", + "mean" + ], + "type": "string" + }, + "ImputeParams": { + "additionalProperties": false, + "properties": { + "frame": { + "description": "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 rows preceding or following the current data object. For example, the value `[-5, 5]` indicates that the window should include five objects preceding and five objects following the current object.\n\n__Default value:__: `[null, null]` indicating that the window includes all objects.", + "items": { + "type": [ + "null", + "number" + ] + }, + "type": "array" + }, + "keyvals": { + "anyOf": [ + { + "items": { + }, + "type": "array" + }, + { + "$ref": "#/definitions/ImputeSequence" + } + ], + "description": "Defines the key values that should be considered for imputation.\nAn array of key values or an object defining a [number sequence](https://vega.github.io/vega-lite/docs/impute.html#sequence-def).\n\nIf provided, this will be used in addition to the key values observed within the input data. If not provided, the values will be derived from all unique values of the `key` field. For `impute` in `encoding`, the key field is the x-field if the y-field is imputed, or vice versa.\n\nIf there is no impute grouping, this property _must_ be specified." + }, + "method": { + "$ref": "#/definitions/ImputeMethod", + "description": "The imputation method to use for the field value of imputed data objects.\nOne of `value`, `mean`, `median`, `max` or `min`.\n\n__Default value:__ `\"value\"`" + }, + "value": { + "description": "The field value to use when the imputation `method` is `\"value\"`." + } + }, + "type": "object" + }, + "ImputeSequence": { + "additionalProperties": false, + "properties": { + "start": { + "description": "The starting value of the sequence.\n__Default value:__ `0`", + "type": "number" + }, + "step": { + "description": "The step value between sequence entries.\n__Default value:__ `1` or `-1` if `stop < start`", + "type": "number" + }, + "stop": { + "description": "The ending value(exclusive) of the sequence.", + "type": "number" + } + }, + "required": [ + "stop" + ], + "type": "object" + }, + "ImputeTransform": { + "additionalProperties": false, + "properties": { + "frame": { + "description": "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 rows preceding or following the current data object. For example, the value `[-5, 5]` indicates that the window should include five objects preceding and five objects following the current object.\n\n__Default value:__: `[null, null]` indicating that the window includes all objects.", + "items": { + "type": [ + "null", + "number" + ] + }, + "type": "array" + }, + "groupby": { + "description": "An optional array of fields by which to group the values.\nImputation will then be performed on a per-group basis.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "impute": { + "$ref": "#/definitions/FieldName", + "description": "The data field for which the missing values should be imputed." + }, + "key": { + "$ref": "#/definitions/FieldName", + "description": "A key field that uniquely identifies data objects within a group.\nMissing key values (those occurring in the data but not in the current group) will be imputed." + }, + "keyvals": { + "anyOf": [ + { + "items": { + }, + "type": "array" + }, + { + "$ref": "#/definitions/ImputeSequence" + } + ], + "description": "Defines the key values that should be considered for imputation.\nAn array of key values or an object defining a [number sequence](https://vega.github.io/vega-lite/docs/impute.html#sequence-def).\n\nIf provided, this will be used in addition to the key values observed within the input data. If not provided, the values will be derived from all unique values of the `key` field. For `impute` in `encoding`, the key field is the x-field if the y-field is imputed, or vice versa.\n\nIf there is no impute grouping, this property _must_ be specified." + }, + "method": { + "$ref": "#/definitions/ImputeMethod", + "description": "The imputation method to use for the field value of imputed data objects.\nOne of `value`, `mean`, `median`, `max` or `min`.\n\n__Default value:__ `\"value\"`" + }, + "value": { + "description": "The field value to use when the imputation `method` is `\"value\"`." + } + }, + "required": [ + "impute", + "key" + ], + "type": "object" + }, + "InlineData": { + "additionalProperties": false, + "properties": { + "format": { + "$ref": "#/definitions/DataFormat", + "description": "An object that specifies the format for parsing the data." + }, + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + }, + "values": { + "$ref": "#/definitions/InlineDataset", + "description": "The full data set, included inline. This can be an array of objects or primitive values, an object, or a string.\nArrays of primitive values are ingested as objects with a `data` property. Strings are parsed according to the specified format type." + } + }, + "required": [ + "values" + ], + "type": "object" + }, + "InlineDataset": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "type": "object" + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "object" + } + ] + }, + "InputBinding": { + "additionalProperties": false, + "properties": { + "autocomplete": { + "type": "string" + }, + "debounce": { + "type": "number" + }, + "element": { + "$ref": "#/definitions/Element" + }, + "input": { + "type": "string" + }, + "name": { + "type": "string" + }, + "placeholder": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "Interpolate": { + "enum": [ + "linear", + "linear-closed", + "step", + "step-before", + "step-after", + "basis", + "basis-open", + "basis-closed", + "cardinal", + "cardinal-open", + "cardinal-closed", + "bundle", + "monotone" + ], + "type": "string" + }, + "IntervalSelection": { + "additionalProperties": false, + "properties": { + "bind": { + "description": "Establishes a two-way binding between the interval selection and the scales\nused within the same view. This allows a user to interactively pan and\nzoom the view.\n\n__See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation.", + "enum": [ + "scales" + ], + "type": "string" + }, + "clear": { + "anyOf": [ + { + "$ref": "#/definitions/EventStream" + }, + { + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. Can be an\n[EventStream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + }, + "empty": { + "description": "By default, `all` data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.", + "enum": [ + "all", + "none" + ], + "type": "string" + }, + "encodings": { + "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/SingleDefUnitChannel" + }, + "type": "array" + }, + "fields": { + "description": "An array of field names whose values must match for a data tuple to\nfall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "init": { + "$ref": "#/definitions/SelectionInitIntervalMapping", + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and arrays of\ninitial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation." + }, + "mark": { + "$ref": "#/definitions/BrushConfig", + "description": "An interval selection also adds a rectangle mark to depict the\nextents of the interval. The `mark` property can be used to customize the\nappearance of the mark.\n\n__See also:__ [`mark`](https://vega.github.io/vega-lite/docs/selection-mark.html) documentation." + }, + "on": { + "$ref": "#/definitions/EventStream", + "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters)." + }, + "resolve": { + "$ref": "#/definitions/SelectionResolution", + "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + }, + "translate": { + "description": "When truthy, allows a user to interactively move an interval selection\nback-and-forth. Can be `true`, `false` (to disable panning), or a\n[Vega event stream definition](https://vega.github.io/vega/docs/event-streams/)\nwhich must include a start and end event to trigger continuous panning.\n\n__Default value:__ `true`, which corresponds to\n`[mousedown, window:mouseup] > window:mousemove!` which corresponds to\nclicks and dragging within an interval selection to reposition it.\n\n__See also:__ [`translate`](https://vega.github.io/vega-lite/docs/translate.html) documentation.", + "type": [ + "string", + "boolean" + ] + }, + "type": { + "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports three selection types:\n\n- `single` -- to select a single discrete data value on `click`.\n- `multi` -- to select multiple discrete data value; the first value is selected on `click` and additional values toggled on shift-`click`.\n- `interval` -- to select a continuous range of data values on `drag`.", + "enum": [ + "interval" + ], + "type": "string" + }, + "zoom": { + "description": "When truthy, allows a user to interactively resize an interval selection.\nCan be `true`, `false` (to disable zooming), or a [Vega event stream\ndefinition](https://vega.github.io/vega/docs/event-streams/). Currently,\nonly `wheel` events are supported.\n\n__Default value:__ `true`, which corresponds to `wheel!`.\n\n__See also:__ [`zoom`](https://vega.github.io/vega-lite/docs/zoom.html) documentation.", + "type": [ + "string", + "boolean" + ] + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "IntervalSelectionConfig": { + "additionalProperties": false, + "properties": { + "bind": { + "description": "Establishes a two-way binding between the interval selection and the scales\nused within the same view. This allows a user to interactively pan and\nzoom the view.\n\n__See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation.", + "enum": [ + "scales" + ], + "type": "string" + }, + "clear": { + "anyOf": [ + { + "$ref": "#/definitions/EventStream" + }, + { + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. Can be an\n[EventStream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + }, + "empty": { + "description": "By default, `all` data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.", + "enum": [ + "all", + "none" + ], + "type": "string" + }, + "encodings": { + "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/SingleDefUnitChannel" + }, + "type": "array" + }, + "fields": { + "description": "An array of field names whose values must match for a data tuple to\nfall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "init": { + "$ref": "#/definitions/SelectionInitIntervalMapping", + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and arrays of\ninitial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation." + }, + "mark": { + "$ref": "#/definitions/BrushConfig", + "description": "An interval selection also adds a rectangle mark to depict the\nextents of the interval. The `mark` property can be used to customize the\nappearance of the mark.\n\n__See also:__ [`mark`](https://vega.github.io/vega-lite/docs/selection-mark.html) documentation." + }, + "on": { + "$ref": "#/definitions/EventStream", + "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters)." + }, + "resolve": { + "$ref": "#/definitions/SelectionResolution", + "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + }, + "translate": { + "description": "When truthy, allows a user to interactively move an interval selection\nback-and-forth. Can be `true`, `false` (to disable panning), or a\n[Vega event stream definition](https://vega.github.io/vega/docs/event-streams/)\nwhich must include a start and end event to trigger continuous panning.\n\n__Default value:__ `true`, which corresponds to\n`[mousedown, window:mouseup] > window:mousemove!` which corresponds to\nclicks and dragging within an interval selection to reposition it.\n\n__See also:__ [`translate`](https://vega.github.io/vega-lite/docs/translate.html) documentation.", + "type": [ + "string", + "boolean" + ] + }, + "zoom": { + "description": "When truthy, allows a user to interactively resize an interval selection.\nCan be `true`, `false` (to disable zooming), or a [Vega event stream\ndefinition](https://vega.github.io/vega/docs/event-streams/). Currently,\nonly `wheel` events are supported.\n\n__Default value:__ `true`, which corresponds to `wheel!`.\n\n__See also:__ [`zoom`](https://vega.github.io/vega-lite/docs/zoom.html) documentation.", + "type": [ + "string", + "boolean" + ] + } + }, + "type": "object" + }, + "JoinAggregateFieldDef": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The output name for the join aggregate operation." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "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`." + }, + "op": { + "$ref": "#/definitions/AggregateOp", + "description": "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)." + } + }, + "required": [ + "op", + "as" + ], + "type": "object" + }, + "JoinAggregateTransform": { + "additionalProperties": false, + "properties": { + "groupby": { + "description": "The data fields for partitioning the data objects into separate groups. If unspecified, all data points will be in a single group.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "joinaggregate": { + "description": "The definition of the fields in the join aggregate, and what calculations to use.", + "items": { + "$ref": "#/definitions/JoinAggregateFieldDef" + }, + "type": "array" + } + }, + "required": [ + "joinaggregate" + ], + "type": "object" + }, + "JsonDataFormat": { + "additionalProperties": false, + "properties": { + "parse": { + "anyOf": [ + { + "$ref": "#/definitions/Parse" + }, + { + "type": "null" + } + ], + "description": "If set to `null`, disable type inference based on the spec and only use type inference based on the data.\nAlternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `\"number\"`, `\"boolean\"`, `\"date\"`, or null (do not parse the field)).\nFor example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each input record a Date value.\n\nFor `\"date\"`, we parse data based using Javascript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).\nFor Specific date formats can be provided (e.g., `{foo: \"date:'%m%d%Y'\"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). 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": { + "description": "The JSON property containing the desired data.\nThis parameter can be used when the loaded JSON file may have surrounding structure or meta-data.\nFor example `\"property\": \"values.features\"` is equivalent to retrieving `json.values.features`\nfrom the loaded JSON object.", + "type": "string" + }, + "type": { + "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL.\nIf no extension is detected, `\"json\"` will be used by default.", + "enum": [ + "json" + ], + "type": "string" + } + }, + "type": "object" + }, + "LabelOverlap": { + "anyOf": [ + { + "type": "boolean" + }, + { + "enum": [ + "parity" + ], + "type": "string" + }, + { + "enum": [ + "greedy" + ], + "type": "string" + } + ] + }, + "LatLongFieldDef": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bin": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", + "type": "null" + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\n- 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`).\n- 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.\n- 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).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- 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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation.", + "enum": [ + "quantitative" + ], + "type": "string" + } + }, + "type": "object" + }, + "LayerSpec": { + "additionalProperties": false, + "description": "A full layered plot specification, which may contains `encoding` and `projection` properties that will be applied to underlying unit (single-view) specifications.", + "properties": { + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/Encoding", + "description": "A shared key-value mapping between encoding channels and definition of fields in the underlying layers." + }, + "height": { + "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\n\n__Note__: For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + }, + "layer": { + "description": "Layer or single view specifications to be layered.\n\n__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.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/UnitSpec" + } + ] + }, + "type": "array" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "An object defining properties of the geographic projection shared by underlying layers." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its x-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the width is [determined by the range step, paddings, and the cardinality of the field mapped to x-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height) for `text` mark and the value of `rangeStep` for other marks.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + } + }, + "required": [ + "layer" + ], + "type": "object" + }, + "LayoutAlign": { + "enum": [ + "all", + "each", + "none" + ], + "type": "string" + }, + "LayoutBounds": { + "anyOf": [ + { + "enum": [ + "full" + ], + "type": "string" + }, + { + "enum": [ + "flush" + ], + "type": "string" + }, + { + "$ref": "#/definitions/SignalRef" + } + ] + }, + "Legend": { + "additionalProperties": false, + "description": "Properties of a legend or boolean flag for determining whether to show it.", + "properties": { + "clipHeight": { + "description": "The height in pixels to clip symbol legend entries and limit their size.", + "type": "number" + }, + "columnPadding": { + "description": "The horizontal padding in pixels between symbol legend entries.\n\n__Default value:__ `10`.", + "type": "number" + }, + "columns": { + "description": "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.", + "type": "number" + }, + "cornerRadius": { + "description": "Corner radius for the full legend.", + "type": "number" + }, + "direction": { + "$ref": "#/definitions/Orientation", + "description": "The direction of the legend, one of `\"vertical\"` or `\"horizontal\"`.\n\n__Default value:__\n- For top-/bottom-`orient`ed legends, `\"horizontal\"`\n- For left-/right-`orient`ed legends, `\"vertical\"`\n- For top/bottom-left/right-`orient`ed legends, `\"horizontal\"` for gradient legends and `\"vertical\"` for symbol legends." + }, + "fillColor": { + "$ref": "#/definitions/Color", + "description": "Background fill color for the full legend." + }, + "format": { + "description": "The text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format.", + "type": "string" + }, + "formatType": { + "description": "The format type for labels (`\"number\"` or `\"time\"`).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", + "enum": [ + "number", + "time" + ], + "type": "string" + }, + "gradientLength": { + "description": "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.\n\n__Default value:__ `200`.", + "minimum": 0, + "type": "number" + }, + "gradientOpacity": { + "description": "Opacity of the color gradient.", + "type": "number" + }, + "gradientStrokeColor": { + "$ref": "#/definitions/Color", + "description": "The color of the gradient stroke, can be in hex color code or regular color name.\n\n__Default value:__ `\"lightGray\"`." + }, + "gradientStrokeWidth": { + "description": "The width of the gradient stroke, in pixels.\n\n__Default value:__ `0`.", + "minimum": 0, + "type": "number" + }, + "gradientThickness": { + "description": "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.\n\n__Default value:__ `16`.", + "minimum": 0, + "type": "number" + }, + "gridAlign": { + "$ref": "#/definitions/LayoutAlign", + "description": "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).\n\n__Default value:__ `\"each\"`." + }, + "labelAlign": { + "$ref": "#/definitions/Align", + "description": "The alignment of the legend label, can be left, center, or right." + }, + "labelBaseline": { + "$ref": "#/definitions/TextBaseline", + "description": "The position of the baseline of legend label, can be `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`.\n\n__Default value:__ `\"middle\"`." + }, + "labelColor": { + "$ref": "#/definitions/Color", + "description": "The color of the legend label, can be in hex color code or regular color name." + }, + "labelFont": { + "description": "The font of the legend label.", + "type": "string" + }, + "labelFontSize": { + "description": "The font size of legend label.\n\n__Default value:__ `10`.", + "minimum": 0, + "type": "number" + }, + "labelFontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style of legend label." + }, + "labelFontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "The font weight of legend label." + }, + "labelLimit": { + "description": "Maximum allowed pixel width of legend tick labels.\n\n__Default value:__ `160`.", + "type": "number" + }, + "labelOffset": { + "description": "The offset of the legend label.", + "type": "number" + }, + "labelOpacity": { + "description": "Opacity of labels.", + "type": "number" + }, + "labelOverlap": { + "$ref": "#/definitions/LabelOverlap", + "description": "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 `\"greedy\"`, a linear scan of the labels is performed, removing any label that overlaps with the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true`." + }, + "labelPadding": { + "description": "Padding in pixels between the legend and legend labels.", + "type": "number" + }, + "labelSeparation": { + "description": "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.", + "type": "number" + }, + "legendX": { + "description": "Custom x-position for legend with orient \"none\".", + "type": "number" + }, + "legendY": { + "description": "Custom y-position for legend with orient \"none\".", + "type": "number" + }, + "offset": { + "description": "The offset in pixels by which to displace the legend from the data rectangle and axes.\n\n__Default value:__ `18`.", + "type": "number" + }, + "orient": { + "$ref": "#/definitions/LegendOrient", + "description": "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\"`.\n\n__Default value:__ `\"right\"`" + }, + "padding": { + "description": "The padding between the border and content of the legend group.\n\n__Default value:__ `0`.", + "type": "number" + }, + "rowPadding": { + "description": "The vertical padding in pixels between symbol legend entries.\n\n__Default value:__ `2`.", + "type": "number" + }, + "strokeColor": { + "$ref": "#/definitions/Color", + "description": "Border stroke color for the full legend." + }, + "symbolDash": { + "description": "An array of alternating [stroke, space] lengths for dashed symbol strokes.", + "items": { + "type": "number" + }, + "type": "array" + }, + "symbolDashOffset": { + "description": "The pixel offset at which to start drawing with the symbol stroke dash array.", + "type": "number" + }, + "symbolFillColor": { + "$ref": "#/definitions/Color", + "description": "The color of the legend symbol," + }, + "symbolOffset": { + "description": "Horizontal pixel offset for legend symbols.\n\n__Default value:__ `0`.", + "type": "number" + }, + "symbolOpacity": { + "description": "Opacity of the legend symbols.", + "type": "number" + }, + "symbolSize": { + "description": "The size of the legend symbol, in pixels.\n\n__Default value:__ `100`.", + "minimum": 0, + "type": "number" + }, + "symbolStrokeColor": { + "$ref": "#/definitions/Color", + "description": "Stroke color for legend symbols." + }, + "symbolStrokeWidth": { + "description": "The width of the symbol's stroke.\n\n__Default value:__ `1.5`.", + "minimum": 0, + "type": "number" + }, + "symbolType": { + "$ref": "#/definitions/SymbolShape", + "description": "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 shapes `arrow`, `wedge`, or `triangle`. Alternatively, a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) can be provided. 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.\n\n__Default value:__ `\"circle\"`." + }, + "tickCount": { + "description": "The desired number of tick values for quantitative legends.", + "type": "number" + }, + "tickMinStep": { + "description": "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.\n\n__Default value__: `undefined`", + "type": "number" + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "titleAlign": { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment for legend titles.\n\n__Default value:__ `\"left\"`." + }, + "titleAnchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "Text anchor position for placing legend titles." + }, + "titleBaseline": { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline for legend titles.\n\n__Default value:__ `\"top\"`." + }, + "titleColor": { + "$ref": "#/definitions/Color", + "description": "The color of the legend title, can be in hex color code or regular color name." + }, + "titleFont": { + "description": "The font of the legend title.", + "type": "string" + }, + "titleFontSize": { + "description": "The font size of the legend title.", + "type": "number" + }, + "titleFontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style of the legend title." + }, + "titleFontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "The font weight of the legend title.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "titleLimit": { + "description": "Maximum allowed pixel width of legend titles.\n\n__Default value:__ `180`.", + "minimum": 0, + "type": "number" + }, + "titleOpacity": { + "description": "Opacity of the legend title.", + "type": "number" + }, + "titleOrient": { + "$ref": "#/definitions/Orient", + "description": "Orientation of the legend title." + }, + "titlePadding": { + "description": "The padding, in pixels, between title and legend.\n\n__Default value:__ `5`.", + "type": "number" + }, + "type": { + "description": "The type of the legend. Use `\"symbol\"` to create a discrete legend and `\"gradient\"` for a continuous color gradient.\n\n__Default value:__ `\"gradient\"` for non-binned quantitative fields and temporal fields; `\"symbol\"` otherwise.", + "enum": [ + "symbol", + "gradient" + ], + "type": "string" + }, + "values": { + "description": "Explicitly set the visible legend values.", + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/DateTime" + } + ] + }, + "type": "array" + }, + "zindex": { + "description": "A non-negative integer indicating the z-index of the legend.\nIf zindex is 0, legend should be drawn behind all chart elements.\nTo put them in front, use zindex = 1.", + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "LegendConfig": { + "additionalProperties": false, + "properties": { + "clipHeight": { + "description": "The height in pixels to clip symbol legend entries and limit their size.", + "type": "number" + }, + "columnPadding": { + "description": "The horizontal padding in pixels between symbol legend entries.\n\n__Default value:__ `10`.", + "type": "number" + }, + "columns": { + "description": "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.", + "type": "number" + }, + "cornerRadius": { + "description": "Corner radius for the full legend.", + "type": "number" + }, + "fillColor": { + "$ref": "#/definitions/Color", + "description": "Background fill color for the full legend." + }, + "gradientDirection": { + "$ref": "#/definitions/Orientation", + "description": "The default direction (`\"horizontal\"` or `\"vertical\"`) for gradient legends.\n\n__Default value:__ `\"vertical\"`." + }, + "gradientHorizontalMaxLength": { + "description": "Max legend length for a horizontal gradient when `config.legend.gradientLength` is undefined.\n\n__Default value:__ `200`", + "type": "number" + }, + "gradientHorizontalMinLength": { + "description": "Min legend length for a horizontal gradient when `config.legend.gradientLength` is undefined.\n\n__Default value:__ `100`", + "type": "number" + }, + "gradientLabelLimit": { + "description": "The maximum allowed length in pixels of color ramp gradient labels.", + "type": "number" + }, + "gradientLabelOffset": { + "description": "Vertical offset in pixels for color ramp gradient labels.\n\n__Default value:__ `2`.", + "type": "number" + }, + "gradientLength": { + "description": "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.\n\n__Default value:__ `200`.", + "minimum": 0, + "type": "number" + }, + "gradientOpacity": { + "description": "Opacity of the color gradient.", + "type": "number" + }, + "gradientStrokeColor": { + "$ref": "#/definitions/Color", + "description": "The color of the gradient stroke, can be in hex color code or regular color name.\n\n__Default value:__ `\"lightGray\"`." + }, + "gradientStrokeWidth": { + "description": "The width of the gradient stroke, in pixels.\n\n__Default value:__ `0`.", + "minimum": 0, + "type": "number" + }, + "gradientThickness": { + "description": "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.\n\n__Default value:__ `16`.", + "minimum": 0, + "type": "number" + }, + "gradientVerticalMaxLength": { + "description": "Max legend length for a vertical gradient when `config.legend.gradientLength` is undefined.\n\n__Default value:__ `200`", + "type": "number" + }, + "gradientVerticalMinLength": { + "description": "Min legend length for a vertical gradient when `config.legend.gradientLength` is undefined.\n\n__Default value:__ `100`", + "type": "number" + }, + "gridAlign": { + "$ref": "#/definitions/LayoutAlign", + "description": "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).\n\n__Default value:__ `\"each\"`." + }, + "labelAlign": { + "$ref": "#/definitions/Align", + "description": "The alignment of the legend label, can be left, center, or right." + }, + "labelBaseline": { + "$ref": "#/definitions/TextBaseline", + "description": "The position of the baseline of legend label, can be `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`.\n\n__Default value:__ `\"middle\"`." + }, + "labelColor": { + "$ref": "#/definitions/Color", + "description": "The color of the legend label, can be in hex color code or regular color name." + }, + "labelFont": { + "description": "The font of the legend label.", + "type": "string" + }, + "labelFontSize": { + "description": "The font size of legend label.\n\n__Default value:__ `10`.", + "minimum": 0, + "type": "number" + }, + "labelFontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style of legend label." + }, + "labelFontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "The font weight of legend label." + }, + "labelLimit": { + "description": "Maximum allowed pixel width of legend tick labels.\n\n__Default value:__ `160`.", + "type": "number" + }, + "labelOffset": { + "description": "The offset of the legend label.", + "type": "number" + }, + "labelOpacity": { + "description": "Opacity of labels.", + "type": "number" + }, + "labelOverlap": { + "$ref": "#/definitions/LabelOverlap", + "description": "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 scan of the labels is performed, removing any label that overlaps with the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `\"greedy\"` for `log scales otherwise `true`." + }, + "labelPadding": { + "description": "Padding in pixels between the legend and legend labels.", + "type": "number" + }, + "labelSeparation": { + "description": "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.", + "type": "number" + }, + "layout": { + "$ref": "#/definitions/LegendLayout", + "description": "Legend orient group layout parameters." + }, + "legendX": { + "description": "Custom x-position for legend with orient \"none\".", + "type": "number" + }, + "legendY": { + "description": "Custom y-position for legend with orient \"none\".", + "type": "number" + }, + "offset": { + "description": "The offset in pixels by which to displace the legend from the data rectangle and axes.\n\n__Default value:__ `18`.", + "type": "number" + }, + "orient": { + "$ref": "#/definitions/LegendOrient", + "description": "The orientation of the legend, which determines how the legend is positioned within the scene. One of \"left\", \"right\", \"top-left\", \"top-right\", \"bottom-left\", \"bottom-right\", \"none\".\n\n__Default value:__ `\"right\"`" + }, + "padding": { + "description": "The padding between the border and content of the legend group.\n\n__Default value:__ `0`.", + "type": "number" + }, + "rowPadding": { + "description": "The vertical padding in pixels between symbol legend entries.\n\n__Default value:__ `2`.", + "type": "number" + }, + "shortTimeLabels": { + "description": "Whether month names and weekday names should be abbreviated.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "strokeColor": { + "$ref": "#/definitions/Color", + "description": "Border stroke color for the full legend." + }, + "strokeDash": { + "description": "Border stroke dash pattern for the full legend.", + "items": { + "type": "number" + }, + "type": "array" + }, + "strokeWidth": { + "description": "Border stroke width for the full legend.", + "type": "number" + }, + "symbolBaseFillColor": { + "$ref": "#/definitions/Color", + "description": "Default fill color for legend symbols. Only applied if there is no `\"fill\"` scale color encoding for the legend.\n\n__Default value:__ `\"transparent\"`." + }, + "symbolBaseStrokeColor": { + "$ref": "#/definitions/Color", + "description": "Default stroke color for legend symbols. Only applied if there is no `\"fill\"` scale color encoding for the legend.\n\n__Default value:__ `\"gray\"`." + }, + "symbolDash": { + "description": "An array of alternating [stroke, space] lengths for dashed symbol strokes.", + "items": { + "type": "number" + }, + "type": "array" + }, + "symbolDashOffset": { + "description": "The pixel offset at which to start drawing with the symbol stroke dash array.", + "type": "number" + }, + "symbolDirection": { + "$ref": "#/definitions/Orientation", + "description": "The default direction (`\"horizontal\"` or `\"vertical\"`) for symbol legends.\n\n__Default value:__ `\"vertical\"`." + }, + "symbolFillColor": { + "$ref": "#/definitions/Color", + "description": "The color of the legend symbol," + }, + "symbolOffset": { + "description": "Horizontal pixel offset for legend symbols.\n\n__Default value:__ `0`.", + "type": "number" + }, + "symbolOpacity": { + "description": "Opacity of the legend symbols.", + "type": "number" + }, + "symbolSize": { + "description": "The size of the legend symbol, in pixels.\n\n__Default value:__ `100`.", + "minimum": 0, + "type": "number" + }, + "symbolStrokeColor": { + "$ref": "#/definitions/Color", + "description": "Stroke color for legend symbols." + }, + "symbolStrokeWidth": { + "description": "The width of the symbol's stroke.\n\n__Default value:__ `1.5`.", + "minimum": 0, + "type": "number" + }, + "symbolType": { + "$ref": "#/definitions/SymbolShape", + "description": "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 shapes `arrow`, `wedge`, or `triangle`. Alternatively, a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) can be provided. 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.\n\n__Default value:__ `\"circle\"`." + }, + "title": { + "description": "Set to null to disable title for the axis, legend, or header.", + "type": "null" + }, + "titleAlign": { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment for legend titles.\n\n__Default value:__ `\"left\"`." + }, + "titleAnchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "Text anchor position for placing legend titles." + }, + "titleBaseline": { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline for legend titles.\n\n__Default value:__ `\"top\"`." + }, + "titleColor": { + "$ref": "#/definitions/Color", + "description": "The color of the legend title, can be in hex color code or regular color name." + }, + "titleFont": { + "description": "The font of the legend title.", + "type": "string" + }, + "titleFontSize": { + "description": "The font size of the legend title.", + "type": "number" + }, + "titleFontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style of the legend title." + }, + "titleFontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "The font weight of the legend title.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "titleLimit": { + "description": "Maximum allowed pixel width of legend titles.\n\n__Default value:__ `180`.", + "minimum": 0, + "type": "number" + }, + "titleOpacity": { + "description": "Opacity of the legend title.", + "type": "number" + }, + "titleOrient": { + "$ref": "#/definitions/Orient", + "description": "Orientation of the legend title." + }, + "titlePadding": { + "description": "The padding, in pixels, between title and legend.\n\n__Default value:__ `5`.", + "type": "number" + } + }, + "type": "object" + }, + "LegendLayout": { + "additionalProperties": false, + "properties": { + "anchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "The anchor point for legend orient group layout." + }, + "bottom": { + "$ref": "#/definitions/BaseLegendLayout" + }, + "bottom-left": { + "$ref": "#/definitions/BaseLegendLayout" + }, + "bottom-right": { + "$ref": "#/definitions/BaseLegendLayout" + }, + "bounds": { + "$ref": "#/definitions/LayoutBounds", + "description": "The bounds calculation to use for legend orient group layout." + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/SignalRef" + } + ], + "description": "A flag to center legends within a shared orient group." + }, + "direction": { + "anyOf": [ + { + "$ref": "#/definitions/Orientation" + }, + { + "$ref": "#/definitions/SignalRef" + } + ], + "description": "The layout direction for legend orient group layout." + }, + "left": { + "$ref": "#/definitions/BaseLegendLayout" + }, + "margin": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/SignalRef" + } + ], + "description": "The pixel margin between legends within a orient group." + }, + "offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/SignalRef" + } + ], + "description": "The pixel offset from the chart body for a legend orient group." + }, + "right": { + "$ref": "#/definitions/BaseLegendLayout" + }, + "top": { + "$ref": "#/definitions/BaseLegendLayout" + }, + "top-left": { + "$ref": "#/definitions/BaseLegendLayout" + }, + "top-right": { + "$ref": "#/definitions/BaseLegendLayout" + } + }, + "type": "object" + }, + "LegendOrient": { + "enum": [ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right" + ], + "type": "string" + }, + "LegendResolveMap": { + "additionalProperties": false, + "properties": { + "color": { + "$ref": "#/definitions/ResolveMode" + }, + "fill": { + "$ref": "#/definitions/ResolveMode" + }, + "fillOpacity": { + "$ref": "#/definitions/ResolveMode" + }, + "opacity": { + "$ref": "#/definitions/ResolveMode" + }, + "shape": { + "$ref": "#/definitions/ResolveMode" + }, + "size": { + "$ref": "#/definitions/ResolveMode" + }, + "stroke": { + "$ref": "#/definitions/ResolveMode" + }, + "strokeOpacity": { + "$ref": "#/definitions/ResolveMode" + }, + "strokeWidth": { + "$ref": "#/definitions/ResolveMode" + } + }, + "type": "object" + }, + "LineConfig": { + "additionalProperties": false, + "properties": { + "align": { + "$ref": "#/definitions/Align", + "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`." + }, + "angle": { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + "baseline": { + "$ref": "#/definitions/TextBaseline", + "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`" + }, + "color": { + "$ref": "#/definitions/Color", + "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `color`.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config)." + }, + "cornerRadius": { + "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", + "type": "number" + }, + "cursor": { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + "dir": { + "$ref": "#/definitions/Dir", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + "dx": { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "dy": { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "ellipsis": { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + "fill": { + "$ref": "#/definitions/Color", + "description": "Default Fill Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for `point`, `line` and `rule`; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + "fontSize": { + "description": "The font size, in pixels.", + "type": "number" + }, + "fontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + "fontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "height": { + "description": "Height of the marks.", + "type": "number" + }, + "href": { + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", + "format": "uri", + "type": "string" + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "limit": { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit", + "type": "number" + }, + "opacity": { + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." + }, + "point": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/OverlayMarkDef" + }, + { + "enum": [ + "transparent" + ], + "type": "string" + } + ], + "description": "A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points.\n\n- If this property is `\"transparent\"`, transparent points will be used (for enhancing tooltips and selections).\n\n- If this property is an empty object (`{}`) or `true`, filled points with default properties will be used.\n\n- If this property is `false`, no points would be automatically added to line or area marks.\n\n__Default value:__ `false`." + }, + "radius": { + "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", + "minimum": 0, + "type": "number" + }, + "shape": { + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- 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.)\n\n__Default value:__ `\"circle\"`", + "type": "string" + }, + "size": { + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. For example: in the case of circles, the radius is determined in part by the square root of the size value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__ `30` for point, circle, square marks; `rangeStep` - 1 for bar marks with discrete dimensions; `5` for bar marks with continuous dimensions; `11` for text marks.", + "minimum": 0, + "type": "number" + }, + "stroke": { + "$ref": "#/definitions/Color", + "description": "Default Stroke Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "strokeCap": { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"square\"`" + }, + "strokeDash": { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "strokeDashOffset": { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + "strokeJoin": { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + "strokeMiterLimit": { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + "strokeOpacity": { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "strokeWidth": { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + "tension": { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "text": { + "description": "Placeholder text if the `text` channel is not specified", + "type": "string" + }, + "theta": { + "description": "Polar coordinate angle, in radians, of the text label from the origin determined by 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\".", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/Value" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null`, then no tooltip will be used." + }, + "width": { + "description": "Width of the marks.", + "type": "number" + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "height" + ], + "type": "string" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "LocalMultiTimeUnit": { + "enum": [ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "quartermonth", + "monthdate", + "monthdatehours", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds" + ], + "type": "string" + }, + "LocalSingleTimeUnit": { + "enum": [ + "year", + "quarter", + "month", + "day", + "date", + "hours", + "minutes", + "seconds", + "milliseconds" + ], + "type": "string" + }, + "LogicalAnd": { + "additionalProperties": false, + "properties": { + "and": { + "items": { + "$ref": "#/definitions/LogicalOperand" + }, + "type": "array" + } + }, + "required": [ + "and" + ], + "type": "object" + }, + "SelectionAnd": { + "additionalProperties": false, + "properties": { + "and": { + "items": { + "$ref": "#/definitions/SelectionOperand" + }, + "type": "array" + } + }, + "required": [ + "and" + ], + "type": "object" + }, + "LogicalNot": { + "additionalProperties": false, + "properties": { + "not": { + "$ref": "#/definitions/LogicalOperand" + } + }, + "required": [ + "not" + ], + "type": "object" + }, + "SelectionNot": { + "additionalProperties": false, + "properties": { + "not": { + "$ref": "#/definitions/SelectionOperand" + } + }, + "required": [ + "not" + ], + "type": "object" + }, + "LogicalOperand": { + "anyOf": [ + { + "$ref": "#/definitions/LogicalNot" + }, + { + "$ref": "#/definitions/LogicalAnd" + }, + { + "$ref": "#/definitions/LogicalOr" + }, + { + "$ref": "#/definitions/Predicate" + } + ] + }, + "SelectionOperand": { + "anyOf": [ + { + "$ref": "#/definitions/SelectionNot" + }, + { + "$ref": "#/definitions/SelectionAnd" + }, + { + "$ref": "#/definitions/SelectionOr" + }, + { + "type": "string" + } + ] + }, + "LogicalOr": { + "additionalProperties": false, + "properties": { + "or": { + "items": { + "$ref": "#/definitions/LogicalOperand" + }, + "type": "array" + } + }, + "required": [ + "or" + ], + "type": "object" + }, + "SelectionOr": { + "additionalProperties": false, + "properties": { + "or": { + "items": { + "$ref": "#/definitions/SelectionOperand" + }, + "type": "array" + } + }, + "required": [ + "or" + ], + "type": "object" + }, + "LookupData": { + "additionalProperties": false, + "properties": { + "data": { + "$ref": "#/definitions/Data", + "description": "Secondary data source to lookup in." + }, + "fields": { + "description": "Fields in foreign data to lookup.\nIf not specified, the entire object is queried.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "key": { + "$ref": "#/definitions/FieldName", + "description": "Key in data to lookup." + } + }, + "required": [ + "data", + "key" + ], + "type": "object" + }, + "LookupTransform": { + "additionalProperties": false, + "properties": { + "as": { + "anyOf": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + } + ], + "description": "The field or fields for storing the computed formula value.\nIf `from.fields` is specified, the transform will use the same names for `as`.\nIf `from.fields` is not specified, `as` has to be a string and we put the whole object into the data under the specified name." + }, + "default": { + "description": "The default value to use if lookup fails.\n\n__Default value:__ `null`", + "type": "string" + }, + "from": { + "$ref": "#/definitions/LookupData", + "description": "Secondary data reference." + }, + "lookup": { + "$ref": "#/definitions/FieldName", + "description": "Key in primary data source." + } + }, + "required": [ + "lookup", + "from" + ], + "type": "object" + }, + "Mark": { + "description": "All types of primitive marks.", + "enum": [ + "area", + "bar", + "line", + "trail", + "point", + "text", + "tick", + "rect", + "rule", + "circle", + "square", + "geoshape" + ], + "type": "string" + }, + "MarkConfig": { + "additionalProperties": false, + "properties": { + "align": { + "$ref": "#/definitions/Align", + "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`." + }, + "angle": { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + "baseline": { + "$ref": "#/definitions/TextBaseline", + "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`" + }, + "color": { + "$ref": "#/definitions/Color", + "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `color`.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config)." + }, + "cornerRadius": { + "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", + "type": "number" + }, + "cursor": { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + "dir": { + "$ref": "#/definitions/Dir", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + "dx": { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "dy": { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "ellipsis": { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + "fill": { + "$ref": "#/definitions/Color", + "description": "Default Fill Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for `point`, `line` and `rule`; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + "fontSize": { + "description": "The font size, in pixels.", + "type": "number" + }, + "fontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + "fontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "height": { + "description": "Height of the marks.", + "type": "number" + }, + "href": { + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", + "format": "uri", + "type": "string" + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "limit": { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit", + "type": "number" + }, + "opacity": { + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." + }, + "radius": { + "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", + "minimum": 0, + "type": "number" + }, + "shape": { + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- 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.)\n\n__Default value:__ `\"circle\"`", + "type": "string" + }, + "size": { + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. For example: in the case of circles, the radius is determined in part by the square root of the size value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__ `30` for point, circle, square marks; `rangeStep` - 1 for bar marks with discrete dimensions; `5` for bar marks with continuous dimensions; `11` for text marks.", + "minimum": 0, + "type": "number" + }, + "stroke": { + "$ref": "#/definitions/Color", + "description": "Default Stroke Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "strokeCap": { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"square\"`" + }, + "strokeDash": { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "strokeDashOffset": { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + "strokeJoin": { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + "strokeMiterLimit": { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + "strokeOpacity": { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "strokeWidth": { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + "tension": { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "text": { + "description": "Placeholder text if the `text` channel is not specified", + "type": "string" + }, + "theta": { + "description": "Polar coordinate angle, in radians, of the text label from the origin determined by 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\".", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/Value" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null`, then no tooltip will be used." + }, + "width": { + "description": "Width of the marks.", + "type": "number" + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "height" + ], + "type": "string" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "MarkDef": { + "additionalProperties": false, + "properties": { + "align": { + "$ref": "#/definitions/Align", + "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`." + }, + "angle": { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + "baseline": { + "$ref": "#/definitions/TextBaseline", + "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`" + }, + "binSpacing": { + "description": "Offset between bars for binned field. Ideal value for this is either 0 (Preferred by statisticians) or 1 (Vega-Lite Default, D3 example style).\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "clip": { + "description": "Whether a mark be clipped to the enclosing group’s width and height.", + "type": "boolean" + }, + "color": { + "$ref": "#/definitions/Color", + "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `color`.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config)." + }, + "cornerRadius": { + "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", + "type": "number" + }, + "cursor": { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + "dir": { + "$ref": "#/definitions/Dir", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + "dx": { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "dy": { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "ellipsis": { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + "fill": { + "$ref": "#/definitions/Color", + "description": "Default Fill Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for `point`, `line` and `rule`; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + "fontSize": { + "description": "The font size, in pixels.", + "type": "number" + }, + "fontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + "fontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "height": { + "description": "Height of the marks.", + "type": "number" + }, + "href": { + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", + "format": "uri", + "type": "string" + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "limit": { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit", + "type": "number" + }, + "line": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/OverlayMarkDef" + } + ], + "description": "A flag for overlaying line on top of area marks, or an object defining the properties of the overlayed lines.\n\n- If this value is an empty object (`{}`) or `true`, lines with default properties will be used.\n\n- If this value is `false`, no lines would be automatically added to area marks.\n\n__Default value:__ `false`." + }, + "opacity": { + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." + }, + "point": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/OverlayMarkDef" + }, + { + "enum": [ + "transparent" + ], + "type": "string" + } + ], + "description": "A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points.\n\n- If this property is `\"transparent\"`, transparent points will be used (for enhancing tooltips and selections).\n\n- If this property is an empty object (`{}`) or `true`, filled points with default properties will be used.\n\n- If this property is `false`, no points would be automatically added to line or area marks.\n\n__Default value:__ `false`." + }, + "radius": { + "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", + "minimum": 0, + "type": "number" + }, + "shape": { + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- 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.)\n\n__Default value:__ `\"circle\"`", + "type": "string" + }, + "size": { + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. For example: in the case of circles, the radius is determined in part by the square root of the size value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__ `30` for point, circle, square marks; `rangeStep` - 1 for bar marks with discrete dimensions; `5` for bar marks with continuous dimensions; `11` for text marks.", + "minimum": 0, + "type": "number" + }, + "stroke": { + "$ref": "#/definitions/Color", + "description": "Default Stroke Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "strokeCap": { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"square\"`" + }, + "strokeDash": { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "strokeDashOffset": { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + "strokeJoin": { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + "strokeMiterLimit": { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + "strokeOpacity": { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "strokeWidth": { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "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](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is an array, later styles will override earlier styles. Any [mark properties](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) explicitly defined within the `encoding` will override a style default.\n\n__Default value:__ The mark's name. For example, a bar mark will have style `\"bar\"` by default.\n__Note:__ Any specified style will augment the default style. 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": { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "text": { + "description": "Placeholder text if the `text` channel is not specified", + "type": "string" + }, + "theta": { + "description": "Polar coordinate angle, in radians, of the text label from the origin determined by 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\".", + "type": "number" + }, + "thickness": { + "description": "Thickness of the tick mark.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/Value" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null`, then no tooltip will be used." + }, + "type": { + "$ref": "#/definitions/Mark", + "description": "The mark type. This could a primitive mark type\n(one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`)\nor a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." + }, + "width": { + "description": "Width of the marks.", + "type": "number" + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2Offset": { + "description": "Offset for x2-position.", + "type": "number" + }, + "xOffset": { + "description": "Offset for x-position.", + "type": "number" + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "height" + ], + "type": "string" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2Offset": { + "description": "Offset for y2-position.", + "type": "number" + }, + "yOffset": { + "description": "Offset for y-position.", + "type": "number" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "Month": { + "maximum": 12, + "minimum": 1, + "type": "number" + }, + "MultiSelection": { + "additionalProperties": false, + "properties": { + "clear": { + "anyOf": [ + { + "$ref": "#/definitions/EventStream" + }, + { + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. Can be an\n[EventStream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + }, + "empty": { + "description": "By default, `all` data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.", + "enum": [ + "all", + "none" + ], + "type": "string" + }, + "encodings": { + "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/SingleDefUnitChannel" + }, + "type": "array" + }, + "fields": { + "description": "An array of field names whose values must match for a data tuple to\nfall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "init": { + "anyOf": [ + { + "$ref": "#/definitions/SelectionInitMapping" + }, + { + "items": { + "$ref": "#/definitions/SelectionInitMapping" + }, + "type": "array" + } + ], + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and an initial\nvalue (or array of values).\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation." + }, + "nearest": { + "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\n__See also:__ [`nearest`](https://vega.github.io/vega-lite/docs/nearest.html) documentation.", + "type": "boolean" + }, + "on": { + "$ref": "#/definitions/EventStream", + "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters)." + }, + "resolve": { + "$ref": "#/definitions/SelectionResolution", + "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + }, + "toggle": { + "description": "Controls whether data values should be toggled or only ever inserted into\nmulti selections. Can be `true`, `false` (for insertion only), or a\n[Vega expression](https://vega.github.io/vega/docs/expressions/).\n\n__Default value:__ `true`, which corresponds to `event.shiftKey` (i.e.,\ndata values are toggled when a user interacts with the shift-key pressed).\n\n__See also:__ [`toggle`](https://vega.github.io/vega-lite/docs/toggle.html) documentation.", + "type": [ + "string", + "boolean" + ] + }, + "type": { + "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports three selection types:\n\n- `single` -- to select a single discrete data value on `click`.\n- `multi` -- to select multiple discrete data value; the first value is selected on `click` and additional values toggled on shift-`click`.\n- `interval` -- to select a continuous range of data values on `drag`.", + "enum": [ + "multi" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "MultiSelectionConfig": { + "additionalProperties": false, + "properties": { + "clear": { + "anyOf": [ + { + "$ref": "#/definitions/EventStream" + }, + { + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. Can be an\n[EventStream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + }, + "empty": { + "description": "By default, `all` data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.", + "enum": [ + "all", + "none" + ], + "type": "string" + }, + "encodings": { + "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/SingleDefUnitChannel" + }, + "type": "array" + }, + "fields": { + "description": "An array of field names whose values must match for a data tuple to\nfall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "init": { + "anyOf": [ + { + "$ref": "#/definitions/SelectionInitMapping" + }, + { + "items": { + "$ref": "#/definitions/SelectionInitMapping" + }, + "type": "array" + } + ], + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and an initial\nvalue (or array of values).\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation." + }, + "nearest": { + "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\n__See also:__ [`nearest`](https://vega.github.io/vega-lite/docs/nearest.html) documentation.", + "type": "boolean" + }, + "on": { + "$ref": "#/definitions/EventStream", + "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters)." + }, + "resolve": { + "$ref": "#/definitions/SelectionResolution", + "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + }, + "toggle": { + "description": "Controls whether data values should be toggled or only ever inserted into\nmulti selections. Can be `true`, `false` (for insertion only), or a\n[Vega expression](https://vega.github.io/vega/docs/expressions/).\n\n__Default value:__ `true`, which corresponds to `event.shiftKey` (i.e.,\ndata values are toggled when a user interacts with the shift-key pressed).\n\n__See also:__ [`toggle`](https://vega.github.io/vega-lite/docs/toggle.html) documentation.", + "type": [ + "string", + "boolean" + ] + } + }, + "type": "object" + }, + "MultiTimeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/LocalMultiTimeUnit" + }, + { + "$ref": "#/definitions/UtcMultiTimeUnit" + } + ] + }, + "NamedData": { + "additionalProperties": false, + "properties": { + "format": { + "$ref": "#/definitions/DataFormat", + "description": "An object that specifies the format for parsing the data." + }, + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "NiceTime": { + "enum": [ + "second", + "minute", + "hour", + "day", + "week", + "month", + "year" + ], + "type": "string" + }, + "NumericFieldDefWithCondition": { + "$ref": "#/definitions/FieldDefWithCondition" + }, + "NumericValueDefWithCondition": { + "$ref": "#/definitions/ValueDefWithCondition" + }, + "OrderFieldDef": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "binned" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "sort": { + "$ref": "#/definitions/SortOrder", + "description": "The sort order. One of `\"ascending\"` (default) or `\"descending\"`." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\n- 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`).\n- 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.\n- 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).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- 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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "Orient": { + "enum": [ + "left", + "right", + "top", + "bottom" + ], + "type": "string" + }, + "Orientation": { + "enum": [ + "horizontal", + "vertical" + ], + "type": "string" + }, + "OverlayMarkDef": { + "additionalProperties": false, + "properties": { + "align": { + "$ref": "#/definitions/Align", + "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`." + }, + "angle": { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + "baseline": { + "$ref": "#/definitions/TextBaseline", + "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`" + }, + "clip": { + "description": "Whether a mark be clipped to the enclosing group’s width and height.", + "type": "boolean" + }, + "color": { + "$ref": "#/definitions/Color", + "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `color`.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config)." + }, + "cornerRadius": { + "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", + "type": "number" + }, + "cursor": { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + "dir": { + "$ref": "#/definitions/Dir", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + "dx": { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "dy": { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "ellipsis": { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + "fill": { + "$ref": "#/definitions/Color", + "description": "Default Fill Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for `point`, `line` and `rule`; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + "fontSize": { + "description": "The font size, in pixels.", + "type": "number" + }, + "fontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + "fontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "height": { + "description": "Height of the marks.", + "type": "number" + }, + "href": { + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", + "format": "uri", + "type": "string" + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "limit": { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit", + "type": "number" + }, + "opacity": { + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." + }, + "radius": { + "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", + "minimum": 0, + "type": "number" + }, + "shape": { + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- 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.)\n\n__Default value:__ `\"circle\"`", + "type": "string" + }, + "size": { + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. For example: in the case of circles, the radius is determined in part by the square root of the size value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__ `30` for point, circle, square marks; `rangeStep` - 1 for bar marks with discrete dimensions; `5` for bar marks with continuous dimensions; `11` for text marks.", + "minimum": 0, + "type": "number" + }, + "stroke": { + "$ref": "#/definitions/Color", + "description": "Default Stroke Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "strokeCap": { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"square\"`" + }, + "strokeDash": { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "strokeDashOffset": { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + "strokeJoin": { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + "strokeMiterLimit": { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + "strokeOpacity": { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "strokeWidth": { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "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](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is an array, later styles will override earlier styles. Any [mark properties](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) explicitly defined within the `encoding` will override a style default.\n\n__Default value:__ The mark's name. For example, a bar mark will have style `\"bar\"` by default.\n__Note:__ Any specified style will augment the default style. 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": { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "text": { + "description": "Placeholder text if the `text` channel is not specified", + "type": "string" + }, + "theta": { + "description": "Polar coordinate angle, in radians, of the text label from the origin determined by 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\".", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/Value" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null`, then no tooltip will be used." + }, + "width": { + "description": "Width of the marks.", + "type": "number" + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2Offset": { + "description": "Offset for x2-position.", + "type": "number" + }, + "xOffset": { + "description": "Offset for x-position.", + "type": "number" + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "height" + ], + "type": "string" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2Offset": { + "description": "Offset for y2-position.", + "type": "number" + }, + "yOffset": { + "description": "Offset for y-position.", + "type": "number" + } + }, + "type": "object" + }, + "Padding": { + "anyOf": [ + { + "type": "number" + }, + { + "additionalProperties": false, + "properties": { + "bottom": { + "type": "number" + }, + "left": { + "type": "number" + }, + "right": { + "type": "number" + }, + "top": { + "type": "number" + } + }, + "type": "object" + } + ], + "minimum": 0 + }, + "Parse": { + "additionalProperties": { + "$ref": "#/definitions/ParseValue" + }, + "type": "object" + }, + "ParseValue": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "enum": [ + "string" + ], + "type": "string" + }, + { + "enum": [ + "boolean" + ], + "type": "string" + }, + { + "enum": [ + "date" + ], + "type": "string" + }, + { + "enum": [ + "number" + ], + "type": "string" + } + ] + }, + "PartsMixins": { + "additionalProperties": false, + "properties": { + "box": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "median": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "outliers": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "rule": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "ticks": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + } + }, + "type": "object" + }, + "PartsMixins": { + "additionalProperties": false, + "properties": { + "band": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "borders": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + } + }, + "type": "object" + }, + "PartsMixins": { + "additionalProperties": false, + "properties": { + "rule": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "ticks": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + } + }, + "type": "object" + }, + "PositionFieldDef": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "axis": { + "anyOf": [ + { + "$ref": "#/definitions/Axis" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of axis's gridlines, ticks and labels.\nIf `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation." + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "binned" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "impute": { + "$ref": "#/definitions/ImputeParams", + "description": "An object defining the properties of the Impute Operation to be applied.\nThe field value of the other positional channel is taken as `key` of the `Impute` Operation.\nThe field of the `color` channel if specified is used as `groupby` of the `Impute` Operation.\n\n__See also:__ [`impute`](https://vega.github.io/vega-lite/docs/impute.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in Javascript.\n- [A sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) for sorting by another encoding channel. (This type of sort definition is not available for `row` and `column` channels.)\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "Type of stacking offset if the field should be stacked.\n`stack` is only applicable for `x` and `y` channels with continuous domains.\nFor example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
    \n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true:\n(1) the mark is `bar` or `area`;\n(2) the stacked measure channel (x or y) has a linear scale;\n(3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\n- 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`).\n- 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.\n- 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).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- 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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "Predicate": { + "anyOf": [ + { + "$ref": "#/definitions/FieldEqualPredicate" + }, + { + "$ref": "#/definitions/FieldRangePredicate" + }, + { + "$ref": "#/definitions/FieldOneOfPredicate" + }, + { + "$ref": "#/definitions/FieldLTPredicate" + }, + { + "$ref": "#/definitions/FieldGTPredicate" + }, + { + "$ref": "#/definitions/FieldLTEPredicate" + }, + { + "$ref": "#/definitions/FieldGTEPredicate" + }, + { + "$ref": "#/definitions/FieldValidPredicate" + }, + { + "$ref": "#/definitions/SelectionPredicate" + }, + { + "type": "string" + } + ] + }, + "Projection": { + "additionalProperties": false, + "properties": { + "center": { + "description": "Sets the projection’s center to the specified center, a two-element array of longitude and latitude in degrees.\n\n__Default value:__ `[0, 0]`", + "items": { + "type": "number" + }, + "type": "array" + }, + "clipAngle": { + "description": "Sets 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.", + "type": "number" + }, + "clipExtent": { + "description": "Sets 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.", + "items": { + "items": { + "type": "number" + }, + "type": "array" + }, + "type": "array" + }, + "coefficient": { + "type": "number" + }, + "distance": { + "type": "number" + }, + "fraction": { + "type": "number" + }, + "lobes": { + "type": "number" + }, + "parallel": { + "type": "number" + }, + "precision": { + "description": "Sets 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…`.", + "type": "number" + }, + "radius": { + "type": "number" + }, + "ratio": { + "type": "number" + }, + "reflectX": { + "type": "boolean" + }, + "reflectY": { + "type": "boolean" + }, + "rotate": { + "description": "Sets 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.)\n\n__Default value:__ `[0, 0, 0]`", + "items": { + "type": "number" + }, + "type": "array" + }, + "scale": { + "description": "Sets the projection's scale (zoom) value, overriding automatic fitting.", + "type": "number" + }, + "spacing": { + "type": "number" + }, + "tilt": { + "type": "number" + }, + "translate": { + "description": "Sets the projection's translation (pan) value, overriding automatic fitting.", + "items": { + "type": "number" + }, + "type": "array" + }, + "type": { + "$ref": "#/definitions/ProjectionType", + "description": "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](https://vega.github.io/vega-lite/docs/projection.html#projection-types).\n\n__Default value:__ `mercator`" + } + }, + "type": "object" + }, + "ProjectionConfig": { + "$ref": "#/definitions/Projection", + "description": "Any property of Projection can be in config" + }, + "ProjectionType": { + "enum": [ + "albers", + "albersUsa", + "azimuthalEqualArea", + "azimuthalEquidistant", + "conicConformal", + "conicEqualArea", + "conicEquidistant", + "equirectangular", + "gnomonic", + "identity", + "mercator", + "naturalEarth1", + "orthographic", + "stereographic", + "transverseMercator" + ], + "type": "string" + }, + "RangeConfig": { + "additionalProperties": { + "$ref": "#/definitions/RangeConfigValue" + }, + "properties": { + "category": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/definitions/SchemeConfig" + } + ], + "description": "Default range for _nominal_ (categorical) fields." + }, + "diverging": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/definitions/SchemeConfig" + } + ], + "description": "Default range for diverging _quantitative_ fields." + }, + "heatmap": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/definitions/SchemeConfig" + } + ], + "description": "Default range for _quantitative_ heatmaps." + }, + "ordinal": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/definitions/SchemeConfig" + } + ], + "description": "Default range for _ordinal_ fields." + }, + "ramp": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/definitions/SchemeConfig" + } + ], + "description": "Default range for _quantitative_ and _temporal_ fields." + }, + "symbol": { + "description": "Default range palette for the `shape` channel.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "RangeConfigValue": { + "anyOf": [ + { + "items": { + "type": [ + "number", + "string" + ] + }, + "type": "array" + }, + { + "$ref": "#/definitions/SchemeConfig" + }, + { + "additionalProperties": false, + "properties": { + "step": { + "type": "number" + } + }, + "required": [ + "step" + ], + "type": "object" + } + ] + }, + "RectConfig": { + "additionalProperties": false, + "properties": { + "align": { + "$ref": "#/definitions/Align", + "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`." + }, + "angle": { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + "baseline": { + "$ref": "#/definitions/TextBaseline", + "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`" + }, + "binSpacing": { + "description": "Offset between bars for binned field. Ideal value for this is either 0 (Preferred by statisticians) or 1 (Vega-Lite Default, D3 example style).\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "color": { + "$ref": "#/definitions/Color", + "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `color`.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config)." + }, + "continuousBandSize": { + "description": "The default size of the bars on continuous scales.\n\n__Default value:__ `5`", + "minimum": 0, + "type": "number" + }, + "cornerRadius": { + "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", + "type": "number" + }, + "cursor": { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + "dir": { + "$ref": "#/definitions/Dir", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + "discreteBandSize": { + "description": "The default size of the bars with discrete dimensions. If unspecified, the default size is `bandSize-1`,\nwhich provides 1 pixel offset between bars.", + "minimum": 0, + "type": "number" + }, + "dx": { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "dy": { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "ellipsis": { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + "fill": { + "$ref": "#/definitions/Color", + "description": "Default Fill Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for `point`, `line` and `rule`; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + "fontSize": { + "description": "The font size, in pixels.", + "type": "number" + }, + "fontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + "fontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "height": { + "description": "Height of the marks.", + "type": "number" + }, + "href": { + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", + "format": "uri", + "type": "string" + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "limit": { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit", + "type": "number" + }, + "opacity": { + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." + }, + "radius": { + "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", + "minimum": 0, + "type": "number" + }, + "shape": { + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- 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.)\n\n__Default value:__ `\"circle\"`", + "type": "string" + }, + "size": { + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. For example: in the case of circles, the radius is determined in part by the square root of the size value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__ `30` for point, circle, square marks; `rangeStep` - 1 for bar marks with discrete dimensions; `5` for bar marks with continuous dimensions; `11` for text marks.", + "minimum": 0, + "type": "number" + }, + "stroke": { + "$ref": "#/definitions/Color", + "description": "Default Stroke Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "strokeCap": { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"square\"`" + }, + "strokeDash": { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "strokeDashOffset": { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + "strokeJoin": { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + "strokeMiterLimit": { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + "strokeOpacity": { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "strokeWidth": { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + "tension": { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "text": { + "description": "Placeholder text if the `text` channel is not specified", + "type": "string" + }, + "theta": { + "description": "Polar coordinate angle, in radians, of the text label from the origin determined by 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\".", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/Value" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null`, then no tooltip will be used." + }, + "width": { + "description": "Width of the marks.", + "type": "number" + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "height" + ], + "type": "string" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "RepeatMapping": { + "additionalProperties": false, + "properties": { + "column": { + "description": "An array of fields to be repeated horizontally.", + "items": { + "type": "string" + }, + "type": "array" + }, + "row": { + "description": "An array of fields to be repeated vertically.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "RepeatRef": { + "additionalProperties": false, + "description": "A ValueDef with optional Condition\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n} \n Reference to a repeated value.", + "properties": { + "repeat": { + "enum": [ + "row", + "column", + "repeat" + ], + "type": "string" + } + }, + "required": [ + "repeat" + ], + "type": "object" + }, + "Resolve": { + "additionalProperties": false, + "description": "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.", + "properties": { + "axis": { + "$ref": "#/definitions/AxisResolveMap" + }, + "legend": { + "$ref": "#/definitions/LegendResolveMap" + }, + "scale": { + "$ref": "#/definitions/ScaleResolveMap" + } + }, + "type": "object" + }, + "ResolveMode": { + "enum": [ + "independent", + "shared" + ], + "type": "string" + }, + "RowCol": { + "additionalProperties": false, + "properties": { + "column": { + "$ref": "#/definitions/LayoutAlign" + }, + "row": { + "$ref": "#/definitions/LayoutAlign" + } + }, + "type": "object" + }, + "RowCol": { + "additionalProperties": false, + "properties": { + "column": { + "type": "boolean" + }, + "row": { + "type": "boolean" + } + }, + "type": "object" + }, + "RowCol": { + "additionalProperties": false, + "properties": { + "column": { + "type": "number" + }, + "row": { + "type": "number" + } + }, + "type": "object" + }, + "SampleTransform": { + "additionalProperties": false, + "properties": { + "sample": { + "description": "The maximum number of data objects to include in the sample.\n\n__Default value:__ `1000`", + "type": "number" + } + }, + "required": [ + "sample" + ], + "type": "object" + }, + "Scale": { + "additionalProperties": false, + "properties": { + "align": { + "description": "The alignment of the steps within the scale range.\n\nThis value must lie in the range `[0,1]`. A value of `0.5` indicates that the steps should be centered within the range. A value of `0` or `1` may be used to shift the bands to one side, say to position them adjacent to an axis.\n\n__Default value:__ `0.5`", + "type": "number" + }, + "base": { + "description": "The logarithm base of the `log` scale (default `10`).", + "type": "number" + }, + "bins": { + "description": "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.", + "items": { + "type": "number" + }, + "type": "array" + }, + "clamp": { + "description": "If `true`, values that exceed the data domain are clamped to either the minimum or maximum range value\n\n__Default value:__ derived from the [scale config](https://vega.github.io/vega-lite/docs/config.html#scale-config)'s `clamp` (`true` by default).", + "type": "boolean" + }, + "constant": { + "description": "A constant determining the slope of the symlog function around zero. Only used for `symlog` scales.\n\n__Default value:__ `1`", + "type": "number" + }, + "domain": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + }, + { + "enum": [ + "unaggregated" + ], + "type": "string" + }, + { + "$ref": "#/definitions/SelectionDomain" + } + ], + "description": "Customized domain values.\n\nFor _quantitative_ fields, `domain` can take the form of a two-element array with minimum and maximum values. [Piecewise scales](https://vega.github.io/vega-lite/docs/scale.html#piecewise) can be created by providing a `domain` with more than two entries.\nIf the input field is aggregated, `domain` can also be a string value `\"unaggregated\"`, indicating that the domain should include the raw data values prior to the aggregation.\n\nFor _temporal_ fields, `domain` can be a two-element array minimum and maximum values, in the form of either timestamps or the [DateTime definition objects](https://vega.github.io/vega-lite/docs/types.html#datetime).\n\nFor _ordinal_ and _nominal_ fields, `domain` can be an array that lists valid input values.\n\nThe `selection` property can be used to [interactively determine](https://vega.github.io/vega-lite/docs/selection.html#scale-domains) the scale domain." + }, + "exponent": { + "description": "The exponent of the `pow` scale.", + "type": "number" + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInterpolate" + }, + { + "$ref": "#/definitions/ScaleInterpolateParams" + } + ], + "description": "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 `rgb`, `hsl`, `hsl-long`, `lab`, `hcl`, `hcl-long`, `cubehelix` and `cubehelix-long` ('-long' variants use longer paths in polar coordinate spaces). If object-valued, this property accepts an object with a string-valued _type_ property and an optional numeric _gamma_ property applicable to rgb and cubehelix interpolators. For more, see the [d3-interpolate documentation](https://github.com/d3/d3-interpolate).\n\n* __Default value:__ `hcl`" + }, + "nice": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/NiceTime" + }, + { + "additionalProperties": false, + "properties": { + "interval": { + "type": "string" + }, + "step": { + "type": "number" + } + }, + "required": [ + "interval", + "step" + ], + "type": "object" + } + ], + "description": "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 irregular. For example, for a domain of _[0.201479…, 0.996679…]_, a nice domain might be _[0.2, 1.0]_.\n\nFor quantitative scales such as linear, `nice` can be either a boolean flag or a number. If `nice` is a number, it will represent a desired tick count. This allows greater control over the step size used to extend the bounds, guaranteeing that the returned ticks will exactly cover the domain.\n\nFor temporal fields with time and utc scales, the `nice` value can be a string indicating the desired time interval. Legal values are `\"millisecond\"`, `\"second\"`, `\"minute\"`, `\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, and `\"year\"`. Alternatively, `time` and `utc` scales can accept an object-valued interval specifier of the form `{\"interval\": \"month\", \"step\": 3}`, which includes a desired number of interval steps. Here, the domain would snap to quarter (Jan, Apr, Jul, Oct) boundaries.\n\n__Default value:__ `true` for unbinned _quantitative_ fields; `false` otherwise." + }, + "padding": { + "description": "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 function as intended. Padding adjustment is performed prior to all other adjustments, including the effects of the `zero`, `nice`, `domainMin`, and `domainMax` properties.\n\nFor _[band](https://vega.github.io/vega-lite/docs/scale.html#band)_ scales, shortcut for setting `paddingInner` and `paddingOuter` to the same value.\n\nFor _[point](https://vega.github.io/vega-lite/docs/scale.html#point)_ scales, alias for `paddingOuter`.\n\n__Default value:__ For _continuous_ scales, derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `continuousPadding`.\nFor _band and point_ scales, see `paddingInner` and `paddingOuter`. By default, Vega-Lite sets padding such that _width/height = number of unique values * step_.", + "minimum": 0, + "type": "number" + }, + "paddingInner": { + "description": "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].\n\nFor point scale, this property is invalid as point scales do not have internal band widths (only step sizes between bands).\n\n__Default value:__ derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `bandPaddingInner`.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "paddingOuter": { + "description": "The outer padding (spacing) at the ends of the range of band and point scales,\nas a fraction of the step size. This value must lie in the range [0,1].\n\n__Default value:__ derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `bandPaddingOuter` for band scales and `pointPadding` for point scales.\nBy default, Vega-Lite sets outer padding such that _width/height = number of unique values * step_.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "range": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "string" + } + ], + "description": "The range of the scale. One of:\n\n- A string indicating a [pre-defined named scale range](https://vega.github.io/vega-lite/docs/scale.html#range-config) (e.g., example, `\"symbol\"`, or `\"diverging\"`).\n\n- For [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous), two-element array indicating minimum and maximum values, or an array with more than two entries for specifying a [piecewise scale](https://vega.github.io/vega-lite/docs/scale.html#piecewise).\n\n- For [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) and [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales, an array of desired output values.\n\n__Notes:__\n\n1) For color scales you can also specify a color [`scheme`](https://vega.github.io/vega-lite/docs/scale.html#scheme) instead of `range`.\n\n2) 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`) or via [range steps and paddings properties](#range-step) for [band](#band) and [point](#point) scales." + }, + "rangeStep": { + "description": "The distance between the starts of adjacent bands or points in [band](https://vega.github.io/vega-lite/docs/scale.html#band) and [point](https://vega.github.io/vega-lite/docs/scale.html#point) scales.\n\nIf `rangeStep` is `null` or if the view contains the scale's corresponding [size](https://vega.github.io/vega-lite/docs/size.html) (`width` for `x` scales and `height` for `y` scales), `rangeStep` will be automatically determined to fit the size of the view.\n\n__Default value:__ derived the [scale config](https://vega.github.io/vega-lite/docs/config.html#scale-config)'s `textXRangeStep` (`90` by default) for x-scales of `text` marks and `rangeStep` (`21` by default) for x-scales of other marks and y-scales.\n\n__Warning__: If `rangeStep` is `null` and the cardinality of the scale's domain is higher than `width` or `height`, the rangeStep might become less than one pixel and the mark might not appear correctly.", + "minimum": 0, + "type": [ + "number", + "null" + ] + }, + "round": { + "description": "If `true`, rounds numeric output values to integers. This can be helpful for snapping to the pixel grid.\n\n__Default value:__ `false`.", + "type": "boolean" + }, + "scheme": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/SchemeParams" + } + ], + "description": "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](https://vega.github.io/vega-lite/docs/scale.html#scheme-params).\n\nDiscrete color schemes may be used with [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) or [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales. Continuous color schemes are intended for use with color scales.\n\nFor the full list of supported schemes, please refer to the [Vega Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference." + }, + "type": { + "$ref": "#/definitions/ScaleType", + "description": "The type of scale. Vega-Lite supports the following categories of scale types:\n\n1) [**Continuous Scales**](https://vega.github.io/vega-lite/docs/scale.html#continuous) -- mapping continuous domains to continuous output ranges ([`\"linear\"`](https://vega.github.io/vega-lite/docs/scale.html#linear), [`\"pow\"`](https://vega.github.io/vega-lite/docs/scale.html#pow), [`\"sqrt\"`](https://vega.github.io/vega-lite/docs/scale.html#sqrt), [`\"symlog\"`](https://vega.github.io/vega-lite/docs/scale.html#symlog), [`\"log\"`](https://vega.github.io/vega-lite/docs/scale.html#log), [`\"time\"`](https://vega.github.io/vega-lite/docs/scale.html#time), [`\"utc\"`](https://vega.github.io/vega-lite/docs/scale.html#utc).\n\n2) [**Discrete Scales**](https://vega.github.io/vega-lite/docs/scale.html#discrete) -- mapping discrete domains to discrete ([`\"ordinal\"`](https://vega.github.io/vega-lite/docs/scale.html#ordinal)) or continuous ([`\"band\"`](https://vega.github.io/vega-lite/docs/scale.html#band) and [`\"point\"`](https://vega.github.io/vega-lite/docs/scale.html#point)) output ranges.\n\n3) [**Discretizing Scales**](https://vega.github.io/vega-lite/docs/scale.html#discretizing) -- mapping continuous domains to discrete output ranges [`\"bin-ordinal\"`](https://vega.github.io/vega-lite/docs/scale.html#bin-ordinal), [`\"quantile\"`](https://vega.github.io/vega-lite/docs/scale.html#quantile), [`\"quantize\"`](https://vega.github.io/vega-lite/docs/scale.html#quantize) and [`\"threshold\"`](https://vega.github.io/vega-lite/docs/scale.html#threshold).\n\n__Default value:__ please see the [scale type table](https://vega.github.io/vega-lite/docs/scale.html#type)." + }, + "zero": { + "description": "If `true`, ensures that a zero baseline value is included in the scale domain.\n\n__Default value:__ `true` for x and y channels if the quantitative field is not binned and no custom `domain` is provided; `false` otherwise.\n\n__Note:__ Log, time, and utc scales do not support `zero`.", + "type": "boolean" + } + }, + "type": "object" + }, + "ScaleConfig": { + "additionalProperties": false, + "properties": { + "bandPaddingInner": { + "description": "Default inner padding for `x` and `y` band-ordinal scales.\n\n__Default value:__\n- `barBandPaddingInner` for bar marks (`0.1` by default)\n- `rectBandPaddingInner` for rect and other marks (`0` by default)", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bandPaddingOuter": { + "description": "Default outer padding for `x` and `y` band-ordinal scales.\n\n__Default value:__ `paddingInner/2` (which makes _width/height = number of unique values * step_)", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "barBandPaddingInner": { + "description": "Default inner padding for `x` and `y` band-ordinal scales of `\"bar\"` marks.\n\n__Default value:__ `0.1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "barBandPaddingOuter": { + "description": "Default outer padding for `x` and `y` band-ordinal scales of `\"bar\"` marks.\nIf not specified, by default, band scale's paddingOuter is paddingInner/2.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "clamp": { + "description": "If true, values that exceed the data domain are clamped to either the minimum or maximum range value", + "type": "boolean" + }, + "continuousPadding": { + "description": "Default padding for continuous scales.\n\n__Default:__ `5` for continuous x-scale of a vertical bar and continuous y-scale of a horizontal bar.; `0` otherwise.", + "minimum": 0, + "type": "number" + }, + "maxBandSize": { + "description": "The default max value for mapping quantitative fields to bar's size/bandSize.\n\nIf undefined (default), we will use the scale's `rangeStep` - 1.", + "minimum": 0, + "type": "number" + }, + "maxFontSize": { + "description": "The default max value for mapping quantitative fields to text's size/fontSize.\n\n__Default value:__ `40`", + "minimum": 0, + "type": "number" + }, + "maxOpacity": { + "description": "Default max opacity for mapping a field to opacity.\n\n__Default value:__ `0.8`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "maxSize": { + "description": "Default max value for point size scale.", + "minimum": 0, + "type": "number" + }, + "maxStrokeWidth": { + "description": "Default max strokeWidth for the scale of strokeWidth for rule and line marks and of size for trail marks.\n\n__Default value:__ `4`", + "minimum": 0, + "type": "number" + }, + "minBandSize": { + "description": "The default min value for mapping quantitative fields to bar and tick's size/bandSize scale with zero=false.\n\n__Default value:__ `2`", + "minimum": 0, + "type": "number" + }, + "minFontSize": { + "description": "The default min value for mapping quantitative fields to tick's size/fontSize scale with zero=false\n\n__Default value:__ `8`", + "minimum": 0, + "type": "number" + }, + "minOpacity": { + "description": "Default minimum opacity for mapping a field to opacity.\n\n__Default value:__ `0.3`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "minSize": { + "description": "Default minimum value for point size scale with zero=false.\n\n__Default value:__ `9`", + "minimum": 0, + "type": "number" + }, + "minStrokeWidth": { + "description": "Default minimum strokeWidth for the scale of strokeWidth for rule and line marks and of size for trail marks with zero=false.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "pointPadding": { + "description": "Default outer padding for `x` and `y` point-ordinal scales.\n\n__Default value:__ `0.5` (which makes _width/height = number of unique values * step_)", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "quantileCount": { + "description": "Default range cardinality for [`quantile`](https://vega.github.io/vega-lite/docs/scale.html#quantile) scale.\n\n__Default value:__ `4`", + "minimum": 0, + "type": "number" + }, + "quantizeCount": { + "description": "Default range cardinality for [`quantize`](https://vega.github.io/vega-lite/docs/scale.html#quantize) scale.\n\n__Default value:__ `4`", + "minimum": 0, + "type": "number" + }, + "rangeStep": { + "description": "Default range step for band and point scales of (1) the `y` channel\nand (2) the `x` channel when the mark is not `text`.\n\n__Default value:__ `20`", + "minimum": 0, + "type": [ + "number", + "null" + ] + }, + "rectBandPaddingInner": { + "description": "Default inner padding for `x` and `y` band-ordinal scales of `\"rect\"` marks.\n\n__Default value:__ `0`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "rectBandPaddingOuter": { + "description": "Default outer padding for `x` and `y` band-ordinal scales of `\"rect\"` marks.\nIf not specified, by default, band scale's paddingOuter is paddingInner/2.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "round": { + "description": "If true, rounds numeric output values to integers.\nThis can be helpful for snapping to the pixel grid.\n(Only available for `x`, `y`, and `size` scales.)", + "type": "boolean" + }, + "textXRangeStep": { + "description": "Default range step for `x` band and point scales of text marks.\n\n__Default value:__ `90`", + "minimum": 0, + "type": "number" + }, + "useUnaggregatedDomain": { + "description": "Use the source data range before aggregation as scale domain instead of aggregated data for aggregate axis.\n\nThis is equivalent to setting `domain` to `\"unaggregate\"` for aggregated _quantitative_ fields by default.\n\nThis property only works with aggregate functions that produce values within the raw data domain (`\"mean\"`, `\"average\"`, `\"median\"`, `\"q1\"`, `\"q3\"`, `\"min\"`, `\"max\"`). For other aggregations that produce values outside of the raw data domain (e.g. `\"count\"`, `\"sum\"`), this property is ignored.\n\n__Default value:__ `false`", + "type": "boolean" + } + }, + "type": "object" + }, + "ScaleInterpolate": { + "enum": [ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long" + ], + "type": "string" + }, + "ScaleInterpolateParams": { + "additionalProperties": false, + "properties": { + "gamma": { + "type": "number" + }, + "type": { + "enum": [ + "rgb", + "cubehelix", + "cubehelix-long" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "ScaleResolveMap": { + "additionalProperties": false, + "properties": { + "color": { + "$ref": "#/definitions/ResolveMode" + }, + "fill": { + "$ref": "#/definitions/ResolveMode" + }, + "fillOpacity": { + "$ref": "#/definitions/ResolveMode" + }, + "opacity": { + "$ref": "#/definitions/ResolveMode" + }, + "shape": { + "$ref": "#/definitions/ResolveMode" + }, + "size": { + "$ref": "#/definitions/ResolveMode" + }, + "stroke": { + "$ref": "#/definitions/ResolveMode" + }, + "strokeOpacity": { + "$ref": "#/definitions/ResolveMode" + }, + "strokeWidth": { + "$ref": "#/definitions/ResolveMode" + }, + "x": { + "$ref": "#/definitions/ResolveMode" + }, + "y": { + "$ref": "#/definitions/ResolveMode" + } + }, + "type": "object" + }, + "ScaleType": { + "enum": [ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band" + ], + "type": "string" + }, + "SchemeConfig": { + "additionalProperties": false, + "properties": { + "count": { + "type": "number" + }, + "extent": { + "items": { + "type": "number" + }, + "type": "array" + }, + "scheme": { + "type": "string" + } + }, + "required": [ + "scheme" + ], + "type": "object" + }, + "SchemeParams": { + "additionalProperties": false, + "properties": { + "count": { + "description": "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.", + "type": "number" + }, + "extent": { + "description": "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.", + "items": { + "type": "number" + }, + "type": "array" + }, + "name": { + "description": "A color scheme name for ordinal scales (e.g., `\"category10\"` or `\"blues\"`).\n\nFor the full list of supported schemes, please refer to the [Vega Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "SecondaryFieldDef": { + "additionalProperties": false, + "description": "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`.", + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bin": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", + "type": "null" + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "SelectionConfig": { + "additionalProperties": false, + "properties": { + "interval": { + "$ref": "#/definitions/IntervalSelectionConfig", + "description": "The default definition for an [`interval`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All properties and transformations\nfor an interval selection definition (except `type`) may be specified here.\n\nFor instance, setting `interval` to `{\"translate\": false}` disables the ability to move\ninterval selections by default." + }, + "multi": { + "$ref": "#/definitions/MultiSelectionConfig", + "description": "The default definition for a [`multi`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All properties and transformations\nfor a multi selection definition (except `type`) may be specified here.\n\nFor instance, setting `multi` to `{\"toggle\": \"event.altKey\"}` adds additional values to\nmulti selections when clicking with the alt-key pressed by default." + }, + "single": { + "$ref": "#/definitions/SingleSelectionConfig", + "description": "The default definition for a [`single`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All properties and transformations\n for a single selection definition (except `type`) may be specified here.\n\nFor instance, setting `single` to `{\"on\": \"dblclick\"}` populates single selections on double-click by default." + } + }, + "type": "object" + }, + "SelectionDef": { + "anyOf": [ + { + "$ref": "#/definitions/SingleSelection" + }, + { + "$ref": "#/definitions/MultiSelection" + }, + { + "$ref": "#/definitions/IntervalSelection" + } + ] + }, + "SelectionDomain": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "The field name to extract selected values for, when a selection is [projected](https://vega.github.io/vega-lite/docs/project.html)\nover multiple fields or encodings." + }, + "selection": { + "description": "The name of a selection.", + "type": "string" + } + }, + "required": [ + "selection" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "encoding": { + "description": "The encoding channel to extract selected values for, when a selection is [projected](https://vega.github.io/vega-lite/docs/project.html)\nover multiple fields or encodings.", + "type": "string" + }, + "selection": { + "description": "The name of a selection.", + "type": "string" + } + }, + "required": [ + "selection" + ], + "type": "object" + } + ] + }, + "SelectionInit": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "$ref": "#/definitions/DateTime" + } + ] + }, + "SelectionInitInterval": { + "anyOf": [ + { + "items": [ + { + "type": "boolean" + }, + { + "type": "boolean" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + { + "items": [ + { + "type": "number" + }, + { + "type": "number" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + { + "items": [ + { + "type": "string" + }, + { + "type": "string" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + { + "items": [ + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/DateTime" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + } + ] + }, + "SelectionInitIntervalMapping": { + "additionalProperties": { + "$ref": "#/definitions/SelectionInitInterval" + }, + "type": "object" + }, + "SelectionInitMapping": { + "additionalProperties": { + "$ref": "#/definitions/SelectionInit" + }, + "type": "object" + }, + "SelectionPredicate": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionOperand", + "description": "Filter using a selection name." + } + }, + "required": [ + "selection" + ], + "type": "object" + }, + "SelectionResolution": { + "enum": [ + "global", + "union", + "intersect" + ], + "type": "string" + }, + "SequenceGenerator": { + "additionalProperties": false, + "properties": { + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + }, + "sequence": { + "$ref": "#/definitions/SequenceParams", + "description": "Generate a sequence of numbers." + } + }, + "required": [ + "sequence" + ], + "type": "object" + }, + "SequenceParams": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The name of the generated sequence field.\n\n__Default value:__ `\"data\"`" + }, + "start": { + "description": "The starting value of the sequence (inclusive).", + "type": "number" + }, + "step": { + "description": "The step value between sequence entries.\n\n__Default value:__ `1`", + "type": "number" + }, + "stop": { + "description": "The ending value of the sequence (exclusive).", + "type": "number" + } + }, + "required": [ + "start", + "stop" + ], + "type": "object" + }, + "ShapeFieldDefWithCondition": { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + "ShapeValueDefWithCondition": { + "$ref": "#/definitions/StringValueDefWithCondition" + }, + "SignalRef": { + "additionalProperties": false, + "properties": { + "signal": { + "type": "string" + } + }, + "required": [ + "signal" + ], + "type": "object" + }, + "SingleDefUnitChannel": { + "enum": [ + "x", + "y", + "x2", + "y2", + "longitude", + "latitude", + "longitude2", + "latitude2", + "color", + "fill", + "stroke", + "opacity", + "fillOpacity", + "strokeOpacity", + "strokeWidth", + "size", + "shape", + "key", + "text", + "tooltip", + "href" + ], + "type": "string" + }, + "SingleSelection": { + "additionalProperties": false, + "properties": { + "bind": { + "anyOf": [ + { + "$ref": "#/definitions/Binding" + }, + { + "additionalProperties": { + "$ref": "#/definitions/Binding" + }, + "type": "object" + } + ], + "description": "Establish a two-way binding between a single selection and input elements\n(also known as dynamic query widgets). A binding takes the form of\nVega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind)\nor can be a mapping between projected field/encodings and binding definitions.\n\n__See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation." + }, + "clear": { + "anyOf": [ + { + "$ref": "#/definitions/EventStream" + }, + { + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. Can be an\n[EventStream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + }, + "empty": { + "description": "By default, `all` data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.", + "enum": [ + "all", + "none" + ], + "type": "string" + }, + "encodings": { + "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/SingleDefUnitChannel" + }, + "type": "array" + }, + "fields": { + "description": "An array of field names whose values must match for a data tuple to\nfall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "init": { + "$ref": "#/definitions/SelectionInitMapping", + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and initial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation." + }, + "nearest": { + "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\n__See also:__ [`nearest`](https://vega.github.io/vega-lite/docs/nearest.html) documentation.", + "type": "boolean" + }, + "on": { + "$ref": "#/definitions/EventStream", + "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters)." + }, + "resolve": { + "$ref": "#/definitions/SelectionResolution", + "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + }, + "type": { + "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports three selection types:\n\n- `single` -- to select a single discrete data value on `click`.\n- `multi` -- to select multiple discrete data value; the first value is selected on `click` and additional values toggled on shift-`click`.\n- `interval` -- to select a continuous range of data values on `drag`.", + "enum": [ + "single" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "SingleSelectionConfig": { + "additionalProperties": false, + "properties": { + "bind": { + "anyOf": [ + { + "$ref": "#/definitions/Binding" + }, + { + "additionalProperties": { + "$ref": "#/definitions/Binding" + }, + "type": "object" + } + ], + "description": "Establish a two-way binding between a single selection and input elements\n(also known as dynamic query widgets). A binding takes the form of\nVega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind)\nor can be a mapping between projected field/encodings and binding definitions.\n\n__See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation." + }, + "clear": { + "anyOf": [ + { + "$ref": "#/definitions/EventStream" + }, + { + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. Can be an\n[EventStream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + }, + "empty": { + "description": "By default, `all` data values are considered to lie within an empty selection.\nWhen set to `none`, empty selections contain no data values.", + "enum": [ + "all", + "none" + ], + "type": "string" + }, + "encodings": { + "description": "An array of encoding channels. The corresponding data field values\nmust match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/SingleDefUnitChannel" + }, + "type": "array" + }, + "fields": { + "description": "An array of field names whose values must match for a data tuple to\nfall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "init": { + "$ref": "#/definitions/SelectionInitMapping", + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and initial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation." + }, + "nearest": { + "description": "When true, an invisible voronoi diagram is computed to accelerate discrete\nselection. The data value _nearest_ the mouse cursor is added to the selection.\n\n__See also:__ [`nearest`](https://vega.github.io/vega-lite/docs/nearest.html) documentation.", + "type": "boolean" + }, + "on": { + "$ref": "#/definitions/EventStream", + "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection.\nFor interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters)." + }, + "resolve": { + "$ref": "#/definitions/SelectionResolution", + "description": "With layered and multi-view displays, a strategy that determines how\nselections' data queries are resolved when applied in a filter transform,\nconditional encoding rule, or scale domain.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + } + }, + "type": "object" + }, + "SingleTimeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/LocalSingleTimeUnit" + }, + { + "$ref": "#/definitions/UtcSingleTimeUnit" + } + ] + }, + "Sort": { + "anyOf": [ + { + "$ref": "#/definitions/SortArray" + }, + { + "$ref": "#/definitions/SortOrder" + }, + { + "$ref": "#/definitions/EncodingSortField" + }, + { + "$ref": "#/definitions/SortByEncoding" + }, + { + "type": "null" + } + ] + }, + "SortArray": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + } + ] + }, + "SortByEncoding": { + "additionalProperties": false, + "properties": { + "encoding": { + "$ref": "#/definitions/SingleDefUnitChannel", + "description": "The [encoding channel](https://vega.github.io/vega-lite/docs/encoding.html#channels) to sort by (e.g., `\"x\"`, `\"y\"`)" + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/SortOrder" + }, + { + "type": "null" + } + ], + "description": "The sort order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." + } + }, + "required": [ + "encoding" + ], + "type": "object" + }, + "SortField": { + "additionalProperties": false, + "description": "A sort definition for transform", + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "The name of the field to sort." + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/SortOrder" + }, + { + "type": "null" + } + ], + "description": "Whether to sort the field in ascending or descending order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." + } + }, + "required": [ + "field" + ], + "type": "object" + }, + "SortOrder": { + "enum": [ + "ascending", + "descending" + ], + "type": "string" + }, + "SphereGenerator": { + "additionalProperties": false, + "properties": { + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + }, + "sphere": { + "anyOf": [ + { + "enum": [ + true + ], + "type": "boolean" + }, + { + "additionalProperties": false, + "type": "object" + } + ], + "description": "Generate sphere GeoJSON data for the full globe." + } + }, + "required": [ + "sphere" + ], + "type": "object" + }, + "StackOffset": { + "enum": [ + "zero", + "center", + "normalize" + ], + "type": "string" + }, + "StackTransform": { + "additionalProperties": false, + "properties": { + "as": { + "anyOf": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + } + ], + "description": "Output field names. This can be either a string or an array of strings with\ntwo elements denoting the name for the fields for stack start and stack end\nrespectively.\nIf a single string(eg.\"val\") is provided, the end field will be \"val_end\"." + }, + "groupby": { + "description": "The data fields to group by.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "offset": { + "description": "Mode for stacking marks.\n__Default value:__ `\"zero\"`", + "enum": [ + "zero", + "center", + "normalize" + ], + "type": "string" + }, + "sort": { + "description": "Field that determines the order of leaves in the stacked charts.", + "items": { + "$ref": "#/definitions/SortField" + }, + "type": "array" + }, + "stack": { + "$ref": "#/definitions/FieldName", + "description": "The field which is stacked." + } + }, + "required": [ + "stack", + "groupby", + "as" + ], + "type": "object" + }, + "StandardType": { + "enum": [ + "quantitative", + "ordinal", + "temporal", + "nominal" + ], + "type": "string" + }, + "StringFieldDefWithCondition": { + "$ref": "#/definitions/FieldDefWithCondition,(string|null)>" + }, + "StringFieldDefWithCondition": { + "$ref": "#/definitions/FieldDefWithCondition" + }, + "StringValueDefWithCondition": { + "$ref": "#/definitions/ValueDefWithCondition,(string|null)>" + }, + "StringValueDefWithCondition": { + "$ref": "#/definitions/ValueDefWithCondition" + }, + "StrokeCap": { + "enum": [ + "butt", + "round", + "square" + ], + "type": "string" + }, + "StrokeJoin": { + "enum": [ + "miter", + "round", + "bevel" + ], + "type": "string" + }, + "StyleConfigIndex": { + "additionalProperties": { + "$ref": "#/definitions/BaseMarkConfig" + }, + "type": "object" + }, + "SymbolShape": { + "type": "string" + }, + "TextBaseline": { + "anyOf": [ + { + "enum": [ + "alphabetic" + ], + "type": "string" + }, + { + "$ref": "#/definitions/Baseline" + } + ] + }, + "TextConfig": { + "additionalProperties": false, + "properties": { + "align": { + "$ref": "#/definitions/Align", + "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`." + }, + "angle": { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + "baseline": { + "$ref": "#/definitions/TextBaseline", + "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`" + }, + "color": { + "$ref": "#/definitions/Color", + "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `color`.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config)." + }, + "cornerRadius": { + "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", + "type": "number" + }, + "cursor": { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + "dir": { + "$ref": "#/definitions/Dir", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + "dx": { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "dy": { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "ellipsis": { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + "fill": { + "$ref": "#/definitions/Color", + "description": "Default Fill Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for `point`, `line` and `rule`; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + "fontSize": { + "description": "The font size, in pixels.", + "type": "number" + }, + "fontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + "fontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "height": { + "description": "Height of the marks.", + "type": "number" + }, + "href": { + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", + "format": "uri", + "type": "string" + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "limit": { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit", + "type": "number" + }, + "opacity": { + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." + }, + "radius": { + "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", + "minimum": 0, + "type": "number" + }, + "shape": { + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- 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.)\n\n__Default value:__ `\"circle\"`", + "type": "string" + }, + "shortTimeLabels": { + "description": "Whether month names and weekday names should be abbreviated.", + "type": "boolean" + }, + "size": { + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. For example: in the case of circles, the radius is determined in part by the square root of the size value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__ `30` for point, circle, square marks; `rangeStep` - 1 for bar marks with discrete dimensions; `5` for bar marks with continuous dimensions; `11` for text marks.", + "minimum": 0, + "type": "number" + }, + "stroke": { + "$ref": "#/definitions/Color", + "description": "Default Stroke Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "strokeCap": { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"square\"`" + }, + "strokeDash": { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "strokeDashOffset": { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + "strokeJoin": { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + "strokeMiterLimit": { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + "strokeOpacity": { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "strokeWidth": { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + "tension": { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "text": { + "description": "Placeholder text if the `text` channel is not specified", + "type": "string" + }, + "theta": { + "description": "Polar coordinate angle, in radians, of the text label from the origin determined by 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\".", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/Value" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null`, then no tooltip will be used." + }, + "width": { + "description": "Width of the marks.", + "type": "number" + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "height" + ], + "type": "string" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "TextFieldDef": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "binned" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "format": { + "description": "The text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format.", + "type": "string" + }, + "formatType": { + "description": "The format type for labels (`\"number\"` or `\"time\"`).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nomimal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nomimal fields without `timeUnit`.", + "enum": [ + "number", + "time" + ], + "type": "string" + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\n- 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`).\n- 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.\n- 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).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- 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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "TextFieldDefWithCondition": { + "$ref": "#/definitions/FieldDefWithCondition" + }, + "TextValueDefWithCondition": { + "$ref": "#/definitions/ValueDefWithCondition" + }, + "TickConfig": { + "additionalProperties": false, + "properties": { + "align": { + "$ref": "#/definitions/Align", + "description": "The horizontal alignment of the text. One of `\"left\"`, `\"right\"`, `\"center\"`." + }, + "angle": { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + "bandSize": { + "description": "The width of the ticks.\n\n__Default value:__ 3/4 of rangeStep.", + "minimum": 0, + "type": "number" + }, + "baseline": { + "$ref": "#/definitions/TextBaseline", + "description": "The vertical alignment of the text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Default value:__ `\"middle\"`" + }, + "color": { + "$ref": "#/definitions/Color", + "description": "Default color. Note that `fill` and `stroke` have higher precedence than `color` and will override `color`.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config)." + }, + "cornerRadius": { + "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", + "type": "number" + }, + "cursor": { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + "dir": { + "$ref": "#/definitions/Dir", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + "dx": { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "dy": { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "ellipsis": { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + "fill": { + "$ref": "#/definitions/Color", + "description": "Default Fill Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for `point`, `line` and `rule`; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + "fontSize": { + "description": "The font size, in pixels.", + "type": "number" + }, + "fontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + "fontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "The font weight.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "height": { + "description": "Height of the marks.", + "type": "number" + }, + "href": { + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink.", + "format": "uri", + "type": "string" + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "limit": { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit", + "type": "number" + }, + "opacity": { + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts.\nThe value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick\nshould be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line\nif `config.sortLineBy` is not specified.\nFor stacked charts, this is always determined by the orientation of the stack;\ntherefore explicitly specified value will be ignored." + }, + "radius": { + "description": "Polar coordinate radial offset, in pixels, of the text label from the origin determined by the `x` and `y` properties.", + "minimum": 0, + "type": "number" + }, + "shape": { + "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- 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.)\n\n__Default value:__ `\"circle\"`", + "type": "string" + }, + "size": { + "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. For example: in the case of circles, the radius is determined in part by the square root of the size value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__ `30` for point, circle, square marks; `rangeStep` - 1 for bar marks with discrete dimensions; `5` for bar marks with continuous dimensions; `11` for text marks.", + "minimum": 0, + "type": "number" + }, + "stroke": { + "$ref": "#/definitions/Color", + "description": "Default Stroke Color. This has higher precedence than `config.color`\n\n__Default value:__ (None)" + }, + "strokeCap": { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"square\"`" + }, + "strokeDash": { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "strokeDashOffset": { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + "strokeJoin": { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + "strokeMiterLimit": { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + "strokeOpacity": { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "strokeWidth": { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + "tension": { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "text": { + "description": "Placeholder text if the `text` channel is not specified", + "type": "string" + }, + "theta": { + "description": "Polar coordinate angle, in radians, of the text label from the origin determined by 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\".", + "type": "number" + }, + "thickness": { + "description": "Thickness of the tick mark.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/Value" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null`, then no tooltip will be used." + }, + "width": { + "description": "Width of the marks.", + "type": "number" + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "height" + ], + "type": "string" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "TimeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/SingleTimeUnit" + }, + { + "$ref": "#/definitions/MultiTimeUnit" + } + ] + }, + "TimeUnitTransform": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The output field to write the timeUnit value." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "The data field to apply time unit." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "The timeUnit." + } + }, + "required": [ + "timeUnit", + "field", + "as" + ], + "type": "object" + }, + "TitleAnchor": { + "enum": [ + null, + "start", + "middle", + "end" + ], + "type": [ + "null", + "string" + ] + }, + "TitleConfig": { + "$ref": "#/definitions/BaseTitleConfig" + }, + "TitleFrame": { + "enum": [ + "bounds", + "group" + ], + "type": "string" + }, + "TitleOrient": { + "enum": [ + "none", + "left", + "right", + "top", + "bottom" + ], + "type": "string" + }, + "TitleParams": { + "additionalProperties": false, + "properties": { + "align": { + "$ref": "#/definitions/Align" + }, + "anchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "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.\n\n__Default value:__ `\"middle\"` for [single](https://vega.github.io/vega-lite/docs/spec.html) and [layered](https://vega.github.io/vega-lite/docs/layer.html) views.\n`\"start\"` for other composite views.\n\n__Note:__ [For now](https://github.com/vega/vega-lite/issues/2875), `anchor` is only customizable only for [single](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": { + "description": "Angle in degrees of title text.", + "type": "number" + }, + "baseline": { + "$ref": "#/definitions/TextBaseline", + "description": "Vertical text baseline for title text. One of `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`." + }, + "color": { + "$ref": "#/definitions/Color", + "description": "Text color for title text." + }, + "dx": { + "description": "Delta offset for title text x-coordinate.", + "type": "number" + }, + "dy": { + "description": "Delta offset for title text y-coordinate.", + "type": "number" + }, + "font": { + "description": "Font name for title text.", + "type": "string" + }, + "fontSize": { + "description": "Font size in pixels for title text.\n\n__Default value:__ `10`.", + "minimum": 0, + "type": "number" + }, + "fontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "Font style for title text." + }, + "fontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "Font weight for title text.\nThis can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." + }, + "frame": { + "$ref": "#/definitions/TitleFrame", + "description": "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": { + "description": "The maximum allowed length in pixels of legend labels.", + "minimum": 0, + "type": "number" + }, + "offset": { + "description": "The orthogonal offset in pixels by which to displace the title from its position along the edge of the chart.", + "type": "number" + }, + "orient": { + "$ref": "#/definitions/TitleOrient", + "description": "Default title orientation (`\"top\"`, `\"bottom\"`, `\"left\"`, or `\"right\"`)" + }, + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "A [mark style property](https://vega.github.io/vega-lite/docs/config.html#style) to apply to the title text mark.\n\n__Default value:__ `\"group-title\"`." + }, + "text": { + "description": "The title text.", + "type": "string" + }, + "zindex": { + "description": "The integer z-index indicating the layering of the title group relative to other axis, mark and legend groups.\n\n__Default value:__ `0`.", + "minimum": 0, + "type": "number" + } + }, + "required": [ + "text" + ], + "type": "object" + }, + "TooltipContent": { + "additionalProperties": false, + "properties": { + "content": { + "enum": [ + "encoding", + "data" + ], + "type": "string" + } + }, + "required": [ + "content" + ], + "type": "object" + }, + "TopLevelConcatSpec": { + "additionalProperties": false, + "properties": { + "$schema": { + "description": "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/v3.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns.\nThe supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "Sets how the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`" + }, + "background": { + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ none (transparent)", + "type": "string" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to\n`hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "concat": { + "description": "A list of views to be concatenated.", + "items": { + "$ref": "#/definitions/Spec" + }, + "type": "array" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "$ref": "#/definitions/Datasets", + "description": "A global data store for named datasets. This is a mapping from names to inline datasets.\nThis 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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "$ref": "#/definitions/Padding", + "description": "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.\nIf 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.\n\n__Default value__: `5`" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent spacing values for rows and columns.\n\n__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": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", + "type": "object" + } + }, + "required": [ + "concat" + ], + "type": "object" + }, + "TopLevelHConcatSpec": { + "additionalProperties": false, + "properties": { + "$schema": { + "description": "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/v3.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "Sets how the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`" + }, + "background": { + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ none (transparent)", + "type": "string" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "$ref": "#/definitions/Datasets", + "description": "A global data store for named datasets. This is a mapping from names to inline datasets.\nThis 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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "hconcat": { + "description": "A list of views to be concatenated and put into a row.", + "items": { + "$ref": "#/definitions/Spec" + }, + "type": "array" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "$ref": "#/definitions/Padding", + "description": "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.\nIf 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.\n\n__Default value__: `5`" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", + "type": "object" + } + }, + "required": [ + "hconcat" + ], + "type": "object" + }, + "TopLevelRepeatSpec": { + "additionalProperties": false, + "properties": { + "$schema": { + "description": "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/v3.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns.\nThe supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "Sets how the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`" + }, + "background": { + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ none (transparent)", + "type": "string" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to\n`hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "$ref": "#/definitions/Datasets", + "description": "A global data store for named datasets. This is a mapping from names to inline datasets.\nThis 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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "$ref": "#/definitions/Padding", + "description": "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.\nIf 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.\n\n__Default value__: `5`" + }, + "repeat": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/definitions/RepeatMapping" + } + ], + "description": "Definition for fields to be repeated. One of:\n1) An array of fields to be repeated. If `\"repeat\"` is an array, the field can be referred using `{\"repeat\": \"repeat\"}`\n2) An object that mapped `\"row\"` and/or `\"column\"` to the listed of 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." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent spacing values for rows and columns.\n\n__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)" + }, + "spec": { + "$ref": "#/definitions/Spec", + "description": "A specification of the view that gets repeated." + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", + "type": "object" + } + }, + "required": [ + "repeat", + "spec" + ], + "type": "object" + }, + "TopLevelVConcatSpec": { + "additionalProperties": false, + "properties": { + "$schema": { + "description": "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/v3.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "Sets how the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`" + }, + "background": { + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ none (transparent)", + "type": "string" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "$ref": "#/definitions/Datasets", + "description": "A global data store for named datasets. This is a mapping from names to inline datasets.\nThis 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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "$ref": "#/definitions/Padding", + "description": "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.\nIf 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.\n\n__Default value__: `5`" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", + "type": "object" + }, + "vconcat": { + "description": "A list of views to be concatenated and put into a column.", + "items": { + "$ref": "#/definitions/Spec" + }, + "type": "array" + } + }, + "required": [ + "vconcat" + ], + "type": "object" + }, + "TopLevelLayerSpec": { + "additionalProperties": false, + "properties": { + "$schema": { + "description": "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/v3.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "Sets how the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`" + }, + "background": { + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ none (transparent)", + "type": "string" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "$ref": "#/definitions/Datasets", + "description": "A global data store for named datasets. This is a mapping from names to inline datasets.\nThis 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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/Encoding", + "description": "A shared key-value mapping between encoding channels and definition of fields in the underlying layers." + }, + "height": { + "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\n\n__Note__: For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + }, + "layer": { + "description": "Layer or single view specifications to be layered.\n\n__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.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/UnitSpec" + } + ] + }, + "type": "array" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "$ref": "#/definitions/Padding", + "description": "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.\nIf 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.\n\n__Default value__: `5`" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "An object defining properties of the geographic projection shared by underlying layers." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", + "type": "object" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its x-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the width is [determined by the range step, paddings, and the cardinality of the field mapped to x-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height) for `text` mark and the value of `rangeStep` for other marks.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + } + }, + "required": [ + "layer" + ], + "type": "object" + }, + "TopLevelFacetSpec": { + "additionalProperties": false, + "properties": { + "$schema": { + "description": "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/v3.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns.\nThe supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "Sets how the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`" + }, + "background": { + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ none (transparent)", + "type": "string" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to\n`hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "$ref": "#/definitions/Datasets", + "description": "A global data store for named datasets. This is a mapping from names to inline datasets.\nThis 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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "facet": { + "anyOf": [ + { + "$ref": "#/definitions/FacetFieldDef" + }, + { + "$ref": "#/definitions/FacetMapping" + } + ], + "description": "Definition for how to facet the data. One of:\n1) [a field definition for faceting the plot by one field](https://vega.github.io/vega-lite/docs/facet.html#field-def)\n2) [An object that maps `row` and `column` channels to their field definitions](https://vega.github.io/vega-lite/docs/facet.html#mapping)" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "$ref": "#/definitions/Padding", + "description": "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.\nIf 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.\n\n__Default value__: `5`" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent spacing values for rows and columns.\n\n__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)" + }, + "spec": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/FacetedUnitSpec" + } + ], + "description": "A specification of the view that gets faceted." + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", + "type": "object" + } + }, + "required": [ + "data", + "facet", + "spec" + ], + "type": "object" + }, + "TopLevelSpec": { + "anyOf": [ + { + "$ref": "#/definitions/TopLevelUnitSpec" + }, + { + "$ref": "#/definitions/TopLevelFacetSpec" + }, + { + "$ref": "#/definitions/TopLevelLayerSpec" + }, + { + "$ref": "#/definitions/TopLevelRepeatSpec" + }, + { + "$ref": "#/definitions/TopLevelConcatSpec" + }, + { + "$ref": "#/definitions/TopLevelVConcatSpec" + }, + { + "$ref": "#/definitions/TopLevelHConcatSpec" + } + ], + "description": "A Vega-Lite top-level specification.\nThis is the root class for all Vega-Lite specifications.\n(The json schema is generated from this type.)" + }, + "TopLevelUnitSpec": { + "additionalProperties": false, + "properties": { + "$schema": { + "description": "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/v3.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns.\nThe supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "Sets how the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`.\nObject values can additionally specify parameters for content sizing and automatic resizing.\n`\"fit\"` is only supported for single and layered views that don't use `rangeStep`.\n\n__Default value__: `pad`" + }, + "background": { + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ none (transparent)", + "type": "string" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to\n`hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "$ref": "#/definitions/Datasets", + "description": "A global data store for named datasets. This is a mapping from names to inline datasets.\nThis 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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/FacetedEncoding", + "description": "A key-value mapping between encoding channels and definition of fields." + }, + "height": { + "description": "The height of a visualization.\n\n__Default value:__\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its y-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For y-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the height is [determined by the range step, paddings, and the cardinality of the field mapped to y-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the height will be the value of [`config.view.height`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `y` channel, the `height` will be the value of `rangeStep`.\n\n__Note__: For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + }, + "mark": { + "$ref": "#/definitions/AnyMark", + "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`,\n`\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "$ref": "#/definitions/Padding", + "description": "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.\nIf 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.\n\n__Default value__: `5`" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "An object defining properties of geographic projection, which will be applied to `shape` path for `\"geoshape\"` marks\nand to `latitude` and `\"longitude\"` channels for other marks." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "selection": { + "additionalProperties": { + "$ref": "#/definitions/SelectionDef" + }, + "description": "A key-value mapping between selection names and definitions.", + "type": "object" + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The spacing in pixels between sub-views of the composition operator.\nAn object of the form `{\"row\": number, \"column\": number}` can be used to set\ndifferent spacing values for rows and columns.\n\n__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": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "description": "Optional metadata that will be passed to Vega.\nThis object is completely ignored by Vega and Vega-Lite and can be used for custom metadata.", + "type": "object" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "description": "The width of a visualization.\n\n__Default value:__ This will be determined by the following rules:\n\n- If a view's [`autosize`](https://vega.github.io/vega-lite/docs/size.html#autosize) type is `\"fit\"` or its x-channel has a [continuous scale](https://vega.github.io/vega-lite/docs/scale.html#continuous), the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- For x-axis with a band or point scale: if [`rangeStep`](https://vega.github.io/vega-lite/docs/scale.html#band) is a numeric value or unspecified, the width is [determined by the range step, paddings, and the cardinality of the field mapped to x-channel](https://vega.github.io/vega-lite/docs/scale.html#band). Otherwise, if the `rangeStep` is `null`, the width will be the value of [`config.view.width`](https://vega.github.io/vega-lite/docs/spec.html#config).\n- If no field is mapped to `x` channel, the `width` will be the value of [`config.scale.textXRangeStep`](https://vega.github.io/vega-lite/docs/size.html#default-width-and-height) for `text` mark and the value of `rangeStep` for other marks.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view.\n\n__See also:__ The documentation for [width and height](https://vega.github.io/vega-lite/docs/size.html) contains more examples.", + "type": "number" + } + }, + "required": [ + "data", + "mark" + ], + "type": "object" + }, + "TopoDataFormat": { + "additionalProperties": false, + "properties": { + "feature": { + "description": "The name of the TopoJSON object set to convert to a GeoJSON feature collection.\nFor example, in a map of the world, there may be an object set named `\"countries\"`.\nUsing the feature property, we can extract this set and generate a GeoJSON feature object for each country.", + "type": "string" + }, + "mesh": { + "description": "The name of the TopoJSON object set to convert to mesh.\nSimilar to the `feature` option, `mesh` extracts a named TopoJSON object set.\n Unlike the `feature` option, the corresponding geo data is returned as a single, unified mesh instance, not as individual GeoJSON features.\nExtracting 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.", + "type": "string" + }, + "parse": { + "anyOf": [ + { + "$ref": "#/definitions/Parse" + }, + { + "type": "null" + } + ], + "description": "If set to `null`, disable type inference based on the spec and only use type inference based on the data.\nAlternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `\"number\"`, `\"boolean\"`, `\"date\"`, or null (do not parse the field)).\nFor example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each input record a Date value.\n\nFor `\"date\"`, we parse data based using Javascript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).\nFor Specific date formats can be provided (e.g., `{foo: \"date:'%m%d%Y'\"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). 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": { + "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL.\nIf no extension is detected, `\"json\"` will be used by default.", + "enum": [ + "topojson" + ], + "type": "string" + } + }, + "type": "object" + }, + "Transform": { + "anyOf": [ + { + "$ref": "#/definitions/AggregateTransform" + }, + { + "$ref": "#/definitions/BinTransform" + }, + { + "$ref": "#/definitions/CalculateTransform" + }, + { + "$ref": "#/definitions/FilterTransform" + }, + { + "$ref": "#/definitions/FlattenTransform" + }, + { + "$ref": "#/definitions/FoldTransform" + }, + { + "$ref": "#/definitions/ImputeTransform" + }, + { + "$ref": "#/definitions/JoinAggregateTransform" + }, + { + "$ref": "#/definitions/LookupTransform" + }, + { + "$ref": "#/definitions/TimeUnitTransform" + }, + { + "$ref": "#/definitions/SampleTransform" + }, + { + "$ref": "#/definitions/StackTransform" + }, + { + "$ref": "#/definitions/WindowTransform" + } + ] + }, + "TypeForShape": { + "enum": [ + "nominal", + "ordinal", + "geojson" + ], + "type": "string" + }, + "TypedFieldDef": { + "additionalProperties": false, + "description": "Definition object for a data field, its type and transformation of an encoding channel.", + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field\n(e.g., `mean`, `sum`, `median`, `min`, `max`, `count`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "enum": [ + "binned" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__Required.__ A string defining the name of the field from which to pull a data value\nor an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__\n1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`).\nIf field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`).\nSee more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html).\n2) `field` is not required if `aggregate` is `count`." + }, + "timeUnit": { + "$ref": "#/definitions/TimeUnit", + "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field.\nor [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used.", + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "The encoded field's type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`).\nIt can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\n\n__Note:__\n\n- 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`).\n- 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.\n- 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).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- 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\", \"type\": \"quantitative\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "UnitSpec": { + "$ref": "#/definitions/GenericUnitSpec", + "description": "A unit specification, which can contain either [primitive marks or composite marks](https://vega.github.io/vega-lite/docs/mark.html#types)." + }, + "UrlData": { + "additionalProperties": false, + "properties": { + "format": { + "$ref": "#/definitions/DataFormat", + "description": "An object that specifies the format for parsing the data." + }, + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + }, + "url": { + "description": "An URL from which to load the data set. Use the `format.type` property\nto ensure the loaded data is correctly parsed.", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "UtcMultiTimeUnit": { + "enum": [ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds" + ], + "type": "string" + }, + "UtcSingleTimeUnit": { + "enum": [ + "utcyear", + "utcquarter", + "utcmonth", + "utcday", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds" + ], + "type": "string" + }, + "Value": { + "type": [ + "number", + "string", + "boolean", + "null" + ] + }, + "YValueDef": { + "additionalProperties": false, + "description": "Definition object for a constant value of an encoding channel.", + "properties": { + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "height" + ], + "type": "string" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "XValueDef": { + "additionalProperties": false, + "description": "Definition object for a constant value of an encoding channel.", + "properties": { + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "enum": [ + "width" + ], + "type": "string" + } + ], + "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity)." + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "NumberValueDef": { + "additionalProperties": false, + "description": "Definition object for a constant value of an encoding channel.", + "properties": { + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity).", + "type": "number" + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "ValueDefWithCondition": { + "additionalProperties": false, + "description": "A ValueDef with Condition where either the condition or the value are optional.\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}", + "minProperties": 1, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldDef" + }, + { + "$ref": "#/definitions/ConditionalStringValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalStringValueDef" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity).", + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "ValueDefWithCondition": { + "additionalProperties": false, + "description": "A ValueDef with Condition where either the condition or the value are optional.\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}", + "minProperties": 1, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldDef" + }, + { + "$ref": "#/definitions/ConditionalNumberValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalNumberValueDef" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity).", + "type": "number" + } + }, + "type": "object" + }, + "ValueDefWithCondition,(string|null)>": { + "additionalProperties": false, + "description": "A ValueDef with Condition where either the condition or the value are optional.\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}", + "minProperties": 1, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldDef" + }, + { + "$ref": "#/definitions/ConditionalStringValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalStringValueDef" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + }, + "value": { + "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity).", + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "ValueDefWithCondition": { + "additionalProperties": false, + "description": "A ValueDef with Condition where either the condition or the value are optional.\n{\n condition: {field: ...} | {value: ...},\n value: ...,\n}", + "minProperties": 1, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalTextFieldDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + }, + "value": { + "$ref": "#/definitions/Value", + "description": "A constant value in visual domain (e.g., `\"red\"` / \"#0099ff\" for color, values between `0` to `1` for opacity)." + } + }, + "type": "object" + }, + "ViewBackground": { + "additionalProperties": false, + "properties": { + "cornerRadius": { + "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", + "type": "number" + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "type": "null" + } + ], + "description": "The fill color.\n\n__Default value:__ `undefined`" + }, + "fillOpacity": { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "opacity": { + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "type": "null" + } + ], + "description": "The stroke color.\n\n__Default value:__ `\"#ddd\"`" + }, + "strokeCap": { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"square\"`" + }, + "strokeDash": { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "strokeDashOffset": { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + "strokeJoin": { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + "strokeMiterLimit": { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + "strokeOpacity": { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "strokeWidth": { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "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](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is an array, later styles will override earlier styles.\n\n__Default value:__ `\"cell\"`\n__Note:__ Any specified view background properties will augment the default style." + } + }, + "type": "object" + }, + "ViewConfig": { + "additionalProperties": false, + "properties": { + "clip": { + "description": "Whether the view should be clipped.", + "type": "boolean" + }, + "cornerRadius": { + "description": "The radius in pixels of rounded rectangle corners.\n\n__Default value:__ `0`", + "type": "number" + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "type": "null" + } + ], + "description": "The fill color.\n\n__Default value:__ `undefined`" + }, + "fillOpacity": { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "height": { + "description": "The default height of the single plot or each plot in a trellis plot when the visualization has a continuous (non-ordinal) y-scale with `rangeStep` = `null`.\n\n__Default value:__ `200`", + "type": "number" + }, + "opacity": { + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "type": "null" + } + ], + "description": "The stroke color.\n\n__Default value:__ `\"#ddd\"`" + }, + "strokeCap": { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"square\"`" + }, + "strokeDash": { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "strokeDashOffset": { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + "strokeJoin": { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + "strokeMiterLimit": { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + "strokeOpacity": { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "strokeWidth": { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + "width": { + "description": "The default width of the single plot or each plot in a trellis plot when the visualization has a continuous (non-ordinal) x-scale or ordinal x-scale with `rangeStep` = `null`.\n\n__Default value:__ `200`", + "type": "number" + } + }, + "type": "object" + }, + "WindowFieldDef": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The output name for the window operation." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "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`." + }, + "op": { + "anyOf": [ + { + "$ref": "#/definitions/AggregateOp" + }, + { + "$ref": "#/definitions/WindowOnlyOp" + } + ], + "description": "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)." + }, + "param": { + "description": "Parameter values for the window functions. Parameter values can be omitted for operations that do not accept a parameter.\n\nSee the list of all supported operations and their parameters [here](https://vega.github.io/vega-lite/docs/transforms/window.html).", + "type": "number" + } + }, + "required": [ + "op", + "as" + ], + "type": "object" + }, + "WindowOnlyOp": { + "enum": [ + "row_number", + "rank", + "dense_rank", + "percent_rank", + "cume_dist", + "ntile", + "lag", + "lead", + "first_value", + "last_value", + "nth_value" + ], + "type": "string" + }, + "WindowTransform": { + "additionalProperties": false, + "properties": { + "frame": { + "description": "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 following the current data object. The default value is `[null, 0]`, indicating that the sliding window includes the current object and all preceding objects. The value `[-5, 5]` indicates that the window should include five objects preceding and five objects following the current object. Finally, `[null, null]` indicates that the window frame should always include all data objects. If you this frame and want to assign the same value to add objects, you can use the simpler [join aggregate transform](https://vega.github.io/vega-lite/docs/joinaggregate.html). The only operators affected are the aggregation operations and the `first_value`, `last_value`, and `nth_value` window operations. The other window operations are not affected by this.\n\n__Default value:__: `[null, 0]` (includes the current object and all preceding objects)", + "items": { + "type": [ + "null", + "number" + ] + }, + "type": "array" + }, + "groupby": { + "description": "The data fields for partitioning the data objects into separate windows. If unspecified, all data points will be in a single window.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "ignorePeers": { + "description": "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 defined by offset values only. This setting only affects those operations that depend on the window frame, namely aggregation operations and the first_value, last_value, and nth_value window operations.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "sort": { + "description": "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`).", + "items": { + "$ref": "#/definitions/SortField" + }, + "type": "array" + }, + "window": { + "description": "The definition of the fields in the window, and what calculations to use.", + "items": { + "$ref": "#/definitions/WindowFieldDef" + }, + "type": "array" + } + }, + "required": [ + "window" + ], + "type": "object" + } + } +} \ No newline at end of file diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/tests/__init__.py b/runtime/Lib/site-packages/altair/vegalite/v3/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_api.py b/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_api.py new file mode 100644 index 0000000000000000000000000000000000000000..489d8cf6735f4a0fb444839d9a497e24e9ecf15c --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_api.py @@ -0,0 +1,937 @@ +"""Unit tests for altair API""" + +import io +import json +import operator +import os +import tempfile + +import jsonschema +import pytest +import pandas as pd + +import altair.vegalite.v3 as alt +from altair.utils import AltairDeprecationWarning + +try: + import altair_saver # noqa: F401 +except ImportError: + altair_saver = None + + +def getargs(*args, **kwargs): + return args, kwargs + + +OP_DICT = { + "layer": operator.add, + "hconcat": operator.or_, + "vconcat": operator.and_, +} + + +def _make_chart_type(chart_type): + data = pd.DataFrame( + { + "x": [28, 55, 43, 91, 81, 53, 19, 87], + "y": [43, 91, 81, 53, 19, 87, 52, 28], + "color": list("AAAABBBB"), + } + ) + base = ( + alt.Chart(data) + .mark_point() + .encode( + x="x", + y="y", + color="color", + ) + ) + + if chart_type in ["layer", "hconcat", "vconcat", "concat"]: + func = getattr(alt, chart_type) + return func(base.mark_square(), base.mark_circle()) + elif chart_type == "facet": + return base.facet("color") + elif chart_type == "facet_encoding": + return base.encode(facet="color") + elif chart_type == "repeat": + return base.encode(alt.X(alt.repeat(), type="quantitative")).repeat(["x", "y"]) + elif chart_type == "chart": + return base + else: + raise ValueError("chart_type='{}' is not recognized".format(chart_type)) + + +@pytest.fixture +def basic_chart(): + data = pd.DataFrame( + { + "a": ["A", "B", "C", "D", "E", "F", "G", "H", "I"], + "b": [28, 55, 43, 91, 81, 53, 19, 87, 52], + } + ) + + return alt.Chart(data).mark_bar().encode(x="a", y="b") + + +def test_chart_data_types(): + def Chart(data): + return alt.Chart(data).mark_point().encode(x="x:Q", y="y:Q") + + # Url Data + data = "/path/to/my/data.csv" + dct = Chart(data).to_dict() + assert dct["data"] == {"url": data} + + # Dict Data + data = {"values": [{"x": 1, "y": 2}, {"x": 2, "y": 3}]} + with alt.data_transformers.enable(consolidate_datasets=False): + dct = Chart(data).to_dict() + assert dct["data"] == data + + with alt.data_transformers.enable(consolidate_datasets=True): + dct = Chart(data).to_dict() + name = dct["data"]["name"] + assert dct["datasets"][name] == data["values"] + + # DataFrame data + data = pd.DataFrame({"x": range(5), "y": range(5)}) + with alt.data_transformers.enable(consolidate_datasets=False): + dct = Chart(data).to_dict() + assert dct["data"]["values"] == data.to_dict(orient="records") + + with alt.data_transformers.enable(consolidate_datasets=True): + dct = Chart(data).to_dict() + name = dct["data"]["name"] + assert dct["datasets"][name] == data.to_dict(orient="records") + + # Named data object + data = alt.NamedData(name="Foo") + dct = Chart(data).to_dict() + assert dct["data"] == {"name": "Foo"} + + +def test_chart_infer_types(): + data = pd.DataFrame( + { + "x": pd.date_range("2012", periods=10, freq="Y"), + "y": range(10), + "c": list("abcabcabca"), + } + ) + + def _check_encodings(chart): + dct = chart.to_dict() + assert dct["encoding"]["x"]["type"] == "temporal" + assert dct["encoding"]["x"]["field"] == "x" + assert dct["encoding"]["y"]["type"] == "quantitative" + assert dct["encoding"]["y"]["field"] == "y" + assert dct["encoding"]["color"]["type"] == "nominal" + assert dct["encoding"]["color"]["field"] == "c" + + # Pass field names by keyword + chart = alt.Chart(data).mark_point().encode(x="x", y="y", color="c") + _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")) + ) + _check_encodings(chart) + + # pass Channel objects by value + chart = alt.Chart(data).mark_point().encode(alt.X("x"), alt.Y("y"), alt.Color("c")) + _check_encodings(chart) + + # override default types + chart = ( + alt.Chart(data) + .mark_point() + .encode(alt.X("x", type="nominal"), alt.Y("y", type="ordinal")) + ) + dct = chart.to_dict() + assert dct["encoding"]["x"]["type"] == "nominal" + assert dct["encoding"]["y"]["type"] == "ordinal" + + +@pytest.mark.parametrize( + "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"}, + ] + 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(): + data = pd.DataFrame( + { + "x": pd.date_range("2012", periods=10, freq="Y"), + "y": range(10), + "c": list("abcabcabca"), + } + ) + chart1 = alt.Chart(data).mark_line().encode(x="x", y="y", color="c") + chart2 = chart1.mark_point() + chart3 = chart1.mark_circle() + chart4 = chart1.mark_square() + + chart = chart1 + chart2 + chart3 + assert isinstance(chart, alt.LayerChart) + assert len(chart.layer) == 3 + chart += chart4 + assert len(chart.layer) == 4 + + chart = chart1 | chart2 | chart3 + assert isinstance(chart, alt.HConcatChart) + assert len(chart.hconcat) == 3 + chart |= chart4 + assert len(chart.hconcat) == 4 + + chart = chart1 & chart2 & chart3 + assert isinstance(chart, alt.VConcatChart) + assert len(chart.vconcat) == 3 + chart &= chart4 + assert len(chart.vconcat) == 4 + + +def test_selection_to_dict(): + brush = alt.selection(type="interval") + + # test some value selections + # Note: X and Y cannot have conditions + alt.Chart("path/to/data.json").mark_point().encode( + color=alt.condition(brush, alt.ColorValue("red"), alt.ColorValue("blue")), + opacity=alt.condition(brush, alt.value(0.5), alt.value(1.0)), + text=alt.condition(brush, alt.TextValue("foo"), alt.value("bar")), + ).to_dict() + + # test some field selections + # Note: X and Y cannot have conditions + # Conditions cannot both be fields + alt.Chart("path/to/data.json").mark_point().encode( + color=alt.condition(brush, alt.Color("col1:N"), alt.value("blue")), + opacity=alt.condition(brush, "col1:N", alt.value(0.5)), + text=alt.condition(brush, alt.value("abc"), alt.Text("col2:N")), + size=alt.condition(brush, alt.value(20), "col2:N"), + ).to_dict() + + +def test_selection_expression(): + selection = alt.selection_single(fields=["value"]) + + assert isinstance(selection.value, alt.expr.Expression) + assert selection.value.to_dict() == "{0}.value".format(selection.name) + + 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): + if format in ["pdf", "png"]: + out = io.BytesIO() + mode = "rb" + else: + out = io.StringIO() + mode = "r" + + 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) + content = out.read() + + if format == "json": + assert "$schema" in json.loads(content) + if format == "html": + assert content.startswith("") + + 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) + + +def test_facet_basic(): + # wrapped facet + chart1 = ( + alt.Chart("data.csv") + .mark_point() + .encode( + x="x:Q", + y="y:Q", + ) + .facet("category:N", columns=2) + ) + + dct1 = chart1.to_dict() + + assert dct1["facet"] == alt.Facet("category:N").to_dict() + assert dct1["columns"] == 2 + assert dct1["data"] == alt.UrlData("data.csv").to_dict() + + # explicit row/col facet + chart2 = ( + alt.Chart("data.csv") + .mark_point() + .encode( + x="x:Q", + y="y:Q", + ) + .facet(row="category1:Q", column="category2:Q") + ) + + dct2 = chart2.to_dict() + + assert dct2["facet"]["row"] == alt.Facet("category1:Q").to_dict() + assert dct2["facet"]["column"] == alt.Facet("category2:Q").to_dict() + assert "columns" not in dct2 + assert dct2["data"] == alt.UrlData("data.csv").to_dict() + + +def test_facet_parse(): + chart = ( + alt.Chart("data.csv") + .mark_point() + .encode(x="x:Q", y="y:Q") + .facet(row="row:N", column="column:O") + ) + dct = chart.to_dict() + assert dct["data"] == {"url": "data.csv"} + assert "data" not in dct["spec"] + assert dct["facet"] == { + "column": {"field": "column", "type": "ordinal"}, + "row": {"field": "row", "type": "nominal"}, + } + + +def test_facet_parse_data(): + data = pd.DataFrame({"x": range(5), "y": range(5), "row": list("abcab")}) + chart = ( + alt.Chart(data) + .mark_point() + .encode(x="x", y="y:O") + .facet(row="row", column="column:O") + ) + with alt.data_transformers.enable(consolidate_datasets=False): + dct = chart.to_dict() + assert "values" in dct["data"] + assert "data" not in dct["spec"] + assert dct["facet"] == { + "column": {"field": "column", "type": "ordinal"}, + "row": {"field": "row", "type": "nominal"}, + } + + with alt.data_transformers.enable(consolidate_datasets=True): + dct = chart.to_dict() + assert "datasets" in dct + assert "name" in dct["data"] + assert "data" not in dct["spec"] + assert dct["facet"] == { + "column": {"field": "column", "type": "ordinal"}, + "row": {"field": "row", "type": "nominal"}, + } + + +def test_selection(): + # test instantiation of selections + interval = alt.selection_interval(name="selec_1") + assert interval.selection.type == "interval" + assert interval.name == "selec_1" + + single = alt.selection_single(name="selec_2") + assert single.selection.type == "single" + assert single.name == "selec_2" + + multi = alt.selection_multi(name="selec_3") + assert multi.selection.type == "multi" + assert multi.name == "selec_3" + + # 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 + assert isinstance(single & multi, alt.Selection) + assert isinstance(single | multi, alt.Selection) + assert isinstance(~single, alt.Selection) + assert isinstance((single & multi)[0].group, alt.SelectionAnd) + assert isinstance((single | multi)[0].group, alt.SelectionOr) + assert isinstance((~single)[0].group, alt.SelectionNot) + + # test that default names increment (regression for #1454) + sel1 = alt.selection_single() + sel2 = alt.selection_multi() + sel3 = alt.selection_interval() + names = {s.name for s in (sel1, sel2, sel3)} + assert len(names) == 3 + + +def test_transforms(): + # aggregate transform + agg1 = alt.AggregatedFieldDef(**{"as": "x1", "op": "mean", "field": "y"}) + agg2 = alt.AggregatedFieldDef(**{"as": "x2", "op": "median", "field": "z"}) + chart = alt.Chart().transform_aggregate([agg1], ["foo"], x2="median(z)") + kwds = dict(aggregate=[agg1, agg2], groupby=["foo"]) + assert chart.transform == [alt.AggregateTransform(**kwds)] + + # bin transform + chart = alt.Chart().transform_bin("binned", field="field", bin=True) + kwds = {"as": "binned", "field": "field", "bin": True} + assert chart.transform == [alt.BinTransform(**kwds)] + + # calcualte transform + chart = alt.Chart().transform_calculate("calc", "datum.a * 4") + kwds = {"as": "calc", "calculate": "datum.a * 4"} + assert chart.transform == [alt.CalculateTransform(**kwds)] + + # impute transform + chart = alt.Chart().transform_impute("field", "key", groupby=["x"]) + kwds = {"impute": "field", "key": "key", "groupby": ["x"]} + assert chart.transform == [alt.ImputeTransform(**kwds)] + + # joinaggregate transform + chart = alt.Chart().transform_joinaggregate(min="min(x)", groupby=["key"]) + kwds = { + "joinaggregate": [ + alt.JoinAggregateFieldDef(field="x", op="min", **{"as": "min"}) + ], + "groupby": ["key"], + } + assert chart.transform == [alt.JoinAggregateTransform(**kwds)] + + # filter transform + chart = alt.Chart().transform_filter("datum.a < 4") + assert chart.transform == [alt.FilterTransform(filter="datum.a < 4")] + + # flatten transform + chart = alt.Chart().transform_flatten(["A", "B"], ["X", "Y"]) + kwds = {"as": ["X", "Y"], "flatten": ["A", "B"]} + assert chart.transform == [alt.FlattenTransform(**kwds)] + + # fold transform + chart = alt.Chart().transform_fold(["A", "B", "C"], as_=["key", "val"]) + kwds = {"as": ["key", "val"], "fold": ["A", "B", "C"]} + assert chart.transform == [alt.FoldTransform(**kwds)] + + # lookup transform + lookup_data = alt.LookupData(alt.UrlData("foo.csv"), "id", ["rate"]) + chart = alt.Chart().transform_lookup( + from_=lookup_data, as_="a", lookup="a", default="b" + ) + kwds = {"from": lookup_data, "as": "a", "lookup": "a", "default": "b"} + assert chart.transform == [alt.LookupTransform(**kwds)] + + # sample transform + chart = alt.Chart().transform_sample() + assert chart.transform == [alt.SampleTransform(1000)] + + # stack transform + chart = alt.Chart().transform_stack("stacked", "x", groupby=["y"]) + assert chart.transform == [ + alt.StackTransform(stack="x", groupby=["y"], **{"as": "stacked"}) + ] + + # timeUnit transform + chart = alt.Chart().transform_timeunit("foo", field="x", timeUnit="date") + kwds = {"as": "foo", "field": "x", "timeUnit": "date"} + assert chart.transform == [alt.TimeUnitTransform(**kwds)] + + # window transform + chart = alt.Chart().transform_window(xsum="sum(x)", ymin="min(y)", frame=[None, 0]) + window = [ + alt.WindowFieldDef(**{"as": "xsum", "field": "x", "op": "sum"}), + alt.WindowFieldDef(**{"as": "ymin", "field": "y", "op": "min"}), + ] + + # kwargs don't maintain order in Python < 3.6, so window list can + # be reversed + assert chart.transform == [ + alt.WindowTransform(frame=[None, 0], window=window) + ] or chart.transform == [alt.WindowTransform(frame=[None, 0], 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"]}}} + ] + + chart = base.transform_filter(selector1 | ~selector2) + assert chart.to_dict()["transform"] == [ + {"filter": {"selection": {"or": ["s1", {"not": "s2"}]}}} + ] + + chart = base.transform_filter(~selector1 | ~selector2) + assert chart.to_dict()["transform"] == [ + {"filter": {"selection": {"or": [{"not": "s1"}, {"not": "s2"}]}}} + ] + + chart = base.transform_filter(~(selector1 & selector2)) + assert chart.to_dict()["transform"] == [ + {"filter": {"selection": {"not": {"and": ["s1", "s2"]}}}} + ] + + +def test_resolve_methods(): + chart = alt.LayerChart().resolve_axis(x="shared", y="independent") + assert chart.resolve == alt.Resolve( + axis=alt.AxisResolveMap(x="shared", y="independent") + ) + + chart = alt.LayerChart().resolve_legend(color="shared", fill="independent") + assert chart.resolve == alt.Resolve( + legend=alt.LegendResolveMap(color="shared", fill="independent") + ) + + chart = alt.LayerChart().resolve_scale(x="shared", y="independent") + assert chart.resolve == alt.Resolve( + scale=alt.ScaleResolveMap(x="shared", y="independent") + ) + + +def test_layer_encodings(): + chart = alt.LayerChart().encode(x="column:Q") + assert chart.encoding.x == alt.X(shorthand="column:Q") + + +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 = {s.name: s.selection for s in selections} + 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() + + +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() + + +@pytest.mark.parametrize("charttype", [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(selection=sel) + + assert list(chart["selection"].keys()) == [sel.name] + + +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}] + } + + +def test_themes(): + chart = alt.Chart("foo.txt").mark_point() + active = alt.themes.active + + try: + alt.themes.enable("default") + assert chart.to_dict()["config"] == { + "mark": {"tooltip": None}, + "view": {"width": 400, "height": 300}, + } + + alt.themes.enable("opaque") + assert chart.to_dict()["config"] == { + "background": "white", + "mark": {"tooltip": None}, + "view": {"width": 400, "height": 300}, + } + + alt.themes.enable("none") + assert "config" not in chart.to_dict() + + finally: + # re-enable the original active theme + alt.themes.enable(active) + + +def test_chart_from_dict(): + base = alt.Chart("data.csv").mark_point().encode(x="x:Q", y="y:Q") + + charts = [ + base, + base + base, + base | base, + base & base, + base.facet("c:N"), + (base + base).facet(row="c:N", data="data.csv"), + base.repeat(["c", "d"]), + (base + base).repeat(row=["c", "d"]), + ] + + for chart in charts: + print(chart) + chart_out = alt.Chart.from_dict(chart.to_dict()) + assert type(chart_out) is type(chart) + + # test that an invalid spec leads to a schema validation error + with pytest.raises(jsonschema.ValidationError): + alt.Chart.from_dict({"invalid": "spec"}) + + +def test_consolidate_datasets(basic_chart): + subchart1 = basic_chart + subchart2 = basic_chart.copy() + subchart2.data = basic_chart.data.copy() + chart = subchart1 | subchart2 + + with alt.data_transformers.enable(consolidate_datasets=True): + dct_consolidated = chart.to_dict() + + with alt.data_transformers.enable(consolidate_datasets=False): + dct_standard = chart.to_dict() + + assert "datasets" in dct_consolidated + assert "datasets" not in dct_standard + + datasets = dct_consolidated["datasets"] + + # two dataset copies should be recognized as duplicates + assert len(datasets) == 1 + + # make sure data matches original & names are correct + name, data = datasets.popitem() + + for spec in dct_standard["hconcat"]: + assert spec["data"]["values"] == data + + 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() + + +def test_deprecated_encodings(): + base = alt.Chart("data.txt").mark_point() + + with pytest.warns(AltairDeprecationWarning) as record: + chart1 = base.encode(strokeOpacity=alt.Strokeopacity("x:Q")).to_dict() + assert "alt.StrokeOpacity" in record[0].message.args[0] + chart2 = base.encode(strokeOpacity=alt.StrokeOpacity("x:Q")).to_dict() + + 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"} + + +def test_data_property(): + data = pd.DataFrame({"x": [1, 2, 3], "y": list("ABC")}) + chart1 = alt.Chart(data).mark_point() + chart2 = alt.Chart().mark_point().properties(data=data) + + assert chart1.to_dict() == chart2.to_dict() + + +@pytest.mark.parametrize("method", ["layer", "hconcat", "vconcat", "concat"]) +@pytest.mark.parametrize( + "data", ["data.json", pd.DataFrame({"x": range(3), "y": list("abc")})] +) +def test_subcharts_with_same_data(method, data): + func = getattr(alt, method) + + point = alt.Chart(data).mark_point().encode(x="x:Q", y="y:Q") + line = point.mark_line() + text = point.mark_text() + + chart1 = func(point, line, text) + assert chart1.data is not alt.Undefined + assert all(c.data is alt.Undefined for c in getattr(chart1, method)) + + if method != "concat": + op = OP_DICT[method] + chart2 = op(op(point, line), text) + assert chart2.data is not alt.Undefined + assert all(c.data is alt.Undefined for c in getattr(chart2, method)) + + +@pytest.mark.parametrize("method", ["layer", "hconcat", "vconcat", "concat"]) +@pytest.mark.parametrize( + "data", ["data.json", pd.DataFrame({"x": range(3), "y": list("abc")})] +) +def test_subcharts_different_data(method, data): + func = getattr(alt, method) + + point = alt.Chart(data).mark_point().encode(x="x:Q", y="y:Q") + otherdata = alt.Chart("data.csv").mark_point().encode(x="x:Q", y="y:Q") + nodata = alt.Chart().mark_point().encode(x="x:Q", y="y:Q") + + chart1 = func(point, otherdata) + assert chart1.data is alt.Undefined + assert getattr(chart1, method)[0].data is data + + chart2 = func(point, nodata) + assert chart2.data is alt.Undefined + assert getattr(chart2, method)[0].data is data + + +def test_layer_facet(basic_chart): + chart = (basic_chart + basic_chart).facet(row="row:Q") + assert chart.data is not alt.Undefined + assert chart.spec.data is alt.Undefined + for layer in chart.spec.layer: + assert layer.data is alt.Undefined + + dct = chart.to_dict() + assert "data" in dct + + +def test_layer_errors(): + toplevel_chart = alt.Chart("data.txt").mark_point().configure_legend(columns=2) + + facet_chart1 = alt.Chart("data.txt").mark_point().encode(facet="row:Q") + + facet_chart2 = alt.Chart("data.txt").mark_point().facet("row:Q") + + repeat_chart = alt.Chart("data.txt").mark_point().repeat(["A", "B", "C"]) + + simple_chart = alt.Chart("data.txt").mark_point() + + with pytest.raises(ValueError) as err: + toplevel_chart + simple_chart + assert str(err.value).startswith( + 'Objects with "config" attribute cannot be used within LayerChart.' + ) + + with pytest.raises(ValueError) as err: + repeat_chart + simple_chart + assert str(err.value) == "Repeat charts cannot be layered." + + with pytest.raises(ValueError) as err: + facet_chart1 + simple_chart + assert str(err.value) == "Faceted charts cannot be layered." + + with pytest.raises(ValueError) as err: + alt.layer(simple_chart) + facet_chart2 + assert str(err.value) == "Faceted charts cannot be layered." + + +@pytest.mark.parametrize( + "chart_type", + ["layer", "hconcat", "vconcat", "concat", "facet", "facet_encoding", "repeat"], +) +def test_resolve(chart_type): + chart = _make_chart_type(chart_type) + chart = ( + chart.resolve_scale( + x="independent", + ) + .resolve_legend(color="independent") + .resolve_axis(y="independent") + ) + dct = chart.to_dict() + assert dct["resolve"] == { + "scale": {"x": "independent"}, + "legend": {"color": "independent"}, + "axis": {"y": "independent"}, + } + + +# TODO: test vconcat, hconcat, concat when schema allows them. +# This is blocked by https://github.com/vega/vega-lite/issues/5261 +@pytest.mark.parametrize("chart_type", ["chart", "layer", "facet_encoding"]) +@pytest.mark.parametrize("facet_arg", [None, "facet", "row", "column"]) +def test_facet(chart_type, facet_arg): + chart = _make_chart_type(chart_type) + if facet_arg is None: + chart = chart.facet("color:N", columns=2) + else: + chart = chart.facet(**{facet_arg: "color:N", "columns": 2}) + dct = chart.to_dict() + + assert "spec" in dct + assert dct["columns"] == 2 + expected = {"field": "color", "type": "nominal"} + if facet_arg is None or facet_arg == "facet": + 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]}} + + +def test_sphere(): + data = alt.sphere() + assert data.to_dict() == {"sphere": True} diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_data.py b/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_data.py new file mode 100644 index 0000000000000000000000000000000000000000..8eae11c868c6bc0ba14edb9cc7bae6d588f1d5aa --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_data.py @@ -0,0 +1,33 @@ +import os + +import pandas as pd +import pytest + +from .. import data as alt + + +@pytest.fixture +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 TypeError: + jsonfile = {} + finally: + if jsonfile: + os.remove(jsonfile["url"]) diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_display.py b/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_display.py new file mode 100644 index 0000000000000000000000000000000000000000..9035ead7cdfaf5f3efb401d1f1485f5d7bc19e84 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_display.py @@ -0,0 +1,69 @@ +from contextlib import contextmanager + +import pytest + +import altair.vegalite.v3 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() diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_geo_interface.py b/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_geo_interface.py new file mode 100644 index 0000000000000000000000000000000000000000..cc157032b71621a00b838d4a512f7f9117984bd0 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_geo_interface.py @@ -0,0 +1,204 @@ +import pytest +import altair.vegalite.v3 as alt + + +def geom_obj(geom): + class Geom(object): + pass + + geom_obj = Geom() + setattr(geom_obj, "__geo_interface__", geom) + return geom_obj + + +# correct translation of Polygon geometry to Feature type +def test_geo_interface_polygon_feature(): + geom = { + "coordinates": [[(0, 0), (0, 2), (2, 2), (2, 0), (0, 0)]], + "type": "Polygon", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"]["type"] == "Feature" + + +# merge geometry with empty properties dictionary +def test_geo_interface_removal_empty_properties(): + geom = { + "geometry": { + "coordinates": [ + [[6.90, 53.48], [5.98, 51.85], [6.07, 53.51], [6.90, 53.48]] + ], + "type": "Polygon", + }, + "id": None, + "properties": {}, + "type": "Feature", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"]["type"] == "Feature" + + +# only register metadata in the properties member +def test_geo_interface_register_foreign_member(): + geom = { + "geometry": { + "coordinates": [ + [[6.90, 53.48], [5.98, 51.85], [6.07, 53.51], [6.90, 53.48]] + ], + "type": "Polygon", + }, + "id": 2, + "properties": {"foo": "bah"}, + "type": "Feature", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + with pytest.raises(KeyError): + spec["data"]["values"]["id"] + assert spec["data"]["values"]["foo"] == "bah" + + +# correct serializing of arrays and nested tuples +def test_geo_interface_serializing_arrays_tuples(): + import array as arr + + geom = { + "bbox": arr.array("d", [1, 2, 3, 4]), + "geometry": { + "coordinates": [ + tuple( + ( + tuple((6.90, 53.48)), + tuple((5.98, 51.85)), + tuple((6.07, 53.51)), + tuple((6.90, 53.48)), + ) + ) + ], + "type": "Polygon", + }, + "id": 27, + "properties": {}, + "type": "Feature", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"]["geometry"]["coordinates"][0][0] == [6.9, 53.48] + + +# overwrite existing 'type' value in properties with `Feature` +def test_geo_interface_reserved_members(): + geom = { + "geometry": { + "coordinates": [ + [[6.90, 53.48], [5.98, 51.85], [6.07, 53.51], [6.90, 53.48]] + ], + "type": "Polygon", + }, + "id": 27, + "properties": {"type": "foo"}, + "type": "Feature", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"]["type"] == "Feature" + + +# an empty FeatureCollection is valid +def test_geo_interface_empty_feature_collection(): + geom = {"type": "FeatureCollection", "features": []} + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"] == [] + + +# Features in a FeatureCollection only keep properties and geometry +def test_geo_interface_feature_collection(): + geom = { + "type": "FeatureCollection", + "features": [ + { + "geometry": { + "coordinates": [ + [[6.90, 53.48], [5.98, 51.85], [6.07, 53.51], [6.90, 53.48]] + ], + "type": "Polygon", + }, + "id": 27, + "properties": {"type": "foo", "id": 1, "geometry": 1}, + "type": "Feature", + }, + { + "geometry": { + "coordinates": [ + [[8.90, 53.48], [7.98, 51.85], [8.07, 53.51], [8.90, 53.48]] + ], + "type": "Polygon", + }, + "id": 28, + "properties": {"type": "foo", "id": 2, "geometry": 1}, + "type": "Feature", + }, + ], + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"][0]["id"] == 1 + assert spec["data"]["values"][1]["id"] == 2 + assert "coordinates" in spec["data"]["values"][0]["geometry"] + assert "coordinates" in spec["data"]["values"][1]["geometry"] + assert spec["data"]["values"][0]["type"] == "Feature" + assert spec["data"]["values"][1]["type"] == "Feature" + + +# typical output of a __geo_interface__ from geopandas GeoDataFrame +# notic that the index value is registerd as a commonly used identifier +# with the name "id" (in this case 49). Similar to serialization of a +# pandas DataFrame is the index not included in the output +def test_geo_interface_feature_collection_gdf(): + geom = { + "bbox": (19.89, -26.82, 29.43, -17.66), + "features": [ + { + "bbox": (19.89, -26.82, 29.43, -17.66), + "geometry": { + "coordinates": [ + [[6.90, 53.48], [5.98, 51.85], [6.07, 53.51], [6.90, 53.48]] + ], + "type": "Polygon", + }, + "id": "49", + "properties": { + "continent": "Africa", + "gdp_md_est": 35900.0, + "id": "BWA", + "iso_a3": "BWA", + "name": "Botswana", + "pop_est": 2214858, + }, + "type": "Feature", + } + ], + "type": "FeatureCollection", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"][0]["id"] == "BWA" diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_renderers.py b/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_renderers.py new file mode 100644 index 0000000000000000000000000000000000000000..ba8b4c9855a36774ca88a1027b12c9910213b67d --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_renderers.py @@ -0,0 +1,86 @@ +"""Tests of various renderers""" + +import json +import re + +import pytest + +import altair.vegalite.v3 as alt + + +def _extract_embedOpt(html): + """Extract an embedOpt definition from an html string. + + Note: this is very brittle, but works for the specific test in this file. + """ + result = re.search(r"embedOpt\s+=\s+(?P\{.*?\})", html) + if not result: + return None + else: + return json.loads(result.groupdict()["embedOpt"]) + + +@pytest.fixture +def chart(): + return alt.Chart("data.csv").mark_point() + + +def test_colab_renderer_embed_options(chart): + """Test that embed_options in renderer metadata are correctly manifest in html""" + + def assert_actions_true(chart): + bundle = chart._repr_mimebundle_(None, None) + embedOpt = _extract_embedOpt(bundle["text/html"]) + assert embedOpt == {"actions": True, "mode": "vega-lite"} + + def assert_actions_false(chart): + bundle = chart._repr_mimebundle_(None, None) + embedOpt = _extract_embedOpt(bundle["text/html"]) + assert embedOpt == {"actions": False, "mode": "vega-lite"} + + with alt.renderers.enable("colab", embed_options=dict(actions=False)): + assert_actions_false(chart) + + with alt.renderers.enable("colab"): + with alt.renderers.enable(embed_options=dict(actions=True)): + assert_actions_true(chart) + + with alt.renderers.set_embed_options(actions=False): + assert_actions_false(chart) + + with alt.renderers.set_embed_options(actions=True): + assert_actions_true(chart) + + +def test_default_renderer_embed_options(chart, renderer="default"): + # check that metadata is passed appropriately + mimetype = alt.display.VEGALITE_MIME_TYPE + spec = chart.to_dict() + with alt.renderers.enable(renderer, embed_options=dict(actions=False)): + bundle, metadata = chart._repr_mimebundle_(None, None) + assert set(bundle.keys()) == {mimetype, "text/plain"} + assert bundle[mimetype] == spec + assert metadata == {mimetype: {"embed_options": {"actions": False}}} + + # Sanity check: no metadata specified + with alt.renderers.enable(renderer): + bundle, metadata = chart._repr_mimebundle_(None, None) + assert bundle[mimetype] == spec + assert metadata == {} + + +def test_json_renderer_embed_options(chart, renderer="json"): + """Test that embed_options in renderer metadata are correctly manifest in html""" + mimetype = "application/json" + spec = chart.to_dict() + with alt.renderers.enable("json", option="foo"): + bundle, metadata = chart._repr_mimebundle_(None, None) + assert set(bundle.keys()) == {mimetype, "text/plain"} + assert bundle[mimetype] == spec + assert metadata == {mimetype: {"option": "foo"}} + + # Sanity check: no options specified + with alt.renderers.enable(renderer): + bundle, metadata = chart._repr_mimebundle_(None, None) + assert bundle[mimetype] == spec + assert metadata == {} diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_theme.py b/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_theme.py new file mode 100644 index 0000000000000000000000000000000000000000..430c2193517f9b404c1183231ec05085b4e305ae --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/tests/test_theme.py @@ -0,0 +1,20 @@ +import pytest + +import altair.vegalite.v3 as alt +from altair.vegalite.v3.theme import VEGA_THEMES + + +@pytest.fixture +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}, + } diff --git a/runtime/Lib/site-packages/altair/vegalite/v3/theme.py b/runtime/Lib/site-packages/altair/vegalite/v3/theme.py new file mode 100644 index 0000000000000000000000000000000000000000..91d37649b4ef661842f823c16e10d6c22200fd0e --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v3/theme.py @@ -0,0 +1,54 @@ +"""Tools for enabling and registering chart themes""" + +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. +ENTRY_POINT_GROUP = "altair.vegalite.v3.theme" # type: str +themes = ThemeRegistry(entry_point_group=ENTRY_POINT_GROUP) + +themes.register( + "default", + lambda: { + "config": {"view": {"width": 400, "height": 300}, "mark": {"tooltip": None}} + }, +) +themes.register( + "opaque", + lambda: { + "config": { + "background": "white", + "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/runtime/Lib/site-packages/altair/vegalite/v4/__init__.py b/runtime/Lib/site-packages/altair/vegalite/v4/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..90b76bf87cf834a7b193d62362958ca51ec57a24 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v4/__init__.py @@ -0,0 +1,23 @@ +# flake8: noqa +from .schema import * +from .api import * + +from ...datasets import list_datasets, load_dataset + +from ... import expr +from ...expr import datum + +from .display import VegaLite, renderers + +from .data import ( + MaxRowsError, + pipe, + curry, + limit_rows, + sample, + to_json, + to_csv, + to_values, + default_data_transformer, + data_transformers, +) diff --git a/runtime/Lib/site-packages/altair/vegalite/v4/api.py b/runtime/Lib/site-packages/altair/vegalite/v4/api.py new file mode 100644 index 0000000000000000000000000000000000000000..84162e11410c85e03ac18223efa2c6db392b75e9 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v4/api.py @@ -0,0 +1,2519 @@ +import warnings + +import hashlib +import io +import json +import jsonschema +import pandas as pd +from toolz.curried import pipe as _pipe + +from .schema import core, channels, mixins, Undefined, SCHEMA_URL + +from .data import data_transformers +from ... import utils, expr +from .display import renderers, VEGALITE_VERSION, VEGAEMBED_VERSION, VEGA_VERSION +from .theme import themes + + +# ------------------------------------------------------------------------ +# Data Utilities +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() + if values == [{}]: + return "empty" + 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): + if data.name is Undefined and data.values is not Undefined: + if isinstance(data.values, core.InlineDataset): + values = data.to_dict()["values"] + else: + 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=None): + """Convert input data to data for use within schema + + Parameters + ---------- + 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 (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. + """ + if data is Undefined: + return data + + # convert dataframes or objects with __geo_interface__ to dict + if isinstance(data, pd.DataFrame) or hasattr(data, "__geo_interface__"): + data = _pipe(data, data_transformers.get()) + + # convert string input to a URLData + if isinstance(data, str): + data = core.UrlData(data) + + # consolidate inline data to top-level 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 + if not isinstance(data, (dict, core.Data)): + warnings.warn("data of type {} not recognized".format(type(data))) + + return data + + +# ------------------------------------------------------------------------ +# Aliases & specializations +Bin = core.BinParams + + +@utils.use_signature(core.LookupData) +class LookupData(core.LookupData): + def to_dict(self, *args, **kwargs): + """Convert the chart to a dictionary suitable for JSON export.""" + copy = self.copy(deep=False) + copy.data = _prepare_data(copy.data, kwargs.get("context")) + return super(LookupData, copy).to_dict(*args, **kwargs) + + +@utils.use_signature(core.FacetMapping) +class FacetMapping(core.FacetMapping): + _class_is_valid_at_instantiation = False + + def to_dict(self, *args, **kwargs): + copy = self.copy(deep=False) + context = kwargs.get("context", {}) + data = context.get("data", None) + if isinstance(self.row, str): + copy.row = core.FacetFieldDef(**utils.parse_shorthand(self.row, data)) + if isinstance(self.column, str): + copy.column = core.FacetFieldDef(**utils.parse_shorthand(self.column, data)) + return super(FacetMapping, copy).to_dict(*args, **kwargs) + + +# ------------------------------------------------------------------------ +# Encoding will contain channel objects that aren't valid at instantiation +core.FacetedEncoding._class_is_valid_at_instantiation = False + +# ------------------------------------------------------------------------ +# These are parameters that are valid at the top level, but are not valid +# for specs that are within a composite chart +# (layer, hconcat, vconcat, facet, repeat) +TOPLEVEL_ONLY_KEYS = {"background", "config", "autosize", "padding", "$schema"} + + +def _get_channels_mapping(): + mapping = {} + for attr in dir(channels): + cls = getattr(channels, attr) + if isinstance(cls, type) and issubclass(cls, core.SchemaBase): + mapping[cls] = attr.replace("Value", "").lower() + return mapping + + +# ------------------------------------------------------------------------- +# Tools for working with selections +class Selection(object): + """A Selection object""" + + _counter = 0 + + @classmethod + def _get_name(cls): + cls._counter += 1 + return "selector{:03d}".format(cls._counter) + + def __init__(self, name, selection): + if name is None: + name = self._get_name() + self.name = name + self.selection = selection + + def __repr__(self): + return "Selection({0!r}, {1})".format(self.name, self.selection) + + def ref(self): + return self.to_dict() + + def to_dict(self): + return { + "selection": self.name.to_dict() + if hasattr(self.name, "to_dict") + else self.name + } + + def __invert__(self): + return Selection(core.SelectionNot(**{"not": self.name}), self.selection) + + def __and__(self, other): + if isinstance(other, Selection): + other = other.name + return Selection( + core.SelectionAnd(**{"and": [self.name, other]}), self.selection + ) + + def __or__(self, other): + if isinstance(other, Selection): + other = other.name + 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): + return expr.core.GetItemExpression(self.name, field_name) + + +# ------------------------------------------------------------------------ +# Top-Level Functions + + +def value(value, **kwargs): + """Specify a value for use in an encoding""" + return dict(value=value, **kwargs) + + +def selection(name=None, type=Undefined, **kwds): + """Create a named selection. + + Parameters + ---------- + name : string (optional) + The name of the selection. If not specified, a unique name will be + created. + type : string + The type of the selection: one of ["interval", "single", or "multi"] + **kwds : + additional keywords will be used to construct a SelectionDef instance + that controls the selection. + + Returns + ------- + selection: Selection + The selection object that can be used in chart creation. + """ + return Selection(name, core.SelectionDef(type=type, **kwds)) + + +@utils.use_signature(core.IntervalSelection) +def selection_interval(**kwargs): + """Create a selection with type='interval'""" + return selection(type="interval", **kwargs) + + +@utils.use_signature(core.MultiSelection) +def selection_multi(**kwargs): + """Create a selection with type='multi'""" + return selection(type="multi", **kwargs) + + +@utils.use_signature(core.SingleSelection) +def selection_single(**kwargs): + """Create a selection with type='single'""" + return selection(type="single", **kwargs) + + +@utils.use_signature(core.Binding) +def binding(input, **kwargs): + """A generic binding""" + return core.Binding(input=input, **kwargs) + + +@utils.use_signature(core.BindCheckbox) +def binding_checkbox(**kwargs): + """A checkbox binding""" + return core.BindCheckbox(input="checkbox", **kwargs) + + +@utils.use_signature(core.BindRadioSelect) +def binding_radio(**kwargs): + """A radio button binding""" + return core.BindRadioSelect(input="radio", **kwargs) + + +@utils.use_signature(core.BindRadioSelect) +def binding_select(**kwargs): + """A select binding""" + return core.BindRadioSelect(input="select", **kwargs) + + +@utils.use_signature(core.BindRange) +def binding_range(**kwargs): + """A range binding""" + return core.BindRange(input="range", **kwargs) + + +def condition(predicate, if_true, if_false, **kwargs): + """A conditional attribute or encoding + + Parameters + ---------- + predicate: Selection, PredicateComposition, 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: + the spec or object to use if the selection predicate is true + if_false: + the spec or object to use if the selection predicate is false + **kwargs: + additional keyword args are added to the resulting dict + + Returns + ------- + spec: dict or VegaLiteSchema + the spec that describes the condition + """ + test_predicates = (str, expr.Expression, core.PredicateComposition) + + if isinstance(predicate, Selection): + condition = {"selection": predicate.name} + elif isinstance(predicate, core.SelectionComposition): + condition = {"selection": predicate} + elif isinstance(predicate, test_predicates): + condition = {"test": predicate} + elif isinstance(predicate, dict): + condition = predicate + else: + raise NotImplementedError( + "condition predicate of type {}" "".format(type(predicate)) + ) + + if isinstance(if_true, core.SchemaBase): + # convert to dict for now; the from_dict call below will wrap this + # dict in the appropriate schema + if_true = if_true.to_dict() + elif isinstance(if_true, str): + if_true = {"shorthand": if_true} + if_true.update(kwargs) + condition.update(if_true) + + if isinstance(if_false, core.SchemaBase): + # For the selection, the channel definitions all allow selections + # already. So use this SchemaBase wrapper if possible. + selection = if_false.copy() + selection.condition = condition + elif isinstance(if_false, str): + selection = {"condition": condition, "shorthand": if_false} + selection.update(kwargs) + else: + selection = dict(condition=condition, **if_false) + + return selection + + +# -------------------------------------------------------------------- +# Top-level objects + + +class TopLevelMixin(mixins.ConfigMethodMixin): + """Mixin for top-level chart objects such as Chart, LayeredChart, etc.""" + + _class_is_valid_at_instantiation = False + + def to_dict(self, *args, **kwargs): + """Convert the chart to a dictionary suitable for JSON export""" + # We make use of three context markers: + # - 'data' points to the data that should be referenced for column type + # inference. + # - '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. + # - 'datasets' is a dict of named datasets that should be inserted + # in the top-level object + + # note: not a deep copy because we want datasets and data arguments to + # be passed by reference + context = kwargs.get("context", {}).copy() + context.setdefault("datasets", {}) + is_top_level = context.get("top_level", True) + + copy = self.copy(deep=False) + original_data = getattr(copy, "data", Undefined) + copy.data = _prepare_data(original_data, context) + + if original_data is not Undefined: + context["data"] = original_data + + # remaining to_dict calls are not at top level + 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) + + # TODO: following entries are added after validation. Should they be validated? + 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 + + # apply theme from theme registry + the_theme = themes.get() + dct = utils.update_nested(the_theme(), dct, copy=True) + + # update datasets + if context["datasets"]: + dct.setdefault("datasets", {}).update(context["datasets"]) + + return dct + + def to_html( + self, + base_url="https://cdn.jsdelivr.net/npm/", + output_div="vis", + embed_options=None, + json_kwds=None, + fullhtml=True, + requirejs=False, + ): + return utils.spec_to_html( + self.to_dict(), + mode="vega-lite", + vegalite_version=VEGALITE_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vega_version=VEGA_VERSION, + base_url=base_url, + output_div=output_div, + embed_options=embed_options, + json_kwds=json_kwds, + fullhtml=fullhtml, + requirejs=requirejs, + ) + + def save( + self, + fp, + format=None, + override_data_transformer=True, + scale_factor=1.0, + vegalite_version=VEGALITE_VERSION, + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + **kwargs, + ): + """Save a chart to file in a variety of formats + + 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', '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 + 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. + Default is 1.0 + **kwargs : + Additional keyword arguments are passed to the output method + associated with the specified format. + + """ + from ...utils.save import save + + kwds = dict( + chart=self, + fp=fp, + format=format, + scale_factor=scale_factor, + vegalite_version=vegalite_version, + vega_version=vega_version, + vegaembed_version=vegaembed_version, + **kwargs, + ) + + # By default we override the data transformer. This makes it so + # that save() will succeed even for large datasets that would + # normally trigger a MaxRowsError + if override_data_transformer: + with data_transformers.disable_max_rows(): + result = save(**kwds) + else: + result = save(**kwds) + return result + + # Fallback for when rendering fails; the full repr is too long to be + # useful in nearly all cases. + def __repr__(self): + return "alt.{}(...)".format(self.__class__.__name__) + + # Layering and stacking + def __add__(self, other): + if not isinstance(other, TopLevelMixin): + raise ValueError("Only Chart objects can be layered.") + return layer(self, other) + + def __and__(self, other): + if not isinstance(other, TopLevelMixin): + raise ValueError("Only Chart objects can be concatenated.") + return vconcat(self, other) + + def __or__(self, other): + if not isinstance(other, TopLevelMixin): + raise ValueError("Only Chart objects can be concatenated.") + return hconcat(self, other) + + def repeat( + self, + repeat=Undefined, + row=Undefined, + column=Undefined, + layer=Undefined, + columns=Undefined, + **kwargs, + ): + """Return a RepeatChart built from the chart + + Fields within the chart can be set to correspond to the row or + column using `alt.repeat('row')` and `alt.repeat('column')`. + + Parameters + ---------- + repeat : list + a list of data column names to be repeated. This cannot be + used along with the ``row``, ``column`` or ``layer`` 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 + layer : list + a list of data column names to be layered. This cannot be + used along with the ``row``, ``column`` or ``repeat`` argument. + 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_specified = repeat is not Undefined + rowcol_specified = row is not Undefined or column is not Undefined + layer_specified = layer is not Undefined + + if repeat_specified and rowcol_specified: + raise ValueError( + "repeat argument cannot be combined with row/column argument." + ) + elif repeat_specified and layer_specified: + raise ValueError("repeat argument cannot be combined with layer argument.") + elif layer_specified and rowcol_specified: + raise ValueError( + "layer argument cannot be combined with row/column argument." + ) + + if repeat_specified: + repeat = repeat + elif layer_specified: + repeat = core.LayerRepeatMapping(layer=layer) + 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. + + Argument names and types are the same as class initialization. + """ + copy = self.copy(deep=False) + for key, val in kwargs.items(): + if key == "selection" and isinstance(val, Selection): + # For backward compatibility with old selection interface. + setattr(copy, key, {val.name: val.selection}) + else: + # Don't validate data, because it hasn't been processed. + if key != "data": + self.validate_property(key, val) + setattr(copy, key, val) + 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, + reflectX=Undefined, + reflectY=Undefined, + rotate=Undefined, + scale=Undefined, + spacing=Undefined, + tilt=Undefined, + translate=Undefined, + **kwds, + ): + """Add a geographic projection to the chart. + + This is generally used either with ``mark_geoshape`` or with the + ``latitude``/``longitude`` encodings. + + Available projection types are + ['albers', 'albersUsa', 'azimuthalEqualArea', 'azimuthalEquidistant', + 'conicConformal', 'conicEqualArea', 'conicEquidistant', 'equalEarth', 'equirectangular', + 'gnomonic', 'identity', 'mercator', 'orthographic', 'stereographic', 'transverseMercator'] + + Attributes + ---------- + type : ProjectionType + 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](https://vega.github.io/vega-lite/docs/projection.html#projection-types). + + **Default value:** `mercator` + center : List(float) + Sets the projection’s center to the specified center, a two-element array of + longitude and latitude in degrees. + + **Default value:** `[0, 0]` + clipAngle : float + Sets 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 : List(List(float)) + Sets 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 : float + + distance : float + + fraction : float + + lobes : float + + parallel : float + + precision : Mapping(required=[length]) + Sets 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 : float + + ratio : float + + reflectX : boolean + + reflectY : boolean + + rotate : List(float) + Sets 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 : float + Sets the projection's scale (zoom) value, overriding automatic fitting. + + spacing : float + + tilt : float + + translate : List(float) + Sets the projection's translation (pan) value, overriding automatic fitting. + + """ + projection = core.Projection( + center=center, + clipAngle=clipAngle, + clipExtent=clipExtent, + coefficient=coefficient, + distance=distance, + fraction=fraction, + lobes=lobes, + parallel=parallel, + precision=precision, + radius=radius, + ratio=ratio, + reflectX=reflectX, + reflectY=reflectY, + rotate=rotate, + scale=scale, + spacing=spacing, + tilt=tilt, + translate=translate, + type=type, + **kwds, + ) + return self.properties(projection=projection) + + def _add_transform(self, *transforms): + """Copy the chart and add specified transforms to chart.transform""" + copy = self.copy(deep=["transform"]) + if copy.transform is Undefined: + copy.transform = [] + copy.transform.extend(transforms) + return copy + + def transform_aggregate(self, aggregate=Undefined, groupby=Undefined, **kwds): + """ + Add an AggregateTransform to the schema. + + Parameters + ---------- + aggregate : List(:class:`AggregatedFieldDef`) + Array of objects that define fields to aggregate. + groupby : List(string) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + **kwds : + additional keywords are converted to aggregates using standard + shorthand parsing. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + Examples + -------- + The aggregate transform allows you to specify transforms directly using + the same shorthand syntax as used in encodings: + + >>> import altair as alt + >>> chart1 = alt.Chart().transform_aggregate( + ... mean_acc='mean(Acceleration)', + ... groupby=['Origin'] + ... ) + >>> print(chart1.transform[0].to_json()) # doctest: +NORMALIZE_WHITESPACE + { + "aggregate": [ + { + "as": "mean_acc", + "field": "Acceleration", + "op": "mean" + } + ], + "groupby": [ + "Origin" + ] + } + + It also supports including AggregatedFieldDef instances or dicts directly, + so you can create the above transform like this: + + >>> chart2 = alt.Chart().transform_aggregate( + ... [alt.AggregatedFieldDef(field='Acceleration', op='mean', + ... **{'as': 'mean_acc'})], + ... groupby=['Origin'] + ... ) + >>> chart2.transform == chart1.transform + True + + See Also + -------- + alt.AggregateTransform : underlying transform object + + """ + if aggregate is Undefined: + aggregate = [] + for key, val in kwds.items(): + parsed = utils.parse_shorthand(val) + dct = { + "as": key, + "field": parsed.get("field", Undefined), + "op": parsed.get("aggregate", Undefined), + } + aggregate.append(core.AggregatedFieldDef(**dct)) + return self._add_transform( + core.AggregateTransform(aggregate=aggregate, groupby=groupby) + ) + + def transform_bin(self, as_=Undefined, field=Undefined, bin=True, **kwargs): + """ + Add a BinTransform to the schema. + + Parameters + ---------- + as_ : anyOf(string, List(string)) + The output fields at which to write the start and end bin values. + bin : anyOf(boolean, :class:`BinParams`) + An object indicating bin properties, or simply ``true`` for using default bin + parameters. + field : string + The data field to bin. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + Examples + -------- + >>> import altair as alt + >>> chart = alt.Chart().transform_bin("x_binned", "x") + >>> chart.transform[0] + BinTransform({ + as: 'x_binned', + bin: True, + field: 'x' + }) + + >>> chart = alt.Chart().transform_bin("x_binned", "x", + ... bin=alt.Bin(maxbins=10)) + >>> chart.transform[0] + BinTransform({ + as: 'x_binned', + bin: BinParams({ + maxbins: 10 + }), + field: 'x' + }) + + See Also + -------- + alt.BinTransform : underlying transform object + + """ + if as_ is not Undefined: + if "as" in kwargs: + raise ValueError( + "transform_bin: both 'as_' and 'as' passed as arguments." + ) + kwargs["as"] = as_ + kwargs["bin"] = bin + kwargs["field"] = field + return self._add_transform(core.BinTransform(**kwargs)) + + def transform_calculate(self, as_=Undefined, calculate=Undefined, **kwargs): + """ + Add a CalculateTransform to the schema. + + Parameters + ---------- + as_ : string + The field for storing the computed formula value. + calculate : string or alt.expr expression + A `expression `__ + string. Use the variable ``datum`` to refer to the current data object. + **kwargs + transforms can also be passed by keyword argument; see Examples + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + Examples + -------- + >>> import altair as alt + >>> from altair import datum, expr + + >>> chart = alt.Chart().transform_calculate(y = 2 * expr.sin(datum.x)) + >>> chart.transform[0] + CalculateTransform({ + as: 'y', + calculate: (2 * sin(datum.x)) + }) + + It's also possible to pass the ``CalculateTransform`` arguments directly: + + >>> kwds = {'as': 'y', 'calculate': '2 * sin(datum.x)'} + >>> chart = alt.Chart().transform_calculate(**kwds) + >>> chart.transform[0] + CalculateTransform({ + as: 'y', + calculate: '2 * sin(datum.x)' + }) + + As the first form is easier to write and understand, that is the + recommended method. + + See Also + -------- + alt.CalculateTransform : underlying transform object + """ + if as_ is Undefined: + as_ = kwargs.pop("as", Undefined) + elif "as" in kwargs: + raise ValueError( + "transform_calculate: both 'as_' and 'as' passed as arguments." + ) + if as_ is not Undefined or calculate is not Undefined: + dct = {"as": as_, "calculate": calculate} + self = self._add_transform(core.CalculateTransform(**dct)) + for as_, calculate in kwargs.items(): + dct = {"as": as_, "calculate": calculate} + self = self._add_transform(core.CalculateTransform(**dct)) + return self + + def transform_density( + self, + density, + as_=Undefined, + bandwidth=Undefined, + counts=Undefined, + cumulative=Undefined, + extent=Undefined, + groupby=Undefined, + maxsteps=Undefined, + minsteps=Undefined, + steps=Undefined, + ): + """Add a DensityTransform to the spec. + + Attributes + ---------- + density : str + The data field for which to perform density estimation. + as_ : [str, str] + The output fields for the sample value and corresponding density estimate. + **Default value:** ``["value", "density"]`` + 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 + A boolean flag indicating if the output values should be probability estimates + (false) or smoothed counts (true). + **Default value:** ``false`` + cumulative : boolean + A boolean flag indicating whether to produce density estimates (false) or cumulative + density estimates (true). + **Default value:** ``false`` + extent : List([float, 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(str) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + maxsteps : float + The maximum number of samples to take along the extent domain for plotting the + density. **Default value:** ``200`` + minsteps : float + The minimum number of samples to take along the extent domain for plotting the + density. **Default value:** ``25`` + steps : float + The exact number of samples to take along the extent domain for plotting the + 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. + """ + return self._add_transform( + core.DensityTransform( + density=density, + bandwidth=bandwidth, + counts=counts, + cumulative=cumulative, + extent=extent, + groupby=groupby, + maxsteps=maxsteps, + minsteps=minsteps, + steps=steps, + **{"as": as_}, + ) + ) + + def transform_impute( + self, + impute, + key, + frame=Undefined, + groupby=Undefined, + keyvals=Undefined, + method=Undefined, + value=Undefined, + ): + """ + Add an ImputeTransform to the schema. + + Parameters + ---------- + impute : string + The data field for which the missing values should be imputed. + key : string + 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)) + 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 + rows preceding or following the current data object. For example, the value ``[-5, + 5]`` indicates that the window should include five objects preceding and five + objects following the current object. + **Default value:** : ``[null, null]`` indicating that the window includes all + objects. + groupby : List(string) + 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`) + Defines the key values that should be considered for imputation. + An array of key values or an object defining a `number sequence + `__. + If provided, this will be used in addition to the key values observed within the + input data. If not provided, the values will be derived from all unique values of + the ``key`` field. For ``impute`` in ``encoding``, the key field is the x-field if + the y-field is imputed, or vice versa. + If there is no impute grouping, this property *must* be specified. + method : :class:`ImputeMethod` + The imputation method to use for the field value of imputed data objects. + One of ``value``, ``mean``, ``median``, ``max`` or ``min``. + **Default value:** ``"value"`` + value : Mapping(required=[]) + The field value to use when the imputation ``method`` is ``"value"``. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.ImputeTransform : underlying transform object + """ + return self._add_transform( + core.ImputeTransform( + impute=impute, + key=key, + frame=frame, + groupby=groupby, + keyvals=keyvals, + method=method, + value=value, + ) + ) + + def transform_joinaggregate( + self, joinaggregate=Undefined, groupby=Undefined, **kwargs + ): + """ + Add a JoinAggregateTransform to the schema. + + Parameters + ---------- + joinaggregate : List(:class:`JoinAggregateFieldDef`) + The definition of the fields in the join aggregate, and what calculations to use. + groupby : List(string) + The data fields for partitioning the data objects into separate groups. If + unspecified, all data points will be in a single group. + **kwargs + joinaggregates can also be passed by keyword argument; see Examples. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + Examples + -------- + >>> import altair as alt + >>> chart = alt.Chart().transform_joinaggregate(x='sum(y)') + >>> chart.transform[0] + JoinAggregateTransform({ + joinaggregate: [JoinAggregateFieldDef({ + as: 'x', + field: 'y', + op: 'sum' + })] + }) + + See Also + -------- + alt.JoinAggregateTransform : underlying transform object + """ + if joinaggregate is Undefined: + joinaggregate = [] + for key, val in kwargs.items(): + parsed = utils.parse_shorthand(val) + dct = { + "as": key, + "field": parsed.get("field", Undefined), + "op": parsed.get("aggregate", Undefined), + } + joinaggregate.append(core.JoinAggregateFieldDef(**dct)) + return self._add_transform( + core.JoinAggregateTransform(joinaggregate=joinaggregate, groupby=groupby) + ) + + def transform_filter(self, filter, **kwargs): + """ + Add a FilterTransform to the schema. + + Parameters + ---------- + filter : a filter expression or :class:`PredicateComposition` + The `filter` property must be one of the predicate definitions: + (1) a string or alt.expr expression + (2) a range predicate + (3) a selection predicate + (4) a logical operand combining (1)-(3) + (5) a Selection object + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.FilterTransform : underlying transform object + + """ + if isinstance(filter, Selection): + filter = {"selection": filter.name} + elif isinstance(filter, core.SelectionComposition): + filter = {"selection": filter} + return self._add_transform(core.FilterTransform(filter=filter, **kwargs)) + + def transform_flatten(self, flatten, as_=Undefined): + """Add a FlattenTransform to the schema. + + Parameters + ---------- + flatten : List(string) + 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(string) + The output field names for extracted array values. + **Default value:** The field name of the corresponding array field + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.FlattenTransform : underlying transform object + """ + return self._add_transform( + core.FlattenTransform(flatten=flatten, **{"as": as_}) + ) + + def transform_fold(self, fold, as_=Undefined): + """Add a FoldTransform to the spec. + + Parameters + ---------- + fold : List(string) + An array of data fields indicating the properties to fold. + as : [string, string] + The output field names for the key and value properties produced by the fold + transform. Default: ``["key", "value"]`` + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + Chart.transform_pivot : pivot transform - opposite of fold. + alt.FoldTransform : underlying transform object + """ + return self._add_transform(core.FoldTransform(fold=fold, **{"as": as_})) + + def transform_loess( + self, on, loess, as_=Undefined, bandwidth=Undefined, groupby=Undefined + ): + """Add a LoessTransform to the spec. + + Parameters + ---------- + on : str + The data field of the independent variable to use a predictor. + loess : str + The data field of the dependent variable to smooth. + as_ : [str, 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. + bandwidth : float + A bandwidth parameter in the range ``[0, 1]`` that determines the amount of + smoothing. **Default value:** ``0.3`` + groupby : List(str) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + Chart.transform_regression: regression transform + alt.LoessTransform : underlying transform object + """ + return self._add_transform( + core.LoessTransform( + loess=loess, on=on, bandwidth=bandwidth, groupby=groupby, **{"as": as_} + ) + ) + + def transform_lookup( + self, + lookup=Undefined, + from_=Undefined, + as_=Undefined, + default=Undefined, + **kwargs, + ): + """Add a DataLookupTransform or SelectionLookupTransform to the chart + + Attributes + ---------- + lookup : string + Key in primary data source. + from_ : anyOf(:class:`LookupData`, :class:`LookupSelection`) + Secondary data reference. + as_ : anyOf(string, List(string)) + 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 specified (those field names will be used); if ``from_.fields`` + has not been specified, ``as_`` must be a string. + + 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``. + default : string + The default value to use if lookup fails. **Default value:** ``null`` + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.DataLookupTransform : underlying transform object + alt.SelectionLookupTransform : underlying transform object + """ + if as_ is not Undefined: + if "as" in kwargs: + raise ValueError( + "transform_lookup: both 'as_' and 'as' passed as arguments." + ) + kwargs["as"] = as_ + if from_ is not Undefined: + if "from" in kwargs: + raise ValueError( + "transform_lookup: both 'from_' and 'from' passed as arguments." + ) + kwargs["from"] = from_ + kwargs["lookup"] = lookup + kwargs["default"] = default + return self._add_transform(core.LookupTransform(**kwargs)) + + def transform_pivot( + self, pivot, value, groupby=Undefined, limit=Undefined, op=Undefined + ): + """Add a pivot transform to the chart. + + Parameters + ---------- + pivot : str + The data field to pivot on. The unique values of this field become new field names + in the output stream. + value : str + The data field to populate pivoted fields. The aggregate values of this field become + the values of the new pivoted fields. + groupby : List(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 : string + The aggregation operation to apply to grouped ``value`` field values. + **Default value:** ``sum`` + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + Chart.transform_fold : fold transform - opposite of pivot. + alt.PivotTransform : underlying transform object + """ + return self._add_transform( + core.PivotTransform( + pivot=pivot, value=value, groupby=groupby, limit=limit, op=op + ) + ) + + def transform_quantile( + self, + quantile, + as_=Undefined, + groupby=Undefined, + probs=Undefined, + step=Undefined, + ): + """Add a quantile transform to the chart + + Parameters + ---------- + quantile : str + The data field for which to perform quantile estimation. + as : [str, str] + The output field names for the probability and quantile values. + groupby : List(str) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + probs : List(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. **Default value:** ``["prob", "value"]`` + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.QuantileTransform : underlying transform object + """ + return self._add_transform( + core.QuantileTransform( + quantile=quantile, + groupby=groupby, + probs=probs, + step=step, + **{"as": as_}, + ) + ) + + def transform_regression( + self, + on, + regression, + as_=Undefined, + extent=Undefined, + groupby=Undefined, + method=Undefined, + order=Undefined, + params=Undefined, + ): + """Add a RegressionTransform to the chart. + + Parameters + ---------- + on : str + The data field of the independent variable to use a predictor. + regression : str + The data field of the dependent variable to predict. + as_ : [str, 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. + extent : [float, float] + A [min, max] domain over the independent (x) field for the starting and ending + points of the generated trend line. + groupby : List(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') + The functional form of the regression model. One of ``"linear"``, ``"log"``, + ``"exp"``, ``"pow"``, ``"quad"``, or ``"poly"``. **Default value:** ``"linear"`` + order : float + The polynomial order (number of coefficients) for the 'poly' method. + **Default value:** ``3`` + params : boolean + 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 intercept term and then including terms of increasing order) + and an ``rSquared`` value (indicating the total variance explained by the model). + **Default value:** ``false`` + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + Chart.transform_loess : LOESS transform + alt.RegressionTransform : underlying transform object + """ + return self._add_transform( + core.RegressionTransform( + regression=regression, + on=on, + extent=extent, + groupby=groupby, + method=method, + order=order, + params=params, + **{"as": as_}, + ) + ) + + def transform_sample(self, sample=1000): + """ + Add a SampleTransform to the schema. + + Parameters + ---------- + sample : float + The maximum number of data objects to include in the sample. Default: 1000. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.SampleTransform : underlying transform object + """ + return self._add_transform(core.SampleTransform(sample)) + + def transform_stack(self, as_, stack, groupby, offset=Undefined, sort=Undefined): + """ + Add a StackTransform to the schema. + + Parameters + ---------- + as_ : anyOf(string, List(string)) + 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(eg."val") is provided, the end field will be "val_end". + stack : string + The field which is stacked. + groupby : List(string) + The data fields to group by. + offset : enum('zero', 'center', 'normalize') + Mode for stacking marks. Default: 'zero'. + sort : List(:class:`SortField`) + Field that determines the order of leaves in the stacked charts. + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + See Also + -------- + alt.StackTransform : underlying transform object + """ + return self._add_transform( + core.StackTransform( + stack=stack, groupby=groupby, offset=offset, sort=sort, **{"as": as_} + ) + ) + + def transform_timeunit( + self, as_=Undefined, field=Undefined, timeUnit=Undefined, **kwargs + ): + """ + Add a TimeUnitTransform to the schema. + + Parameters + ---------- + as_ : string + The output field to write the timeUnit value. + field : string + The data field to apply time unit. + timeUnit : :class:`TimeUnit` + The timeUnit. + **kwargs + transforms can also be passed by keyword argument; see Examples + + Returns + ------- + self : Chart object + returns chart to allow for chaining + + Examples + -------- + >>> import altair as alt + >>> from altair import datum, expr + + >>> chart = alt.Chart().transform_timeunit(month='month(date)') + >>> chart.transform[0] + TimeUnitTransform({ + as: 'month', + field: 'date', + timeUnit: 'month' + }) + + It's also possible to pass the ``TimeUnitTransform`` arguments directly; + this is most useful in cases where the desired field name is not a + valid python identifier: + + >>> kwds = {'as': 'month', 'timeUnit': 'month', 'field': 'The Month'} + >>> chart = alt.Chart().transform_timeunit(**kwds) + >>> chart.transform[0] + TimeUnitTransform({ + as: 'month', + field: 'The Month', + timeUnit: 'month' + }) + + As the first form is easier to write and understand, that is the + recommended method. + + See Also + -------- + alt.TimeUnitTransform : underlying transform object + + """ + if as_ is Undefined: + as_ = kwargs.pop("as", Undefined) + else: + if "as" in kwargs: + raise ValueError( + "transform_timeunit: both 'as_' and 'as' passed as arguments." + ) + if as_ is not Undefined: + dct = {"as": as_, "timeUnit": timeUnit, "field": field} + self = self._add_transform(core.TimeUnitTransform(**dct)) + for as_, shorthand in kwargs.items(): + dct = utils.parse_shorthand( + shorthand, + parse_timeunits=True, + parse_aggregates=False, + parse_types=False, + ) + dct.pop("type", None) + dct["as"] = as_ + if "timeUnit" not in dct: + raise ValueError("'{}' must include a valid timeUnit".format(shorthand)) + self = self._add_transform(core.TimeUnitTransform(**dct)) + return self + + def transform_window( + self, + window=Undefined, + frame=Undefined, + groupby=Undefined, + ignorePeers=Undefined, + sort=Undefined, + **kwargs, + ): + """Add a WindowTransform to the schema + + Parameters + ---------- + window : List(:class:`WindowFieldDef`) + The definition of the fields in the window, and what calculations to use. + frame : List(anyOf(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 + following the current data object. The default value is ``[null, 0]``, indicating + that the sliding window includes the current object and all preceding objects. The + value ``[-5, 5]`` indicates that the window should include five objects preceding + and five objects following the current object. Finally, ``[null, null]`` indicates + that the window frame should always include all data objects. The only operators + affected are the aggregation operations and the ``first_value``, ``last_value``, and + ``nth_value`` window operations. The other window operations are not affected by + this. + + **Default value:** : ``[null, 0]`` (includes the current object and all preceding + objects) + groupby : List(string) + The data fields for partitioning the data objects into separate windows. If + unspecified, all data points will be in a single group. + ignorePeers : boolean + Indicates if the sliding window frame should ignore peer values. (Peer values are + those 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 defined by offset values only. This setting only affects those operations + that depend on the window frame, namely aggregation operations and the first_value, + last_value, and nth_value window operations. + + **Default value:** ``false`` + sort : List(:class:`SortField`) + 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`` ). + **kwargs + transforms can also be passed by keyword argument; see Examples + + Examples + -------- + A cumulative line chart + + >>> import altair as alt + >>> import numpy as np + >>> import pandas as pd + >>> data = pd.DataFrame({'x': np.arange(100), + ... 'y': np.random.randn(100)}) + >>> chart = alt.Chart(data).mark_line().encode( + ... x='x:Q', + ... y='ycuml:Q' + ... ).transform_window( + ... ycuml='sum(y)' + ... ) + >>> chart.transform[0] + WindowTransform({ + window: [WindowFieldDef({ + as: 'ycuml', + field: 'y', + op: 'sum' + })] + }) + + """ + if kwargs: + if window is Undefined: + window = [] + for as_, shorthand in kwargs.items(): + kwds = {"as": as_} + kwds.update( + utils.parse_shorthand( + shorthand, + parse_aggregates=False, + parse_window_ops=True, + parse_timeunits=False, + parse_types=False, + ) + ) + window.append(core.WindowFieldDef(**kwds)) + + return self._add_transform( + core.WindowTransform( + window=window, + frame=frame, + groupby=groupby, + ignorePeers=ignorePeers, + sort=sort, + ) + ) + + # Display-related methods + + def _repr_mimebundle_(self, include=None, exclude=None): + """Return a MIME bundle for display in Jupyter frontends.""" + # Catch errors explicitly to get around issues in Jupyter frontend + # see https://github.com/ipython/ipython/issues/11038 + try: + dct = self.to_dict() + except Exception: + utils.display_traceback(in_ipython=True) + return {} + else: + return renderers.get()(dct) + + 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 + + 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) + + @utils.deprecation.deprecated(message="serve() is deprecated. Use show() instead.") + def serve( + self, + ip="127.0.0.1", + port=8888, + n_retries=50, + files=None, + jupyter_warning=True, + open_browser=True, + http_server=None, + **kwargs, + ): + """Open a browser window and display a rendering of the chart + + Parameters + ---------- + html : string + HTML to serve + ip : string (default = '127.0.0.1') + ip address at which the HTML will be served. + port : int (default = 8888) + the port at which to serve the HTML + n_retries : int (default = 50) + the number of nearby ports to search if the specified port + is already in use. + files : dictionary (optional) + dictionary of extra content to serve + jupyter_warning : bool (optional) + if True (default), then print a warning if this is used + within the Jupyter notebook + open_browser : bool (optional) + if True (default), then open a web browser to the given HTML + http_server : class (optional) + optionally specify an HTTPServer class to use for showing the + figure. The default is Python's basic HTTPServer. + **kwargs : + additional keyword arguments passed to the save() method + + """ + from ...utils.server import serve + + html = io.StringIO() + self.save(html, format="html", **kwargs) + html.seek(0) + + serve( + html.read(), + ip=ip, + port=port, + n_retries=n_retries, + files=files, + jupyter_warning=jupyter_warning, + open_browser=open_browser, + http_server=http_server, + ) + + def show(self, embed_opt=None, open_browser=None): + """Show the chart in an external browser window. + + This requires a recent version of the altair_viewer package. + + Parameters + ---------- + embed_opt : dict (optional) + The Vega embed options that control the dispay of the chart. + open_browser : bool (optional) + Specify whether a browser window should be opened. If not specified, + a browser window will be opened only if the server is not already + connected to a browser. + """ + try: + import altair_viewer # type: ignore + except ImportError: + raise ValueError( + "show() method requires the altair_viewer package. " + "See http://github.com/altair-viz/altair_viewer" + ) + altair_viewer.show(self, embed_opt=embed_opt, open_browser=open_browser) + + @utils.use_signature(core.Resolve) + def _set_resolve(self, **kwargs): + """Copy the chart and update the resolve property with kwargs""" + if not hasattr(self, "resolve"): + raise ValueError( + "{} object has no attribute " "'resolve'".format(self.__class__) + ) + copy = self.copy(deep=["resolve"]) + if copy.resolve is Undefined: + copy.resolve = core.Resolve() + for key, val in kwargs.items(): + copy.resolve[key] = val + return copy + + @utils.use_signature(core.AxisResolveMap) + def resolve_axis(self, *args, **kwargs): + return self._set_resolve(axis=core.AxisResolveMap(*args, **kwargs)) + + @utils.use_signature(core.LegendResolveMap) + def resolve_legend(self, *args, **kwargs): + return self._set_resolve(legend=core.LegendResolveMap(*args, **kwargs)) + + @utils.use_signature(core.ScaleResolveMap) + def resolve_scale(self, *args, **kwargs): + return self._set_resolve(scale=core.ScaleResolveMap(*args, **kwargs)) + + +class _EncodingMixin(object): + @utils.use_signature(core.FacetedEncoding) + def encode(self, *args, **kwargs): + # 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() if v is not Undefined} + + # update with the new encodings, and apply them to the copy + encoding.update(kwargs) + copy.encoding = core.FacetedEncoding(**encoding) + return copy + + 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: + if self.data is Undefined: + raise ValueError( + "Facet charts require data to be specified at the top level." + ) + self = self.copy(deep=False) + data, self.data = self.data, Undefined + + if facet_specified: + if isinstance(facet, str): + facet = channels.Facet(facet) + else: + facet = FacetMapping(row=row, column=column) + + return FacetChart(spec=self, facet=facet, data=data, columns=columns, **kwargs) + + +class Chart( + TopLevelMixin, _EncodingMixin, mixins.MarkMethodMixin, core.TopLevelUnitSpec +): + """Create a basic Altair/Vega-Lite chart. + + Although it is possible to set all Chart properties as constructor attributes, + it is more idiomatic to use methods such as ``mark_point()``, ``encode()``, + ``transform_filter()``, ``properties()``, etc. See Altair's documentation + for details and examples: http://altair-viz.github.io/. + + Attributes + ---------- + data : Data + An object describing the data source + mark : AnyMark + A string describing the mark type (one of `"bar"`, `"circle"`, `"square"`, `"tick"`, + `"line"`, * `"area"`, `"point"`, `"rule"`, `"geoshape"`, and `"text"`) or a + MarkDef object. + encoding : FacetedEncoding + A key-value mapping between encoding channels and definition of fields. + autosize : anyOf(AutosizeType, AutoSizeParams) + Sets 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. `"fit"` is only supported for single and + layered views that don't use `rangeStep`. __Default value__: `pad` + background : string + CSS color property to use as the background of visualization. + + **Default value:** none (transparent) + config : Config + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + description : string + Description of this mark for commenting purpose. + height : float + The height of a visualization. + name : string + Name of the visualization for later reference. + padding : Padding + 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` + projection : Projection + An object defining properties of geographic projection. Works with `"geoshape"` + marks and `"point"` or `"line"` marks that have a channel (one or more of `"X"`, + `"X2"`, `"Y"`, `"Y2"`) with type `"latitude"`, or `"longitude"`. + selection : Mapping(required=[]) + A key-value mapping between selection names and definitions. + title : anyOf(string, TitleParams) + Title for the plot. + transform : List(Transform) + An array of data transformations such as filter and new field calculation. + width : float + The width of a visualization. + """ + + def __init__( + self, + data=Undefined, + encoding=Undefined, + mark=Undefined, + width=Undefined, + height=Undefined, + **kwargs, + ): + super(Chart, self).__init__( + data=data, + encoding=encoding, + mark=mark, + width=width, + height=height, + **kwargs, + ) + + @classmethod + def from_dict(cls, dct, validate=True): + """Construct class from a dictionary representation + + Parameters + ---------- + dct : dictionary + The dict from which to construct the class + validate : boolean + If True (default), then validate the input against the schema. + + Returns + ------- + obj : Chart object + The wrapped schema + + Raises + ------ + jsonschema.ValidationError : + if validate=True and dct does not conform to the schema + """ + for class_ in TopLevelMixin.__subclasses__(): + if class_ is Chart: + class_ = super(Chart, cls) + try: + return class_.from_dict(dct, validate=validate) + except jsonschema.ValidationError: + pass + + # As a last resort, try using the Root vegalite object + return core.Root.from_dict(dct, validate) + + def to_dict(self, *args, **kwargs): + """Convert the chart to a dictionary suitable for JSON export.""" + context = kwargs.get("context", {}) + if self.data is Undefined and "data" not in context: + # No data specified here or in parent: inject empty data + # for easier specification of datum encodings. + copy = self.copy(deep=False) + copy.data = core.InlineData(values=[{}]) + return super(Chart, copy).to_dict(*args, **kwargs) + return super().to_dict(*args, **kwargs) + + 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 + + Parameters + ---------- + name : string + The selection name to use for the axes scales. This name should be + unique among all selections within the chart. + bind_x : boolean, default True + If true, then bind the interactive scales to the x-axis + bind_y : boolean, default True + If true, then bind the interactive scales to the y-axis + + Returns + ------- + chart : + copy of self, with interactive axes added + + """ + encodings = [] + if bind_x: + encodings.append("x") + if bind_y: + encodings.append("y") + return self.add_selection( + selection_interval(bind="scales", encodings=encodings) + ) + + +def _check_if_valid_subspec(spec, classname): + """Check if the spec is a valid sub-spec. + + If it is not, then raise a ValueError + """ + err = ( + 'Objects with "{0}" attribute cannot be used within {1}. ' + "Consider defining the {0} attribute in the {1} object instead." + ) + + if not isinstance(spec, (core.SchemaBase, dict)): + raise ValueError("Only chart objects can be used in {0}.".format(classname)) + for attr in TOPLEVEL_ONLY_KEYS: + if isinstance(spec, core.SchemaBase): + val = getattr(spec, attr, Undefined) + else: + val = spec.get(attr, Undefined) + if val is not Undefined: + raise ValueError(err.format(attr, classname)) + + +def _check_if_can_be_layered(spec): + """Check if the spec can be layered.""" + + def _get(spec, attr): + if isinstance(spec, core.SchemaBase): + return spec._get(attr) + else: + return spec.get(attr, Undefined) + + encoding = _get(spec, "encoding") + 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.") + 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.") + if isinstance(spec, FacetChart) or _get(spec, "facet") is not Undefined: + raise ValueError("Faceted charts cannot be layered.") + if isinstance(spec, RepeatChart) or _get(spec, "repeat") is not Undefined: + raise ValueError("Repeat charts cannot be layered.") + if isinstance(spec, ConcatChart) or _get(spec, "concat") is not Undefined: + raise ValueError("Concatenated charts cannot be layered.") + if isinstance(spec, HConcatChart) or _get(spec, "hconcat") is not Undefined: + raise ValueError("Concatenated charts cannot be layered.") + if isinstance(spec, VConcatChart) or _get(spec, "vconcat") is not Undefined: + raise ValueError("Concatenated charts cannot be layered.") + + +@utils.use_signature(core.TopLevelRepeatSpec) +class RepeatChart(TopLevelMixin, core.TopLevelRepeatSpec): + """A chart repeated across rows and columns with small changes""" + + # Because TopLevelRepeatSpec is defined as a union as of Vega-Lite schema 4.9, + # we set the arguments explicitly here. + # TODO: Should we instead use tools/schemapi/codegen._get_args? + def __init__( + self, + repeat=Undefined, + spec=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, + ): + _check_if_valid_subspec(spec, "RepeatChart") + super(RepeatChart, self).__init__( + repeat=repeat, + spec=spec, + 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, + ) + + def interactive(self, name=None, bind_x=True, bind_y=True): + """Make chart axes scales interactive + + Parameters + ---------- + name : string + The selection name to use for the axes scales. This name should be + unique among all selections within the chart. + bind_x : boolean, default True + If true, then bind the interactive scales to the x-axis + bind_y : boolean, default True + If true, then bind the interactive scales to the y-axis + + Returns + ------- + chart : + copy of self, with interactive axes added + + """ + copy = self.copy(deep=False) + 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 + + The output of this should be passed to the ``field`` attribute of + a channel. + + Parameters + ---------- + repeater : {'row'|'column'|'repeat'|'layer'} + The repeater to tie the field to. Default is 'repeat'. + + Returns + ------- + repeat : RepeatRef object + """ + if repeater not in ["row", "column", "repeat", "layer"]: + raise ValueError("repeater must be one of ['row', 'column', 'repeat', 'layer']") + return core.RepeatRef(repeat=repeater) + + +@utils.use_signature(core.TopLevelNormalizedConcatSpecGenericSpec) +class ConcatChart(TopLevelMixin, core.TopLevelNormalizedConcatSpecGenericSpec): + """A chart with horizontally-concatenated facets""" + + def __init__(self, data=Undefined, concat=(), columns=Undefined, **kwargs): + # TODO: move common data to top level? + for spec in concat: + _check_if_valid_subspec(spec, "ConcatChart") + super(ConcatChart, self).__init__( + data=data, concat=list(concat), columns=columns, **kwargs + ) + self.data, self.concat = _combine_subchart_data(self.data, self.concat) + + def __ior__(self, other): + _check_if_valid_subspec(other, "ConcatChart") + self.concat.append(other) + self.data, self.concat = _combine_subchart_data(self.data, self.concat) + return self + + def __or__(self, other): + copy = self.copy(deep=["concat"]) + 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""" + return ConcatChart(concat=charts, **kwargs) + + +@utils.use_signature(core.TopLevelNormalizedHConcatSpecGenericSpec) +class HConcatChart(TopLevelMixin, core.TopLevelNormalizedHConcatSpecGenericSpec): + """A chart with horizontally-concatenated facets""" + + def __init__(self, data=Undefined, hconcat=(), **kwargs): + # TODO: move common data to top level? + for spec in hconcat: + _check_if_valid_subspec(spec, "HConcatChart") + super(HConcatChart, self).__init__(data=data, hconcat=list(hconcat), **kwargs) + self.data, self.hconcat = _combine_subchart_data(self.data, self.hconcat) + + def __ior__(self, other): + _check_if_valid_subspec(other, "HConcatChart") + self.hconcat.append(other) + self.data, self.hconcat = _combine_subchart_data(self.data, self.hconcat) + return self + + def __or__(self, other): + copy = self.copy(deep=["hconcat"]) + 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""" + return HConcatChart(hconcat=charts, **kwargs) + + +@utils.use_signature(core.TopLevelNormalizedVConcatSpecGenericSpec) +class VConcatChart(TopLevelMixin, core.TopLevelNormalizedVConcatSpecGenericSpec): + """A chart with vertically-concatenated facets""" + + def __init__(self, data=Undefined, vconcat=(), **kwargs): + # TODO: move common data to top level? + for spec in vconcat: + _check_if_valid_subspec(spec, "VConcatChart") + super(VConcatChart, self).__init__(data=data, vconcat=list(vconcat), **kwargs) + self.data, self.vconcat = _combine_subchart_data(self.data, self.vconcat) + + def __iand__(self, other): + _check_if_valid_subspec(other, "VConcatChart") + self.vconcat.append(other) + self.data, self.vconcat = _combine_subchart_data(self.data, self.vconcat) + return self + + def __and__(self, other): + copy = self.copy(deep=["vconcat"]) + 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""" + return VConcatChart(vconcat=charts, **kwargs) + + +@utils.use_signature(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? + # TODO: check for conflicting interaction + for spec in layer: + _check_if_valid_subspec(spec, "LayerChart") + _check_if_can_be_layered(spec) + super(LayerChart, self).__init__(data=data, layer=list(layer), **kwargs) + self.data, self.layer = _combine_subchart_data(self.data, self.layer) + + def __iadd__(self, other): + _check_if_valid_subspec(other, "LayerChart") + _check_if_can_be_layered(other) + self.layer.append(other) + self.data, self.layer = _combine_subchart_data(self.data, self.layer) + return self + + def __add__(self, other): + copy = self.copy(deep=["layer"]) + copy += other + return copy + + def add_layers(self, *layers): + copy = self.copy(deep=["layer"]) + for layer in layers: + copy += layer + return copy + + def interactive(self, name=None, bind_x=True, bind_y=True): + """Make chart axes scales interactive + + Parameters + ---------- + name : string + The selection name to use for the axes scales. This name should be + unique among all selections within the chart. + bind_x : boolean, default True + If true, then bind the interactive scales to the x-axis + bind_y : boolean, default True + If true, then bind the interactive scales to the y-axis + + Returns + ------- + chart : + copy of self, with interactive axes added + + """ + if not self.layer: + raise ValueError( + "LayerChart: cannot call interactive() until a " "layer is defined" + ) + copy = self.copy(deep=["layer"]) + 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[0] = copy.layer[0].add_selection(*selections) + return copy + + +def layer(*charts, **kwargs): + """layer multiple charts""" + return LayerChart(layer=charts, **kwargs) + + +@utils.use_signature(core.TopLevelFacetSpec) +class FacetChart(TopLevelMixin, core.TopLevelFacetSpec): + """A Chart with layers within a single panel""" + + def __init__(self, data=Undefined, spec=Undefined, facet=Undefined, **kwargs): + _check_if_valid_subspec(spec, "FacetChart") + super(FacetChart, self).__init__(data=data, spec=spec, facet=facet, **kwargs) + + def interactive(self, name=None, bind_x=True, bind_y=True): + """Make chart axes scales interactive + + Parameters + ---------- + name : string + The selection name to use for the axes scales. This name should be + unique among all selections within the chart. + bind_x : boolean, default True + If true, then bind the interactive scales to the x-axis + bind_y : boolean, default True + If true, then bind the interactive scales to the y-axis + + Returns + ------- + chart : + copy of self, with interactive axes added + + """ + copy = self.copy(deep=False) + 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 + + Parameters + ---------- + url : string + An URL from which to load the data set. + + feature : string + 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. + + **kwargs : + additional keywords passed to TopoDataFormat + """ + return core.UrlData( + url=url, format=core.TopoDataFormat(type="topojson", feature=feature, **kwargs) + ) + + +def _combine_subchart_data(data, subcharts): + def remove_data(subchart): + if subchart.data is not Undefined: + subchart = subchart.copy() + subchart.data = Undefined + return subchart + + if not subcharts: + # No subcharts = nothing to do. + pass + elif data is Undefined: + # Top level has no data; all subchart data must + # be identical to proceed. + subdata = subcharts[0].data + if subdata is not Undefined and all(c.data is subdata for c in subcharts): + data = subdata + subcharts = [remove_data(c) for c in subcharts] + else: + # Top level has data; subchart data must be either + # undefined or identical to proceed. + if all(c.data is Undefined or c.data is data for c in subcharts): + subcharts = [remove_data(c) for c in subcharts] + + return data, subcharts + + +@utils.use_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) + + +@utils.use_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) + + +def sphere(): + """Sphere generator.""" + return core.SphereGenerator(sphere=True) diff --git a/runtime/Lib/site-packages/altair/vegalite/v4/data.py b/runtime/Lib/site-packages/altair/vegalite/v4/data.py new file mode 100644 index 0000000000000000000000000000000000000000..e379a203490a2bdf7b8ebf22a5ef9e0974558f8f --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v4/data.py @@ -0,0 +1,43 @@ +from ..data import ( + MaxRowsError, + curry, + default_data_transformer, + limit_rows, + pipe, + sample, + to_csv, + to_json, + to_values, + DataTransformerRegistry, +) + + +# ============================================================================== +# VegaLite 4 data transformers +# ============================================================================== + + +ENTRY_POINT_GROUP = "altair.vegalite.v4.data_transformer" # type: str + + +data_transformers = DataTransformerRegistry( + entry_point_group=ENTRY_POINT_GROUP +) # type: DataTransformerRegistry +data_transformers.register("default", default_data_transformer) +data_transformers.register("json", to_json) +data_transformers.register("csv", to_csv) +data_transformers.enable("default") + + +__all__ = ( + "MaxRowsError", + "curry", + "default_data_transformer", + "limit_rows", + "pipe", + "sample", + "to_csv", + "to_json", + "to_values", + "data_transformers", +) diff --git a/runtime/Lib/site-packages/altair/vegalite/v4/display.py b/runtime/Lib/site-packages/altair/vegalite/v4/display.py new file mode 100644 index 0000000000000000000000000000000000000000..7615fc4f68cd97e3a4b2752ee828c79d8f794e55 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v4/display.py @@ -0,0 +1,119 @@ +import os + +from ...utils.mimebundle import spec_to_mimebundle +from ..display import Displayable +from ..display import default_renderer_base +from ..display import json_renderer_base +from ..display import RendererRegistry +from ..display import HTMLRenderer + +from .schema import SCHEMA_VERSION + +VEGALITE_VERSION = SCHEMA_VERSION.lstrip("v") +VEGA_VERSION = "5" +VEGAEMBED_VERSION = "6" + + +# ============================================================================== +# VegaLite v4 renderer logic +# ============================================================================== + + +# The MIME type for Vega-Lite 4.x releases. +VEGALITE_MIME_TYPE = "application/vnd.vegalite.v4+json" # type: str + +# 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. +ENTRY_POINT_GROUP = "altair.vegalite.v4.renderer" # type: str + +# The display message when rendering fails +DEFAULT_DISPLAY = """\ + + +If you see this message, it means the renderer has not been properly enabled +for the frontend that you are using. For more information, see +https://altair-viz.github.io/user_guide/troubleshooting.html +""" + +renderers = RendererRegistry(entry_point_group=ENTRY_POINT_GROUP) + +here = os.path.dirname(os.path.realpath(__file__)) + + +def mimetype_renderer(spec, **metadata): + return default_renderer_base(spec, VEGALITE_MIME_TYPE, DEFAULT_DISPLAY, **metadata) + + +def json_renderer(spec, **metadata): + return json_renderer_base(spec, DEFAULT_DISPLAY, **metadata) + + +def png_renderer(spec, **metadata): + return spec_to_mimebundle( + spec, + format="png", + mode="vega-lite", + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vegalite_version=VEGALITE_VERSION, + **metadata, + ) + + +def svg_renderer(spec, **metadata): + return spec_to_mimebundle( + spec, + format="svg", + mode="vega-lite", + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vegalite_version=VEGALITE_VERSION, + **metadata, + ) + + +html_renderer = HTMLRenderer( + mode="vega-lite", + template="universal", + vega_version=VEGA_VERSION, + vegaembed_version=VEGAEMBED_VERSION, + vegalite_version=VEGALITE_VERSION, +) + +renderers.register("default", html_renderer) +renderers.register("html", html_renderer) +renderers.register("colab", html_renderer) +renderers.register("kaggle", html_renderer) +renderers.register("zeppelin", html_renderer) +renderers.register("mimetype", mimetype_renderer) +renderers.register("jupyterlab", mimetype_renderer) +renderers.register("nteract", mimetype_renderer) +renderers.register("json", json_renderer) +renderers.register("png", png_renderer) +renderers.register("svg", svg_renderer) +renderers.enable("default") + + +class VegaLite(Displayable): + """An IPython/Jupyter display class for rendering VegaLite 4.""" + + renderers = renderers + schema_path = (__name__, "schema/vega-lite-schema.json") + + +def vegalite(spec, validate=True): + """Render and optionally validate a VegaLite 4 spec. + + This will use the currently enabled renderer to render the spec. + + Parameters + ========== + spec: dict + A fully compliant VegaLite 4 spec, with the data portion fully processed. + validate: bool + Should the spec be validated against the VegaLite 4 schema? + """ + from IPython.display import display + + display(VegaLite(spec, validate=validate)) diff --git a/runtime/Lib/site-packages/altair/vegalite/v4/schema/__init__.py b/runtime/Lib/site-packages/altair/vegalite/v4/schema/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..618a50350bc74acb21a60987a78f62535c70b8b2 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v4/schema/__init__.py @@ -0,0 +1,5 @@ +# flake8: noqa +from .core import * +from .channels import * +SCHEMA_VERSION = 'v4.17.0' +SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v4.17.0.json' diff --git a/runtime/Lib/site-packages/altair/vegalite/v4/schema/channels.py b/runtime/Lib/site-packages/altair/vegalite/v4/schema/channels.py new file mode 100644 index 0000000000000000000000000000000000000000..1a6dda19d501793f2a0d2d7d542727fdfca61427 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v4/schema/channels.py @@ -0,0 +1,10343 @@ +# The contents of this file are automatically written by +# tools/generate_schema_wrapper.py. Do not modify directly. + +from . import core +import pandas as pd +from altair.utils.schemapi import Undefined +from altair.utils import parse_shorthand + + +class FieldChannelMixin(object): + def to_dict(self, validate=True, ignore=(), context=None): + context = context or {} + shorthand = self._get('shorthand') + field = self._get('field') + + if shorthand is not Undefined and field is not Undefined: + 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] + + 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 + 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) + elif not (type_in_shorthand or type_defined_explicitly): + if isinstance(context.get('data', None), pd.DataFrame): + raise ValueError("{} encoding field is specified without a type; " + "the type cannot be inferred because it does not " + "match any column in the data.".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)) + else: + # Shorthand is not a string; we pass the definition to field, + # and do not do any parsing. + parsed = {'field': shorthand} + + # 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, + context=context + ) + + +class ValueChannelMixin(object): + def to_dict(self, validate=True, ignore=(), context=None): + context = context or {} + condition = getattr(self, 'condition', Undefined) + 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) + + +class DatumChannelMixin(object): + def to_dict(self, validate=True, ignore=(), context=None): + context = context or {} + datum = getattr(self, 'datum', Undefined) + 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) + + +class Angle(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): + """Angle schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "angle" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class AngleDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): + """AngleDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "angle" + def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(AngleDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) + + +class AngleValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """AngleValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "angle" + + def __init__(self, value, condition=Undefined, **kwds): + super(AngleValue, self).__init__(value=value, condition=condition, **kwds) + + +class Color(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull): + """Color schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "color" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class ColorDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGradientstringnull): + """ColorDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "color" + def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(ColorDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) + + +class ColorValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): + """ColorValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _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) + + +class Column(FieldChannelMixin, core.RowColumnEncodingFieldDef): + """Column schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + align : :class:`LayoutAlign` + The alignment to apply to row/column facet's subplot. The supported string values + are ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. - For ``"each"``, subviews will be aligned into a + clean grid structure, but each row or column may be of variable size. - For + ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + **Default value:** ``"all"``. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + center : boolean + Boolean flag indicating if facet's subviews should be centered relative to their + respective rows or columns. + + **Default value:** ``false`` + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + header : :class:`Header` + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + spacing : float + The spacing in pixels between facet's sub-views. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "column" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, align=Undefined, band=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, band=band, + bin=bin, center=center, field=field, header=header, sort=sort, + spacing=spacing, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class Description(FieldChannelMixin, core.StringFieldDefWithCondition): + """Description schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"time"`` for temporal fields and ordinal and nominal fields + with ``timeUnit``. - ``"number"`` for quantitative fields as well as ordinal and + nominal fields without ``timeUnit``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "description" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, + labelExpr=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Description, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + condition=condition, field=field, format=format, + formatType=formatType, labelExpr=labelExpr, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class DescriptionValue(ValueChannelMixin, core.StringValueDefWithCondition): + """DescriptionValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "description" + + def __init__(self, value, condition=Undefined, **kwds): + super(DescriptionValue, self).__init__(value=value, condition=condition, **kwds) + + +class Detail(FieldChannelMixin, core.FieldDefWithoutScale): + """Detail schema wrapper + + Mapping(required=[shorthand]) + Definition object for a data field, its type and transformation of an encoding channel. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "detail" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Detail, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class Facet(FieldChannelMixin, core.FacetEncodingFieldDef): + """Facet schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. - For ``"each"``, subviews will be aligned into a + clean grid structure, but each row or column may be of variable size. - For + ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: - the general (wrappable) ``concat`` operator (not + ``hconcat`` / ``vconcat`` ) - the ``facet`` and ``repeat`` operator with one + field/repetition definition (without row/column nesting) + + 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` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + header : :class:`Header` + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "facet" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, align=Undefined, band=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, band=band, + bin=bin, bounds=bounds, center=center, columns=columns, field=field, + header=header, sort=sort, spacing=spacing, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class Fill(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull): + """Fill schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "fill" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class FillDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGradientstringnull): + """FillDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "fill" + def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(FillDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) + + +class FillValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): + """FillValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _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) + + +class FillOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): + """FillOpacity schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "fillOpacity" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class FillOpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): + """FillOpacityDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "fillOpacity" + def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(FillOpacityDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, + **kwds) + + +class FillOpacityValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """FillOpacityValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "fillOpacity" + + def __init__(self, value, condition=Undefined, **kwds): + super(FillOpacityValue, self).__init__(value=value, condition=condition, **kwds) + + +class Href(FieldChannelMixin, core.StringFieldDefWithCondition): + """Href schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"time"`` for temporal fields and ordinal and nominal fields + with ``timeUnit``. - ``"number"`` for quantitative fields as well as ordinal and + nominal fields without ``timeUnit``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "href" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, + labelExpr=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Href, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + condition=condition, field=field, format=format, + formatType=formatType, labelExpr=labelExpr, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class HrefValue(ValueChannelMixin, core.StringValueDefWithCondition): + """HrefValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _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) + + +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. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "key" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Key, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class Latitude(FieldChannelMixin, core.LatLongFieldDef): + """Latitude schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 2) If both field definition's ``title`` and axis, header, or legend ``title`` are + defined, axis/header/legend title will be used. + type : string + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "latitude" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Latitude, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class LatitudeDatum(DatumChannelMixin, core.DatumDef): + """LatitudeDatum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "latitude" + def __init__(self, datum, band=Undefined, type=Undefined, **kwds): + super(LatitudeDatum, self).__init__(datum=datum, band=band, type=type, **kwds) + + +class LatitudeValue(ValueChannelMixin, core.NumericValueDef): + """LatitudeValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values 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) + + +class Latitude2(FieldChannelMixin, core.SecondaryFieldDef): + """Latitude2 schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(Latitude2, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) + + +class Latitude2Datum(DatumChannelMixin, core.DatumDef): + """Latitude2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "latitude2" + def __init__(self, datum, band=Undefined, type=Undefined, **kwds): + super(Latitude2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) + + +class Latitude2Value(ValueChannelMixin, core.PositionValueDef): + """Latitude2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ 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) + + +class Longitude(FieldChannelMixin, core.LatLongFieldDef): + """Longitude schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 2) If both field definition's ``title`` and axis, header, or legend ``title`` are + defined, axis/header/legend title will be used. + type : string + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "longitude" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Longitude, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class LongitudeDatum(DatumChannelMixin, core.DatumDef): + """LongitudeDatum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "longitude" + def __init__(self, datum, band=Undefined, type=Undefined, **kwds): + super(LongitudeDatum, self).__init__(datum=datum, band=band, type=type, **kwds) + + +class LongitudeValue(ValueChannelMixin, core.NumericValueDef): + """LongitudeValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values 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) + + +class Longitude2(FieldChannelMixin, core.SecondaryFieldDef): + """Longitude2 schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(Longitude2, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) + + +class Longitude2Datum(DatumChannelMixin, core.DatumDef): + """Longitude2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "longitude2" + def __init__(self, datum, band=Undefined, type=Undefined, **kwds): + super(Longitude2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) + + +class Longitude2Value(ValueChannelMixin, core.PositionValueDef): + """Longitude2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ 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) + + +class Opacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): + """Opacity schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "opacity" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class OpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): + """OpacityDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "opacity" + def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(OpacityDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, + **kwds) + + +class OpacityValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """OpacityValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _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) + + +class Order(FieldChannelMixin, core.OrderFieldDef): + """Order schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + sort : :class:`SortOrder` + The sort order. One of ``"ascending"`` (default) or ``"descending"``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "order" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, + **kwds): + super(Order, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, sort=sort, timeUnit=timeUnit, title=title, type=type, + **kwds) + + +class OrderValue(ValueChannelMixin, core.OrderValueDef): + """OrderValue schema wrapper + + Mapping(required=[value]) + + Attributes + ---------- + + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + condition : anyOf(:class:`ConditionalValueDefnumber`, + List(:class:`ConditionalValueDefnumber`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "order" + + def __init__(self, value, condition=Undefined, **kwds): + super(OrderValue, self).__init__(value=value, condition=condition, **kwds) + + +class Radius(FieldChannelMixin, core.PositionFieldDefBase): + """Radius schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + 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: - ``"zero"`` or `true`: stacking with + baseline offset at zero value of the scale (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). - ``"normalize"`` + - stacking with normalized domain (for creating `normalized stacked bar and area + charts `__. + :raw-html:`
    ` - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). - ``null`` or + ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "radius" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, + field=field, scale=scale, sort=sort, stack=stack, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class RadiusDatum(DatumChannelMixin, core.PositionDatumDefBase): + """RadiusDatum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + 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: - ``"zero"`` or `true`: stacking with + baseline offset at zero value of the scale (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). - ``"normalize"`` + - stacking with normalized domain (for creating `normalized stacked bar and area + charts `__. + :raw-html:`
    ` - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). - ``null`` or + ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "radius" + def __init__(self, datum, band=Undefined, scale=Undefined, stack=Undefined, type=Undefined, **kwds): + super(RadiusDatum, self).__init__(datum=datum, band=band, scale=scale, stack=stack, type=type, + **kwds) + + +class RadiusValue(ValueChannelMixin, core.PositionValueDef): + """RadiusValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ 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) + + +class Radius2(FieldChannelMixin, core.SecondaryFieldDef): + """Radius2 schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(Radius2, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) + + +class Radius2Datum(DatumChannelMixin, core.DatumDef): + """Radius2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "radius2" + def __init__(self, datum, band=Undefined, type=Undefined, **kwds): + super(Radius2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) + + +class Radius2Value(ValueChannelMixin, core.PositionValueDef): + """Radius2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ 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) + + +class Row(FieldChannelMixin, core.RowColumnEncodingFieldDef): + """Row schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + align : :class:`LayoutAlign` + The alignment to apply to row/column facet's subplot. The supported string values + are ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. - For ``"each"``, subviews will be aligned into a + clean grid structure, but each row or column may be of variable size. - For + ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + **Default value:** ``"all"``. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + center : boolean + Boolean flag indicating if facet's subviews should be centered relative to their + respective rows or columns. + + **Default value:** ``false`` + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + header : :class:`Header` + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + spacing : float + The spacing in pixels between facet's sub-views. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "row" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, align=Undefined, band=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, band=band, + bin=bin, center=center, field=field, header=header, sort=sort, + spacing=spacing, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class Shape(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull): + """Shape schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "shape" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class ShapeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefstringnull): + """ShapeDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "shape" + def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(ShapeDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) + + +class ShapeValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull): + """ShapeValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDefTypeForShape`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _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) + + +class Size(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): + """Size schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "size" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class SizeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): + """SizeDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "size" + def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(SizeDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) + + +class SizeValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """SizeValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _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) + + +class Stroke(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull): + """Stroke schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "stroke" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class StrokeDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefGradientstringnull): + """StrokeDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "stroke" + def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(StrokeDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, **kwds) + + +class StrokeValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull): + """StrokeValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _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) + + +class StrokeDash(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray): + """StrokeDash schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefnumberArrayExprRef`, + List(:class:`ConditionalValueDefnumberArrayExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "strokeDash" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class StrokeDashDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumberArray): + """StrokeDashDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberArrayExprRef`, + List(:class:`ConditionalValueDefnumberArrayExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "strokeDash" + def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(StrokeDashDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, + **kwds) + + +class StrokeDashValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray): + """StrokeDashValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberArrayExprRef`, + List(:class:`ConditionalValueDefnumberArrayExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(List(float), :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "strokeDash" + + def __init__(self, value, condition=Undefined, **kwds): + super(StrokeDashValue, self).__init__(value=value, condition=condition, **kwds) + + +class StrokeOpacity(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): + """StrokeOpacity schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "strokeOpacity" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, + bin=bin, condition=condition, field=field, legend=legend, + scale=scale, sort=sort, timeUnit=timeUnit, title=title, + type=type, **kwds) + + +class StrokeOpacityDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): + """StrokeOpacityDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "strokeOpacity" + def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(StrokeOpacityDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, + **kwds) + + +class StrokeOpacityValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """StrokeOpacityValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "strokeOpacity" + + def __init__(self, value, condition=Undefined, **kwds): + super(StrokeOpacityValue, self).__init__(value=value, condition=condition, **kwds) + + +class StrokeWidth(FieldChannelMixin, core.FieldOrDatumDefWithConditionMarkPropFieldDefnumber): + """StrokeWidth schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "strokeWidth" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, + condition=condition, field=field, legend=legend, scale=scale, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class StrokeWidthDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionDatumDefnumber): + """StrokeWidthDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "strokeWidth" + def __init__(self, datum, band=Undefined, condition=Undefined, type=Undefined, **kwds): + super(StrokeWidthDatum, self).__init__(datum=datum, band=band, condition=condition, type=type, + **kwds) + + +class StrokeWidthValue(ValueChannelMixin, core.ValueDefWithConditionMarkPropFieldOrDatumDefnumber): + """StrokeWidthValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "strokeWidth" + + def __init__(self, value, condition=Undefined, **kwds): + super(StrokeWidthValue, self).__init__(value=value, condition=condition, **kwds) + + +class Text(FieldChannelMixin, core.FieldOrDatumDefWithConditionStringFieldDefText): + """Text schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefTextExprRef`, + List(:class:`ConditionalValueDefTextExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"time"`` for temporal fields and ordinal and nominal fields + with ``timeUnit``. - ``"number"`` for quantitative fields as well as ordinal and + nominal fields without ``timeUnit``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "text" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, + labelExpr=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Text, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + condition=condition, field=field, format=format, + formatType=formatType, labelExpr=labelExpr, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class TextDatum(DatumChannelMixin, core.FieldOrDatumDefWithConditionStringDatumDefText): + """TextDatum schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefTextExprRef`, + List(:class:`ConditionalValueDefTextExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"time"`` for temporal fields and ordinal and nominal fields + with ``timeUnit``. - ``"number"`` for quantitative fields as well as ordinal and + nominal fields without ``timeUnit``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "text" + def __init__(self, datum, band=Undefined, condition=Undefined, format=Undefined, + formatType=Undefined, labelExpr=Undefined, type=Undefined, **kwds): + super(TextDatum, self).__init__(datum=datum, band=band, condition=condition, format=format, + formatType=formatType, labelExpr=labelExpr, type=type, **kwds) + + +class TextValue(ValueChannelMixin, core.ValueDefWithConditionStringFieldDefText): + """TextValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalStringFieldDef`, + :class:`ConditionalValueDefTextExprRef`, List(:class:`ConditionalValueDefTextExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(:class:`Text`, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _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) + + +class Theta(FieldChannelMixin, core.PositionFieldDefBase): + """Theta schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + 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: - ``"zero"`` or `true`: stacking with + baseline offset at zero value of the scale (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). - ``"normalize"`` + - stacking with normalized domain (for creating `normalized stacked bar and area + charts `__. + :raw-html:`
    ` - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). - ``null`` or + ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "theta" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=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, band=band, bin=bin, + field=field, scale=scale, sort=sort, stack=stack, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class ThetaDatum(DatumChannelMixin, core.PositionDatumDefBase): + """ThetaDatum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + 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: - ``"zero"`` or `true`: stacking with + baseline offset at zero value of the scale (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). - ``"normalize"`` + - stacking with normalized domain (for creating `normalized stacked bar and area + charts `__. + :raw-html:`
    ` - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). - ``null`` or + ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "theta" + def __init__(self, datum, band=Undefined, scale=Undefined, stack=Undefined, type=Undefined, **kwds): + super(ThetaDatum, self).__init__(datum=datum, band=band, scale=scale, stack=stack, type=type, + **kwds) + + +class ThetaValue(ValueChannelMixin, core.PositionValueDef): + """ThetaValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ 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) + + +class Theta2(FieldChannelMixin, core.SecondaryFieldDef): + """Theta2 schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(Theta2, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) + + +class Theta2Datum(DatumChannelMixin, core.DatumDef): + """Theta2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "theta2" + def __init__(self, datum, band=Undefined, type=Undefined, **kwds): + super(Theta2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) + + +class Theta2Value(ValueChannelMixin, core.PositionValueDef): + """Theta2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ 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) + + +class Tooltip(FieldChannelMixin, core.StringFieldDefWithCondition): + """Tooltip schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"time"`` for temporal fields and ordinal and nominal fields + with ``timeUnit``. - ``"number"`` for quantitative fields as well as ordinal and + nominal fields without ``timeUnit``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "tooltip" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, + labelExpr=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Tooltip, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + condition=condition, field=field, format=format, + formatType=formatType, labelExpr=labelExpr, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class TooltipValue(ValueChannelMixin, core.StringValueDefWithCondition): + """TooltipValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _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) + + +class Url(FieldChannelMixin, core.StringFieldDefWithCondition): + """Url schema wrapper + + Mapping(required=[shorthand]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"time"`` for temporal fields and ordinal and nominal fields + with ``timeUnit``. - ``"number"`` for quantitative fields as well as ordinal and + nominal fields without ``timeUnit``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "url" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + condition=Undefined, field=Undefined, format=Undefined, formatType=Undefined, + labelExpr=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(Url, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + condition=condition, field=field, format=format, + formatType=formatType, labelExpr=labelExpr, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class UrlValue(ValueChannelMixin, core.StringValueDefWithCondition): + """UrlValue schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _class_is_valid_at_instantiation = False + _encoding_name = "url" + + def __init__(self, value, condition=Undefined, **kwds): + super(UrlValue, self).__init__(value=value, condition=condition, **kwds) + + +class X(FieldChannelMixin, core.PositionFieldDef): + """X schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + axis : anyOf(:class:`Axis`, None) + An object defining properties of axis's gridlines, ticks and labels. If ``null``, + the axis for the encoding channel will be removed. + + **Default value:** If undefined, default `axis properties + `__ are applied. + + **See also:** `axis `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + impute : anyOf(:class:`ImputeParams`, 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 + the ``Impute`` Operation. + + **See also:** `impute `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + 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: - ``"zero"`` or `true`: stacking with + baseline offset at zero value of the scale (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). - ``"normalize"`` + - stacking with normalized domain (for creating `normalized stacked bar and area + charts `__. + :raw-html:`
    ` - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). - ``null`` or + ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "x" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, axis=Undefined, band=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, band=band, bin=bin, + field=field, impute=impute, scale=scale, sort=sort, stack=stack, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class XDatum(DatumChannelMixin, core.PositionDatumDef): + """XDatum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + axis : anyOf(:class:`Axis`, None) + An object defining properties of axis's gridlines, ticks and labels. If ``null``, + the axis for the encoding channel will be removed. + + **Default value:** If undefined, default `axis properties + `__ are applied. + + **See also:** `axis `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + impute : anyOf(:class:`ImputeParams`, 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 + the ``Impute`` Operation. + + **See also:** `impute `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + 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: - ``"zero"`` or `true`: stacking with + baseline offset at zero value of the scale (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). - ``"normalize"`` + - stacking with normalized domain (for creating `normalized stacked bar and area + charts `__. + :raw-html:`
    ` - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). - ``null`` or + ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "x" + def __init__(self, datum, axis=Undefined, band=Undefined, impute=Undefined, scale=Undefined, + stack=Undefined, type=Undefined, **kwds): + super(XDatum, self).__init__(datum=datum, axis=axis, band=band, impute=impute, scale=scale, + stack=stack, type=type, **kwds) + + +class XValue(ValueChannelMixin, core.PositionValueDef): + """XValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ 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) + + +class X2(FieldChannelMixin, core.SecondaryFieldDef): + """X2 schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(X2, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) + + +class X2Datum(DatumChannelMixin, core.DatumDef): + """X2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "x2" + def __init__(self, datum, band=Undefined, type=Undefined, **kwds): + super(X2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) + + +class X2Value(ValueChannelMixin, core.PositionValueDef): + """X2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ 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) + + +class XError(FieldChannelMixin, core.SecondaryFieldDef): + """XError schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(XError, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) + + +class XErrorValue(ValueChannelMixin, core.ValueDefnumber): + """XErrorValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ 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) + + +class XError2(FieldChannelMixin, core.SecondaryFieldDef): + """XError2 schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(XError2, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) + + +class XError2Value(ValueChannelMixin, core.ValueDefnumber): + """XError2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ 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) + + +class Y(FieldChannelMixin, core.PositionFieldDef): + """Y schema wrapper + + Mapping(required=[shorthand]) + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + axis : anyOf(:class:`Axis`, None) + An object defining properties of axis's gridlines, ticks and labels. If ``null``, + the axis for the encoding channel will be removed. + + **Default value:** If undefined, default `axis properties + `__ are applied. + + **See also:** `axis `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + impute : anyOf(:class:`ImputeParams`, 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 + the ``Impute`` Operation. + + **See also:** `impute `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + 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: - ``"zero"`` or `true`: stacking with + baseline offset at zero value of the scale (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). - ``"normalize"`` + - stacking with normalized domain (for creating `normalized stacked bar and area + charts `__. + :raw-html:`
    ` - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). - ``null`` or + ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "y" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, axis=Undefined, band=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, band=band, bin=bin, + field=field, impute=impute, scale=scale, sort=sort, stack=stack, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class YDatum(DatumChannelMixin, core.PositionDatumDef): + """YDatum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + axis : anyOf(:class:`Axis`, None) + An object defining properties of axis's gridlines, ticks and labels. If ``null``, + the axis for the encoding channel will be removed. + + **Default value:** If undefined, default `axis properties + `__ are applied. + + **See also:** `axis `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + impute : anyOf(:class:`ImputeParams`, 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 + the ``Impute`` Operation. + + **See also:** `impute `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + 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: - ``"zero"`` or `true`: stacking with + baseline offset at zero value of the scale (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). - ``"normalize"`` + - stacking with normalized domain (for creating `normalized stacked bar and area + charts `__. + :raw-html:`
    ` - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). - ``null`` or + ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "y" + def __init__(self, datum, axis=Undefined, band=Undefined, impute=Undefined, scale=Undefined, + stack=Undefined, type=Undefined, **kwds): + super(YDatum, self).__init__(datum=datum, axis=axis, band=band, impute=impute, scale=scale, + stack=stack, type=type, **kwds) + + +class YValue(ValueChannelMixin, core.PositionValueDef): + """YValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ 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) + + +class Y2(FieldChannelMixin, core.SecondaryFieldDef): + """Y2 schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(Y2, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) + + +class Y2Datum(DatumChannelMixin, core.DatumDef): + """Y2Datum schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _class_is_valid_at_instantiation = False + _encoding_name = "y2" + def __init__(self, datum, band=Undefined, type=Undefined, **kwds): + super(Y2Datum, self).__init__(datum=datum, band=band, type=type, **kwds) + + +class Y2Value(ValueChannelMixin, core.PositionValueDef): + """Y2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ 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) + + +class YError(FieldChannelMixin, core.SecondaryFieldDef): + """YError schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(YError, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) + + +class YErrorValue(ValueChannelMixin, core.ValueDefnumber): + """YErrorValue schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ 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) + + +class YError2(FieldChannelMixin, core.SecondaryFieldDef): + """YError2 schema wrapper + + Mapping(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``. + + Attributes + ---------- + + 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) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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" + + def __init__(self, shorthand=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, timeUnit=Undefined, title=Undefined, **kwds): + super(YError2, self).__init__(shorthand=shorthand, aggregate=aggregate, band=band, bin=bin, + field=field, timeUnit=timeUnit, title=title, **kwds) + + +class YError2Value(ValueChannelMixin, core.ValueDefnumber): + """YError2Value schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ 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) diff --git a/runtime/Lib/site-packages/altair/vegalite/v4/schema/core.py b/runtime/Lib/site-packages/altair/vegalite/v4/schema/core.py new file mode 100644 index 0000000000000000000000000000000000000000..acb88bed8e34916d1936177a2c44b4db7209f3e2 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v4/schema/core.py @@ -0,0 +1,19905 @@ +# The contents of this file are automatically written by +# tools/generate_schema_wrapper.py. Do not modify directly. + +from altair.utils.schemapi import SchemaBase, Undefined, _subclasses + +import pkgutil +import json + +def load_schema(): + """Load the json schema associated with this module's functions""" + return json.loads(pkgutil.get_data(__name__, 'vega-lite-schema.json').decode('utf-8')) + + +class VegaLiteSchema(SchemaBase): + _rootschema = load_schema() + @classmethod + def _default_wrapper_classes(cls): + return _subclasses(VegaLiteSchema) + + +class Root(VegaLiteSchema): + """Root schema wrapper + + anyOf(:class:`TopLevelUnitSpec`, :class:`TopLevelFacetSpec`, :class:`TopLevelLayerSpec`, + :class:`TopLevelRepeatSpec`, :class:`TopLevelNormalizedConcatSpecGenericSpec`, + :class:`TopLevelNormalizedVConcatSpecGenericSpec`, + :class:`TopLevelNormalizedHConcatSpecGenericSpec`) + 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): + super(Root, self).__init__(*args, **kwds) + + +class Aggregate(VegaLiteSchema): + """Aggregate schema wrapper + + anyOf(:class:`NonArgAggregateOp`, :class:`ArgmaxDef`, :class:`ArgminDef`) + """ + _schema = {'$ref': '#/definitions/Aggregate'} + + def __init__(self, *args, **kwds): + super(Aggregate, self).__init__(*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') + """ + _schema = {'$ref': '#/definitions/AggregateOp'} + + def __init__(self, *args): + super(AggregateOp, self).__init__(*args) + + +class AggregatedFieldDef(VegaLiteSchema): + """AggregatedFieldDef schema wrapper + + Mapping(required=[op, as]) + + Attributes + ---------- + + op : :class:`AggregateOp` + The aggregation operation to apply to the fields (e.g., ``"sum"``, ``"average"``, or + ``"count"`` ). See the `full list of supported aggregation operations + `__ for more information. + field : :class:`FieldName` + The data field for which to compute aggregate function. This is required for all + aggregation operations except ``"count"``. + as : :class:`FieldName` + The output field names to use for each aggregated field. + """ + _schema = {'$ref': '#/definitions/AggregatedFieldDef'} + + def __init__(self, op=Undefined, field=Undefined, **kwds): + super(AggregatedFieldDef, self).__init__(op=op, field=field, **kwds) + + +class Align(VegaLiteSchema): + """Align schema wrapper + + enum('left', 'center', 'right') + """ + _schema = {'$ref': '#/definitions/Align'} + + def __init__(self, *args): + super(Align, self).__init__(*args) + + +class AnyMark(VegaLiteSchema): + """AnyMark schema wrapper + + anyOf(:class:`CompositeMark`, :class:`CompositeMarkDef`, :class:`Mark`, :class:`MarkDef`) + """ + _schema = {'$ref': '#/definitions/AnyMark'} + + def __init__(self, *args, **kwds): + super(AnyMark, self).__init__(*args, **kwds) + + +class AnyMarkConfig(VegaLiteSchema): + """AnyMarkConfig schema wrapper + + anyOf(:class:`MarkConfig`, :class:`AreaConfig`, :class:`BarConfig`, :class:`RectConfig`, + :class:`LineConfig`, :class:`TickConfig`) + """ + _schema = {'$ref': '#/definitions/AnyMarkConfig'} + + def __init__(self, *args, **kwds): + super(AnyMarkConfig, self).__init__(*args, **kwds) + + +class AreaConfig(AnyMarkConfig): + """AreaConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(:class:`Align`, :class:`ExprRef`) + 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`) + + aria : anyOf(boolean, :class:`ExprRef`) + + ariaRole : anyOf(string, :class:`ExprRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprRef`) + + aspect : anyOf(boolean, :class:`ExprRef`) + + baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + 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 + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + blend : anyOf(:class:`Blend`, :class:`ExprRef`) + + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** - This property cannot be used in a `style config + `__. - The ``fill`` + and ``stroke`` properties have higher precedence than ``color`` and will override + ``color``. + cornerRadius : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + ellipsis : anyOf(string, :class:`ExprRef`) + + endAngle : anyOf(float, :class:`ExprRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + 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`) + + filled : boolean + 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 + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + height : anyOf(float, :class:`ExprRef`) + + href : anyOf(:class:`URI`, :class:`ExprRef`) + + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). - If set to ``"filter"`` (default), all data items with null values will be + skipped (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`) + + line : anyOf(boolean, :class:`OverlayMarkDef`) + A flag for overlaying line on top of area marks, or an object defining the + properties of the overlayed lines. + + + If this value is an empty object ( ``{}`` ) or ``true``, lines with default + properties will be used. + + If this value is ``false``, no lines would be automatically added to area marks. + + **Default value:** ``false``. + lineBreak : anyOf(string, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. - For bar, rule and tick, this determines + whether the size of the bar and tick should be applied to x or y dimension. - For + area, this property determines the orient property of the Vega output. - For line + and trail marks, this property determines the sort order of the points in 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`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + padAngle : anyOf(float, :class:`ExprRef`) + + point : anyOf(boolean, :class:`OverlayMarkDef`, string) + A flag for overlaying points on top of line or area marks, or an object defining the + properties of the overlayed points. + + + If this property is ``"transparent"``, transparent points will be used (for + enhancing tooltips and selections). + + If this property is an empty object ( ``{}`` ) or ``true``, filled points with + default properties will be used. + + If this property is ``false``, no points would be automatically added to line or + area marks. + + **Default value:** ``false``. + radius : anyOf(float, :class:`ExprRef`) + 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. + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + + size : anyOf(float, :class:`ExprRef`) + Default size for marks. - For ``point`` / ``circle`` / ``square``, this represents + the pixel area of the marks. Note that this value sets the area of the symbol; the + side lengths will increase with the square root of this value. - For ``bar``, this + represents the band size of the bar, in pixels. - For ``text``, this represents the + font size, in pixels. + + **Default value:** - ``30`` for point, circle, square marks; width/height's ``step`` + - ``2`` for bar marks with discrete dimensions; - ``5`` for bar marks with + continuous dimensions; - ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprRef`) + + startAngle : anyOf(float, :class:`ExprRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + 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`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOffset : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + tension : anyOf(float, :class:`ExprRef`) + + text : anyOf(:class:`Text`, :class:`ExprRef`) + + theta : anyOf(float, :class:`ExprRef`) + 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`) + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + timeUnitBand : float + 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. + timeUnitBandPosition : float + Default relative band position for a time unit. If set to ``0``, the marks will be + positioned at the beginning of the time unit band step. If set to ``0.5``, the marks + will be positioned in the middle of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. - If ``tooltip`` is ``{"content": "data"}``, then all + fields that appear in the highlighted data point will be used. - If set to + ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) + + width : anyOf(float, :class:`ExprRef`) + + x : anyOf(float, string, :class:`ExprRef`) + 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 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 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 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, timeUnitBand=Undefined, timeUnitBandPosition=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, + timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, + url=url, width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + +class ArgmaxDef(Aggregate): + """ArgmaxDef schema wrapper + + Mapping(required=[argmax]) + + Attributes + ---------- + + argmax : string + + """ + _schema = {'$ref': '#/definitions/ArgmaxDef'} + + def __init__(self, argmax=Undefined, **kwds): + super(ArgmaxDef, self).__init__(argmax=argmax, **kwds) + + +class ArgminDef(Aggregate): + """ArgminDef schema wrapper + + Mapping(required=[argmin]) + + Attributes + ---------- + + argmin : string + + """ + _schema = {'$ref': '#/definitions/ArgminDef'} + + def __init__(self, argmin=Undefined, **kwds): + super(ArgminDef, self).__init__(argmin=argmin, **kwds) + + +class AutoSizeParams(VegaLiteSchema): + """AutoSizeParams schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + contains : enum('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 + added. In contrast, the ``"padding"`` setting includes the padding within the view + size calculations, such that the width and height settings indicate the **total** + intended size of the view. + + **Default value** : ``"content"`` + resize : boolean + A boolean flag indicating if autosize layout should be re-calculated on every view + update. + + **Default value** : ``false`` + type : :class:`AutosizeType` + The sizing format type. One of ``"pad"``, ``"fit"``, ``"fit-x"``, ``"fit-y"``, or + ``"none"``. See the `autosize type + `__ documentation for + descriptions of each. + + **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) + + +class AutosizeType(VegaLiteSchema): + """AutosizeType schema wrapper + + enum('pad', 'none', 'fit', 'fit-x', 'fit-y') + """ + _schema = {'$ref': '#/definitions/AutosizeType'} + + def __init__(self, *args): + super(AutosizeType, self).__init__(*args) + + +class Axis(VegaLiteSchema): + """Axis schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aria : anyOf(boolean, :class:`ExprRef`) + + bandPosition : anyOf(float, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + domain : anyOf(boolean, :class:`ExprRef`) + + domainCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + domainColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + domainDash : anyOf(List(float), :class:`ExprRef`) + + domainDashOffset : anyOf(float, :class:`ExprRef`) + + domainOpacity : anyOf(float, :class:`ExprRef`) + + domainWidth : anyOf(float, :class:`ExprRef`) + + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"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 + A boolean flag indicating if grid lines should be included as part of the axis + + **Default value:** ``true`` for `continuous scales + `__ that are not + binned; otherwise, ``false``. + gridCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + gridColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, + :class:`ConditionalAxisColor`) + + gridDash : anyOf(List(float), :class:`ExprRef`, :class:`ConditionalAxisNumberArray`) + + gridDashOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + gridOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + gridWidth : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelAlign : anyOf(:class:`Align`, :class:`ExprRef`, :class:`ConditionalAxisLabelAlign`) + + labelAngle : anyOf(float, :class:`ExprRef`) + + labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`, + :class:`ConditionalAxisLabelBaseline`) + + labelBound : anyOf(anyOf(float, boolean), :class:`ExprRef`) + + labelColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, + :class:`ConditionalAxisColor`) + + labelExpr : string + `Vega expression `__ 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) + 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 + applied instead. If this property is a number, it also indicates the number of + pixels by which to offset the first and last labels; for example, a value of 2 will + flush-align the first and last labels and also push them 2 pixels outward from the + center of the axis. The additional adjustment can sometimes help the labels better + visually group with corresponding axis ticks. + + **Default value:** ``true`` for axis of a continuous x-scale. Otherwise, ``false``. + labelFlushOffset : anyOf(float, :class:`ExprRef`) + + labelFont : anyOf(string, :class:`ExprRef`, :class:`ConditionalAxisString`) + + labelFontSize : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`, + :class:`ConditionalAxisLabelFontStyle`) + + labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`, + :class:`ConditionalAxisLabelFontWeight`) + + labelLimit : anyOf(float, :class:`ExprRef`) + + labelLineHeight : anyOf(float, :class:`ExprRef`) + + labelOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelOverlap : anyOf(:class:`LabelOverlap`, :class:`ExprRef`) + 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 + axes). If set to ``"greedy"``, a linear scan of the labels is performed, removing + any labels that overlaps with the last visible label (this often works better for + log-scaled axes). + + **Default value:** ``true`` for non-nominal fields with non-log scales; ``"greedy"`` + for log scales; otherwise ``false``. + labelPadding : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelSeparation : anyOf(float, :class:`ExprRef`) + + labels : anyOf(boolean, :class:`ExprRef`) + + maxExtent : anyOf(float, :class:`ExprRef`) + + minExtent : anyOf(float, :class:`ExprRef`) + + offset : 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 + `__ 's + ``offset`` ( ``0`` by default) + orient : anyOf(:class:`AxisOrient`, :class:`ExprRef`) + 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`) + 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)) + 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 `__. If + style is an array, later styles will override earlier styles. + + **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`) + + tickCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + tickColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, + :class:`ConditionalAxisColor`) + + tickCount : anyOf(float, :class:`TimeInterval`, :class:`TimeIntervalStep`, :class:`ExprRef`) + 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. + + For scales of type ``"time"`` or ``"utc"``, the tick count can instead be a time + interval specifier. Legal string values are ``"millisecond"``, ``"second"``, + ``"minute"``, ``"hour"``, ``"day"``, ``"week"``, ``"month"``, and ``"year"``. + Alternatively, an object-valued interval specifier of the form ``{"interval": + "month", "step": 3}`` includes a desired number of interval steps. Here, ticks are + generated for each quarter (Jan, Apr, Jul, Oct) boundary. + + **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`) + + tickDashOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + tickExtra : anyOf(boolean, :class:`ExprRef`) + + tickMinStep : anyOf(float, :class:`ExprRef`) + 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`) + + tickOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + tickRound : anyOf(boolean, :class:`ExprRef`) + + tickSize : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + tickWidth : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + ticks : anyOf(boolean, :class:`ExprRef`) + + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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`) + + titleAnchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + + titleAngle : anyOf(float, :class:`ExprRef`) + + titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + + titleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + titleFont : anyOf(string, :class:`ExprRef`) + + titleFontSize : anyOf(float, :class:`ExprRef`) + + titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + titleLimit : anyOf(float, :class:`ExprRef`) + + titleLineHeight : anyOf(float, :class:`ExprRef`) + + titleOpacity : anyOf(float, :class:`ExprRef`) + + titlePadding : anyOf(float, :class:`ExprRef`) + + titleX : anyOf(float, :class:`ExprRef`) + + titleY : anyOf(float, :class:`ExprRef`) + + translate : anyOf(float, :class:`ExprRef`) + + values : anyOf(List(float), List(string), List(boolean), List(:class:`DateTime`), + :class:`ExprRef`) + 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 + should be drawn behind all chart elements. To put them in front, set ``zindex`` to + ``1`` or more. + + **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) + + +class AxisConfig(VegaLiteSchema): + """AxisConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aria : anyOf(boolean, :class:`ExprRef`) + + bandPosition : anyOf(float, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + disable : boolean + Disable axis by default. + domain : anyOf(boolean, :class:`ExprRef`) + + domainCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + domainColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + domainDash : anyOf(List(float), :class:`ExprRef`) + + domainDashOffset : anyOf(float, :class:`ExprRef`) + + domainOpacity : anyOf(float, :class:`ExprRef`) + + domainWidth : anyOf(float, :class:`ExprRef`) + + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"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 + A boolean flag indicating if grid lines should be included as part of the axis + + **Default value:** ``true`` for `continuous scales + `__ that are not + binned; otherwise, ``false``. + gridCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + gridColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, + :class:`ConditionalAxisColor`) + + gridDash : anyOf(List(float), :class:`ExprRef`, :class:`ConditionalAxisNumberArray`) + + gridDashOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + gridOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + gridWidth : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelAlign : anyOf(:class:`Align`, :class:`ExprRef`, :class:`ConditionalAxisLabelAlign`) + + labelAngle : anyOf(float, :class:`ExprRef`) + + labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`, + :class:`ConditionalAxisLabelBaseline`) + + labelBound : anyOf(anyOf(float, boolean), :class:`ExprRef`) + + labelColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, + :class:`ConditionalAxisColor`) + + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **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) + 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 + applied instead. If this property is a number, it also indicates the number of + pixels by which to offset the first and last labels; for example, a value of 2 will + flush-align the first and last labels and also push them 2 pixels outward from the + center of the axis. The additional adjustment can sometimes help the labels better + visually group with corresponding axis ticks. + + **Default value:** ``true`` for axis of a continuous x-scale. Otherwise, ``false``. + labelFlushOffset : anyOf(float, :class:`ExprRef`) + + labelFont : anyOf(string, :class:`ExprRef`, :class:`ConditionalAxisString`) + + labelFontSize : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`, + :class:`ConditionalAxisLabelFontStyle`) + + labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`, + :class:`ConditionalAxisLabelFontWeight`) + + labelLimit : anyOf(float, :class:`ExprRef`) + + labelLineHeight : anyOf(float, :class:`ExprRef`) + + labelOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelOverlap : anyOf(:class:`LabelOverlap`, :class:`ExprRef`) + 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 + axes). If set to ``"greedy"``, a linear scan of the labels is performed, removing + any labels that overlaps with the last visible label (this often works better for + log-scaled axes). + + **Default value:** ``true`` for non-nominal fields with non-log scales; ``"greedy"`` + for log scales; otherwise ``false``. + labelPadding : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + labelSeparation : anyOf(float, :class:`ExprRef`) + + labels : anyOf(boolean, :class:`ExprRef`) + + maxExtent : anyOf(float, :class:`ExprRef`) + + minExtent : anyOf(float, :class:`ExprRef`) + + offset : 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 + `__ 's + ``offset`` ( ``0`` by default) + orient : anyOf(:class:`AxisOrient`, :class:`ExprRef`) + 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`) + 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)) + 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 `__. If + style is an array, later styles will override earlier styles. + + **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`) + + tickCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + tickColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`, + :class:`ConditionalAxisColor`) + + tickCount : anyOf(float, :class:`TimeInterval`, :class:`TimeIntervalStep`, :class:`ExprRef`) + 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. + + For scales of type ``"time"`` or ``"utc"``, the tick count can instead be a time + interval specifier. Legal string values are ``"millisecond"``, ``"second"``, + ``"minute"``, ``"hour"``, ``"day"``, ``"week"``, ``"month"``, and ``"year"``. + Alternatively, an object-valued interval specifier of the form ``{"interval": + "month", "step": 3}`` includes a desired number of interval steps. Here, ticks are + generated for each quarter (Jan, Apr, Jul, Oct) boundary. + + **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`) + + tickDashOffset : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + tickExtra : anyOf(boolean, :class:`ExprRef`) + + tickMinStep : anyOf(float, :class:`ExprRef`) + 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`) + + tickOpacity : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + tickRound : anyOf(boolean, :class:`ExprRef`) + + tickSize : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + tickWidth : anyOf(float, :class:`ExprRef`, :class:`ConditionalAxisNumber`) + + ticks : anyOf(boolean, :class:`ExprRef`) + + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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`) + + titleAnchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + + titleAngle : anyOf(float, :class:`ExprRef`) + + titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + + titleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + titleFont : anyOf(string, :class:`ExprRef`) + + titleFontSize : anyOf(float, :class:`ExprRef`) + + titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + titleLimit : anyOf(float, :class:`ExprRef`) + + titleLineHeight : anyOf(float, :class:`ExprRef`) + + titleOpacity : anyOf(float, :class:`ExprRef`) + + titlePadding : anyOf(float, :class:`ExprRef`) + + titleX : anyOf(float, :class:`ExprRef`) + + titleY : anyOf(float, :class:`ExprRef`) + + translate : anyOf(float, :class:`ExprRef`) + + values : anyOf(List(float), List(string), List(boolean), List(:class:`DateTime`), + :class:`ExprRef`) + 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 + should be drawn behind all chart elements. To put them in front, set ``zindex`` to + ``1`` or more. + + **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) + + +class AxisOrient(VegaLiteSchema): + """AxisOrient schema wrapper + + enum('top', 'bottom', 'left', 'right') + """ + _schema = {'$ref': '#/definitions/AxisOrient'} + + def __init__(self, *args): + super(AxisOrient, self).__init__(*args) + + +class AxisResolveMap(VegaLiteSchema): + """AxisResolveMap schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + x : :class:`ResolveMode` + + y : :class:`ResolveMode` + + """ + _schema = {'$ref': '#/definitions/AxisResolveMap'} + + def __init__(self, x=Undefined, y=Undefined, **kwds): + super(AxisResolveMap, self).__init__(x=x, y=y, **kwds) + + +class BarConfig(AnyMarkConfig): + """BarConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(:class:`Align`, :class:`ExprRef`) + 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`) + + aria : anyOf(boolean, :class:`ExprRef`) + + ariaRole : anyOf(string, :class:`ExprRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprRef`) + + aspect : anyOf(boolean, :class:`ExprRef`) + + baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + 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 + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + binSpacing : float + Offset between bars for binned field. The ideal value for this is either 0 + (preferred by statisticians) or 1 (Vega-Lite default, D3 example style). + + **Default value:** ``1`` + blend : anyOf(:class:`Blend`, :class:`ExprRef`) + + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** - This property cannot be used in a `style config + `__. - The ``fill`` + and ``stroke`` properties have higher precedence than ``color`` and will override + ``color``. + continuousBandSize : float + The default size of the bars on continuous scales. + + **Default value:** ``5`` + cornerRadius : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + + cornerRadiusEnd : anyOf(float, :class:`ExprRef`) + * 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`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + discreteBandSize : 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`) + + dy : anyOf(float, :class:`ExprRef`) + + ellipsis : anyOf(string, :class:`ExprRef`) + + endAngle : anyOf(float, :class:`ExprRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + 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`) + + filled : boolean + 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 + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + height : anyOf(float, :class:`ExprRef`) + + href : anyOf(:class:`URI`, :class:`ExprRef`) + + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). - If set to ``"filter"`` (default), all data items with null values will be + skipped (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`) + + lineBreak : anyOf(string, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. - For bar, rule and tick, this determines + whether the size of the bar and tick should be applied to x or y dimension. - For + area, this property determines the orient property of the Vega output. - For line + and trail marks, this property determines the sort order of the points in 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`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + padAngle : anyOf(float, :class:`ExprRef`) + + radius : anyOf(float, :class:`ExprRef`) + 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. + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + + size : anyOf(float, :class:`ExprRef`) + Default size for marks. - For ``point`` / ``circle`` / ``square``, this represents + the pixel area of the marks. Note that this value sets the area of the symbol; the + side lengths will increase with the square root of this value. - For ``bar``, this + represents the band size of the bar, in pixels. - For ``text``, this represents the + font size, in pixels. + + **Default value:** - ``30`` for point, circle, square marks; width/height's ``step`` + - ``2`` for bar marks with discrete dimensions; - ``5`` for bar marks with + continuous dimensions; - ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprRef`) + + startAngle : anyOf(float, :class:`ExprRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + 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`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOffset : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + tension : anyOf(float, :class:`ExprRef`) + + text : anyOf(:class:`Text`, :class:`ExprRef`) + + theta : anyOf(float, :class:`ExprRef`) + 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`) + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + timeUnitBand : float + 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. + timeUnitBandPosition : float + Default relative band position for a time unit. If set to ``0``, the marks will be + positioned at the beginning of the time unit band step. If set to ``0.5``, the marks + will be positioned in the middle of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. - If ``tooltip`` is ``{"content": "data"}``, then all + fields that appear in the highlighted data point will be used. - If set to + ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) + + width : anyOf(float, :class:`ExprRef`) + + x : anyOf(float, string, :class:`ExprRef`) + 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 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 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 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, 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, + timeUnitBand=Undefined, timeUnitBandPosition=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, 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, + timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, + url=url, width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + +class BaseTitleNoValueRefs(VegaLiteSchema): + """BaseTitleNoValueRefs schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : :class:`Align` + Horizontal text alignment for title text. One of ``"left"``, ``"center"``, or + ``"right"``. + anchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + + angle : anyOf(float, :class:`ExprRef`) + + aria : anyOf(boolean, :class:`ExprRef`) + + baseline : :class:`TextBaseline` + 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`) + + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + frame : anyOf(anyOf(:class:`TitleFrame`, string), :class:`ExprRef`) + + limit : anyOf(float, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + offset : anyOf(float, :class:`ExprRef`) + + orient : anyOf(:class:`TitleOrient`, :class:`ExprRef`) + + subtitleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + subtitleFont : anyOf(string, :class:`ExprRef`) + + subtitleFontSize : anyOf(float, :class:`ExprRef`) + + subtitleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + subtitleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + subtitleLineHeight : anyOf(float, :class:`ExprRef`) + + subtitlePadding : anyOf(float, :class:`ExprRef`) + + zindex : anyOf(float, :class:`ExprRef`) + + """ + _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) + + +class BinExtent(VegaLiteSchema): + """BinExtent schema wrapper + + anyOf(List([float, float]), :class:`SelectionExtent`) + """ + _schema = {'$ref': '#/definitions/BinExtent'} + + def __init__(self, *args, **kwds): + super(BinExtent, self).__init__(*args, **kwds) + + +class BinParams(VegaLiteSchema): + """BinParams schema wrapper + + Mapping(required=[]) + Binning properties or boolean flag for determining whether to bin data or not. + + Attributes + ---------- + + anchor : float + A value in the binned domain at which to anchor the bins, shifting the bin + boundaries if necessary to ensure that a boundary aligns with the anchor value. + + **Default value:** the minimum bin extent value + base : float + The number base to use for automatic bin determination (default is base 10). + + **Default value:** ``10`` + binned : boolean + When set to ``true``, Vega-Lite treats the input data as already binned. + divide : List([float, 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 + method can check if bin sizes of 2 (= 10/5), 5 (= 10/2), or 1 (= 10/(5*2)) might + also satisfy the given constraints. + + **Default value:** ``[5, 2]`` + extent : :class:`BinExtent` + A two-element ( ``[min, max]`` ) array indicating the range of desired bin values. + maxbins : float + Maximum number of bins. + + **Default value:** ``6`` for ``row``, ``column`` and ``shape`` channels; ``10`` for + other channels + minstep : float + A minimum allowable step size (particularly useful for integer values). + nice : boolean + If true, attempts to make the bin boundaries use human-friendly boundaries, such as + multiples of ten. + + **Default value:** ``true`` + step : float + An exact step size to use between bins. + + **Note:** If provided, options such as maxbins will be ignored. + steps : List(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) + + +class Binding(VegaLiteSchema): + """Binding schema wrapper + + anyOf(:class:`BindCheckbox`, :class:`BindRadioSelect`, :class:`BindRange`, + :class:`InputBinding`) + """ + _schema = {'$ref': '#/definitions/Binding'} + + def __init__(self, *args, **kwds): + super(Binding, self).__init__(*args, **kwds) + + +class BindCheckbox(Binding): + """BindCheckbox schema wrapper + + Mapping(required=[input]) + + Attributes + ---------- + + input : string + + debounce : float + + element : :class:`Element` + + name : string + + type : string + + """ + _schema = {'$ref': '#/definitions/BindCheckbox'} + + def __init__(self, input=Undefined, debounce=Undefined, element=Undefined, name=Undefined, + type=Undefined, **kwds): + super(BindCheckbox, self).__init__(input=input, debounce=debounce, element=element, name=name, + type=type, **kwds) + + +class BindRadioSelect(Binding): + """BindRadioSelect schema wrapper + + Mapping(required=[input, options]) + + Attributes + ---------- + + input : enum('radio', 'select') + + options : List(Any) + + debounce : float + + element : :class:`Element` + + labels : List(string) + + name : string + + type : string + + """ + _schema = {'$ref': '#/definitions/BindRadioSelect'} + + def __init__(self, input=Undefined, options=Undefined, debounce=Undefined, element=Undefined, + labels=Undefined, name=Undefined, type=Undefined, **kwds): + super(BindRadioSelect, self).__init__(input=input, options=options, debounce=debounce, + element=element, labels=labels, name=name, type=type, + **kwds) + + +class BindRange(Binding): + """BindRange schema wrapper + + Mapping(required=[input]) + + Attributes + ---------- + + input : string + + debounce : float + + element : :class:`Element` + + max : float + + min : float + + name : string + + step : float + + type : string + + """ + _schema = {'$ref': '#/definitions/BindRange'} + + def __init__(self, input=Undefined, debounce=Undefined, element=Undefined, max=Undefined, + min=Undefined, name=Undefined, step=Undefined, type=Undefined, **kwds): + super(BindRange, self).__init__(input=input, debounce=debounce, element=element, max=max, + min=min, name=name, step=step, type=type, **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') + """ + _schema = {'$ref': '#/definitions/Blend'} + + def __init__(self, *args): + super(Blend, self).__init__(*args) + + +class BoxPlotConfig(VegaLiteSchema): + """BoxPlotConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + box : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) + + extent : anyOf(string, float) + The extent of the whiskers. Available options include: - ``"min-max"`` : min and max + are the lower and upper whiskers respectively. - A number representing multiple of + the interquartile range. This number will be multiplied by the IQR to determine + whisker boundary, which spans from the smallest data to the largest data within the + range *[Q1 - k * IQR, Q3 + k * IQR]* where *Q1* and *Q3* are the first and third + quartiles while *IQR* is the interquartile range ( *Q3-Q1* ). + + **Default value:** ``1.5``. + median : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) + + outliers : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) + + rule : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) + + size : float + Size of the box and median tick of a box plot + ticks : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) + + """ + _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) + + +class BrushConfig(VegaLiteSchema): + """BrushConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + cursor : :class:`Cursor` + The mouse cursor used over the interval mark. Any valid `CSS cursor type + `__ can be used. + fill : :class:`Color` + The fill color of the interval mark. + + **Default value:** ``"#333333"`` + fillOpacity : float + The fill opacity of the interval mark (a value between ``0`` and ``1`` ). + + **Default value:** ``0.125`` + stroke : :class:`Color` + The stroke color of the interval mark. + + **Default value:** ``"#ffffff"`` + strokeDash : List(float) + An array of alternating stroke and space lengths, for creating dashed or dotted + lines. + strokeDashOffset : float + The offset (in pixels) with which to begin drawing the stroke dash array. + strokeOpacity : float + The stroke opacity of the interval mark (a value between ``0`` and ``1`` ). + 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) + + +class Color(VegaLiteSchema): + """Color schema wrapper + + anyOf(:class:`ColorName`, :class:`HexColor`, string) + """ + _schema = {'$ref': '#/definitions/Color'} + + def __init__(self, *args, **kwds): + super(Color, self).__init__(*args, **kwds) + + +class ColorDef(VegaLiteSchema): + """ColorDef schema wrapper + + anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull`, + :class:`FieldOrDatumDefWithConditionDatumDefGradientstringnull`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull`) + """ + _schema = {'$ref': '#/definitions/ColorDef'} + + def __init__(self, *args, **kwds): + super(ColorDef, self).__init__(*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', + 'ghostwhite', 'gold', 'goldenrod', 'greenyellow', 'grey', 'honeydew', 'hotpink', + 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', + 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', + 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', + 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', + 'magenta', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', + 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', + 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', + 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', + 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', + 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', + 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', + 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', + 'whitesmoke', 'yellowgreen', 'rebeccapurple') + """ + _schema = {'$ref': '#/definitions/ColorName'} + + def __init__(self, *args): + super(ColorName, self).__init__(*args) + + +class ColorScheme(VegaLiteSchema): + """ColorScheme schema wrapper + + anyOf(:class:`Categorical`, :class:`SequentialSingleHue`, :class:`SequentialMultiHue`, + :class:`Diverging`, :class:`Cyclical`) + """ + _schema = {'$ref': '#/definitions/ColorScheme'} + + def __init__(self, *args, **kwds): + super(ColorScheme, self).__init__(*args, **kwds) + + +class Categorical(ColorScheme): + """Categorical schema wrapper + + enum('accent', 'category10', 'category20', 'category20b', 'category20c', 'dark2', 'paired', + 'pastel1', 'pastel2', 'set1', 'set2', 'set3', 'tableau10', 'tableau20') + """ + _schema = {'$ref': '#/definitions/Categorical'} + + def __init__(self, *args): + super(Categorical, self).__init__(*args) + + +class CompositeMark(AnyMark): + """CompositeMark schema wrapper + + anyOf(:class:`BoxPlot`, :class:`ErrorBar`, :class:`ErrorBand`) + """ + _schema = {'$ref': '#/definitions/CompositeMark'} + + def __init__(self, *args, **kwds): + super(CompositeMark, self).__init__(*args, **kwds) + + +class BoxPlot(CompositeMark): + """BoxPlot schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/BoxPlot'} + + def __init__(self, *args): + super(BoxPlot, self).__init__(*args) + + +class CompositeMarkDef(AnyMark): + """CompositeMarkDef schema wrapper + + anyOf(:class:`BoxPlotDef`, :class:`ErrorBarDef`, :class:`ErrorBandDef`) + """ + _schema = {'$ref': '#/definitions/CompositeMarkDef'} + + def __init__(self, *args, **kwds): + super(CompositeMarkDef, self).__init__(*args, **kwds) + + +class BoxPlotDef(CompositeMarkDef): + """BoxPlotDef schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`BoxPlot` + 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:`MarkConfigExprOrSignalRef`) + + clip : boolean + Whether a composite mark be clipped to the enclosing group’s width and height. + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** - This property cannot be used in a `style config + `__. - The ``fill`` + and ``stroke`` properties have higher precedence than ``color`` and will override + ``color``. + extent : anyOf(string, float) + The extent of the whiskers. Available options include: - ``"min-max"`` : min and max + are the lower and upper whiskers respectively. - A number representing multiple of + the interquartile range. This number will be multiplied by the IQR to determine + whisker boundary, which spans from the smallest data to the largest data within the + range *[Q1 - k * IQR, Q3 + k * IQR]* where *Q1* and *Q3* are the first and third + quartiles while *IQR* is the interquartile range ( *Q3-Q1* ). + + **Default value:** ``1.5``. + median : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) + + opacity : float + The opacity (value between [0,1]) of the mark. + orient : :class:`Orientation` + 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:`MarkConfigExprOrSignalRef`) + + rule : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) + + size : float + Size of the box and median tick of a box plot + ticks : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) + + """ + _schema = {'$ref': '#/definitions/BoxPlotDef'} + + def __init__(self, type=Undefined, box=Undefined, clip=Undefined, color=Undefined, extent=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, + median=median, opacity=opacity, orient=orient, + outliers=outliers, rule=rule, size=size, ticks=ticks, **kwds) + + +class CompositionConfig(VegaLiteSchema): + """CompositionConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: - the general (wrappable) ``concat`` operator (not + ``hconcat`` / ``vconcat`` ) - the ``facet`` and ``repeat`` operator with one + field/repetition definition (without row/column nesting) + + 2) Setting the ``columns`` to ``1`` is equivalent to ``vconcat`` (for ``concat`` ) + and to using the ``row`` channel (for ``facet`` and ``repeat`` ). + spacing : float + The default spacing in pixels between composed sub-views. + + **Default value** : ``20`` + """ + _schema = {'$ref': '#/definitions/CompositionConfig'} + + def __init__(self, columns=Undefined, spacing=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])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisColor'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisColor, self).__init__(*args, **kwds) + + +class ConditionalAxisLabelAlign(VegaLiteSchema): + """ConditionalAxisLabelAlign schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisLabelAlign'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisLabelAlign, self).__init__(*args, **kwds) + + +class ConditionalAxisLabelBaseline(VegaLiteSchema): + """ConditionalAxisLabelBaseline schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisLabelBaseline'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisLabelBaseline, self).__init__(*args, **kwds) + + +class ConditionalAxisLabelFontStyle(VegaLiteSchema): + """ConditionalAxisLabelFontStyle schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisLabelFontStyle'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisLabelFontStyle, self).__init__(*args, **kwds) + + +class ConditionalAxisLabelFontWeight(VegaLiteSchema): + """ConditionalAxisLabelFontWeight schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisLabelFontWeight'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisLabelFontWeight, self).__init__(*args, **kwds) + + +class ConditionalAxisNumber(VegaLiteSchema): + """ConditionalAxisNumber schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisNumber'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisNumber, self).__init__(*args, **kwds) + + +class ConditionalAxisNumberArray(VegaLiteSchema): + """ConditionalAxisNumberArray schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisNumberArray'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisNumberArray, self).__init__(*args, **kwds) + + +class ConditionalAxisPropertyAlignnull(VegaLiteSchema): + """ConditionalAxisPropertyAlignnull schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(Align|null)>'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertyAlignnull, self).__init__(*args, **kwds) + + +class ConditionalAxisPropertyColornull(VegaLiteSchema): + """ConditionalAxisPropertyColornull schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(Color|null)>'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertyColornull, self).__init__(*args, **kwds) + + +class ConditionalAxisPropertyFontStylenull(VegaLiteSchema): + """ConditionalAxisPropertyFontStylenull schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(FontStyle|null)>'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertyFontStylenull, self).__init__(*args, **kwds) + + +class ConditionalAxisPropertyFontWeightnull(VegaLiteSchema): + """ConditionalAxisPropertyFontWeightnull schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(FontWeight|null)>'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertyFontWeightnull, self).__init__(*args, **kwds) + + +class ConditionalAxisPropertyTextBaselinenull(VegaLiteSchema): + """ConditionalAxisPropertyTextBaselinenull schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(TextBaseline|null)>'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertyTextBaselinenull, self).__init__(*args, **kwds) + + +class ConditionalAxisPropertynumberArraynull(VegaLiteSchema): + """ConditionalAxisPropertynumberArraynull schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(number[]|null)>'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertynumberArraynull, self).__init__(*args, **kwds) + + +class ConditionalAxisPropertynumbernull(VegaLiteSchema): + """ConditionalAxisPropertynumbernull schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(number|null)>'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertynumbernull, self).__init__(*args, **kwds) + + +class ConditionalAxisPropertystringnull(VegaLiteSchema): + """ConditionalAxisPropertystringnull schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisProperty<(string|null)>'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisPropertystringnull, self).__init__(*args, **kwds) + + +class ConditionalAxisString(VegaLiteSchema): + """ConditionalAxisString schema wrapper + + anyOf(Mapping(required=[condition, value]), Mapping(required=[condition, expr])) + """ + _schema = {'$ref': '#/definitions/ConditionalAxisString'} + + def __init__(self, *args, **kwds): + super(ConditionalAxisString, self).__init__(*args, **kwds) + + +class ConditionalMarkPropFieldOrDatumDef(VegaLiteSchema): + """ConditionalMarkPropFieldOrDatumDef schema wrapper + + anyOf(:class:`ConditionalPredicateMarkPropFieldOrDatumDef`, + :class:`ConditionalSelectionMarkPropFieldOrDatumDef`) + """ + _schema = {'$ref': '#/definitions/ConditionalMarkPropFieldOrDatumDef'} + + def __init__(self, *args, **kwds): + super(ConditionalMarkPropFieldOrDatumDef, self).__init__(*args, **kwds) + + +class ConditionalMarkPropFieldOrDatumDefTypeForShape(VegaLiteSchema): + """ConditionalMarkPropFieldOrDatumDefTypeForShape schema wrapper + + anyOf(:class:`ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape`, + :class:`ConditionalSelectionMarkPropFieldOrDatumDefTypeForShape`) + """ + _schema = {'$ref': '#/definitions/ConditionalMarkPropFieldOrDatumDef'} + + def __init__(self, *args, **kwds): + super(ConditionalMarkPropFieldOrDatumDefTypeForShape, self).__init__(*args, **kwds) + + +class ConditionalPredicateMarkPropFieldOrDatumDef(ConditionalMarkPropFieldOrDatumDef): + """ConditionalPredicateMarkPropFieldOrDatumDef schema wrapper + + anyOf(Mapping(required=[test]), Mapping(required=[test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateMarkPropFieldOrDatumDef, self).__init__(*args, **kwds) + + +class ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape(ConditionalMarkPropFieldOrDatumDefTypeForShape): + """ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape schema wrapper + + anyOf(Mapping(required=[test]), Mapping(required=[test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateMarkPropFieldOrDatumDefTypeForShape, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefAlignnullExprRef(VegaLiteSchema): + """ConditionalPredicateValueDefAlignnullExprRef schema wrapper + + anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateValueDefAlignnullExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefColornullExprRef(VegaLiteSchema): + """ConditionalPredicateValueDefColornullExprRef schema wrapper + + anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateValueDefColornullExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefFontStylenullExprRef(VegaLiteSchema): + """ConditionalPredicateValueDefFontStylenullExprRef schema wrapper + + anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateValueDefFontStylenullExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefFontWeightnullExprRef(VegaLiteSchema): + """ConditionalPredicateValueDefFontWeightnullExprRef schema wrapper + + anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateValueDefFontWeightnullExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefTextBaselinenullExprRef(VegaLiteSchema): + """ConditionalPredicateValueDefTextBaselinenullExprRef schema wrapper + + anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateValueDefTextBaselinenullExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefnumberArraynullExprRef(VegaLiteSchema): + """ConditionalPredicateValueDefnumberArraynullExprRef schema wrapper + + anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateValueDefnumberArraynullExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefnumbernullExprRef(VegaLiteSchema): + """ConditionalPredicateValueDefnumbernullExprRef schema wrapper + + anyOf(Mapping(required=[test, value]), Mapping(required=[expr, test])) + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalPredicateValueDefnumbernullExprRef, self).__init__(*args, **kwds) + + +class ConditionalSelectionMarkPropFieldOrDatumDef(ConditionalMarkPropFieldOrDatumDef): + """ConditionalSelectionMarkPropFieldOrDatumDef schema wrapper + + anyOf(Mapping(required=[selection]), Mapping(required=[selection])) + """ + _schema = {'$ref': '#/definitions/ConditionalSelection'} + + def __init__(self, *args, **kwds): + super(ConditionalSelectionMarkPropFieldOrDatumDef, self).__init__(*args, **kwds) + + +class ConditionalSelectionMarkPropFieldOrDatumDefTypeForShape(ConditionalMarkPropFieldOrDatumDefTypeForShape): + """ConditionalSelectionMarkPropFieldOrDatumDefTypeForShape schema wrapper + + anyOf(Mapping(required=[selection]), Mapping(required=[selection])) + """ + _schema = {'$ref': '#/definitions/ConditionalSelection>'} + + def __init__(self, *args, **kwds): + super(ConditionalSelectionMarkPropFieldOrDatumDefTypeForShape, self).__init__(*args, **kwds) + + +class ConditionalStringFieldDef(VegaLiteSchema): + """ConditionalStringFieldDef schema wrapper + + anyOf(:class:`ConditionalPredicateStringFieldDef`, + :class:`ConditionalSelectionStringFieldDef`) + """ + _schema = {'$ref': '#/definitions/ConditionalStringFieldDef'} + + def __init__(self, *args, **kwds): + super(ConditionalStringFieldDef, self).__init__(*args, **kwds) + + +class ConditionalPredicateStringFieldDef(ConditionalStringFieldDef): + """ConditionalPredicateStringFieldDef schema wrapper + + Mapping(required=[test]) + + Attributes + ---------- + + test : :class:`PredicateComposition` + Predicate for triggering the condition + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"time"`` for temporal fields and ordinal and nominal fields + with ``timeUnit``. - ``"number"`` for quantitative fields as well as ordinal and + nominal fields without ``timeUnit``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate'} + + def __init__(self, test=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(ConditionalPredicateStringFieldDef, self).__init__(test=test, aggregate=aggregate, + band=band, bin=bin, field=field, + format=format, formatType=formatType, + labelExpr=labelExpr, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class ConditionalSelectionStringFieldDef(ConditionalStringFieldDef): + """ConditionalSelectionStringFieldDef schema wrapper + + Mapping(required=[selection]) + + Attributes + ---------- + + selection : :class:`SelectionComposition` + A `selection name `__, or a + series of `composed selections + `__. + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"time"`` for temporal fields and ordinal and nominal fields + with ``timeUnit``. - ``"number"`` for quantitative fields as well as ordinal and + nominal fields without ``timeUnit``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/ConditionalSelection'} + + def __init__(self, selection=Undefined, aggregate=Undefined, band=Undefined, bin=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(ConditionalSelectionStringFieldDef, self).__init__(selection=selection, + aggregate=aggregate, band=band, + bin=bin, field=field, format=format, + formatType=formatType, + labelExpr=labelExpr, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class ConditionalValueDefGradientstringnullExprRef(VegaLiteSchema): + """ConditionalValueDefGradientstringnullExprRef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefGradientstringnullExprRef`, + :class:`ConditionalSelectionValueDefGradientstringnullExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefGradientstringnullExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefGradientstringnullExprRef(ConditionalValueDefGradientstringnullExprRef): + """ConditionalPredicateValueDefGradientstringnullExprRef schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`PredicateComposition` + Predicate for triggering the condition + value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDefGradientstringnullExprRef, self).__init__(test=test, + value=value, **kwds) + + +class ConditionalSelectionValueDefGradientstringnullExprRef(ConditionalValueDefGradientstringnullExprRef): + """ConditionalSelectionValueDefGradientstringnullExprRef schema wrapper + + Mapping(required=[selection, value]) + + Attributes + ---------- + + selection : :class:`SelectionComposition` + A `selection name `__, or a + series of `composed selections + `__. + value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalSelection>'} + + def __init__(self, selection=Undefined, value=Undefined, **kwds): + super(ConditionalSelectionValueDefGradientstringnullExprRef, self).__init__(selection=selection, + value=value, **kwds) + + +class ConditionalValueDefTextExprRef(VegaLiteSchema): + """ConditionalValueDefTextExprRef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefTextExprRef`, + :class:`ConditionalSelectionValueDefTextExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(Text|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefTextExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefTextExprRef(ConditionalValueDefTextExprRef): + """ConditionalPredicateValueDefTextExprRef schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`PredicateComposition` + Predicate for triggering the condition + value : anyOf(:class:`Text`, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDefTextExprRef, self).__init__(test=test, value=value, **kwds) + + +class ConditionalSelectionValueDefTextExprRef(ConditionalValueDefTextExprRef): + """ConditionalSelectionValueDefTextExprRef schema wrapper + + Mapping(required=[selection, value]) + + Attributes + ---------- + + selection : :class:`SelectionComposition` + A `selection name `__, or a + series of `composed selections + `__. + value : anyOf(:class:`Text`, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalSelection>'} + + def __init__(self, selection=Undefined, value=Undefined, **kwds): + super(ConditionalSelectionValueDefTextExprRef, self).__init__(selection=selection, value=value, + **kwds) + + +class ConditionalValueDefnumber(VegaLiteSchema): + """ConditionalValueDefnumber schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefnumber`, + :class:`ConditionalSelectionValueDefnumber`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefnumber, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefnumber(ConditionalValueDefnumber): + """ConditionalPredicateValueDefnumber schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`PredicateComposition` + Predicate for triggering the condition + value : float + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDefnumber, self).__init__(test=test, value=value, **kwds) + + +class ConditionalSelectionValueDefnumber(ConditionalValueDefnumber): + """ConditionalSelectionValueDefnumber schema wrapper + + Mapping(required=[selection, value]) + + Attributes + ---------- + + selection : :class:`SelectionComposition` + A `selection name `__, or a + series of `composed selections + `__. + value : float + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalSelection>'} + + def __init__(self, selection=Undefined, value=Undefined, **kwds): + super(ConditionalSelectionValueDefnumber, self).__init__(selection=selection, value=value, + **kwds) + + +class ConditionalValueDefnumberArrayExprRef(VegaLiteSchema): + """ConditionalValueDefnumberArrayExprRef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefnumberArrayExprRef`, + :class:`ConditionalSelectionValueDefnumberArrayExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(number[]|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefnumberArrayExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefnumberArrayExprRef(ConditionalValueDefnumberArrayExprRef): + """ConditionalPredicateValueDefnumberArrayExprRef schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`PredicateComposition` + Predicate for triggering the condition + value : anyOf(List(float), :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDefnumberArrayExprRef, self).__init__(test=test, value=value, + **kwds) + + +class ConditionalSelectionValueDefnumberArrayExprRef(ConditionalValueDefnumberArrayExprRef): + """ConditionalSelectionValueDefnumberArrayExprRef schema wrapper + + Mapping(required=[selection, value]) + + Attributes + ---------- + + selection : :class:`SelectionComposition` + A `selection name `__, or a + series of `composed selections + `__. + value : anyOf(List(float), :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalSelection>'} + + def __init__(self, selection=Undefined, value=Undefined, **kwds): + super(ConditionalSelectionValueDefnumberArrayExprRef, self).__init__(selection=selection, + value=value, **kwds) + + +class ConditionalValueDefnumberExprRef(VegaLiteSchema): + """ConditionalValueDefnumberExprRef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefnumberExprRef`, + :class:`ConditionalSelectionValueDefnumberExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(number|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefnumberExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefnumberExprRef(ConditionalValueDefnumberExprRef): + """ConditionalPredicateValueDefnumberExprRef schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`PredicateComposition` + Predicate for triggering the condition + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDefnumberExprRef, self).__init__(test=test, value=value, **kwds) + + +class ConditionalSelectionValueDefnumberExprRef(ConditionalValueDefnumberExprRef): + """ConditionalSelectionValueDefnumberExprRef schema wrapper + + Mapping(required=[selection, value]) + + Attributes + ---------- + + selection : :class:`SelectionComposition` + A `selection name `__, or a + series of `composed selections + `__. + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalSelection>'} + + def __init__(self, selection=Undefined, value=Undefined, **kwds): + super(ConditionalSelectionValueDefnumberExprRef, self).__init__(selection=selection, + value=value, **kwds) + + +class ConditionalValueDefstringExprRef(VegaLiteSchema): + """ConditionalValueDefstringExprRef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefstringExprRef`, + :class:`ConditionalSelectionValueDefstringExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(string|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefstringExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefstringExprRef(ConditionalValueDefstringExprRef): + """ConditionalPredicateValueDefstringExprRef schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`PredicateComposition` + Predicate for triggering the condition + value : anyOf(string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDefstringExprRef, self).__init__(test=test, value=value, **kwds) + + +class ConditionalSelectionValueDefstringExprRef(ConditionalValueDefstringExprRef): + """ConditionalSelectionValueDefstringExprRef schema wrapper + + Mapping(required=[selection, value]) + + Attributes + ---------- + + selection : :class:`SelectionComposition` + A `selection name `__, or a + series of `composed selections + `__. + value : anyOf(string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalSelection>'} + + def __init__(self, selection=Undefined, value=Undefined, **kwds): + super(ConditionalSelectionValueDefstringExprRef, self).__init__(selection=selection, + value=value, **kwds) + + +class ConditionalValueDefstringnullExprRef(VegaLiteSchema): + """ConditionalValueDefstringnullExprRef schema wrapper + + anyOf(:class:`ConditionalPredicateValueDefstringnullExprRef`, + :class:`ConditionalSelectionValueDefstringnullExprRef`) + """ + _schema = {'$ref': '#/definitions/ConditionalValueDef<(string|null|ExprRef)>'} + + def __init__(self, *args, **kwds): + super(ConditionalValueDefstringnullExprRef, self).__init__(*args, **kwds) + + +class ConditionalPredicateValueDefstringnullExprRef(ConditionalValueDefstringnullExprRef): + """ConditionalPredicateValueDefstringnullExprRef schema wrapper + + Mapping(required=[test, value]) + + Attributes + ---------- + + test : :class:`PredicateComposition` + Predicate for triggering the condition + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalPredicate>'} + + def __init__(self, test=Undefined, value=Undefined, **kwds): + super(ConditionalPredicateValueDefstringnullExprRef, self).__init__(test=test, value=value, + **kwds) + + +class ConditionalSelectionValueDefstringnullExprRef(ConditionalValueDefstringnullExprRef): + """ConditionalSelectionValueDefstringnullExprRef schema wrapper + + Mapping(required=[selection, value]) + + Attributes + ---------- + + selection : :class:`SelectionComposition` + A `selection name `__, or a + series of `composed selections + `__. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ConditionalSelection>'} + + def __init__(self, selection=Undefined, value=Undefined, **kwds): + super(ConditionalSelectionValueDefstringnullExprRef, self).__init__(selection=selection, + value=value, **kwds) + + +class Config(VegaLiteSchema): + """Config schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + arc : :class:`RectConfig` + Arc-specific Config + area : :class:`AreaConfig` + Area-Specific Config + aria : boolean + 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`) + 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 configuration, which determines default properties for all ``x`` and ``y`` + `axes `__. For a full list of axis + configuration options, please see the `corresponding section of the axis + documentation `__. + axisBand : :class:`AxisConfig` + Config for axes with "band" scales. + axisBottom : :class:`AxisConfig` + Config for x-axis along the bottom edge of the chart. + axisDiscrete : :class:`AxisConfig` + Config for axes with "point" or "band" scales. + axisLeft : :class:`AxisConfig` + Config for y-axis along the left edge of the chart. + axisPoint : :class:`AxisConfig` + Config for axes with "point" scales. + axisQuantitative : :class:`AxisConfig` + Config for quantitative axes. + axisRight : :class:`AxisConfig` + Config for y-axis along the right edge of the chart. + axisTemporal : :class:`AxisConfig` + Config for temporal axes. + axisTop : :class:`AxisConfig` + Config for x-axis along the top edge of the chart. + axisX : :class:`AxisConfig` + X-axis specific config. + axisXBand : :class:`AxisConfig` + Config for x-axes with "band" scales. + axisXDiscrete : :class:`AxisConfig` + Config for x-axes with "point" or "band" scales. + axisXPoint : :class:`AxisConfig` + Config for x-axes with "point" scales. + axisXQuantitative : :class:`AxisConfig` + Config for x-quantitative axes. + axisXTemporal : :class:`AxisConfig` + Config for x-temporal axes. + axisY : :class:`AxisConfig` + Y-axis specific config. + axisYBand : :class:`AxisConfig` + Config for y-axes with "band" scales. + axisYDiscrete : :class:`AxisConfig` + Config for y-axes with "point" or "band" scales. + axisYPoint : :class:`AxisConfig` + Config for y-axes with "point" scales. + axisYQuantitative : :class:`AxisConfig` + Config for y-quantitative axes. + axisYTemporal : :class:`AxisConfig` + Config for y-temporal axes. + background : anyOf(:class:`Color`, :class:`ExprRef`) + CSS color property to use as the background of the entire view. + + **Default value:** ``"white"`` + bar : :class:`BarConfig` + Bar-Specific Config + boxplot : :class:`BoxPlotConfig` + Box Config + circle : :class:`MarkConfig` + Circle-Specific Config + concat : :class:`CompositionConfig` + Default configuration for all concatenation and repeat view composition operators ( + ``concat``, ``hconcat``, ``vconcat``, and ``repeat`` ) + countTitle : string + Default axis and legend title for count fields. + + **Default value:** ``'Count of Records``. + customFormatTypes : boolean + Allow the ``formatType`` property for text marks and guides to accept a custom + formatter function `registered as a Vega expression + `__. + errorband : :class:`ErrorBandConfig` + ErrorBand Config + errorbar : :class:`ErrorBarConfig` + ErrorBar Config + facet : :class:`CompositionConfig` + Default configuration for the ``facet`` view composition operator + fieldTitle : enum('verbal', 'functional', 'plain') + Defines how Vega-Lite generates title for fields. There are three possible styles: - + ``"verbal"`` (Default) - displays function in a verbal style (e.g., "Sum of field", + "Year-month of date", "field (binned)"). - ``"function"`` - displays function using + parentheses and capitalized texts (e.g., "SUM(field)", "YEARMONTH(date)", + "BIN(field)"). - ``"plain"`` - displays only the field name without functions (e.g., + "field", "date", "field"). + font : string + Default font for all text marks, titles, and labels. + geoshape : :class:`MarkConfig` + Geoshape-Specific Config + header : :class:`HeaderConfig` + Header configuration, which determines default properties for all `headers + `__. + + For a full list of header configuration options, please see the `corresponding + section of in the header documentation + `__. + headerColumn : :class:`HeaderConfig` + Header configuration, which determines default properties for column `headers + `__. + + For a full list of header configuration options, please see the `corresponding + section of in the header documentation + `__. + headerFacet : :class:`HeaderConfig` + Header configuration, which determines default properties for non-row/column facet + `headers `__. + + For a full list of header configuration options, please see the `corresponding + section of in the header documentation + `__. + headerRow : :class:`HeaderConfig` + Header configuration, which determines default properties for row `headers + `__. + + For a full list of header configuration options, please see the `corresponding + section of in the header documentation + `__. + image : :class:`RectConfig` + Image-specific Config + legend : :class:`LegendConfig` + Legend configuration, which determines default properties for all `legends + `__. For a full list of legend + configuration options, please see the `corresponding section of in the legend + documentation `__. + line : :class:`LineConfig` + Line-Specific Config + lineBreak : anyOf(string, :class:`ExprRef`) + 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. + mark : :class:`MarkConfig` + Mark Config + numberFormat : string + D3 Number format for guide labels and text marks. For example ``"s"`` for SI units. + Use `D3's number format pattern `__. + padding : anyOf(:class:`Padding`, :class:`ExprRef`) + 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:`Parameter`) + Dynamic variables that parameterize a visualization. + point : :class:`MarkConfig` + Point-Specific Config + projection : :class:`ProjectionConfig` + Projection configuration, which determines default properties for all `projections + `__. For a full list of + projection configuration options, please see the `corresponding section of the + projection documentation + `__. + range : :class:`RangeConfig` + 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 + `__. + rect : :class:`RectConfig` + Rect-Specific Config + rule : :class:`MarkConfig` + Rule-Specific Config + scale : :class:`ScaleConfig` + Scale configuration determines default properties for all `scales + `__. For a full list of scale + configuration options, please see the `corresponding section of the scale + documentation `__. + selection : :class:`SelectionConfig` + An object hash for defining default properties for each type of selections. + square : :class:`MarkConfig` + Square-Specific Config + style : :class:`StyleConfigIndex` + An object hash that defines key-value mappings to determine default properties for + marks with a given `style + `__. The keys represent + styles names; the values have to be valid `mark configuration objects + `__. + text : :class:`MarkConfig` + Text-Specific Config + tick : :class:`TickConfig` + Tick-Specific Config + timeFormat : string + 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. + title : :class:`TitleConfig` + Title configuration, which determines default properties for all `titles + `__. For a full list of title + configuration options, please see the `corresponding section of the title + documentation `__. + trail : :class:`LineConfig` + Trail-Specific Config + view : :class:`ViewConfig` + Default properties for `single view plots + `__. + """ + _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, mark=Undefined, numberFormat=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, title=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, mark=mark, + numberFormat=numberFormat, 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, + title=title, 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') + """ + _schema = {'$ref': '#/definitions/Cursor'} + + def __init__(self, *args): + super(Cursor, self).__init__(*args) + + +class Cyclical(ColorScheme): + """Cyclical schema wrapper + + enum('rainbow', 'sinebow') + """ + _schema = {'$ref': '#/definitions/Cyclical'} + + def __init__(self, *args): + super(Cyclical, self).__init__(*args) + + +class Data(VegaLiteSchema): + """Data schema wrapper + + anyOf(:class:`DataSource`, :class:`Generator`) + """ + _schema = {'$ref': '#/definitions/Data'} + + def __init__(self, *args, **kwds): + super(Data, self).__init__(*args, **kwds) + + +class DataFormat(VegaLiteSchema): + """DataFormat schema wrapper + + anyOf(:class:`CsvDataFormat`, :class:`DsvDataFormat`, :class:`JsonDataFormat`, + :class:`TopoDataFormat`) + """ + _schema = {'$ref': '#/definitions/DataFormat'} + + def __init__(self, *args, **kwds): + super(DataFormat, self).__init__(*args, **kwds) + + +class CsvDataFormat(DataFormat): + """CsvDataFormat schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + parse : anyOf(:class:`Parse`, 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 + name, and the value to the desired data type (one of ``"number"``, ``"boolean"``, + ``"date"``, or null (do not parse the field)). For example, ``"parse": + {"modified_on": "date"}`` parses the ``modified_on`` field in each input record a + Date value. + + For ``"date"``, we parse data based using Javascript's `Date.parse() + `__. + For Specific date formats can be provided (e.g., ``{foo: "date:'%m%d%Y'"}`` ), using + the `d3-time-format syntax `__. + UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). + See more about `UTC time + `__ + type : enum('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): + super(CsvDataFormat, self).__init__(parse=parse, type=type, **kwds) + + +class DataSource(Data): + """DataSource schema wrapper + + anyOf(:class:`UrlData`, :class:`InlineData`, :class:`NamedData`) + """ + _schema = {'$ref': '#/definitions/DataSource'} + + def __init__(self, *args, **kwds): + super(DataSource, self).__init__(*args, **kwds) + + +class Datasets(VegaLiteSchema): + """Datasets schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Datasets'} + + def __init__(self, **kwds): + super(Datasets, self).__init__(**kwds) + + +class Day(VegaLiteSchema): + """Day schema wrapper + + float + """ + _schema = {'$ref': '#/definitions/Day'} + + def __init__(self, *args): + super(Day, self).__init__(*args) + + +class DictInlineDataset(VegaLiteSchema): + """DictInlineDataset schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Dict'} + + def __init__(self, **kwds): + super(DictInlineDataset, self).__init__(**kwds) + + +class DictSelectionInit(VegaLiteSchema): + """DictSelectionInit schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Dict'} + + def __init__(self, **kwds): + super(DictSelectionInit, self).__init__(**kwds) + + +class DictSelectionInitInterval(VegaLiteSchema): + """DictSelectionInitInterval schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Dict'} + + def __init__(self, **kwds): + super(DictSelectionInitInterval, self).__init__(**kwds) + + +class Dictunknown(VegaLiteSchema): + """Dictunknown schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Dict'} + + def __init__(self, **kwds): + super(Dictunknown, self).__init__(**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'} + + def __init__(self, *args): + super(Diverging, self).__init__(*args) + + +class DomainUnionWith(VegaLiteSchema): + """DomainUnionWith schema wrapper + + Mapping(required=[unionWith]) + + Attributes + ---------- + + unionWith : anyOf(List(float), List(string), List(boolean), List(:class:`DateTime`)) + Customized domain values to be union with the field's values. + + 1) ``domain`` for *quantitative* fields can take one of the following forms: + + + * a two-element array with minimum and maximum values. - an array with more than two + entries, for `Piecewise quantitative scales + `__. (Alternatively, + the ``domainMid`` property can be set for a diverging scale.) - a string value + ``"unaggregated"``, if the input field is aggregated, to indicate that the domain + should include the raw data values prior to the aggregation. + + 2) ``domain`` for *temporal* fields can be a two-element array minimum and maximum + values, in the form of either timestamps or the `DateTime definition objects + `__. + + 3) ``domain`` for *ordinal* and *nominal* fields can be an array that lists valid + input values. + """ + _schema = {'$ref': '#/definitions/DomainUnionWith'} + + def __init__(self, unionWith=Undefined, **kwds): + super(DomainUnionWith, self).__init__(unionWith=unionWith, **kwds) + + +class DsvDataFormat(DataFormat): + """DsvDataFormat schema wrapper + + Mapping(required=[delimiter]) + + Attributes + ---------- + + delimiter : string + 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) + 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 + name, and the value to the desired data type (one of ``"number"``, ``"boolean"``, + ``"date"``, or null (do not parse the field)). For example, ``"parse": + {"modified_on": "date"}`` parses the ``modified_on`` field in each input record a + Date value. + + For ``"date"``, we parse data based using Javascript's `Date.parse() + `__. + For Specific date formats can be provided (e.g., ``{foo: "date:'%m%d%Y'"}`` ), using + the `d3-time-format syntax `__. + UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). + See more about `UTC time + `__ + type : string + 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) + + +class Element(VegaLiteSchema): + """Element schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/Element'} + + def __init__(self, *args): + super(Element, self).__init__(*args) + + +class Encoding(VegaLiteSchema): + """Encoding schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + angle : :class:`NumericMarkPropDef` + Rotation angle of point and text marks. + color : :class:`ColorDef` + 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 + `__ '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 + `__. + description : anyOf(:class:`StringFieldDefWithCondition`, + :class:`StringValueDefWithCondition`) + 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`)) + 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 color of the marks. **Default value:** If undefined, the default color depends + on `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` + Fill opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's + ``fillOpacity`` property. + href : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + A URL to load upon mouse click. + key : :class:`FieldDefWithoutScale` + 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 position of geographically projected marks. + latitude2 : :class:`Position2Def` + Latitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, + ``"rect"``, and ``"rule"``. + longitude : :class:`LatLongDef` + Longitude position of geographically projected marks. + longitude2 : :class:`Position2Def` + Longitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, + ``"rect"``, and ``"rule"``. + opacity : :class:`NumericMarkPropDef` + Opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's ``opacity`` + property. + order : anyOf(:class:`OrderFieldDef`, List(:class:`OrderFieldDef`), :class:`OrderValueDef`) + Order of the marks. - For stacked marks, this ``order`` channel encodes `stack 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 + `__. 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 : :class:`PolarDef` + The outer radius in pixels of arc marks. + radius2 : :class:`Position2Def` + The inner radius in pixels of arc marks. + shape : :class:`ShapeDef` + 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 + `__ (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 + `__ 's ``shape`` + property. ( ``"circle"`` if unset.) + size : :class:`NumericMarkPropDef` + 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 : :class:`ColorDef` + Stroke color of the marks. **Default value:** If undefined, the default color + depends on `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 : :class:`NumericArrayMarkPropDef` + Stroke dash of the marks. + + **Default value:** ``[1,0]`` (No dash). + strokeOpacity : :class:`NumericMarkPropDef` + Stroke opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's + ``strokeOpacity`` property. + strokeWidth : :class:`NumericMarkPropDef` + Stroke width of the marks. + + **Default value:** If undefined, the default stroke width depends on `mark config + `__ 's + ``strokeWidth`` property. + text : :class:`TextDef` + Text of the ``text`` mark. + theta : :class:`PolarDef` + 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` + 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) + The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding overrides + `the tooltip property in the mark definition + `__. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + url : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + The URL of an image mark. + x : :class:`PositionDef` + 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 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`) + Error value of x coordinates for error specified ``"errorbar"`` and ``"errorband"``. + xError2 : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + Secondary error value of x coordinates for error specified ``"errorbar"`` and + ``"errorband"``. + y : :class:`PositionDef` + 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 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`) + Error value of y coordinates for error specified ``"errorbar"`` and ``"errorband"``. + yError2 : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + Secondary error value of y coordinates for error specified ``"errorbar"`` and + ``"errorband"``. + """ + _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, y=Undefined, y2=Undefined, yError=Undefined, + yError2=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, y=y, y2=y2, yError=yError, + yError2=yError2, **kwds) + + +class EncodingSortFieldFieldName(VegaLiteSchema): + """EncodingSortFieldFieldName schema wrapper + + Mapping(required=[]) + A sort definition for sorting a discrete scale in an encoding field definition. + + Attributes + ---------- + + field : :class:`FieldName` + The data `field `__ to sort by. + + **Default value:** If unspecified, defaults to the field specified in the outer data + reference. + op : :class:`NonArgAggregateOp` + An `aggregate operation + `__ to perform on the + field prior to sorting (e.g., ``"count"``, ``"mean"`` and ``"median"`` ). An + aggregation is required when there are multiple values of the sort field for each + encoded data field. The input data objects will be aggregated, grouped by the + encoded data field. + + For a full list of operations, please see the documentation for `aggregate + `__. + + **Default value:** ``"sum"`` for stacked plots. Otherwise, ``"min"``. + order : anyOf(:class:`SortOrder`, 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): + super(EncodingSortFieldFieldName, self).__init__(field=field, op=op, order=order, **kwds) + + +class ErrorBand(CompositeMark): + """ErrorBand schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/ErrorBand'} + + def __init__(self, *args): + super(ErrorBand, self).__init__(*args) + + +class ErrorBandConfig(VegaLiteSchema): + """ErrorBandConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) + + borders : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) + + extent : :class:`ErrorBarExtent` + The extent of the band. Available options include: - `"ci"`: Extend the band to the + confidence interval of the mean. - `"stderr"`: The size of band are set to the value + of standard error, extending from the mean. - `"stdev"`: The size of band are set to + the value of standard deviation, extending from the mean. - `"iqr"`: Extend the band + to the q1 and q3. + + **Default value:** ``"stderr"``. + interpolate : :class:`Interpolate` + The line interpolation method for the error band. One of the following: - + `"linear"`: piecewise linear segments, as in a polyline. - `"linear-closed"`: close + the linear segments to form a polygon. - `"step"`: a piecewise constant function (a + step function) consisting of alternating horizontal and vertical lines. The y-value + changes at the midpoint of each pair of adjacent x-values. - `"step-before"`: a + piecewise constant function (a step function) consisting of alternating horizontal + and vertical lines. The y-value changes before the x-value. - `"step-after"`: a + piecewise constant function (a step function) consisting of alternating horizontal + and vertical lines. The y-value changes after the x-value. - `"basis"`: a B-spline, + with control point duplication on the ends. - `"basis-open"`: an open B-spline; may + not intersect the start or end. - `"basis-closed"`: a closed B-spline, as in a loop. + - `"cardinal"`: a Cardinal spline, with control point duplication on the ends. - + `"cardinal-open"`: an open Cardinal spline; may not intersect the start or end, but + will intersect other control points. - `"cardinal-closed"`: a closed Cardinal + spline, as in a loop. - `"bundle"`: equivalent to basis, except the tension + parameter is used to straighten the spline. - ``"monotone"`` : cubic interpolation + that preserves monotonicity in y. + 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) + + +class ErrorBandDef(CompositeMarkDef): + """ErrorBandDef schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`ErrorBand` + 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:`MarkConfigExprOrSignalRef`) + + borders : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) + + clip : boolean + Whether a composite mark be clipped to the enclosing group’s width and height. + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** - This property cannot be used in a `style config + `__. - The ``fill`` + and ``stroke`` properties have higher precedence than ``color`` and will override + ``color``. + extent : :class:`ErrorBarExtent` + The extent of the band. Available options include: - `"ci"`: Extend the band to the + confidence interval of the mean. - `"stderr"`: The size of band are set to the value + of standard error, extending from the mean. - `"stdev"`: The size of band are set to + the value of standard deviation, extending from the mean. - `"iqr"`: Extend the band + to the q1 and q3. + + **Default value:** ``"stderr"``. + interpolate : :class:`Interpolate` + The line interpolation method for the error band. One of the following: - + `"linear"`: piecewise linear segments, as in a polyline. - `"linear-closed"`: close + the linear segments to form a polygon. - `"step"`: a piecewise constant function (a + step function) consisting of alternating horizontal and vertical lines. The y-value + changes at the midpoint of each pair of adjacent x-values. - `"step-before"`: a + piecewise constant function (a step function) consisting of alternating horizontal + and vertical lines. The y-value changes before the x-value. - `"step-after"`: a + piecewise constant function (a step function) consisting of alternating horizontal + and vertical lines. The y-value changes after the x-value. - `"basis"`: a B-spline, + with control point duplication on the ends. - `"basis-open"`: an open B-spline; may + not intersect the start or end. - `"basis-closed"`: a closed B-spline, as in a loop. + - `"cardinal"`: a Cardinal spline, with control point duplication on the ends. - + `"cardinal-open"`: an open Cardinal spline; may not intersect the start or end, but + will intersect other control points. - `"cardinal-closed"`: a closed Cardinal + spline, as in a loop. - `"bundle"`: equivalent to basis, except the tension + parameter is used to straighten the spline. - ``"monotone"`` : cubic interpolation + that preserves monotonicity in y. + opacity : float + The opacity (value between [0,1]) of the mark. + orient : :class:`Orientation` + 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) + + +class ErrorBar(CompositeMark): + """ErrorBar schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/ErrorBar'} + + def __init__(self, *args): + super(ErrorBar, self).__init__(*args) + + +class ErrorBarConfig(VegaLiteSchema): + """ErrorBarConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + extent : :class:`ErrorBarExtent` + The extent of the rule. Available options include: - `"ci"`: Extend the rule to the + confidence interval of the mean. - `"stderr"`: The size of rule are set to the value + of standard error, extending from the mean. - `"stdev"`: The size of rule are set to + the value of standard deviation, extending from the mean. - `"iqr"`: Extend the rule + to the q1 and q3. + + **Default value:** ``"stderr"``. + rule : anyOf(boolean, :class:`MarkConfigExprOrSignalRef`) + + 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:`MarkConfigExprOrSignalRef`) + + """ + _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) + + +class ErrorBarDef(CompositeMarkDef): + """ErrorBarDef schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`ErrorBar` + 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 + Whether a composite mark be clipped to the enclosing group’s width and height. + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** - This property cannot be used in a `style config + `__. - The ``fill`` + and ``stroke`` properties have higher precedence than ``color`` and will override + ``color``. + extent : :class:`ErrorBarExtent` + The extent of the rule. Available options include: - `"ci"`: Extend the rule to the + confidence interval of the mean. - `"stderr"`: The size of rule are set to the value + of standard error, extending from the mean. - `"stdev"`: The size of rule are set to + the value of standard deviation, extending from the mean. - `"iqr"`: Extend the rule + to the q1 and q3. + + **Default value:** ``"stderr"``. + opacity : float + The opacity (value between [0,1]) of the mark. + orient : :class:`Orientation` + 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:`MarkConfigExprOrSignalRef`) + + 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:`MarkConfigExprOrSignalRef`) + + """ + _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) + + +class ErrorBarExtent(VegaLiteSchema): + """ErrorBarExtent schema wrapper + + enum('ci', 'iqr', 'stderr', 'stdev') + """ + _schema = {'$ref': '#/definitions/ErrorBarExtent'} + + def __init__(self, *args): + super(ErrorBarExtent, self).__init__(*args) + + +class Expr(VegaLiteSchema): + """Expr schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/Expr'} + + def __init__(self, *args): + super(Expr, self).__init__(*args) + + +class ExprOrSignalRef(VegaLiteSchema): + """ExprOrSignalRef schema wrapper + + Mapping(required=[expr]) + + Attributes + ---------- + + expr : string + Vega expression (which can refer to Vega-Lite parameters). + """ + _schema = {'$ref': '#/definitions/ExprOrSignalRef'} + + def __init__(self, expr=Undefined, **kwds): + super(ExprOrSignalRef, self).__init__(expr=expr, **kwds) + + +class ExprRef(VegaLiteSchema): + """ExprRef schema wrapper + + Mapping(required=[expr]) + + Attributes + ---------- + + expr : string + Vega expression (which can refer to Vega-Lite parameters). + """ + _schema = {'$ref': '#/definitions/ExprRef'} + + def __init__(self, expr=Undefined, **kwds): + super(ExprRef, self).__init__(expr=expr, **kwds) + + +class FacetEncodingFieldDef(VegaLiteSchema): + """FacetEncodingFieldDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. - For ``"each"``, subviews will be aligned into a + clean grid structure, but each row or column may be of variable size. - For + ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: - the general (wrappable) ``concat`` operator (not + ``hconcat`` / ``vconcat`` ) - the ``facet`` and ``repeat`` operator with one + field/repetition definition (without row/column nesting) + + 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` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + header : :class:`Header` + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FacetEncodingFieldDef'} + + def __init__(self, aggregate=Undefined, align=Undefined, band=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, band=band, + 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=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + header : :class:`Header` + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FacetFieldDef'} + + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, field=Undefined, + header=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, + **kwds): + super(FacetFieldDef, self).__init__(aggregate=aggregate, band=band, bin=bin, field=field, + header=header, sort=sort, timeUnit=timeUnit, title=title, + type=type, **kwds) + + +class FacetFieldDefFieldName(VegaLiteSchema): + """FacetFieldDefFieldName schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`FieldName` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + header : :class:`Header` + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortFieldFieldName`, + None) + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FacetFieldDef'} + + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, field=Undefined, + header=Undefined, sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, + **kwds): + super(FacetFieldDefFieldName, self).__init__(aggregate=aggregate, band=band, bin=bin, + field=field, header=header, sort=sort, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class FacetMapping(VegaLiteSchema): + """FacetMapping schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + column : :class:`FacetFieldDef` + A field definition for the horizontal facet of trellis plots. + row : :class:`FacetFieldDef` + A field definition for the vertical facet of trellis plots. + """ + _schema = {'$ref': '#/definitions/FacetMapping'} + + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(FacetMapping, self).__init__(column=column, row=row, **kwds) + + +class FacetMappingFieldName(VegaLiteSchema): + """FacetMappingFieldName schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + column : :class:`FacetFieldDefFieldName` + A field definition for the horizontal facet of trellis plots. + row : :class:`FacetFieldDefFieldName` + A field definition for the vertical facet of trellis plots. + """ + _schema = {'$ref': '#/definitions/FacetMapping'} + + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(FacetMappingFieldName, self).__init__(column=column, row=row, **kwds) + + +class FacetedEncoding(VegaLiteSchema): + """FacetedEncoding schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + angle : :class:`NumericMarkPropDef` + Rotation angle of point and text marks. + color : :class:`ColorDef` + 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 + `__ '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 + `__. + column : :class:`RowColumnEncodingFieldDef` + A field definition for the horizontal facet of trellis plots. + description : anyOf(:class:`StringFieldDefWithCondition`, + :class:`StringValueDefWithCondition`) + 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`)) + 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` + 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 color of the marks. **Default value:** If undefined, the default color depends + on `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` + Fill opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's + ``fillOpacity`` property. + href : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + A URL to load upon mouse click. + key : :class:`FieldDefWithoutScale` + 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 position of geographically projected marks. + latitude2 : :class:`Position2Def` + Latitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, + ``"rect"``, and ``"rule"``. + longitude : :class:`LatLongDef` + Longitude position of geographically projected marks. + longitude2 : :class:`Position2Def` + Longitude-2 position for geographically projected ranged ``"area"``, ``"bar"``, + ``"rect"``, and ``"rule"``. + opacity : :class:`NumericMarkPropDef` + Opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's ``opacity`` + property. + order : anyOf(:class:`OrderFieldDef`, List(:class:`OrderFieldDef`), :class:`OrderValueDef`) + Order of the marks. - For stacked marks, this ``order`` channel encodes `stack 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 + `__. 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 : :class:`PolarDef` + The outer radius in pixels of arc marks. + radius2 : :class:`Position2Def` + The inner radius in pixels of arc marks. + row : :class:`RowColumnEncodingFieldDef` + A field definition for the vertical facet of trellis plots. + shape : :class:`ShapeDef` + 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 + `__ (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 + `__ 's ``shape`` + property. ( ``"circle"`` if unset.) + size : :class:`NumericMarkPropDef` + 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 : :class:`ColorDef` + Stroke color of the marks. **Default value:** If undefined, the default color + depends on `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 : :class:`NumericArrayMarkPropDef` + Stroke dash of the marks. + + **Default value:** ``[1,0]`` (No dash). + strokeOpacity : :class:`NumericMarkPropDef` + Stroke opacity of the marks. + + **Default value:** If undefined, the default opacity depends on `mark config + `__ 's + ``strokeOpacity`` property. + strokeWidth : :class:`NumericMarkPropDef` + Stroke width of the marks. + + **Default value:** If undefined, the default stroke width depends on `mark config + `__ 's + ``strokeWidth`` property. + text : :class:`TextDef` + Text of the ``text`` mark. + theta : :class:`PolarDef` + 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` + 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) + The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding overrides + `the tooltip property in the mark definition + `__. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + url : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`) + The URL of an image mark. + x : :class:`PositionDef` + 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 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`) + Error value of x coordinates for error specified ``"errorbar"`` and ``"errorband"``. + xError2 : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + Secondary error value of x coordinates for error specified ``"errorbar"`` and + ``"errorband"``. + y : :class:`PositionDef` + 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 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`) + Error value of y coordinates for error specified ``"errorbar"`` and ``"errorband"``. + yError2 : anyOf(:class:`SecondaryFieldDef`, :class:`ValueDefnumber`) + Secondary error value of y coordinates for error specified ``"errorbar"`` and + ``"errorband"``. + """ + _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, y=Undefined, + y2=Undefined, yError=Undefined, yError2=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, y=y, + y2=y2, yError=yError, yError2=yError2, **kwds) + + +class Field(VegaLiteSchema): + """Field schema wrapper + + anyOf(:class:`FieldName`, :class:`RepeatRef`) + """ + _schema = {'$ref': '#/definitions/Field'} + + def __init__(self, *args, **kwds): + super(Field, self).__init__(*args, **kwds) + + +class FieldDefWithoutScale(VegaLiteSchema): + """FieldDefWithoutScale schema wrapper + + Mapping(required=[]) + Definition object for a data field, its type and transformation of an encoding channel. + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FieldDefWithoutScale'} + + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(FieldDefWithoutScale, self).__init__(aggregate=aggregate, band=band, bin=bin, field=field, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class FieldName(Field): + """FieldName schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/FieldName'} + + def __init__(self, *args): + super(FieldName, self).__init__(*args) + + +class FieldOrDatumDefWithConditionStringFieldDefstring(VegaLiteSchema): + """FieldOrDatumDefWithConditionStringFieldDefstring schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"time"`` for temporal fields and ordinal and nominal fields + with ``timeUnit``. - ``"number"`` for quantitative fields as well as ordinal and + nominal fields without ``timeUnit``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} + + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionStringFieldDefstring, self).__init__(aggregate=aggregate, + band=band, bin=bin, + condition=condition, + field=field, + format=format, + formatType=formatType, + labelExpr=labelExpr, + timeUnit=timeUnit, + title=title, type=type, + **kwds) + + +class Fit(VegaLiteSchema): + """Fit schema wrapper + + anyOf(:class:`GeoJsonFeature`, :class:`GeoJsonFeatureCollection`, + List(:class:`GeoJsonFeature`)) + """ + _schema = {'$ref': '#/definitions/Fit'} + + def __init__(self, *args, **kwds): + super(Fit, self).__init__(*args, **kwds) + + +class FontStyle(VegaLiteSchema): + """FontStyle schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/FontStyle'} + + def __init__(self, *args): + super(FontStyle, self).__init__(*args) + + +class FontWeight(VegaLiteSchema): + """FontWeight schema wrapper + + enum('normal', 'bold', 'lighter', 'bolder', 100, 200, 300, 400, 500, 600, 700, 800, 900) + """ + _schema = {'$ref': '#/definitions/FontWeight'} + + def __init__(self, *args): + super(FontWeight, self).__init__(*args) + + +class Generator(Data): + """Generator schema wrapper + + anyOf(:class:`SequenceGenerator`, :class:`SphereGenerator`, :class:`GraticuleGenerator`) + """ + _schema = {'$ref': '#/definitions/Generator'} + + def __init__(self, *args, **kwds): + super(Generator, self).__init__(*args, **kwds) + + +class GeoJsonFeature(Fit): + """GeoJsonFeature schema wrapper + + Any + """ + _schema = {'$ref': '#/definitions/GeoJsonFeature'} + + def __init__(self, *args, **kwds): + super(GeoJsonFeature, self).__init__(*args, **kwds) + + +class GeoJsonFeatureCollection(Fit): + """GeoJsonFeatureCollection schema wrapper + + Any + """ + _schema = {'$ref': '#/definitions/GeoJsonFeatureCollection'} + + def __init__(self, *args, **kwds): + super(GeoJsonFeatureCollection, self).__init__(*args, **kwds) + + +class Gradient(VegaLiteSchema): + """Gradient schema wrapper + + anyOf(:class:`LinearGradient`, :class:`RadialGradient`) + """ + _schema = {'$ref': '#/definitions/Gradient'} + + def __init__(self, *args, **kwds): + super(Gradient, self).__init__(*args, **kwds) + + +class GradientStop(VegaLiteSchema): + """GradientStop schema wrapper + + Mapping(required=[offset, color]) + + Attributes + ---------- + + color : :class:`Color` + 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): + super(GradientStop, self).__init__(color=color, offset=offset, **kwds) + + +class GraticuleGenerator(Generator): + """GraticuleGenerator schema wrapper + + Mapping(required=[graticule]) + + Attributes + ---------- + + graticule : anyOf(boolean, :class:`GraticuleParams`) + Generate graticule GeoJSON data for geographic reference lines. + name : string + Provide a placeholder name and bind data at runtime. + """ + _schema = {'$ref': '#/definitions/GraticuleGenerator'} + + def __init__(self, graticule=Undefined, name=Undefined, **kwds): + super(GraticuleGenerator, self).__init__(graticule=graticule, name=name, **kwds) + + +class GraticuleParams(VegaLiteSchema): + """GraticuleParams schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + extent : :class:`Vector2Vector2number` + Sets both the major and minor extents to the same values. + extentMajor : :class:`Vector2Vector2number` + The major extent of the graticule as a two-element array of coordinates. + extentMinor : :class:`Vector2Vector2number` + 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` + Sets both the major and minor step angles to the same values. + stepMajor : :class:`Vector2number` + The major step angles of the graticule. + + **Default value:** ``[90, 360]`` + stepMinor : :class:`Vector2number` + 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) + + +class Header(VegaLiteSchema): + """Header schema wrapper + + Mapping(required=[]) + Headers of row / column channels for faceted plots. + + Attributes + ---------- + + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"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`) + Horizontal text alignment of header labels. One of ``"left"``, ``"center"``, or + ``"right"``. + labelAnchor : :class:`TitleAnchor` + 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. + labelAngle : float + The rotation angle of the header labels. + + **Default value:** ``0`` for column header, ``-90`` for row header. + labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + 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`) + The color of the header label, can be in hex color code or regular color name. + labelExpr : string + `Vega expression `__ 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`) + The font of the header label. + labelFontSize : anyOf(float, :class:`ExprRef`) + The font size of the header label, in pixels. + labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + The font style of the header label. + labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + The font weight of the header label. + labelLimit : anyOf(float, :class:`ExprRef`) + 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`) + Line height in pixels for multi-line header labels or title text with ``"line-top"`` + or ``"line-bottom"`` baseline. + labelOrient : :class:`Orient` + The orientation of the header label. One of ``"top"``, ``"bottom"``, ``"left"`` or + ``"right"``. + labelPadding : anyOf(float, :class:`ExprRef`) + The padding, in pixel, between facet header's label and the plot. + + **Default value:** ``10`` + labels : boolean + A boolean flag indicating if labels should be included as part of the header. + + **Default value:** ``true``. + orient : :class:`Orient` + Shortcut for setting both labelOrient and titleOrient. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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`) + Horizontal text alignment (to the anchor) of header titles. + titleAnchor : :class:`TitleAnchor` + 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. + titleAngle : float + The rotation angle of the header title. + + **Default value:** ``0``. + titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + 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 + ``"bottom"``, but are calculated relative to the ``titleLineHeight`` rather than + ``titleFontSize`` alone. + + **Default value:** ``"middle"`` + titleColor : anyOf(:class:`Color`, :class:`ExprRef`) + Color of the header title, can be in hex color code or regular color name. + titleFont : anyOf(string, :class:`ExprRef`) + Font of the header title. (e.g., ``"Helvetica Neue"`` ). + titleFontSize : anyOf(float, :class:`ExprRef`) + Font size of the header title. + titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + The font style of the header title. + titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + 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`) + 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`) + Line height in pixels for multi-line header title text or title text with + ``"line-top"`` or ``"line-bottom"`` baseline. + titleOrient : :class:`Orient` + The orientation of the header title. One of ``"top"``, ``"bottom"``, ``"left"`` or + ``"right"``. + titlePadding : anyOf(float, :class:`ExprRef`) + 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) + + +class HeaderConfig(VegaLiteSchema): + """HeaderConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"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`) + Horizontal text alignment of header labels. One of ``"left"``, ``"center"``, or + ``"right"``. + labelAnchor : :class:`TitleAnchor` + 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. + labelAngle : float + The rotation angle of the header labels. + + **Default value:** ``0`` for column header, ``-90`` for row header. + labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + 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`) + The color of the header label, can be in hex color code or regular color name. + labelExpr : string + `Vega expression `__ 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`) + The font of the header label. + labelFontSize : anyOf(float, :class:`ExprRef`) + The font size of the header label, in pixels. + labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + The font style of the header label. + labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + The font weight of the header label. + labelLimit : anyOf(float, :class:`ExprRef`) + 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`) + Line height in pixels for multi-line header labels or title text with ``"line-top"`` + or ``"line-bottom"`` baseline. + labelOrient : :class:`Orient` + The orientation of the header label. One of ``"top"``, ``"bottom"``, ``"left"`` or + ``"right"``. + labelPadding : anyOf(float, :class:`ExprRef`) + The padding, in pixel, between facet header's label and the plot. + + **Default value:** ``10`` + labels : boolean + A boolean flag indicating if labels should be included as part of the header. + + **Default value:** ``true``. + orient : :class:`Orient` + 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`) + Horizontal text alignment (to the anchor) of header titles. + titleAnchor : :class:`TitleAnchor` + 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. + titleAngle : float + The rotation angle of the header title. + + **Default value:** ``0``. + titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + 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 + ``"bottom"``, but are calculated relative to the ``titleLineHeight`` rather than + ``titleFontSize`` alone. + + **Default value:** ``"middle"`` + titleColor : anyOf(:class:`Color`, :class:`ExprRef`) + Color of the header title, can be in hex color code or regular color name. + titleFont : anyOf(string, :class:`ExprRef`) + Font of the header title. (e.g., ``"Helvetica Neue"`` ). + titleFontSize : anyOf(float, :class:`ExprRef`) + Font size of the header title. + titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + The font style of the header title. + titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + 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`) + 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`) + Line height in pixels for multi-line header title text or title text with + ``"line-top"`` or ``"line-bottom"`` baseline. + titleOrient : :class:`Orient` + The orientation of the header title. One of ``"top"``, ``"bottom"``, ``"left"`` or + ``"right"``. + titlePadding : anyOf(float, :class:`ExprRef`) + 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) + + +class HexColor(Color): + """HexColor schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/HexColor'} + + def __init__(self, *args): + super(HexColor, self).__init__(*args) + + +class ImputeMethod(VegaLiteSchema): + """ImputeMethod schema wrapper + + enum('value', 'median', 'max', 'min', 'mean') + """ + _schema = {'$ref': '#/definitions/ImputeMethod'} + + def __init__(self, *args): + super(ImputeMethod, self).__init__(*args) + + +class ImputeParams(VegaLiteSchema): + """ImputeParams schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + frame : List([anyOf(None, float), anyOf(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 + rows preceding or following the current data object. For example, the value ``[-5, + 5]`` indicates that the window should include five objects preceding and five + objects following the current object. + + **Default value:** : ``[null, null]`` indicating that the window includes all + objects. + 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 + `__. + + If provided, this will be used in addition to the key values observed within the + input data. If not provided, the values will be derived from all unique values of + the ``key`` field. For ``impute`` in ``encoding``, the key field is the x-field if + the y-field is imputed, or vice versa. + + If there is no impute grouping, this property *must* be specified. + method : :class:`ImputeMethod` + The imputation method to use for the field value of imputed data objects. One of + ``"value"``, ``"mean"``, ``"median"``, ``"max"`` or ``"min"``. + + **Default value:** ``"value"`` + 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) + + +class ImputeSequence(VegaLiteSchema): + """ImputeSequence schema wrapper + + Mapping(required=[stop]) + + Attributes + ---------- + + stop : float + The ending value(exclusive) of the sequence. + start : float + The starting value of the sequence. **Default value:** ``0`` + step : float + 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): + super(ImputeSequence, self).__init__(stop=stop, start=start, step=step, **kwds) + + +class InlineData(DataSource): + """InlineData schema wrapper + + Mapping(required=[values]) + + Attributes + ---------- + + values : :class:`InlineDataset` + 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` + An object that specifies the format for parsing the data. + name : string + 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) + + +class InlineDataset(VegaLiteSchema): + """InlineDataset schema wrapper + + anyOf(List(float), List(string), List(boolean), List(Mapping(required=[])), string, + Mapping(required=[])) + """ + _schema = {'$ref': '#/definitions/InlineDataset'} + + def __init__(self, *args, **kwds): + super(InlineDataset, self).__init__(*args, **kwds) + + +class InputBinding(Binding): + """InputBinding schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + autocomplete : string + + debounce : float + + element : :class:`Element` + + input : string + + name : string + + placeholder : string + + type : string + + """ + _schema = {'$ref': '#/definitions/InputBinding'} + + def __init__(self, autocomplete=Undefined, debounce=Undefined, element=Undefined, input=Undefined, + name=Undefined, placeholder=Undefined, type=Undefined, **kwds): + super(InputBinding, self).__init__(autocomplete=autocomplete, debounce=debounce, + element=element, input=input, name=name, + placeholder=placeholder, type=type, **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') + """ + _schema = {'$ref': '#/definitions/Interpolate'} + + def __init__(self, *args): + super(Interpolate, self).__init__(*args) + + +class IntervalSelectionConfig(VegaLiteSchema): + """IntervalSelectionConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + bind : string + Establishes a two-way binding between the interval selection and the scales used + within the same view. This allows a user to interactively pan and zoom the view. + + **See also:** `bind `__ + documentation. + clear : anyOf(:class:`Stream`, string, boolean) + Clears the selection, emptying it of all values. Can be a `Event Stream + `__ or ``false`` to disable. + + **Default value:** ``dblclick``. + + **See also:** `clear `__ + documentation. + empty : enum('all', 'none') + By default, ``all`` data values are considered to lie within an empty selection. + When set to ``none``, empty selections contain no data values. + encodings : List(:class:`SingleDefUnitChannel`) + An array of encoding channels. The corresponding data field values must match for a + data tuple to fall within the selection. + + **See also:** `encodings `__ + documentation. + fields : List(:class:`FieldName`) + An array of field names whose values must match for a data tuple to fall within the + selection. + + **See also:** `fields `__ + documentation. + init : :class:`SelectionInitIntervalMapping` + Initialize the selection with a mapping between `projected channels or field names + `__ and arrays of initial + values. + + **See also:** `init `__ + documentation. + mark : :class:`BrushConfig` + 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 `__ + documentation. + on : anyOf(:class:`Stream`, string) + A `Vega event stream `__ (object or + selector) that triggers the selection. For interval selections, the event stream + must specify a `start and end + `__. + resolve : :class:`SelectionResolution` + 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. + + **See also:** `resolve + `__ documentation. + translate : anyOf(string, boolean) + 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 `__ which must + include a start and end event to trigger continuous panning. + + **Default value:** ``true``, which corresponds to ``[mousedown, window:mouseup] > + window:mousemove!`` which corresponds to clicks and dragging within an interval + selection to reposition it. + + **See also:** `translate `__ + documentation. + zoom : anyOf(string, boolean) + When truthy, allows a user to interactively resize an interval selection. Can be + ``true``, ``false`` (to disable zooming), or a `Vega event stream definition + `__. Currently, only ``wheel`` + events are supported. + + **Default value:** ``true``, which corresponds to ``wheel!``. + + **See also:** `zoom `__ + documentation. + """ + _schema = {'$ref': '#/definitions/IntervalSelectionConfig'} + + def __init__(self, bind=Undefined, clear=Undefined, empty=Undefined, encodings=Undefined, + fields=Undefined, init=Undefined, mark=Undefined, on=Undefined, resolve=Undefined, + translate=Undefined, zoom=Undefined, **kwds): + super(IntervalSelectionConfig, self).__init__(bind=bind, clear=clear, empty=empty, + encodings=encodings, fields=fields, init=init, + mark=mark, on=on, resolve=resolve, + translate=translate, zoom=zoom, **kwds) + + +class JoinAggregateFieldDef(VegaLiteSchema): + """JoinAggregateFieldDef schema wrapper + + Mapping(required=[op, as]) + + Attributes + ---------- + + op : :class:`AggregateOp` + The aggregation operation to apply (e.g., ``"sum"``, ``"average"`` or ``"count"`` ). + See the list of all supported operations `here + `__. + field : :class:`FieldName` + 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` + The output name for the join aggregate operation. + """ + _schema = {'$ref': '#/definitions/JoinAggregateFieldDef'} + + def __init__(self, op=Undefined, field=Undefined, **kwds): + super(JoinAggregateFieldDef, self).__init__(op=op, field=field, **kwds) + + +class JsonDataFormat(DataFormat): + """JsonDataFormat schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + parse : anyOf(:class:`Parse`, 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 + name, and the value to the desired data type (one of ``"number"``, ``"boolean"``, + ``"date"``, or null (do not parse the field)). For example, ``"parse": + {"modified_on": "date"}`` parses the ``modified_on`` field in each input record a + Date value. + + For ``"date"``, we parse data based using Javascript's `Date.parse() + `__. + For Specific date formats can be provided (e.g., ``{foo: "date:'%m%d%Y'"}`` ), using + the `d3-time-format syntax `__. + UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). + See more about `UTC time + `__ + property : string + 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 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) + + +class LabelOverlap(VegaLiteSchema): + """LabelOverlap schema wrapper + + anyOf(boolean, string, string) + """ + _schema = {'$ref': '#/definitions/LabelOverlap'} + + def __init__(self, *args, **kwds): + super(LabelOverlap, self).__init__(*args, **kwds) + + +class LatLongDef(VegaLiteSchema): + """LatLongDef schema wrapper + + anyOf(:class:`LatLongFieldDef`, :class:`DatumDef`, :class:`NumericValueDef`) + """ + _schema = {'$ref': '#/definitions/LatLongDef'} + + def __init__(self, *args, **kwds): + super(LatLongDef, self).__init__(*args, **kwds) + + +class LatLongFieldDef(LatLongDef): + """LatLongFieldDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 2) If both field definition's ``title`` and axis, header, or legend ``title`` are + defined, axis/header/legend title will be used. + type : string + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/LatLongFieldDef'} + + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(LatLongFieldDef, self).__init__(aggregate=aggregate, band=band, bin=bin, field=field, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class LayerRepeatMapping(VegaLiteSchema): + """LayerRepeatMapping schema wrapper + + Mapping(required=[layer]) + + Attributes + ---------- + + layer : List(string) + An array of fields to be repeated as layers. + column : List(string) + An array of fields to be repeated horizontally. + row : List(string) + 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) + + +class LayoutAlign(VegaLiteSchema): + """LayoutAlign schema wrapper + + enum('all', 'each', 'none') + """ + _schema = {'$ref': '#/definitions/LayoutAlign'} + + def __init__(self, *args): + super(LayoutAlign, self).__init__(*args) + + +class Legend(VegaLiteSchema): + """Legend schema wrapper + + Mapping(required=[]) + Properties of a legend or boolean flag for determining whether to show it. + + Attributes + ---------- + + aria : anyOf(boolean, :class:`ExprRef`) + + clipHeight : anyOf(float, :class:`ExprRef`) + + columnPadding : anyOf(float, :class:`ExprRef`) + + columns : anyOf(float, :class:`ExprRef`) + + cornerRadius : anyOf(float, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + direction : :class:`Orientation` + The direction of the legend, one of ``"vertical"`` or ``"horizontal"``. + + **Default value:** - For top-/bottom- ``orient`` ed legends, ``"horizontal"`` - 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`) + + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"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`) + + gradientOpacity : anyOf(float, :class:`ExprRef`) + + gradientStrokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + gradientStrokeWidth : anyOf(float, :class:`ExprRef`) + + gradientThickness : anyOf(float, :class:`ExprRef`) + + gridAlign : anyOf(:class:`LayoutAlign`, :class:`ExprRef`) + + labelAlign : anyOf(:class:`Align`, :class:`ExprRef`) + + labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + + labelColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + labelExpr : string + `Vega expression `__ 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`) + + labelFontSize : anyOf(float, :class:`ExprRef`) + + labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + labelLimit : anyOf(float, :class:`ExprRef`) + + labelOffset : anyOf(float, :class:`ExprRef`) + + labelOpacity : anyOf(float, :class:`ExprRef`) + + labelOverlap : anyOf(:class:`LabelOverlap`, :class:`ExprRef`) + + labelPadding : anyOf(float, :class:`ExprRef`) + + labelSeparation : anyOf(float, :class:`ExprRef`) + + legendX : anyOf(float, :class:`ExprRef`) + + legendY : anyOf(float, :class:`ExprRef`) + + offset : anyOf(float, :class:`ExprRef`) + + orient : :class:`LegendOrient` + 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`) + + rowPadding : anyOf(float, :class:`ExprRef`) + + strokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + symbolDash : anyOf(List(float), :class:`ExprRef`) + + symbolDashOffset : anyOf(float, :class:`ExprRef`) + + symbolFillColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + symbolLimit : anyOf(float, :class:`ExprRef`) + + symbolOffset : anyOf(float, :class:`ExprRef`) + + symbolOpacity : anyOf(float, :class:`ExprRef`) + + symbolSize : anyOf(float, :class:`ExprRef`) + + symbolStrokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + symbolStrokeWidth : anyOf(float, :class:`ExprRef`) + + symbolType : anyOf(:class:`SymbolShape`, :class:`ExprRef`) + + tickCount : anyOf(:class:`TickCount`, :class:`ExprRef`) + + tickMinStep : anyOf(float, :class:`ExprRef`) + 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) + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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`) + + titleAnchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + + titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + + titleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + titleFont : anyOf(string, :class:`ExprRef`) + + titleFontSize : anyOf(float, :class:`ExprRef`) + + titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + titleLimit : anyOf(float, :class:`ExprRef`) + + titleLineHeight : anyOf(float, :class:`ExprRef`) + + titleOpacity : anyOf(float, :class:`ExprRef`) + + titleOrient : anyOf(:class:`Orient`, :class:`ExprRef`) + + titlePadding : anyOf(float, :class:`ExprRef`) + + type : enum('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`) + 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) + + +class LegendBinding(VegaLiteSchema): + """LegendBinding schema wrapper + + anyOf(string, :class:`LegendStreamBinding`) + """ + _schema = {'$ref': '#/definitions/LegendBinding'} + + def __init__(self, *args, **kwds): + super(LegendBinding, self).__init__(*args, **kwds) + + +class LegendConfig(VegaLiteSchema): + """LegendConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aria : anyOf(boolean, :class:`ExprRef`) + + clipHeight : anyOf(float, :class:`ExprRef`) + + columnPadding : anyOf(float, :class:`ExprRef`) + + columns : anyOf(float, :class:`ExprRef`) + + cornerRadius : anyOf(float, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + direction : :class:`Orientation` + The direction of the legend, one of ``"vertical"`` or ``"horizontal"``. + + **Default value:** - For top-/bottom- ``orient`` ed legends, ``"horizontal"`` - 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 legend by default + fillColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + gradientDirection : anyOf(:class:`Orientation`, :class:`ExprRef`) + + gradientHorizontalMaxLength : float + Max legend length for a horizontal gradient when ``config.legend.gradientLength`` is + undefined. + + **Default value:** ``200`` + gradientHorizontalMinLength : float + Min legend length for a horizontal gradient when ``config.legend.gradientLength`` is + undefined. + + **Default value:** ``100`` + gradientLabelLimit : anyOf(float, :class:`ExprRef`) + + gradientLabelOffset : anyOf(float, :class:`ExprRef`) + + gradientLength : anyOf(float, :class:`ExprRef`) + + gradientOpacity : anyOf(float, :class:`ExprRef`) + + gradientStrokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + gradientStrokeWidth : anyOf(float, :class:`ExprRef`) + + gradientThickness : anyOf(float, :class:`ExprRef`) + + gradientVerticalMaxLength : float + Max legend length for a vertical gradient when ``config.legend.gradientLength`` is + undefined. + + **Default value:** ``200`` + gradientVerticalMinLength : float + Min legend length for a vertical gradient when ``config.legend.gradientLength`` is + undefined. + + **Default value:** ``100`` + gridAlign : anyOf(:class:`LayoutAlign`, :class:`ExprRef`) + + labelAlign : anyOf(:class:`Align`, :class:`ExprRef`) + + labelBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + + labelColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + labelFont : anyOf(string, :class:`ExprRef`) + + labelFontSize : anyOf(float, :class:`ExprRef`) + + labelFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + labelFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + labelLimit : anyOf(float, :class:`ExprRef`) + + labelOffset : anyOf(float, :class:`ExprRef`) + + labelOpacity : anyOf(float, :class:`ExprRef`) + + labelOverlap : anyOf(:class:`LabelOverlap`, :class:`ExprRef`) + 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 + scan of the labels is performed, removing any label that overlaps with the last + visible label (this often works better for log-scaled axes). + + **Default value:** ``"greedy"`` for ``log scales otherwise`` true`. + labelPadding : anyOf(float, :class:`ExprRef`) + + labelSeparation : anyOf(float, :class:`ExprRef`) + + layout : :class:`ExprRef` + + legendX : anyOf(float, :class:`ExprRef`) + + legendY : anyOf(float, :class:`ExprRef`) + + offset : anyOf(float, :class:`ExprRef`) + + orient : :class:`LegendOrient` + 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`) + + rowPadding : anyOf(float, :class:`ExprRef`) + + strokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + symbolBaseFillColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + symbolBaseStrokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + symbolDash : anyOf(List(float), :class:`ExprRef`) + + symbolDashOffset : anyOf(float, :class:`ExprRef`) + + symbolDirection : anyOf(:class:`Orientation`, :class:`ExprRef`) + + symbolFillColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + symbolLimit : anyOf(float, :class:`ExprRef`) + + symbolOffset : anyOf(float, :class:`ExprRef`) + + symbolOpacity : anyOf(float, :class:`ExprRef`) + + symbolSize : anyOf(float, :class:`ExprRef`) + + symbolStrokeColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + symbolStrokeWidth : anyOf(float, :class:`ExprRef`) + + symbolType : anyOf(:class:`SymbolShape`, :class:`ExprRef`) + + tickCount : anyOf(:class:`TickCount`, :class:`ExprRef`) + + title : None + Set to null to disable title for the axis, legend, or header. + titleAlign : anyOf(:class:`Align`, :class:`ExprRef`) + + titleAnchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + + titleBaseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + + titleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + titleFont : anyOf(string, :class:`ExprRef`) + + titleFontSize : anyOf(float, :class:`ExprRef`) + + titleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + titleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + titleLimit : anyOf(float, :class:`ExprRef`) + + titleLineHeight : anyOf(float, :class:`ExprRef`) + + titleOpacity : anyOf(float, :class:`ExprRef`) + + titleOrient : anyOf(:class:`Orient`, :class:`ExprRef`) + + titlePadding : anyOf(float, :class:`ExprRef`) + + unselectedOpacity : float + The opacity of unselected legend entries. + + **Default value:** 0.35. + zindex : anyOf(float, :class:`ExprRef`) + + """ + _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) + + +class LegendOrient(VegaLiteSchema): + """LegendOrient schema wrapper + + enum('none', 'left', 'right', 'top', 'bottom', 'top-left', 'top-right', 'bottom-left', + 'bottom-right') + """ + _schema = {'$ref': '#/definitions/LegendOrient'} + + def __init__(self, *args): + super(LegendOrient, self).__init__(*args) + + +class LegendResolveMap(VegaLiteSchema): + """LegendResolveMap schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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) + + +class LegendStreamBinding(LegendBinding): + """LegendStreamBinding schema wrapper + + Mapping(required=[legend]) + + Attributes + ---------- + + legend : anyOf(string, :class:`Stream`) + + """ + _schema = {'$ref': '#/definitions/LegendStreamBinding'} + + def __init__(self, legend=Undefined, **kwds): + super(LegendStreamBinding, self).__init__(legend=legend, **kwds) + + +class LineConfig(AnyMarkConfig): + """LineConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(:class:`Align`, :class:`ExprRef`) + 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`) + + aria : anyOf(boolean, :class:`ExprRef`) + + ariaRole : anyOf(string, :class:`ExprRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprRef`) + + aspect : anyOf(boolean, :class:`ExprRef`) + + baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + 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 + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + blend : anyOf(:class:`Blend`, :class:`ExprRef`) + + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** - This property cannot be used in a `style config + `__. - The ``fill`` + and ``stroke`` properties have higher precedence than ``color`` and will override + ``color``. + cornerRadius : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + ellipsis : anyOf(string, :class:`ExprRef`) + + endAngle : anyOf(float, :class:`ExprRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + 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`) + + filled : boolean + 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 + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + height : anyOf(float, :class:`ExprRef`) + + href : anyOf(:class:`URI`, :class:`ExprRef`) + + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). - If set to ``"filter"`` (default), all data items with null values will be + skipped (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`) + + lineBreak : anyOf(string, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. - For bar, rule and tick, this determines + whether the size of the bar and tick should be applied to x or y dimension. - For + area, this property determines the orient property of the Vega output. - For line + and trail marks, this property determines the sort order of the points in 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`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + padAngle : anyOf(float, :class:`ExprRef`) + + point : anyOf(boolean, :class:`OverlayMarkDef`, string) + A flag for overlaying points on top of line or area marks, or an object defining the + properties of the overlayed points. + + + If this property is ``"transparent"``, transparent points will be used (for + enhancing tooltips and selections). + + If this property is an empty object ( ``{}`` ) or ``true``, filled points with + default properties will be used. + + If this property is ``false``, no points would be automatically added to line or + area marks. + + **Default value:** ``false``. + radius : anyOf(float, :class:`ExprRef`) + 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. + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + + size : anyOf(float, :class:`ExprRef`) + Default size for marks. - For ``point`` / ``circle`` / ``square``, this represents + the pixel area of the marks. Note that this value sets the area of the symbol; the + side lengths will increase with the square root of this value. - For ``bar``, this + represents the band size of the bar, in pixels. - For ``text``, this represents the + font size, in pixels. + + **Default value:** - ``30`` for point, circle, square marks; width/height's ``step`` + - ``2`` for bar marks with discrete dimensions; - ``5`` for bar marks with + continuous dimensions; - ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprRef`) + + startAngle : anyOf(float, :class:`ExprRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + 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`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOffset : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + tension : anyOf(float, :class:`ExprRef`) + + text : anyOf(:class:`Text`, :class:`ExprRef`) + + theta : anyOf(float, :class:`ExprRef`) + 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`) + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + timeUnitBand : float + 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. + timeUnitBandPosition : float + Default relative band position for a time unit. If set to ``0``, the marks will be + positioned at the beginning of the time unit band step. If set to ``0.5``, the marks + will be positioned in the middle of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. - If ``tooltip`` is ``{"content": "data"}``, then all + fields that appear in the highlighted data point will be used. - If set to + ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) + + width : anyOf(float, :class:`ExprRef`) + + x : anyOf(float, string, :class:`ExprRef`) + 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 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 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 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, + timeUnitBand=Undefined, timeUnitBandPosition=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, + timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, + url=url, width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + +class LinearGradient(Gradient): + """LinearGradient schema wrapper + + Mapping(required=[gradient, stops]) + + Attributes + ---------- + + gradient : string + The type of gradient. Use ``"linear"`` for a linear gradient. + stops : List(:class:`GradientStop`) + An array of gradient stops defining the gradient color sequence. + id : string + + x1 : float + The starting x-coordinate, in normalized [0, 1] coordinates, of the linear gradient. + + **Default value:** ``0`` + x2 : float + The ending x-coordinate, in normalized [0, 1] coordinates, of the linear gradient. + + **Default value:** ``1`` + y1 : float + The starting y-coordinate, in normalized [0, 1] coordinates, of the linear gradient. + + **Default value:** ``0`` + y2 : float + The ending y-coordinate, in normalized [0, 1] coordinates, of the linear 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) + + +class LookupData(VegaLiteSchema): + """LookupData schema wrapper + + Mapping(required=[data, key]) + + Attributes + ---------- + + data : :class:`Data` + Secondary data source to lookup in. + key : :class:`FieldName` + Key in data to lookup. + fields : List(:class:`FieldName`) + 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): + super(LookupData, self).__init__(data=data, key=key, fields=fields, **kwds) + + +class LookupSelection(VegaLiteSchema): + """LookupSelection schema wrapper + + Mapping(required=[key, selection]) + + Attributes + ---------- + + key : :class:`FieldName` + Key in data to lookup. + selection : string + Selection name to look up. + fields : List(:class:`FieldName`) + 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, selection=Undefined, fields=Undefined, **kwds): + super(LookupSelection, self).__init__(key=key, selection=selection, fields=fields, **kwds) + + +class Mark(AnyMark): + """Mark schema wrapper + + enum('arc', 'area', 'bar', 'image', 'line', 'point', 'rect', 'rule', 'text', 'tick', + 'trail', 'circle', 'square', 'geoshape') + All types of primitive marks. + """ + _schema = {'$ref': '#/definitions/Mark'} + + def __init__(self, *args): + super(Mark, self).__init__(*args) + + +class MarkConfig(AnyMarkConfig): + """MarkConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(:class:`Align`, :class:`ExprRef`) + 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`) + + aria : anyOf(boolean, :class:`ExprRef`) + + ariaRole : anyOf(string, :class:`ExprRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprRef`) + + aspect : anyOf(boolean, :class:`ExprRef`) + + baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + 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 + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + blend : anyOf(:class:`Blend`, :class:`ExprRef`) + + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** - This property cannot be used in a `style config + `__. - The ``fill`` + and ``stroke`` properties have higher precedence than ``color`` and will override + ``color``. + cornerRadius : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + ellipsis : anyOf(string, :class:`ExprRef`) + + endAngle : anyOf(float, :class:`ExprRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + 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`) + + filled : boolean + 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 + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + height : anyOf(float, :class:`ExprRef`) + + href : anyOf(:class:`URI`, :class:`ExprRef`) + + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). - If set to ``"filter"`` (default), all data items with null values will be + skipped (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`) + + lineBreak : anyOf(string, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. - For bar, rule and tick, this determines + whether the size of the bar and tick should be applied to x or y dimension. - For + area, this property determines the orient property of the Vega output. - For line + and trail marks, this property determines the sort order of the points in 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`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + padAngle : anyOf(float, :class:`ExprRef`) + + radius : anyOf(float, :class:`ExprRef`) + 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. + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + + size : anyOf(float, :class:`ExprRef`) + Default size for marks. - For ``point`` / ``circle`` / ``square``, this represents + the pixel area of the marks. Note that this value sets the area of the symbol; the + side lengths will increase with the square root of this value. - For ``bar``, this + represents the band size of the bar, in pixels. - For ``text``, this represents the + font size, in pixels. + + **Default value:** - ``30`` for point, circle, square marks; width/height's ``step`` + - ``2`` for bar marks with discrete dimensions; - ``5`` for bar marks with + continuous dimensions; - ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprRef`) + + startAngle : anyOf(float, :class:`ExprRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + 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`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOffset : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + tension : anyOf(float, :class:`ExprRef`) + + text : anyOf(:class:`Text`, :class:`ExprRef`) + + theta : anyOf(float, :class:`ExprRef`) + 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`) + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + timeUnitBand : float + 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. + timeUnitBandPosition : float + Default relative band position for a time unit. If set to ``0``, the marks will be + positioned at the beginning of the time unit band step. If set to ``0.5``, the marks + will be positioned in the middle of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. - If ``tooltip`` is ``{"content": "data"}``, then all + fields that appear in the highlighted data point will be used. - If set to + ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) + + width : anyOf(float, :class:`ExprRef`) + + x : anyOf(float, string, :class:`ExprRef`) + 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 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 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 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, + timeUnitBand=Undefined, timeUnitBandPosition=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, + timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, + url=url, width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + +class MarkConfigExprOrSignalRef(VegaLiteSchema): + """MarkConfigExprOrSignalRef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(:class:`Align`, :class:`ExprOrSignalRef`) + 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:`ExprOrSignalRef`) + + aria : anyOf(boolean, :class:`ExprOrSignalRef`) + + ariaRole : anyOf(string, :class:`ExprOrSignalRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprOrSignalRef`) + + aspect : anyOf(boolean, :class:`ExprOrSignalRef`) + + baseline : anyOf(:class:`TextBaseline`, :class:`ExprOrSignalRef`) + 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 + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + blend : anyOf(:class:`Blend`, :class:`ExprOrSignalRef`) + + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprOrSignalRef`) + Default color. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** - This property cannot be used in a `style config + `__. - The ``fill`` + and ``stroke`` properties have higher precedence than ``color`` and will override + ``color``. + cornerRadius : anyOf(float, :class:`ExprOrSignalRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprOrSignalRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprOrSignalRef`) + + cornerRadiusTopLeft : anyOf(float, :class:`ExprOrSignalRef`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprOrSignalRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprOrSignalRef`) + + description : anyOf(string, :class:`ExprOrSignalRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprOrSignalRef`) + + dx : anyOf(float, :class:`ExprOrSignalRef`) + + dy : anyOf(float, :class:`ExprOrSignalRef`) + + ellipsis : anyOf(string, :class:`ExprOrSignalRef`) + + endAngle : anyOf(float, :class:`ExprOrSignalRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprOrSignalRef`) + Default fill color. This property has higher precedence than ``config.color``. Set + to ``null`` to remove fill. + + **Default value:** (None) + fillOpacity : anyOf(float, :class:`ExprOrSignalRef`) + + filled : boolean + 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 + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprOrSignalRef`) + + fontSize : anyOf(float, :class:`ExprOrSignalRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprOrSignalRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprOrSignalRef`) + + height : anyOf(float, :class:`ExprOrSignalRef`) + + href : anyOf(:class:`URI`, :class:`ExprOrSignalRef`) + + innerRadius : anyOf(float, :class:`ExprOrSignalRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + interpolate : anyOf(:class:`Interpolate`, :class:`ExprOrSignalRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). - If set to ``"filter"`` (default), all data items with null values will be + skipped (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:`ExprOrSignalRef`) + + lineBreak : anyOf(string, :class:`ExprOrSignalRef`) + + lineHeight : anyOf(float, :class:`ExprOrSignalRef`) + + opacity : anyOf(float, :class:`ExprOrSignalRef`) + 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. - For bar, rule and tick, this determines + whether the size of the bar and tick should be applied to x or y dimension. - For + area, this property determines the orient property of the Vega output. - For line + and trail marks, this property determines the sort order of the points in 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:`ExprOrSignalRef`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + padAngle : anyOf(float, :class:`ExprOrSignalRef`) + + radius : anyOf(float, :class:`ExprOrSignalRef`) + 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. + radius2 : anyOf(float, :class:`ExprOrSignalRef`) + The secondary (inner) radius in pixels of arc marks. + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprOrSignalRef`) + + size : anyOf(float, :class:`ExprOrSignalRef`) + Default size for marks. - For ``point`` / ``circle`` / ``square``, this represents + the pixel area of the marks. Note that this value sets the area of the symbol; the + side lengths will increase with the square root of this value. - For ``bar``, this + represents the band size of the bar, in pixels. - For ``text``, this represents the + font size, in pixels. + + **Default value:** - ``30`` for point, circle, square marks; width/height's ``step`` + - ``2`` for bar marks with discrete dimensions; - ``5`` for bar marks with + continuous dimensions; - ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprOrSignalRef`) + + startAngle : anyOf(float, :class:`ExprOrSignalRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprOrSignalRef`) + 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:`ExprOrSignalRef`) + + strokeDash : anyOf(List(float), :class:`ExprOrSignalRef`) + + strokeDashOffset : anyOf(float, :class:`ExprOrSignalRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprOrSignalRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprOrSignalRef`) + + strokeOffset : anyOf(float, :class:`ExprOrSignalRef`) + + strokeOpacity : anyOf(float, :class:`ExprOrSignalRef`) + + strokeWidth : anyOf(float, :class:`ExprOrSignalRef`) + + tension : anyOf(float, :class:`ExprOrSignalRef`) + + text : anyOf(:class:`Text`, :class:`ExprOrSignalRef`) + + theta : anyOf(float, :class:`ExprOrSignalRef`) + 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:`ExprOrSignalRef`) + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + timeUnitBand : float + 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. + timeUnitBandPosition : float + Default relative band position for a time unit. If set to ``0``, the marks will be + positioned at the beginning of the time unit band step. If set to ``0.5``, the marks + will be positioned in the middle of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprOrSignalRef`, + None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. - If ``tooltip`` is ``{"content": "data"}``, then all + fields that appear in the highlighted data point will be used. - If set to + ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprOrSignalRef`) + + width : anyOf(float, :class:`ExprOrSignalRef`) + + x : anyOf(float, string, :class:`ExprOrSignalRef`) + 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:`ExprOrSignalRef`) + 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:`ExprOrSignalRef`) + 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:`ExprOrSignalRef`) + 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, + timeUnitBand=Undefined, timeUnitBandPosition=Undefined, tooltip=Undefined, + url=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, y2=Undefined, + **kwds): + super(MarkConfigExprOrSignalRef, 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, + timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, + tooltip=tooltip, url=url, width=width, x=x, + x2=x2, y=y, y2=y2, **kwds) + + +class MarkDef(AnyMark): + """MarkDef schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : :class:`Mark` + 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`) + 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`) + + aria : anyOf(boolean, :class:`ExprRef`) + + ariaRole : anyOf(string, :class:`ExprRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprRef`) + + aspect : anyOf(boolean, :class:`ExprRef`) + + 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`) + 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 + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + binSpacing : float + Offset between bars for binned field. The ideal value for this is either 0 + (preferred by statisticians) or 1 (Vega-Lite default, D3 example style). + + **Default value:** ``1`` + blend : anyOf(:class:`Blend`, :class:`ExprRef`) + + clip : boolean + Whether a mark be clipped to the enclosing group’s width and height. + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** - This property cannot be used in a `style config + `__. - The ``fill`` + and ``stroke`` properties have higher precedence than ``color`` and will override + ``color``. + continuousBandSize : float + The default size of the bars on continuous scales. + + **Default value:** ``5`` + cornerRadius : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + + cornerRadiusEnd : anyOf(float, :class:`ExprRef`) + * 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`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + discreteBandSize : 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`) + + dy : anyOf(float, :class:`ExprRef`) + + ellipsis : anyOf(string, :class:`ExprRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + 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`) + + filled : boolean + 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 + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + height : anyOf(float, :class:`ExprRef`) + + href : anyOf(:class:`URI`, :class:`ExprRef`) + + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). - If set to ``"filter"`` (default), all data items with null values will be + skipped (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`) + + line : anyOf(boolean, :class:`OverlayMarkDef`) + A flag for overlaying line on top of area marks, or an object defining the + properties of the overlayed lines. + + + If this value is an empty object ( ``{}`` ) or ``true``, lines with default + properties will be used. + + If this value is ``false``, no lines would be automatically added to area marks. + + **Default value:** ``false``. + lineBreak : anyOf(string, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. - For bar, rule and tick, this determines + whether the size of the bar and tick should be applied to x or y dimension. - For + area, this property determines the orient property of the Vega output. - For line + and trail marks, this property determines the sort order of the points in 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`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + padAngle : anyOf(float, :class:`ExprRef`) + + point : anyOf(boolean, :class:`OverlayMarkDef`, string) + A flag for overlaying points on top of line or area marks, or an object defining the + properties of the overlayed points. + + + If this property is ``"transparent"``, transparent points will be used (for + enhancing tooltips and selections). + + If this property is an empty object ( ``{}`` ) or ``true``, filled points with + default properties will be used. + + If this property is ``false``, no points would be automatically added to line or + area marks. + + **Default value:** ``false``. + radius : anyOf(float, :class:`ExprRef`) + 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. + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + radius2Offset : anyOf(float, :class:`ExprRef`) + Offset for radius2. + radiusOffset : anyOf(float, :class:`ExprRef`) + Offset for radius. + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + + size : anyOf(float, :class:`ExprRef`) + Default size for marks. - For ``point`` / ``circle`` / ``square``, this represents + the pixel area of the marks. Note that this value sets the area of the symbol; the + side lengths will increase with the square root of this value. - For ``bar``, this + represents the band size of the bar, in pixels. - For ``text``, this represents the + font size, in pixels. + + **Default value:** - ``30`` for point, circle, square marks; width/height's ``step`` + - ``2`` for bar marks with discrete dimensions; - ``5`` for bar marks with + continuous dimensions; - ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + 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`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOffset : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + style : anyOf(string, List(string)) + 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 + `__. If style is an + array, later styles will override earlier styles. Any `mark properties + `__ explicitly + defined within the ``encoding`` will override a style default. + + **Default value:** The mark's name. For example, a bar mark will have style + ``"bar"`` by default. **Note:** Any specified style will augment the default style. + 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`) + + text : anyOf(:class:`Text`, :class:`ExprRef`) + + theta : anyOf(float, :class:`ExprRef`) + 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`) + 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`) + Offset for theta2. + thetaOffset : anyOf(float, :class:`ExprRef`) + Offset for theta. + thickness : float + Thickness of the tick mark. + + **Default value:** ``1`` + timeUnitBand : float + 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. + timeUnitBandPosition : float + Default relative band position for a time unit. If set to ``0``, the marks will be + positioned at the beginning of the time unit band step. If set to ``0.5``, the marks + will be positioned in the middle of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. - If ``tooltip`` is ``{"content": "data"}``, then all + fields that appear in the highlighted data point will be used. - If set to + ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) + + width : anyOf(float, :class:`ExprRef`) + + x : anyOf(float, string, :class:`ExprRef`) + 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 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`) + Offset for x2-position. + xOffset : anyOf(float, :class:`ExprRef`) + Offset for x-position. + y : anyOf(float, string, :class:`ExprRef`) + 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 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`) + Offset for y2-position. + yOffset : anyOf(float, :class:`ExprRef`) + 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, + 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, + timeUnitBand=Undefined, timeUnitBandPosition=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, 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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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`) + """ + _schema = {'$ref': '#/definitions/MarkPropDef<(Gradient|string|null)>'} + + def __init__(self, *args, **kwds): + super(MarkPropDefGradientstringnull, self).__init__(*args, **kwds) + + +class FieldOrDatumDefWithConditionDatumDefGradientstringnull(ColorDef, MarkPropDefGradientstringnull): + """FieldOrDatumDefWithConditionDatumDefGradientstringnull schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} + + def __init__(self, band=Undefined, condition=Undefined, datum=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionDatumDefGradientstringnull, self).__init__(band=band, + condition=condition, + datum=datum, + type=type, **kwds) + + +class FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull(ColorDef, MarkPropDefGradientstringnull): + """FieldOrDatumDefWithConditionMarkPropFieldDefGradientstringnull schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} + + def __init__(self, aggregate=Undefined, band=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, + band=band, + 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`) + """ + _schema = {'$ref': '#/definitions/MarkPropDef'} + + def __init__(self, *args, **kwds): + super(MarkPropDefnumber, self).__init__(*args, **kwds) + + +class MarkPropDefnumberArray(VegaLiteSchema): + """MarkPropDefnumberArray schema wrapper + + anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray`, + :class:`FieldOrDatumDefWithConditionDatumDefnumberArray`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray`) + """ + _schema = {'$ref': '#/definitions/MarkPropDef'} + + def __init__(self, *args, **kwds): + super(MarkPropDefnumberArray, self).__init__(*args, **kwds) + + +class MarkPropDefstringnullTypeForShape(VegaLiteSchema): + """MarkPropDefstringnullTypeForShape schema wrapper + + anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull`, + :class:`FieldOrDatumDefWithConditionDatumDefstringnull`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull`) + """ + _schema = {'$ref': '#/definitions/MarkPropDef<(string|null),TypeForShape>'} + + def __init__(self, *args, **kwds): + super(MarkPropDefstringnullTypeForShape, self).__init__(*args, **kwds) + + +class MarkType(VegaLiteSchema): + """MarkType schema wrapper + + enum('arc', 'area', 'image', 'group', 'line', 'path', 'rect', 'rule', 'shape', 'symbol', + 'text', 'trail') + """ + _schema = {'$ref': '#/definitions/MarkType'} + + def __init__(self, *args): + super(MarkType, self).__init__(*args) + + +class Month(VegaLiteSchema): + """Month schema wrapper + + float + """ + _schema = {'$ref': '#/definitions/Month'} + + def __init__(self, *args): + super(Month, self).__init__(*args) + + +class MultiSelectionConfig(VegaLiteSchema): + """MultiSelectionConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + bind : :class:`LegendBinding` + When set, a selection is populated by interacting with the corresponding legend. + Direct manipulation interaction is disabled by default; to re-enable it, set the + selection's `on + `__ + property. + + Legend bindings are restricted to selections that only specify a single field or + encoding. + clear : anyOf(:class:`Stream`, string, boolean) + Clears the selection, emptying it of all values. Can be a `Event Stream + `__ or ``false`` to disable. + + **Default value:** ``dblclick``. + + **See also:** `clear `__ + documentation. + empty : enum('all', 'none') + By default, ``all`` data values are considered to lie within an empty selection. + When set to ``none``, empty selections contain no data values. + encodings : List(:class:`SingleDefUnitChannel`) + An array of encoding channels. The corresponding data field values must match for a + data tuple to fall within the selection. + + **See also:** `encodings `__ + documentation. + fields : List(:class:`FieldName`) + An array of field names whose values must match for a data tuple to fall within the + selection. + + **See also:** `fields `__ + documentation. + init : List(:class:`SelectionInitMapping`) + Initialize the selection with a mapping between `projected channels or field names + `__ and an initial value (or + array of values). + + **See also:** `init `__ + documentation. + nearest : boolean + When true, an invisible voronoi diagram is computed to accelerate discrete + selection. The data value *nearest* the mouse cursor is added to the selection. + + **See also:** `nearest `__ + documentation. + on : anyOf(:class:`Stream`, string) + A `Vega event stream `__ (object or + selector) that triggers the selection. For interval selections, the event stream + must specify a `start and end + `__. + resolve : :class:`SelectionResolution` + 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. + + **See also:** `resolve + `__ documentation. + toggle : anyOf(string, boolean) + Controls whether data values should be toggled or only ever inserted into multi + selections. Can be ``true``, ``false`` (for insertion only), or a `Vega expression + `__. + + **Default value:** ``true``, which corresponds to ``event.shiftKey`` (i.e., data + values are toggled when a user interacts with the shift-key pressed). + + Setting the value to the Vega expression ``"true"`` will toggle data values without + the user pressing the shift-key. + + **See also:** `toggle `__ + documentation. + """ + _schema = {'$ref': '#/definitions/MultiSelectionConfig'} + + def __init__(self, bind=Undefined, clear=Undefined, empty=Undefined, encodings=Undefined, + fields=Undefined, init=Undefined, nearest=Undefined, on=Undefined, resolve=Undefined, + toggle=Undefined, **kwds): + super(MultiSelectionConfig, self).__init__(bind=bind, clear=clear, empty=empty, + encodings=encodings, fields=fields, init=init, + nearest=nearest, on=on, resolve=resolve, + toggle=toggle, **kwds) + + +class NamedData(DataSource): + """NamedData schema wrapper + + Mapping(required=[name]) + + Attributes + ---------- + + name : string + Provide a placeholder name and bind data at runtime. + format : :class:`DataFormat` + An object that specifies the format for parsing the data. + """ + _schema = {'$ref': '#/definitions/NamedData'} + + def __init__(self, name=Undefined, format=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') + """ + _schema = {'$ref': '#/definitions/NonArgAggregateOp'} + + def __init__(self, *args): + super(NonArgAggregateOp, self).__init__(*args) + + +class NormalizedSpec(VegaLiteSchema): + """NormalizedSpec schema wrapper + + anyOf(:class:`FacetedUnitSpec`, :class:`LayerSpec`, :class:`RepeatSpec`, + :class:`NormalizedFacetSpec`, :class:`NormalizedConcatSpecGenericSpec`, + :class:`NormalizedVConcatSpecGenericSpec`, :class:`NormalizedHConcatSpecGenericSpec`) + Any specification in Vega-Lite. + """ + _schema = {'$ref': '#/definitions/NormalizedSpec'} + + def __init__(self, *args, **kwds): + super(NormalizedSpec, self).__init__(*args, **kwds) + + +class NormalizedConcatSpecGenericSpec(NormalizedSpec): + """NormalizedConcatSpecGenericSpec schema wrapper + + Mapping(required=[concat]) + Base interface for a generalized concatenation specification. + + Attributes + ---------- + + concat : List(:class:`NormalizedSpec`) + A list of views to be concatenated. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. - For ``"each"``, subviews will be aligned into a + clean grid structure, but each row or column may be of variable size. - For + ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: - the general (wrappable) ``concat`` operator (not + ``hconcat`` / ``vconcat`` ) - the ``facet`` and ``repeat`` operator with one + field/repetition definition (without row/column nesting) + + 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) + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/NormalizedConcatSpec'} + + 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(NormalizedConcatSpecGenericSpec, 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 NormalizedFacetSpec(NormalizedSpec): + """NormalizedFacetSpec schema wrapper + + Mapping(required=[facet, spec]) + Base interface for a facet specification. + + Attributes + ---------- + + facet : anyOf(:class:`FacetFieldDef`, :class:`FacetMapping`) + Definition for how to facet the data. One of: 1) `a field definition for faceting + the plot by one field + `__ 2) `An object that + maps row and column channels to their field definitions + `__ + spec : anyOf(:class:`LayerSpec`, :class:`FacetedUnitSpec`) + A specification of the view that gets faceted. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. - For ``"each"``, subviews will be aligned into a + clean grid structure, but each row or column may be of variable size. - For + ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: - the general (wrappable) ``concat`` operator (not + ``hconcat`` / ``vconcat`` ) - the ``facet`` and ``repeat`` operator with one + field/repetition definition (without row/column nesting) + + 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) + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/NormalizedFacetSpec'} + + 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(NormalizedFacetSpec, 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 NormalizedHConcatSpecGenericSpec(NormalizedSpec): + """NormalizedHConcatSpecGenericSpec schema wrapper + + Mapping(required=[hconcat]) + Base interface for a horizontal concatenation specification. + + Attributes + ---------- + + hconcat : List(:class:`NormalizedSpec`) + A list of views to be concatenated and put into a row. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : boolean + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + **Default value:** ``false`` + data : anyOf(:class:`Data`, 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + 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 for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/NormalizedHConcatSpec'} + + 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(NormalizedHConcatSpecGenericSpec, self).__init__(hconcat=hconcat, bounds=bounds, + center=center, data=data, + description=description, name=name, + resolve=resolve, spacing=spacing, + title=title, transform=transform, **kwds) + + +class NormalizedVConcatSpecGenericSpec(NormalizedSpec): + """NormalizedVConcatSpecGenericSpec schema wrapper + + Mapping(required=[vconcat]) + Base interface for a vertical concatenation specification. + + Attributes + ---------- + + vconcat : List(:class:`NormalizedSpec`) + A list of views to be concatenated and put into a column. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : boolean + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + **Default value:** ``false`` + data : anyOf(:class:`Data`, 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + 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 for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/NormalizedVConcatSpec'} + + 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(NormalizedVConcatSpecGenericSpec, self).__init__(vconcat=vconcat, bounds=bounds, + center=center, data=data, + description=description, name=name, + resolve=resolve, spacing=spacing, + title=title, transform=transform, **kwds) + + +class NumericArrayMarkPropDef(VegaLiteSchema): + """NumericArrayMarkPropDef schema wrapper + + anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray`, + :class:`FieldOrDatumDefWithConditionDatumDefnumberArray`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray`) + """ + _schema = {'$ref': '#/definitions/NumericArrayMarkPropDef'} + + def __init__(self, *args, **kwds): + super(NumericArrayMarkPropDef, self).__init__(*args, **kwds) + + +class FieldOrDatumDefWithConditionDatumDefnumberArray(MarkPropDefnumberArray, NumericArrayMarkPropDef): + """FieldOrDatumDefWithConditionDatumDefnumberArray schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberArrayExprRef`, + List(:class:`ConditionalValueDefnumberArrayExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} + + def __init__(self, band=Undefined, condition=Undefined, datum=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionDatumDefnumberArray, self).__init__(band=band, + condition=condition, + datum=datum, type=type, + **kwds) + + +class FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray(MarkPropDefnumberArray, NumericArrayMarkPropDef): + """FieldOrDatumDefWithConditionMarkPropFieldDefnumberArray schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefnumberArrayExprRef`, + List(:class:`ConditionalValueDefnumberArrayExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} + + def __init__(self, aggregate=Undefined, band=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, + band=band, + 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`) + """ + _schema = {'$ref': '#/definitions/NumericMarkPropDef'} + + def __init__(self, *args, **kwds): + super(NumericMarkPropDef, self).__init__(*args, **kwds) + + +class FieldOrDatumDefWithConditionDatumDefnumber(MarkPropDefnumber, NumericMarkPropDef): + """FieldOrDatumDefWithConditionDatumDefnumber schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} + + def __init__(self, band=Undefined, condition=Undefined, datum=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionDatumDefnumber, self).__init__(band=band, condition=condition, + datum=datum, type=type, **kwds) + + +class FieldOrDatumDefWithConditionMarkPropFieldDefnumber(MarkPropDefnumber, NumericMarkPropDef): + """FieldOrDatumDefWithConditionMarkPropFieldDefnumber schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefnumberExprRef`, + List(:class:`ConditionalValueDefnumberExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} + + def __init__(self, aggregate=Undefined, band=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, + band=band, bin=bin, + condition=condition, + field=field, + legend=legend, + scale=scale, sort=sort, + timeUnit=timeUnit, + title=title, type=type, + **kwds) + + +class NumericValueDef(LatLongDef): + """NumericValueDef schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/NumericValueDef'} + + def __init__(self, value=Undefined, **kwds): + super(NumericValueDef, self).__init__(value=value, **kwds) + + +class OrderFieldDef(VegaLiteSchema): + """OrderFieldDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + sort : :class:`SortOrder` + The sort order. One of ``"ascending"`` (default) or ``"descending"``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/OrderFieldDef'} + + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, field=Undefined, + sort=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(OrderFieldDef, self).__init__(aggregate=aggregate, band=band, bin=bin, field=field, + sort=sort, timeUnit=timeUnit, title=title, type=type, **kwds) + + +class OrderValueDef(VegaLiteSchema): + """OrderValueDef schema wrapper + + Mapping(required=[value]) + + Attributes + ---------- + + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + condition : anyOf(:class:`ConditionalValueDefnumber`, + List(:class:`ConditionalValueDefnumber`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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): + super(OrderValueDef, self).__init__(value=value, condition=condition, **kwds) + + +class Orient(VegaLiteSchema): + """Orient schema wrapper + + enum('left', 'right', 'top', 'bottom') + """ + _schema = {'$ref': '#/definitions/Orient'} + + def __init__(self, *args): + super(Orient, self).__init__(*args) + + +class Orientation(VegaLiteSchema): + """Orientation schema wrapper + + enum('horizontal', 'vertical') + """ + _schema = {'$ref': '#/definitions/Orientation'} + + def __init__(self, *args): + super(Orientation, self).__init__(*args) + + +class OverlayMarkDef(VegaLiteSchema): + """OverlayMarkDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(:class:`Align`, :class:`ExprRef`) + 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`) + + aria : anyOf(boolean, :class:`ExprRef`) + + ariaRole : anyOf(string, :class:`ExprRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprRef`) + + aspect : anyOf(boolean, :class:`ExprRef`) + + baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + 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 + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + blend : anyOf(:class:`Blend`, :class:`ExprRef`) + + clip : boolean + Whether a mark be clipped to the enclosing group’s width and height. + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** - This property cannot be used in a `style config + `__. - The ``fill`` + and ``stroke`` properties have higher precedence than ``color`` and will override + ``color``. + cornerRadius : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + ellipsis : anyOf(string, :class:`ExprRef`) + + endAngle : anyOf(float, :class:`ExprRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + 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`) + + filled : boolean + 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 + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + height : anyOf(float, :class:`ExprRef`) + + href : anyOf(:class:`URI`, :class:`ExprRef`) + + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). - If set to ``"filter"`` (default), all data items with null values will be + skipped (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`) + + lineBreak : anyOf(string, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. - For bar, rule and tick, this determines + whether the size of the bar and tick should be applied to x or y dimension. - For + area, this property determines the orient property of the Vega output. - For line + and trail marks, this property determines the sort order of the points in 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`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + padAngle : anyOf(float, :class:`ExprRef`) + + radius : anyOf(float, :class:`ExprRef`) + 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. + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + radius2Offset : anyOf(float, :class:`ExprRef`) + Offset for radius2. + radiusOffset : anyOf(float, :class:`ExprRef`) + Offset for radius. + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + + size : anyOf(float, :class:`ExprRef`) + Default size for marks. - For ``point`` / ``circle`` / ``square``, this represents + the pixel area of the marks. Note that this value sets the area of the symbol; the + side lengths will increase with the square root of this value. - For ``bar``, this + represents the band size of the bar, in pixels. - For ``text``, this represents the + font size, in pixels. + + **Default value:** - ``30`` for point, circle, square marks; width/height's ``step`` + - ``2`` for bar marks with discrete dimensions; - ``5`` for bar marks with + continuous dimensions; - ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprRef`) + + startAngle : anyOf(float, :class:`ExprRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + 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`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOffset : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + style : anyOf(string, List(string)) + 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 + `__. If style is an + array, later styles will override earlier styles. Any `mark properties + `__ explicitly + defined within the ``encoding`` will override a style default. + + **Default value:** The mark's name. For example, a bar mark will have style + ``"bar"`` by default. **Note:** Any specified style will augment the default style. + 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`) + + text : anyOf(:class:`Text`, :class:`ExprRef`) + + theta : anyOf(float, :class:`ExprRef`) + 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`) + 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`) + Offset for theta2. + thetaOffset : anyOf(float, :class:`ExprRef`) + Offset for theta. + timeUnitBand : float + 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. + timeUnitBandPosition : float + Default relative band position for a time unit. If set to ``0``, the marks will be + positioned at the beginning of the time unit band step. If set to ``0.5``, the marks + will be positioned in the middle of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. - If ``tooltip`` is ``{"content": "data"}``, then all + fields that appear in the highlighted data point will be used. - If set to + ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) + + width : anyOf(float, :class:`ExprRef`) + + x : anyOf(float, string, :class:`ExprRef`) + 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 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`) + Offset for x2-position. + xOffset : anyOf(float, :class:`ExprRef`) + Offset for x-position. + y : anyOf(float, string, :class:`ExprRef`) + 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 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`) + Offset for y2-position. + yOffset : anyOf(float, :class:`ExprRef`) + 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, timeUnitBand=Undefined, + timeUnitBandPosition=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, + timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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=[])) + """ + _schema = {'$ref': '#/definitions/Padding'} + + def __init__(self, *args, **kwds): + super(Padding, self).__init__(*args, **kwds) + + +class Parameter(VegaLiteSchema): + """Parameter schema wrapper + + Mapping(required=[name]) + + Attributes + ---------- + + name : string + Required. A unique name for the 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` + Binds the parameter to an external input element such as a slider, selection list or + radio button group. + description : string + A text description of the parameter, useful for inline documentation. + expr : :class:`Expr` + 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. + value : Any + The initial value of the parameter. + + **Default value:** ``undefined`` + """ + _schema = {'$ref': '#/definitions/Parameter'} + + def __init__(self, name=Undefined, bind=Undefined, description=Undefined, expr=Undefined, + value=Undefined, **kwds): + super(Parameter, self).__init__(name=name, bind=bind, description=description, expr=expr, + value=value, **kwds) + + +class Parse(VegaLiteSchema): + """Parse schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/Parse'} + + def __init__(self, **kwds): + super(Parse, self).__init__(**kwds) + + +class ParseValue(VegaLiteSchema): + """ParseValue schema wrapper + + anyOf(None, string, string, string, string, string) + """ + _schema = {'$ref': '#/definitions/ParseValue'} + + def __init__(self, *args, **kwds): + super(ParseValue, self).__init__(*args, **kwds) + + +class PolarDef(VegaLiteSchema): + """PolarDef schema wrapper + + anyOf(:class:`PositionFieldDefBase`, :class:`PositionDatumDefBase`, + :class:`PositionValueDef`) + """ + _schema = {'$ref': '#/definitions/PolarDef'} + + def __init__(self, *args, **kwds): + super(PolarDef, self).__init__(*args, **kwds) + + +class Position2Def(VegaLiteSchema): + """Position2Def schema wrapper + + anyOf(:class:`SecondaryFieldDef`, :class:`DatumDef`, :class:`PositionValueDef`) + """ + _schema = {'$ref': '#/definitions/Position2Def'} + + def __init__(self, *args, **kwds): + super(Position2Def, self).__init__(*args, **kwds) + + +class DatumDef(LatLongDef, Position2Def): + """DatumDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/DatumDef'} + + def __init__(self, band=Undefined, datum=Undefined, type=Undefined, **kwds): + super(DatumDef, self).__init__(band=band, datum=datum, type=type, **kwds) + + +class PositionDatumDefBase(PolarDef): + """PositionDatumDefBase schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + 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: - ``"zero"`` or `true`: stacking with + baseline offset at zero value of the scale (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). - ``"normalize"`` + - stacking with normalized domain (for creating `normalized stacked bar and area + charts `__. + :raw-html:`
    ` - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). - ``null`` or + ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/PositionDatumDefBase'} + + def __init__(self, band=Undefined, datum=Undefined, scale=Undefined, stack=Undefined, + type=Undefined, **kwds): + super(PositionDatumDefBase, self).__init__(band=band, datum=datum, scale=scale, stack=stack, + type=type, **kwds) + + +class PositionDef(VegaLiteSchema): + """PositionDef schema wrapper + + anyOf(:class:`PositionFieldDef`, :class:`PositionDatumDef`, :class:`PositionValueDef`) + """ + _schema = {'$ref': '#/definitions/PositionDef'} + + def __init__(self, *args, **kwds): + super(PositionDef, self).__init__(*args, **kwds) + + +class PositionDatumDef(PositionDef): + """PositionDatumDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + axis : anyOf(:class:`Axis`, None) + An object defining properties of axis's gridlines, ticks and labels. If ``null``, + the axis for the encoding channel will be removed. + + **Default value:** If undefined, default `axis properties + `__ are applied. + + **See also:** `axis `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + datum : anyOf(:class:`PrimitiveValue`, :class:`DateTime`, :class:`ExprRef`, + :class:`RepeatRef`) + A constant value in data domain. + impute : anyOf(:class:`ImputeParams`, 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 + the ``Impute`` Operation. + + **See also:** `impute `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + 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: - ``"zero"`` or `true`: stacking with + baseline offset at zero value of the scale (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). - ``"normalize"`` + - stacking with normalized domain (for creating `normalized stacked bar and area + charts `__. + :raw-html:`
    ` - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). - ``null`` or + ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/PositionDatumDef'} + + def __init__(self, axis=Undefined, band=Undefined, datum=Undefined, impute=Undefined, + scale=Undefined, stack=Undefined, type=Undefined, **kwds): + super(PositionDatumDef, self).__init__(axis=axis, band=band, datum=datum, impute=impute, + scale=scale, stack=stack, type=type, **kwds) + + +class PositionFieldDef(PositionDef): + """PositionFieldDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + axis : anyOf(:class:`Axis`, None) + An object defining properties of axis's gridlines, ticks and labels. If ``null``, + the axis for the encoding channel will be removed. + + **Default value:** If undefined, default `axis properties + `__ are applied. + + **See also:** `axis `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + impute : anyOf(:class:`ImputeParams`, 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 + the ``Impute`` Operation. + + **See also:** `impute `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + 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: - ``"zero"`` or `true`: stacking with + baseline offset at zero value of the scale (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). - ``"normalize"`` + - stacking with normalized domain (for creating `normalized stacked bar and area + charts `__. + :raw-html:`
    ` - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). - ``null`` or + ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/PositionFieldDef'} + + def __init__(self, aggregate=Undefined, axis=Undefined, band=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, band=band, 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=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + 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: - ``"zero"`` or `true`: stacking with + baseline offset at zero value of the scale (for creating typical stacked + [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and `area + `__ chart). - ``"normalize"`` + - stacking with normalized domain (for creating `normalized stacked bar and area + charts `__. + :raw-html:`
    ` - ``"center"`` - stacking with center baseline (for `streamgraph + `__ ). - ``null`` or + ``false`` - No-stacking. This will produce layered `bar + `__ and area + chart. + + **Default value:** ``zero`` for plots with all of the following conditions are true: + (1) the mark is ``bar``, ``area``, or ``arc`` ; (2) the stacked measure channel (x + or y) has a linear scale; (3) At least one of non-position channels mapped to an + unaggregated field that is different from x and y. Otherwise, ``null`` by default. + + **See also:** `stack `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/PositionFieldDefBase'} + + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, field=Undefined, + scale=Undefined, sort=Undefined, stack=Undefined, timeUnit=Undefined, title=Undefined, + type=Undefined, **kwds): + super(PositionFieldDefBase, self).__init__(aggregate=aggregate, band=band, 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]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/PositionValueDef'} + + def __init__(self, value=Undefined, **kwds): + super(PositionValueDef, self).__init__(value=value, **kwds) + + +class PredicateComposition(VegaLiteSchema): + """PredicateComposition schema wrapper + + anyOf(:class:`LogicalNotPredicate`, :class:`LogicalAndPredicate`, + :class:`LogicalOrPredicate`, :class:`Predicate`) + """ + _schema = {'$ref': '#/definitions/PredicateComposition'} + + def __init__(self, *args, **kwds): + super(PredicateComposition, self).__init__(*args, **kwds) + + +class LogicalAndPredicate(PredicateComposition): + """LogicalAndPredicate schema wrapper + + Mapping(required=[and]) + + Attributes + ---------- + + and : List(:class:`PredicateComposition`) + + """ + _schema = {'$ref': '#/definitions/LogicalAnd'} + + def __init__(self, **kwds): + super(LogicalAndPredicate, self).__init__(**kwds) + + +class LogicalNotPredicate(PredicateComposition): + """LogicalNotPredicate schema wrapper + + Mapping(required=[not]) + + Attributes + ---------- + + not : :class:`PredicateComposition` + + """ + _schema = {'$ref': '#/definitions/LogicalNot'} + + def __init__(self, **kwds): + super(LogicalNotPredicate, self).__init__(**kwds) + + +class LogicalOrPredicate(PredicateComposition): + """LogicalOrPredicate schema wrapper + + Mapping(required=[or]) + + Attributes + ---------- + + or : List(:class:`PredicateComposition`) + + """ + _schema = {'$ref': '#/definitions/LogicalOr'} + + def __init__(self, **kwds): + super(LogicalOrPredicate, self).__init__(**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:`SelectionPredicate`, string) + """ + _schema = {'$ref': '#/definitions/Predicate'} + + def __init__(self, *args, **kwds): + super(Predicate, self).__init__(*args, **kwds) + + +class FieldEqualPredicate(Predicate): + """FieldEqualPredicate schema wrapper + + Mapping(required=[equal, field]) + + Attributes + ---------- + + equal : anyOf(string, float, boolean, :class:`DateTime`, :class:`ExprRef`) + The value that the field should be equal to. + field : :class:`FieldName` + Field to be tested. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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) + + +class FieldGTEPredicate(Predicate): + """FieldGTEPredicate schema wrapper + + Mapping(required=[field, gte]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be tested. + gte : anyOf(string, float, :class:`DateTime`, :class:`ExprRef`) + The value that the field should be greater than or equals to. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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) + + +class FieldGTPredicate(Predicate): + """FieldGTPredicate schema wrapper + + Mapping(required=[field, gt]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be tested. + gt : anyOf(string, float, :class:`DateTime`, :class:`ExprRef`) + The value that the field should be greater than. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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) + + +class FieldLTEPredicate(Predicate): + """FieldLTEPredicate schema wrapper + + Mapping(required=[field, lte]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be tested. + lte : anyOf(string, float, :class:`DateTime`, :class:`ExprRef`) + The value that the field should be less than or equals to. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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) + + +class FieldLTPredicate(Predicate): + """FieldLTPredicate schema wrapper + + Mapping(required=[field, lt]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be tested. + lt : anyOf(string, float, :class:`DateTime`, :class:`ExprRef`) + The value that the field should be less than. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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) + + +class FieldOneOfPredicate(Predicate): + """FieldOneOfPredicate schema wrapper + + Mapping(required=[field, oneOf]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be tested. + oneOf : anyOf(List(string), List(float), List(boolean), List(:class:`DateTime`)) + 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:`TimeUnitParams`) + 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) + + +class FieldRangePredicate(Predicate): + """FieldRangePredicate schema wrapper + + Mapping(required=[field, range]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be tested. + range : anyOf(List(anyOf(float, :class:`DateTime`, None, :class:`ExprRef`)), + :class:`ExprRef`) + 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:`TimeUnitParams`) + 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) + + +class FieldValidPredicate(Predicate): + """FieldValidPredicate schema wrapper + + Mapping(required=[field, valid]) + + Attributes + ---------- + + field : :class:`FieldName` + Field to be tested. + valid : boolean + If set to true the field's value has to be valid, meaning both not ``null`` and not + `NaN + `__. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + 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) + + +class Projection(VegaLiteSchema): + """Projection schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + center : :class:`Vector2number` + The projection's center, a two-element array of longitude and latitude in degrees. + + **Default value:** ``[0, 0]`` + clipAngle : float + The projection's clipping circle radius to the specified angle in degrees. If + ``null``, switches to `antimeridian `__ cutting + rather than small-circle clipping. + clipExtent : :class:`Vector2Vector2number` + 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 : float + + distance : float + + extent : :class:`Vector2Vector2number` + + fit : anyOf(:class:`Fit`, List(:class:`Fit`)) + + fraction : float + + lobes : float + + parallel : float + + parallels : List(float) + For conic projections, the `two standard parallels + `__ that define the map layout. + The default depends on the specific conic projection used. + pointRadius : 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 : float + The threshold for the projection's `adaptive resampling + `__ to the specified value in pixels. This + value corresponds to the `Douglas–Peucker distance + `__. + If precision is not specified, returns the projection's current resampling precision + which defaults to ``√0.5 ≅ 0.70710…``. + radius : float + + ratio : float + + reflectX : boolean + + reflectY : boolean + + rotate : anyOf(:class:`Vector2number`, :class:`Vector3number`) + 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 : 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 : :class:`Vector2number` + + spacing : float + + tilt : float + + translate : :class:`Vector2number` + The projection’s translation offset as a two-element array ``[tx, ty]``. + type : :class:`ProjectionType` + 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 + `__. + + **Default value:** ``mercator`` + """ + _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) + + +class ProjectionConfig(VegaLiteSchema): + """ProjectionConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + center : :class:`Vector2number` + The projection's center, a two-element array of longitude and latitude in degrees. + + **Default value:** ``[0, 0]`` + clipAngle : float + The projection's clipping circle radius to the specified angle in degrees. If + ``null``, switches to `antimeridian `__ cutting + rather than small-circle clipping. + clipExtent : :class:`Vector2Vector2number` + 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 : float + + distance : float + + extent : :class:`Vector2Vector2number` + + fit : anyOf(:class:`Fit`, List(:class:`Fit`)) + + fraction : float + + lobes : float + + parallel : float + + parallels : List(float) + For conic projections, the `two standard parallels + `__ that define the map layout. + The default depends on the specific conic projection used. + pointRadius : 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 : float + The threshold for the projection's `adaptive resampling + `__ to the specified value in pixels. This + value corresponds to the `Douglas–Peucker distance + `__. + If precision is not specified, returns the projection's current resampling precision + which defaults to ``√0.5 ≅ 0.70710…``. + radius : float + + ratio : float + + reflectX : boolean + + reflectY : boolean + + rotate : anyOf(:class:`Vector2number`, :class:`Vector3number`) + 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 : 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 : :class:`Vector2number` + + spacing : float + + tilt : float + + translate : :class:`Vector2number` + The projection’s translation offset as a two-element array ``[tx, ty]``. + type : :class:`ProjectionType` + 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 + `__. + + **Default value:** ``mercator`` + """ + _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) + + +class ProjectionType(VegaLiteSchema): + """ProjectionType schema wrapper + + enum('albers', 'albersUsa', 'azimuthalEqualArea', 'azimuthalEquidistant', 'conicConformal', + 'conicEqualArea', 'conicEquidistant', 'equalEarth', 'equirectangular', 'gnomonic', + 'identity', 'mercator', 'naturalEarth1', 'orthographic', 'stereographic', + 'transverseMercator') + """ + _schema = {'$ref': '#/definitions/ProjectionType'} + + def __init__(self, *args): + super(ProjectionType, self).__init__(*args) + + +class RadialGradient(Gradient): + """RadialGradient schema wrapper + + Mapping(required=[gradient, stops]) + + Attributes + ---------- + + gradient : string + The type of gradient. Use ``"radial"`` for a radial gradient. + stops : List(:class:`GradientStop`) + An array of gradient stops defining the gradient color sequence. + id : string + + r1 : float + The radius length, in normalized [0, 1] coordinates, of the inner circle for the + gradient. + + **Default value:** ``0`` + r2 : float + The radius length, in normalized [0, 1] coordinates, of the outer circle for the + gradient. + + **Default value:** ``0.5`` + x1 : float + The x-coordinate, in normalized [0, 1] coordinates, for the center of the inner + circle for the gradient. + + **Default value:** ``0.5`` + x2 : float + The x-coordinate, in normalized [0, 1] coordinates, for the center of the outer + circle for the gradient. + + **Default value:** ``0.5`` + y1 : float + The y-coordinate, in normalized [0, 1] coordinates, for the center of the inner + circle for the gradient. + + **Default value:** ``0.5`` + y2 : float + The y-coordinate, in normalized [0, 1] coordinates, for the center of the outer + circle for the 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) + + +class RangeConfig(VegaLiteSchema): + """RangeConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + category : anyOf(:class:`RangeScheme`, List(:class:`Color`)) + Default `color scheme `__ for categorical + data. + diverging : anyOf(:class:`RangeScheme`, List(:class:`Color`)) + Default `color scheme `__ for diverging + quantitative ramps. + heatmap : anyOf(:class:`RangeScheme`, List(:class:`Color`)) + Default `color scheme `__ for + quantitative heatmaps. + ordinal : anyOf(:class:`RangeScheme`, List(:class:`Color`)) + Default `color scheme `__ for + rank-ordered data. + ramp : anyOf(:class:`RangeScheme`, List(:class:`Color`)) + Default `color scheme `__ for sequential + quantitative ramps. + symbol : List(:class:`SymbolShape`) + Array of `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) + + +class RangeRawArray(VegaLiteSchema): + """RangeRawArray schema wrapper + + List(float) + """ + _schema = {'$ref': '#/definitions/RangeRawArray'} + + def __init__(self, *args): + super(RangeRawArray, self).__init__(*args) + + +class RangeScheme(VegaLiteSchema): + """RangeScheme schema wrapper + + anyOf(:class:`RangeEnum`, :class:`RangeRaw`, Mapping(required=[scheme])) + """ + _schema = {'$ref': '#/definitions/RangeScheme'} + + def __init__(self, *args, **kwds): + super(RangeScheme, self).__init__(*args, **kwds) + + +class RangeEnum(RangeScheme): + """RangeEnum schema wrapper + + enum('width', 'height', 'symbol', 'category', 'ordinal', 'ramp', 'diverging', 'heatmap') + """ + _schema = {'$ref': '#/definitions/RangeEnum'} + + def __init__(self, *args): + super(RangeEnum, self).__init__(*args) + + +class RangeRaw(RangeScheme): + """RangeRaw schema wrapper + + List(anyOf(None, boolean, string, float, :class:`RangeRawArray`)) + """ + _schema = {'$ref': '#/definitions/RangeRaw'} + + def __init__(self, *args): + super(RangeRaw, self).__init__(*args) + + +class RectConfig(AnyMarkConfig): + """RectConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(:class:`Align`, :class:`ExprRef`) + 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`) + + aria : anyOf(boolean, :class:`ExprRef`) + + ariaRole : anyOf(string, :class:`ExprRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprRef`) + + aspect : anyOf(boolean, :class:`ExprRef`) + + baseline : anyOf(:class:`TextBaseline`, :class:`ExprRef`) + 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 + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + binSpacing : float + Offset between bars for binned field. The ideal value for this is either 0 + (preferred by statisticians) or 1 (Vega-Lite default, D3 example style). + + **Default value:** ``1`` + blend : anyOf(:class:`Blend`, :class:`ExprRef`) + + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** - This property cannot be used in a `style config + `__. - The ``fill`` + and ``stroke`` properties have higher precedence than ``color`` and will override + ``color``. + continuousBandSize : float + The default size of the bars on continuous scales. + + **Default value:** ``5`` + cornerRadius : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + discreteBandSize : 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`) + + dy : anyOf(float, :class:`ExprRef`) + + ellipsis : anyOf(string, :class:`ExprRef`) + + endAngle : anyOf(float, :class:`ExprRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + 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`) + + filled : boolean + 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 + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + height : anyOf(float, :class:`ExprRef`) + + href : anyOf(:class:`URI`, :class:`ExprRef`) + + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). - If set to ``"filter"`` (default), all data items with null values will be + skipped (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`) + + lineBreak : anyOf(string, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. - For bar, rule and tick, this determines + whether the size of the bar and tick should be applied to x or y dimension. - For + area, this property determines the orient property of the Vega output. - For line + and trail marks, this property determines the sort order of the points in 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`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + padAngle : anyOf(float, :class:`ExprRef`) + + radius : anyOf(float, :class:`ExprRef`) + 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. + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + + size : anyOf(float, :class:`ExprRef`) + Default size for marks. - For ``point`` / ``circle`` / ``square``, this represents + the pixel area of the marks. Note that this value sets the area of the symbol; the + side lengths will increase with the square root of this value. - For ``bar``, this + represents the band size of the bar, in pixels. - For ``text``, this represents the + font size, in pixels. + + **Default value:** - ``30`` for point, circle, square marks; width/height's ``step`` + - ``2`` for bar marks with discrete dimensions; - ``5`` for bar marks with + continuous dimensions; - ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprRef`) + + startAngle : anyOf(float, :class:`ExprRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + 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`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOffset : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + tension : anyOf(float, :class:`ExprRef`) + + text : anyOf(:class:`Text`, :class:`ExprRef`) + + theta : anyOf(float, :class:`ExprRef`) + 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`) + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + timeUnitBand : float + 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. + timeUnitBandPosition : float + Default relative band position for a time unit. If set to ``0``, the marks will be + positioned at the beginning of the time unit band step. If set to ``0.5``, the marks + will be positioned in the middle of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. - If ``tooltip`` is ``{"content": "data"}``, then all + fields that appear in the highlighted data point will be used. - If set to + ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) + + width : anyOf(float, :class:`ExprRef`) + + x : anyOf(float, string, :class:`ExprRef`) + 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 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 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 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, + 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, timeUnitBand=Undefined, + timeUnitBandPosition=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, 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, + timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, tooltip=tooltip, + url=url, width=width, x=x, x2=x2, y=y, y2=y2, **kwds) + + +class RepeatMapping(VegaLiteSchema): + """RepeatMapping schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + column : List(string) + An array of fields to be repeated horizontally. + row : List(string) + An array of fields to be repeated vertically. + """ + _schema = {'$ref': '#/definitions/RepeatMapping'} + + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(RepeatMapping, self).__init__(column=column, row=row, **kwds) + + +class RepeatRef(Field): + """RepeatRef schema wrapper + + Mapping(required=[repeat]) + Reference to a repeated value. + + Attributes + ---------- + + repeat : enum('row', 'column', 'repeat', 'layer') + + """ + _schema = {'$ref': '#/definitions/RepeatRef'} + + def __init__(self, repeat=Undefined, **kwds): + super(RepeatRef, self).__init__(repeat=repeat, **kwds) + + +class Resolve(VegaLiteSchema): + """Resolve schema wrapper + + Mapping(required=[]) + 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"``. + + Attributes + ---------- + + axis : :class:`AxisResolveMap` + + legend : :class:`LegendResolveMap` + + scale : :class:`ScaleResolveMap` + + """ + _schema = {'$ref': '#/definitions/Resolve'} + + def __init__(self, axis=Undefined, legend=Undefined, scale=Undefined, **kwds): + super(Resolve, self).__init__(axis=axis, legend=legend, scale=scale, **kwds) + + +class ResolveMode(VegaLiteSchema): + """ResolveMode schema wrapper + + enum('independent', 'shared') + """ + _schema = {'$ref': '#/definitions/ResolveMode'} + + def __init__(self, *args): + super(ResolveMode, self).__init__(*args) + + +class RowColLayoutAlign(VegaLiteSchema): + """RowColLayoutAlign schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + column : :class:`LayoutAlign` + + row : :class:`LayoutAlign` + + """ + _schema = {'$ref': '#/definitions/RowCol'} + + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(RowColLayoutAlign, self).__init__(column=column, row=row, **kwds) + + +class RowColboolean(VegaLiteSchema): + """RowColboolean schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + column : boolean + + row : boolean + + """ + _schema = {'$ref': '#/definitions/RowCol'} + + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(RowColboolean, self).__init__(column=column, row=row, **kwds) + + +class RowColnumber(VegaLiteSchema): + """RowColnumber schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + column : float + + row : float + + """ + _schema = {'$ref': '#/definitions/RowCol'} + + def __init__(self, column=Undefined, row=Undefined, **kwds): + super(RowColnumber, self).__init__(column=column, row=row, **kwds) + + +class RowColumnEncodingFieldDef(VegaLiteSchema): + """RowColumnEncodingFieldDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + align : :class:`LayoutAlign` + The alignment to apply to row/column facet's subplot. The supported string values + are ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. - For ``"each"``, subviews will be aligned into a + clean grid structure, but each row or column may be of variable size. - For + ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + **Default value:** ``"all"``. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + center : boolean + Boolean flag indicating if facet's subviews should be centered relative to their + respective rows or columns. + + **Default value:** ``false`` + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + header : :class:`Header` + An object defining properties of a facet's header. + sort : anyOf(:class:`SortArray`, :class:`SortOrder`, :class:`EncodingSortField`, None) + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` is not supported for ``row`` and ``column``. + spacing : float + The spacing in pixels between facet's sub-views. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/RowColumnEncodingFieldDef'} + + def __init__(self, aggregate=Undefined, align=Undefined, band=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, band=band, + 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=[]) + + Attributes + ---------- + + align : anyOf(float, :class:`ExprRef`) + 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 + steps should be centered within the range. A value of ``0`` or ``1`` may be used to + shift the bands to one side, say to position them adjacent to an axis. + + **Default value:** ``0.5`` + base : anyOf(float, :class:`ExprRef`) + The logarithm base of the ``log`` scale (default ``10`` ). + bins : :class:`ScaleBins` + 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: - An `array + <../types/#Array>`__ literal of bin boundary values. For example, ``[0, 5, 10, 15, + 20]``. The array must include both starting and ending boundaries. The previous + example uses five values to indicate a total of four bin intervals: [0-5), [5-10), + [10-15), [15-20]. Array literals may include signal references as elements. - A `bin + specification object `__ that + indicates the bin *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`) + 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 + `__ 's ``clamp`` ( + ``true`` by default). + constant : anyOf(float, :class:`ExprRef`) + 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:`SelectionExtent`, :class:`DomainUnionWith`, + :class:`ExprRef`) + Customized domain values in the form of constant values or dynamic values driven by + a selection. + + 1) Constant ``domain`` for *quantitative* fields can take one of the following + forms: + + + * A two-element array with minimum and maximum values. To create a diverging scale, + this two-element array can be combined with the ``domainMid`` property. - An array + with more than two entries, for `Piecewise quantitative scales + `__. - A string value + ``"unaggregated"``, if the input field is aggregated, to indicate that the domain + should include the raw data values prior to the aggregation. + + 2) Constant ``domain`` for *temporal* fields can be a two-element array with minimum + and maximum values, in the form of either timestamps or the `DateTime definition + objects `__. + + 3) Constant ``domain`` for *ordinal* and *nominal* fields can be an array that lists + valid input values. + + 4) To combine (union) specified constant domain with the field's values, ``domain`` + can be an object with a ``unionWith`` property that specify constant domain to be + combined. For example, ``domain: {unionWith: [0, 100]}`` for a quantitative scale + means that the scale domain always includes ``[0, 100]``, but will include other + values in the fields beyond ``[0, 100]``. + + 5) Domain can also takes an object defining a field or encoding of a selection that + `interactively determines + `__ the scale + domain. + domainMax : anyOf(float, :class:`DateTime`, :class:`ExprRef`) + 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`) + 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 + `__. The domainMid + property is only intended for use with scales supporting continuous, piecewise + domains. + domainMin : anyOf(float, :class:`DateTime`, :class:`ExprRef`) + Sets the minimum value in the scale domain, overriding the domain property. This + property is only intended for use with scales having continuous domains. + exponent : anyOf(float, :class:`ExprRef`) + The exponent of the ``pow`` scale. + interpolate : anyOf(:class:`ScaleInterpolateEnum`, :class:`ExprRef`, + :class:`ScaleInterpolateParams`) + 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 + ``rgb``, ``hsl``, ``hsl-long``, ``lab``, ``hcl``, ``hcl-long``, ``cubehelix`` and + ``cubehelix-long`` ('-long' variants use longer paths in polar coordinate spaces). + If object-valued, this property accepts an object with a string-valued *type* + property and an optional numeric *gamma* property applicable to rgb and cubehelix + interpolators. For more, see the `d3-interpolate documentation + `__. + + + * **Default value:** ``hcl`` + nice : anyOf(boolean, float, :class:`TimeInterval`, :class:`TimeIntervalStep`, + :class:`ExprRef`) + 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 + irregular. For example, for a domain of *[0.201479…, 0.996679…]*, a nice domain + might be *[0.2, 1.0]*. + + For quantitative scales such as linear, ``nice`` can be either a boolean flag or a + number. If ``nice`` is a number, it will represent a desired tick count. This allows + greater control over the step size used to extend the bounds, guaranteeing that the + returned ticks will exactly cover the domain. + + For temporal fields with time and utc scales, the ``nice`` value can be a string + indicating the desired time interval. Legal values are ``"millisecond"``, + ``"second"``, ``"minute"``, ``"hour"``, ``"day"``, ``"week"``, ``"month"``, and + ``"year"``. Alternatively, ``time`` and ``utc`` scales can accept an object-valued + interval specifier of the form ``{"interval": "month", "step": 3}``, which includes + a desired number of interval steps. Here, the domain would snap to quarter (Jan, + Apr, Jul, Oct) boundaries. + + **Default value:** ``true`` for unbinned *quantitative* fields; ``false`` otherwise. + padding : anyOf(float, :class:`ExprRef`) + For * `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 + function as intended. Padding adjustment is performed prior to all other + adjustments, including the effects of the  ``zero``,  ``nice``,  ``domainMin``, and + ``domainMax``  properties. + + For * `band `__ * scales, + shortcut for setting ``paddingInner`` and ``paddingOuter`` to the same value. + + For * `point `__ * scales, + alias for ``paddingOuter``. + + **Default value:** For *continuous* scales, derived from the `scale config + `__ 's + ``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`) + 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]. + + For point scale, this property is invalid as point scales do not have internal band + widths (only step sizes between bands). + + **Default value:** derived from the `scale config + `__ 's + ``bandPaddingInner``. + paddingOuter : anyOf(float, :class:`ExprRef`) + 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]. + + **Default value:** derived from the `scale 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`)), + Mapping(required=[field])) + The range of the scale. One of: + + + A string indicating a `pre-defined named scale range + `__ (e.g., example, + ``"symbol"``, or ``"diverging"`` ). + + For `continuous scales + `__, two-element array + indicating minimum and maximum values, or an array with more than two entries for + specifying a `piecewise scale + `__. + + For `discrete `__ and + `discretizing `__ + scales, an array of desired output values or an object with a ``field`` property + representing the range values. For example, if a field ``color`` contains CSS color + names, we can set ``range`` to ``{field: "color"}``. + + **Notes:** + + 1) For color scales you can also specify a color `scheme + `__ instead of ``range``. + + 2) Any directly specified ``range`` for ``x`` and ``y`` channels will be ignored. + Range can be customized via the view's corresponding `size + `__ ( ``width`` and ``height`` ). + rangeMax : anyOf(float, string, :class:`ExprRef`) + 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`) + 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`) + If true, reverses the order of the scale range. **Default value:** ``false``. + round : anyOf(boolean, :class:`ExprRef`) + If ``true``, rounds numeric output values to integers. This can be helpful for + snapping to the pixel grid. + + **Default value:** ``false``. + scheme : anyOf(string, :class:`SchemeParams`, :class:`ExprRef`) + A string indicating a color `scheme + `__ name (e.g., + ``"category10"`` or ``"blues"`` ) or a `scheme parameter object + `__. + + Discrete color schemes may be used with `discrete + `__ or `discretizing + `__ scales. + Continuous color schemes are intended for use with color scales. + + For the full list of supported schemes, please refer to the `Vega Scheme + `__ reference. + type : :class:`ScaleType` + The type of scale. Vega-Lite supports the following categories of scale types: + + 1) `Continuous Scales + `__ -- mapping + continuous domains to continuous output ranges ( `"linear" + `__, `"pow" + `__, `"sqrt" + `__, `"symlog" + `__, `"log" + `__, `"time" + `__, `"utc" + `__. + + 2) `Discrete Scales `__ + -- mapping discrete domains to discrete ( `"ordinal" + `__ ) or continuous ( + `"band" `__ and `"point" + `__ ) output ranges. + + 3) `Discretizing Scales + `__ -- mapping + continuous domains to discrete output ranges `"bin-ordinal" + `__, `"quantile" + `__, `"quantize" + `__ and `"threshold" + `__. + + **Default value:** please see the `scale type table + `__. + zero : anyOf(boolean, :class:`ExprRef`) + 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 + binned and no custom ``domain`` is provided; ``false`` otherwise. + + **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, 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, 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`) + """ + _schema = {'$ref': '#/definitions/ScaleBins'} + + def __init__(self, *args, **kwds): + super(ScaleBins, self).__init__(*args, **kwds) + + +class ScaleBinParams(ScaleBins): + """ScaleBinParams schema wrapper + + Mapping(required=[step]) + + Attributes + ---------- + + step : float + The step size defining the bin interval width. + start : float + The starting (lowest-valued) bin boundary. + + **Default value:** The lowest value of the scale domain will be used. + stop : float + The stopping (highest-valued) bin boundary. + + **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): + super(ScaleBinParams, self).__init__(step=step, start=start, stop=stop, **kwds) + + +class ScaleConfig(VegaLiteSchema): + """ScaleConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + bandPaddingInner : anyOf(float, :class:`ExprRef`) + Default inner padding for ``x`` and ``y`` band-ordinal scales. + + **Default value:** - ``barBandPaddingInner`` for bar marks ( ``0.1`` by default) - + ``rectBandPaddingInner`` for rect and other marks ( ``0`` by default) + bandPaddingOuter : anyOf(float, :class:`ExprRef`) + Default outer padding for ``x`` and ``y`` band-ordinal scales. + + **Default value:** ``paddingInner/2`` (which makes *width/height = number of unique + values * step* ) + barBandPaddingInner : anyOf(float, :class:`ExprRef`) + Default inner padding for ``x`` and ``y`` band-ordinal scales of ``"bar"`` marks. + + **Default value:** ``0.1`` + clamp : anyOf(boolean, :class:`ExprRef`) + If true, values that exceed the data domain are clamped to either the minimum or + maximum range value + continuousPadding : anyOf(float, :class:`ExprRef`) + Default padding for continuous scales. + + **Default:** ``5`` for continuous x-scale of a vertical bar and continuous y-scale + of a horizontal bar.; ``0`` otherwise. + maxBandSize : float + The default max value for mapping quantitative fields to bar's size/bandSize. + + If undefined (default), we will use the axis's size (width or height) - 1. + maxFontSize : float + The default max value for mapping quantitative fields to text's size/fontSize. + + **Default value:** ``40`` + maxOpacity : float + Default max opacity for mapping a field to opacity. + + **Default value:** ``0.8`` + maxSize : float + Default max value for point size scale. + maxStrokeWidth : float + Default max strokeWidth for the scale of strokeWidth for rule and line marks and of + size for trail marks. + + **Default value:** ``4`` + minBandSize : float + The default min value for mapping quantitative fields to bar and tick's + size/bandSize scale with zero=false. + + **Default value:** ``2`` + minFontSize : float + The default min value for mapping quantitative fields to tick's size/fontSize scale + with zero=false + + **Default value:** ``8`` + minOpacity : float + Default minimum opacity for mapping a field to opacity. + + **Default value:** ``0.3`` + minSize : float + Default minimum value for point size scale with zero=false. + + **Default value:** ``9`` + minStrokeWidth : float + Default minimum strokeWidth for the scale of strokeWidth for rule and line marks and + of size for trail marks with zero=false. + + **Default value:** ``1`` + pointPadding : anyOf(float, :class:`ExprRef`) + Default outer padding for ``x`` and ``y`` point-ordinal scales. + + **Default value:** ``0.5`` (which makes *width/height = number of unique values * + step* ) + quantileCount : float + Default range cardinality for `quantile + `__ scale. + + **Default value:** ``4`` + quantizeCount : float + Default range cardinality for `quantize + `__ scale. + + **Default value:** ``4`` + rectBandPaddingInner : anyOf(float, :class:`ExprRef`) + Default inner padding for ``x`` and ``y`` band-ordinal scales of ``"rect"`` marks. + + **Default value:** ``0`` + round : anyOf(boolean, :class:`ExprRef`) + 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 + Use the source data range before aggregation as scale domain instead of aggregated + data for aggregate axis. + + This is equivalent to setting ``domain`` to ``"unaggregate"`` for aggregated + *quantitative* fields by default. + + This property only works with aggregate functions that produce values within the raw + data domain ( ``"mean"``, ``"average"``, ``"median"``, ``"q1"``, ``"q3"``, + ``"min"``, ``"max"`` ). For other aggregations that produce values outside of the + raw data domain (e.g. ``"count"``, ``"sum"`` ), this property is ignored. + + **Default value:** ``false`` + xReverse : anyOf(boolean, :class:`ExprRef`) + Reverse x-scale by default (useful for right-to-left charts). + """ + _schema = {'$ref': '#/definitions/ScaleConfig'} + + def __init__(self, bandPaddingInner=Undefined, bandPaddingOuter=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, + pointPadding=Undefined, quantileCount=Undefined, quantizeCount=Undefined, + rectBandPaddingInner=Undefined, round=Undefined, useUnaggregatedDomain=Undefined, + xReverse=Undefined, **kwds): + super(ScaleConfig, self).__init__(bandPaddingInner=bandPaddingInner, + bandPaddingOuter=bandPaddingOuter, + 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, pointPadding=pointPadding, + quantileCount=quantileCount, quantizeCount=quantizeCount, + rectBandPaddingInner=rectBandPaddingInner, round=round, + useUnaggregatedDomain=useUnaggregatedDomain, + xReverse=xReverse, **kwds) + + +class ScaleInterpolateEnum(VegaLiteSchema): + """ScaleInterpolateEnum schema wrapper + + enum('rgb', 'lab', 'hcl', 'hsl', 'hsl-long', 'hcl-long', 'cubehelix', 'cubehelix-long') + """ + _schema = {'$ref': '#/definitions/ScaleInterpolateEnum'} + + def __init__(self, *args): + super(ScaleInterpolateEnum, self).__init__(*args) + + +class ScaleInterpolateParams(VegaLiteSchema): + """ScaleInterpolateParams schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : enum('rgb', 'cubehelix', 'cubehelix-long') + + gamma : float + + """ + _schema = {'$ref': '#/definitions/ScaleInterpolateParams'} + + def __init__(self, type=Undefined, gamma=Undefined, **kwds): + super(ScaleInterpolateParams, self).__init__(type=type, gamma=gamma, **kwds) + + +class ScaleResolveMap(VegaLiteSchema): + """ScaleResolveMap schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + 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` + + y : :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, y=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, y=y, **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') + """ + _schema = {'$ref': '#/definitions/ScaleType'} + + def __init__(self, *args): + super(ScaleType, self).__init__(*args) + + +class SchemeParams(VegaLiteSchema): + """SchemeParams schema wrapper + + Mapping(required=[name]) + + Attributes + ---------- + + name : string + 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 + `__ reference. + count : float + 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) + 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) + + +class SecondaryFieldDef(Position2Def): + """SecondaryFieldDef schema wrapper + + Mapping(required=[]) + 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``. + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : None + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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, band=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, **kwds): + super(SecondaryFieldDef, self).__init__(aggregate=aggregate, band=band, bin=bin, field=field, + timeUnit=timeUnit, title=title, **kwds) + + +class SelectionComposition(VegaLiteSchema): + """SelectionComposition schema wrapper + + anyOf(:class:`SelectionNot`, :class:`SelectionAnd`, :class:`SelectionOr`, string) + """ + _schema = {'$ref': '#/definitions/SelectionComposition'} + + def __init__(self, *args, **kwds): + super(SelectionComposition, self).__init__(*args, **kwds) + + +class SelectionAnd(SelectionComposition): + """SelectionAnd schema wrapper + + Mapping(required=[and]) + + Attributes + ---------- + + and : List(:class:`SelectionComposition`) + + """ + _schema = {'$ref': '#/definitions/SelectionAnd'} + + def __init__(self, **kwds): + super(SelectionAnd, self).__init__(**kwds) + + +class SelectionConfig(VegaLiteSchema): + """SelectionConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + interval : :class:`IntervalSelectionConfig` + The default definition for an `interval + `__ selection. All + properties and transformations for an interval selection definition (except ``type`` + ) may be specified here. + + For instance, setting ``interval`` to ``{"translate": false}`` disables the ability + to move interval selections by default. + multi : :class:`MultiSelectionConfig` + The default definition for a `multi + `__ selection. All + properties and transformations for a multi selection definition (except ``type`` ) + may be specified here. + + For instance, setting ``multi`` to ``{"toggle": "event.altKey"}`` adds additional + values to multi selections when clicking with the alt-key pressed by default. + single : :class:`SingleSelectionConfig` + The default definition for a `single + `__ selection. All + properties and transformations for a single selection definition (except ``type`` + ) may be specified here. + + For instance, setting ``single`` to ``{"on": "dblclick"}`` populates single + selections on double-click by default. + """ + _schema = {'$ref': '#/definitions/SelectionConfig'} + + def __init__(self, interval=Undefined, multi=Undefined, single=Undefined, **kwds): + super(SelectionConfig, self).__init__(interval=interval, multi=multi, single=single, **kwds) + + +class SelectionDef(VegaLiteSchema): + """SelectionDef schema wrapper + + anyOf(:class:`SingleSelection`, :class:`MultiSelection`, :class:`IntervalSelection`) + """ + _schema = {'$ref': '#/definitions/SelectionDef'} + + def __init__(self, *args, **kwds): + super(SelectionDef, self).__init__(*args, **kwds) + + +class IntervalSelection(SelectionDef): + """IntervalSelection schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : string + Determines the default event processing and data query for the selection. Vega-Lite + currently supports three selection types: + + + * ``"single"`` -- to select a single discrete data value on ``click``. - ``"multi"`` + -- to select multiple discrete data value; 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 : string + Establishes a two-way binding between the interval selection and the scales used + within the same view. This allows a user to interactively pan and zoom the view. + + **See also:** `bind `__ + documentation. + clear : anyOf(:class:`Stream`, string, boolean) + Clears the selection, emptying it of all values. Can be a `Event Stream + `__ or ``false`` to disable. + + **Default value:** ``dblclick``. + + **See also:** `clear `__ + documentation. + empty : enum('all', 'none') + By default, ``all`` data values are considered to lie within an empty selection. + When set to ``none``, empty selections contain no data values. + encodings : List(:class:`SingleDefUnitChannel`) + An array of encoding channels. The corresponding data field values must match for a + data tuple to fall within the selection. + + **See also:** `encodings `__ + documentation. + fields : List(:class:`FieldName`) + An array of field names whose values must match for a data tuple to fall within the + selection. + + **See also:** `fields `__ + documentation. + init : :class:`SelectionInitIntervalMapping` + Initialize the selection with a mapping between `projected channels or field names + `__ and arrays of initial + values. + + **See also:** `init `__ + documentation. + mark : :class:`BrushConfig` + 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 `__ + documentation. + on : anyOf(:class:`Stream`, string) + A `Vega event stream `__ (object or + selector) that triggers the selection. For interval selections, the event stream + must specify a `start and end + `__. + resolve : :class:`SelectionResolution` + 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. + + **See also:** `resolve + `__ documentation. + translate : anyOf(string, boolean) + 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 `__ which must + include a start and end event to trigger continuous panning. + + **Default value:** ``true``, which corresponds to ``[mousedown, window:mouseup] > + window:mousemove!`` which corresponds to clicks and dragging within an interval + selection to reposition it. + + **See also:** `translate `__ + documentation. + zoom : anyOf(string, boolean) + When truthy, allows a user to interactively resize an interval selection. Can be + ``true``, ``false`` (to disable zooming), or a `Vega event stream definition + `__. Currently, only ``wheel`` + events are supported. + + **Default value:** ``true``, which corresponds to ``wheel!``. + + **See also:** `zoom `__ + documentation. + """ + _schema = {'$ref': '#/definitions/IntervalSelection'} + + def __init__(self, type=Undefined, bind=Undefined, clear=Undefined, empty=Undefined, + encodings=Undefined, fields=Undefined, init=Undefined, mark=Undefined, on=Undefined, + resolve=Undefined, translate=Undefined, zoom=Undefined, **kwds): + super(IntervalSelection, self).__init__(type=type, bind=bind, clear=clear, empty=empty, + encodings=encodings, fields=fields, init=init, + mark=mark, on=on, resolve=resolve, translate=translate, + zoom=zoom, **kwds) + + +class MultiSelection(SelectionDef): + """MultiSelection schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : string + Determines the default event processing and data query for the selection. Vega-Lite + currently supports three selection types: + + + * ``"single"`` -- to select a single discrete data value on ``click``. - ``"multi"`` + -- to select multiple discrete data value; 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 : :class:`LegendBinding` + When set, a selection is populated by interacting with the corresponding legend. + Direct manipulation interaction is disabled by default; to re-enable it, set the + selection's `on + `__ + property. + + Legend bindings are restricted to selections that only specify a single field or + encoding. + clear : anyOf(:class:`Stream`, string, boolean) + Clears the selection, emptying it of all values. Can be a `Event Stream + `__ or ``false`` to disable. + + **Default value:** ``dblclick``. + + **See also:** `clear `__ + documentation. + empty : enum('all', 'none') + By default, ``all`` data values are considered to lie within an empty selection. + When set to ``none``, empty selections contain no data values. + encodings : List(:class:`SingleDefUnitChannel`) + An array of encoding channels. The corresponding data field values must match for a + data tuple to fall within the selection. + + **See also:** `encodings `__ + documentation. + fields : List(:class:`FieldName`) + An array of field names whose values must match for a data tuple to fall within the + selection. + + **See also:** `fields `__ + documentation. + init : List(:class:`SelectionInitMapping`) + Initialize the selection with a mapping between `projected channels or field names + `__ and an initial value (or + array of values). + + **See also:** `init `__ + documentation. + nearest : boolean + When true, an invisible voronoi diagram is computed to accelerate discrete + selection. The data value *nearest* the mouse cursor is added to the selection. + + **See also:** `nearest `__ + documentation. + on : anyOf(:class:`Stream`, string) + A `Vega event stream `__ (object or + selector) that triggers the selection. For interval selections, the event stream + must specify a `start and end + `__. + resolve : :class:`SelectionResolution` + 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. + + **See also:** `resolve + `__ documentation. + toggle : anyOf(string, boolean) + Controls whether data values should be toggled or only ever inserted into multi + selections. Can be ``true``, ``false`` (for insertion only), or a `Vega expression + `__. + + **Default value:** ``true``, which corresponds to ``event.shiftKey`` (i.e., data + values are toggled when a user interacts with the shift-key pressed). + + Setting the value to the Vega expression ``"true"`` will toggle data values without + the user pressing the shift-key. + + **See also:** `toggle `__ + documentation. + """ + _schema = {'$ref': '#/definitions/MultiSelection'} + + def __init__(self, type=Undefined, bind=Undefined, clear=Undefined, empty=Undefined, + encodings=Undefined, fields=Undefined, init=Undefined, nearest=Undefined, on=Undefined, + resolve=Undefined, toggle=Undefined, **kwds): + super(MultiSelection, self).__init__(type=type, bind=bind, clear=clear, empty=empty, + encodings=encodings, fields=fields, init=init, + nearest=nearest, on=on, resolve=resolve, toggle=toggle, + **kwds) + + +class SelectionExtent(BinExtent): + """SelectionExtent schema wrapper + + anyOf(Mapping(required=[selection]), Mapping(required=[selection])) + """ + _schema = {'$ref': '#/definitions/SelectionExtent'} + + def __init__(self, *args, **kwds): + super(SelectionExtent, self).__init__(*args, **kwds) + + +class SelectionInit(VegaLiteSchema): + """SelectionInit schema wrapper + + anyOf(:class:`PrimitiveValue`, :class:`DateTime`) + """ + _schema = {'$ref': '#/definitions/SelectionInit'} + + def __init__(self, *args, **kwds): + super(SelectionInit, self).__init__(*args, **kwds) + + +class DateTime(SelectionInit): + """DateTime schema wrapper + + Mapping(required=[]) + 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. + + Attributes + ---------- + + date : float + Integer value representing the date (day of the month) from 1-31. + day : anyOf(:class:`Day`, string) + 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"`` ). + + **Warning:** A DateTime definition object with ``day`` ** should not be combined + with ``year``, ``quarter``, ``month``, or ``date``. + hours : float + Integer value representing the hour of a day from 0-23. + milliseconds : float + 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) + 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"`` ). + quarter : float + 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 + 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) + + +class PrimitiveValue(SelectionInit): + """PrimitiveValue schema wrapper + + anyOf(float, string, boolean, None) + """ + _schema = {'$ref': '#/definitions/PrimitiveValue'} + + def __init__(self, *args): + super(PrimitiveValue, self).__init__(*args) + + +class SelectionInitInterval(VegaLiteSchema): + """SelectionInitInterval schema wrapper + + anyOf(:class:`Vector2boolean`, :class:`Vector2number`, :class:`Vector2string`, + :class:`Vector2DateTime`) + """ + _schema = {'$ref': '#/definitions/SelectionInitInterval'} + + def __init__(self, *args, **kwds): + super(SelectionInitInterval, self).__init__(*args, **kwds) + + +class SelectionInitIntervalMapping(VegaLiteSchema): + """SelectionInitIntervalMapping schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/SelectionInitIntervalMapping'} + + def __init__(self, **kwds): + super(SelectionInitIntervalMapping, self).__init__(**kwds) + + +class SelectionInitMapping(VegaLiteSchema): + """SelectionInitMapping schema wrapper + + Mapping(required=[]) + """ + _schema = {'$ref': '#/definitions/SelectionInitMapping'} + + def __init__(self, **kwds): + super(SelectionInitMapping, self).__init__(**kwds) + + +class SelectionNot(SelectionComposition): + """SelectionNot schema wrapper + + Mapping(required=[not]) + + Attributes + ---------- + + not : :class:`SelectionComposition` + + """ + _schema = {'$ref': '#/definitions/SelectionNot'} + + def __init__(self, **kwds): + super(SelectionNot, self).__init__(**kwds) + + +class SelectionOr(SelectionComposition): + """SelectionOr schema wrapper + + Mapping(required=[or]) + + Attributes + ---------- + + or : List(:class:`SelectionComposition`) + + """ + _schema = {'$ref': '#/definitions/SelectionOr'} + + def __init__(self, **kwds): + super(SelectionOr, self).__init__(**kwds) + + +class SelectionPredicate(Predicate): + """SelectionPredicate schema wrapper + + Mapping(required=[selection]) + + Attributes + ---------- + + selection : :class:`SelectionComposition` + Filter using a selection name or a logical composition of selection names. + """ + _schema = {'$ref': '#/definitions/SelectionPredicate'} + + def __init__(self, selection=Undefined, **kwds): + super(SelectionPredicate, self).__init__(selection=selection, **kwds) + + +class SelectionResolution(VegaLiteSchema): + """SelectionResolution schema wrapper + + enum('global', 'union', 'intersect') + """ + _schema = {'$ref': '#/definitions/SelectionResolution'} + + def __init__(self, *args): + super(SelectionResolution, self).__init__(*args) + + +class SequenceGenerator(Generator): + """SequenceGenerator schema wrapper + + Mapping(required=[sequence]) + + Attributes + ---------- + + sequence : :class:`SequenceParams` + Generate a sequence of numbers. + name : string + Provide a placeholder name and bind data at runtime. + """ + _schema = {'$ref': '#/definitions/SequenceGenerator'} + + def __init__(self, sequence=Undefined, name=Undefined, **kwds): + super(SequenceGenerator, self).__init__(sequence=sequence, name=name, **kwds) + + +class SequenceParams(VegaLiteSchema): + """SequenceParams schema wrapper + + Mapping(required=[start, stop]) + + Attributes + ---------- + + start : float + The starting value of the sequence (inclusive). + stop : float + The ending value of the sequence (exclusive). + step : float + The step value between sequence entries. + + **Default value:** ``1`` + as : :class:`FieldName` + The name of the generated sequence field. + + **Default value:** ``"data"`` + """ + _schema = {'$ref': '#/definitions/SequenceParams'} + + def __init__(self, start=Undefined, stop=Undefined, step=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', + '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') + """ + _schema = {'$ref': '#/definitions/SequentialMultiHue'} + + def __init__(self, *args): + super(SequentialMultiHue, self).__init__(*args) + + +class SequentialSingleHue(ColorScheme): + """SequentialSingleHue schema wrapper + + enum('blues', 'tealblues', 'teals', 'greens', 'browns', 'greys', 'purples', 'warmgreys', + 'reds', 'oranges') + """ + _schema = {'$ref': '#/definitions/SequentialSingleHue'} + + def __init__(self, *args): + super(SequentialSingleHue, self).__init__(*args) + + +class ShapeDef(VegaLiteSchema): + """ShapeDef schema wrapper + + anyOf(:class:`FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull`, + :class:`FieldOrDatumDefWithConditionDatumDefstringnull`, + :class:`ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull`) + """ + _schema = {'$ref': '#/definitions/ShapeDef'} + + def __init__(self, *args, **kwds): + super(ShapeDef, self).__init__(*args, **kwds) + + +class FieldOrDatumDefWithConditionDatumDefstringnull(MarkPropDefstringnullTypeForShape, ShapeDef): + """FieldOrDatumDefWithConditionDatumDefstringnull schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} + + def __init__(self, band=Undefined, condition=Undefined, datum=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionDatumDefstringnull, self).__init__(band=band, + condition=condition, + datum=datum, type=type, + **kwds) + + +class FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull(MarkPropDefstringnullTypeForShape, ShapeDef): + """FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapestringnull schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + legend : anyOf(:class:`Legend`, None) + An object defining properties of the legend. If ``null``, the legend for the + encoding channel will be removed. + + **Default value:** If undefined, default `legend properties + `__ are applied. + + **See also:** `legend `__ + documentation. + 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 + `__. + + **Default value:** If undefined, default `scale properties + `__ are applied. + + **See also:** `scale `__ + documentation. + sort : :class:`Sort` + Sort order for the encoded field. + + For continuous fields (quantitative or temporal), ``sort`` can be either + ``"ascending"`` or ``"descending"``. + + For discrete fields, ``sort`` can be one of the following: - ``"ascending"`` or + ``"descending"`` -- for sorting by the values' natural order in JavaScript. - `A + string indicating an encoding channel name to sort by + `__ (e.g., ``"x"`` + or ``"y"`` ) with an optional minus prefix for descending sort (e.g., ``"-x"`` to + sort by x-field, descending). This channel string is short-form of `a + sort-by-encoding definition + `__. For example, + ``"sort": "-x"`` is equivalent to ``"sort": {"encoding": "x", "order": + "descending"}``. - `A sort field definition + `__ for sorting by + another field. - `An array specifying the field values in preferred order + `__. In this case, the + sort order will obey the values in the array, followed by any unspecified values in + their original order. For discrete time field, values in the sort array can be + `date-time definition objects `__. In addition, for time units + ``"month"`` and ``"day"``, the values can be the month or day names (case + insensitive) or their 3-letter initials (e.g., ``"Mon"``, ``"Tue"`` ). - ``null`` + indicating no sort. + + **Default value:** ``"ascending"`` + + **Note:** ``null`` and sorting by another channel is not supported for ``row`` and + ``column``. + + **See also:** `sort `__ + documentation. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition,(string|null)>'} + + def __init__(self, aggregate=Undefined, band=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, + band=band, + 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=[]) + + Attributes + ---------- + + angle : Mapping(required=[]) + + color : Mapping(required=[]) + + description : Mapping(required=[]) + + detail : anyOf(:class:`FieldDefWithoutScale`, List(:class:`FieldDefWithoutScale`)) + 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=[]) + + fillOpacity : Mapping(required=[]) + + href : Mapping(required=[]) + + key : Mapping(required=[]) + + latitude : Mapping(required=[]) + + latitude2 : Mapping(required=[]) + + longitude : Mapping(required=[]) + + longitude2 : Mapping(required=[]) + + opacity : Mapping(required=[]) + + order : anyOf(:class:`OrderFieldDef`, List(:class:`OrderFieldDef`), :class:`OrderValueDef`) + Order of the marks. - For stacked marks, this ``order`` channel encodes `stack 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 + `__. 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 : Mapping(required=[]) + + radius2 : Mapping(required=[]) + + shape : Mapping(required=[]) + + size : Mapping(required=[]) + + stroke : Mapping(required=[]) + + strokeDash : Mapping(required=[]) + + strokeOpacity : Mapping(required=[]) + + strokeWidth : Mapping(required=[]) + + text : Mapping(required=[]) + + theta : Mapping(required=[]) + + theta2 : Mapping(required=[]) + + tooltip : anyOf(:class:`StringFieldDefWithCondition`, :class:`StringValueDefWithCondition`, + List(:class:`StringFieldDef`), None) + The tooltip text to show upon mouse hover. Specifying ``tooltip`` encoding overrides + `the tooltip property in the mark definition + `__. + + See the `tooltip `__ + 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=[]) + + y : Mapping(required=[]) + + y2 : Mapping(required=[]) + + yError : Mapping(required=[]) + + yError2 : 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, y=Undefined, y2=Undefined, yError=Undefined, + yError2=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, y=y, y2=y2, yError=yError, + yError2=yError2, **kwds) + + +class SingleDefUnitChannel(VegaLiteSchema): + """SingleDefUnitChannel schema wrapper + + enum('x', 'y', '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'} + + def __init__(self, *args): + super(SingleDefUnitChannel, self).__init__(*args) + + +class SingleSelection(SelectionDef): + """SingleSelection schema wrapper + + Mapping(required=[type]) + + Attributes + ---------- + + type : string + Determines the default event processing and data query for the selection. Vega-Lite + currently supports three selection types: + + + * ``"single"`` -- to select a single discrete data value on ``click``. - ``"multi"`` + -- to select multiple discrete data value; 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`) + 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 + `__ + property. + + Legend bindings are restricted to selections that only specify a single field or + encoding. + + Query widget binding takes the form of Vega's `input element binding definition + `__ or can be a mapping between + projected field/encodings and binding definitions. + + **See also:** `bind `__ + documentation. + clear : anyOf(:class:`Stream`, string, boolean) + Clears the selection, emptying it of all values. Can be a `Event Stream + `__ or ``false`` to disable. + + **Default value:** ``dblclick``. + + **See also:** `clear `__ + documentation. + empty : enum('all', 'none') + By default, ``all`` data values are considered to lie within an empty selection. + When set to ``none``, empty selections contain no data values. + encodings : List(:class:`SingleDefUnitChannel`) + An array of encoding channels. The corresponding data field values must match for a + data tuple to fall within the selection. + + **See also:** `encodings `__ + documentation. + fields : List(:class:`FieldName`) + An array of field names whose values must match for a data tuple to fall within the + selection. + + **See also:** `fields `__ + documentation. + init : :class:`SelectionInitMapping` + Initialize the selection with a mapping between `projected channels or field names + `__ and initial values. + + **See also:** `init `__ + documentation. + nearest : boolean + When true, an invisible voronoi diagram is computed to accelerate discrete + selection. The data value *nearest* the mouse cursor is added to the selection. + + **See also:** `nearest `__ + documentation. + on : anyOf(:class:`Stream`, string) + A `Vega event stream `__ (object or + selector) that triggers the selection. For interval selections, the event stream + must specify a `start and end + `__. + resolve : :class:`SelectionResolution` + 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. + + **See also:** `resolve + `__ documentation. + """ + _schema = {'$ref': '#/definitions/SingleSelection'} + + def __init__(self, type=Undefined, bind=Undefined, clear=Undefined, empty=Undefined, + encodings=Undefined, fields=Undefined, init=Undefined, nearest=Undefined, on=Undefined, + resolve=Undefined, **kwds): + super(SingleSelection, self).__init__(type=type, bind=bind, clear=clear, empty=empty, + encodings=encodings, fields=fields, init=init, + nearest=nearest, on=on, resolve=resolve, **kwds) + + +class SingleSelectionConfig(VegaLiteSchema): + """SingleSelectionConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + bind : anyOf(:class:`Binding`, Mapping(required=[]), :class:`LegendBinding`) + 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 + `__ + property. + + Legend bindings are restricted to selections that only specify a single field or + encoding. + + Query widget binding takes the form of Vega's `input element binding definition + `__ or can be a mapping between + projected field/encodings and binding definitions. + + **See also:** `bind `__ + documentation. + clear : anyOf(:class:`Stream`, string, boolean) + Clears the selection, emptying it of all values. Can be a `Event Stream + `__ or ``false`` to disable. + + **Default value:** ``dblclick``. + + **See also:** `clear `__ + documentation. + empty : enum('all', 'none') + By default, ``all`` data values are considered to lie within an empty selection. + When set to ``none``, empty selections contain no data values. + encodings : List(:class:`SingleDefUnitChannel`) + An array of encoding channels. The corresponding data field values must match for a + data tuple to fall within the selection. + + **See also:** `encodings `__ + documentation. + fields : List(:class:`FieldName`) + An array of field names whose values must match for a data tuple to fall within the + selection. + + **See also:** `fields `__ + documentation. + init : :class:`SelectionInitMapping` + Initialize the selection with a mapping between `projected channels or field names + `__ and initial values. + + **See also:** `init `__ + documentation. + nearest : boolean + When true, an invisible voronoi diagram is computed to accelerate discrete + selection. The data value *nearest* the mouse cursor is added to the selection. + + **See also:** `nearest `__ + documentation. + on : anyOf(:class:`Stream`, string) + A `Vega event stream `__ (object or + selector) that triggers the selection. For interval selections, the event stream + must specify a `start and end + `__. + resolve : :class:`SelectionResolution` + 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. + + **See also:** `resolve + `__ documentation. + """ + _schema = {'$ref': '#/definitions/SingleSelectionConfig'} + + def __init__(self, bind=Undefined, clear=Undefined, empty=Undefined, encodings=Undefined, + fields=Undefined, init=Undefined, nearest=Undefined, on=Undefined, resolve=Undefined, + **kwds): + super(SingleSelectionConfig, self).__init__(bind=bind, clear=clear, empty=empty, + encodings=encodings, fields=fields, init=init, + nearest=nearest, on=on, resolve=resolve, **kwds) + + +class Sort(VegaLiteSchema): + """Sort schema wrapper + + anyOf(:class:`SortArray`, :class:`AllSortString`, :class:`EncodingSortField`, + :class:`SortByEncoding`, None) + """ + _schema = {'$ref': '#/definitions/Sort'} + + def __init__(self, *args, **kwds): + super(Sort, self).__init__(*args, **kwds) + + +class AllSortString(Sort): + """AllSortString schema wrapper + + anyOf(:class:`SortOrder`, :class:`SortByChannel`, :class:`SortByChannelDesc`) + """ + _schema = {'$ref': '#/definitions/AllSortString'} + + def __init__(self, *args, **kwds): + super(AllSortString, self).__init__(*args, **kwds) + + +class EncodingSortField(Sort): + """EncodingSortField schema wrapper + + Mapping(required=[]) + A sort definition for sorting a discrete scale in an encoding field definition. + + Attributes + ---------- + + field : :class:`Field` + The data `field `__ to sort by. + + **Default value:** If unspecified, defaults to the field specified in the outer data + reference. + op : :class:`NonArgAggregateOp` + An `aggregate operation + `__ to perform on the + field prior to sorting (e.g., ``"count"``, ``"mean"`` and ``"median"`` ). An + aggregation is required when there are multiple values of the sort field for each + encoded data field. The input data objects will be aggregated, grouped by the + encoded data field. + + For a full list of operations, please see the documentation for `aggregate + `__. + + **Default value:** ``"sum"`` for stacked plots. Otherwise, ``"min"``. + order : anyOf(:class:`SortOrder`, 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): + 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`)) + """ + _schema = {'$ref': '#/definitions/SortArray'} + + def __init__(self, *args, **kwds): + super(SortArray, self).__init__(*args, **kwds) + + +class SortByChannel(AllSortString): + """SortByChannel schema wrapper + + enum('x', 'y', 'color', 'fill', 'stroke', 'strokeWidth', 'size', 'shape', 'fillOpacity', + 'strokeOpacity', 'opacity', 'text') + """ + _schema = {'$ref': '#/definitions/SortByChannel'} + + def __init__(self, *args): + super(SortByChannel, self).__init__(*args) + + +class SortByChannelDesc(AllSortString): + """SortByChannelDesc schema wrapper + + enum('-x', '-y', '-color', '-fill', '-stroke', '-strokeWidth', '-size', '-shape', + '-fillOpacity', '-strokeOpacity', '-opacity', '-text') + """ + _schema = {'$ref': '#/definitions/SortByChannelDesc'} + + def __init__(self, *args): + super(SortByChannelDesc, self).__init__(*args) + + +class SortByEncoding(Sort): + """SortByEncoding schema wrapper + + Mapping(required=[encoding]) + + Attributes + ---------- + + encoding : :class:`SortByChannel` + The `encoding channel + `__ to sort by (e.g., + ``"x"``, ``"y"`` ) + order : anyOf(:class:`SortOrder`, 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): + super(SortByEncoding, self).__init__(encoding=encoding, order=order, **kwds) + + +class SortField(VegaLiteSchema): + """SortField schema wrapper + + Mapping(required=[field]) + A sort definition for transform + + Attributes + ---------- + + field : :class:`FieldName` + The name of the field to sort. + order : anyOf(:class:`SortOrder`, 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): + super(SortField, self).__init__(field=field, order=order, **kwds) + + +class SortOrder(AllSortString): + """SortOrder schema wrapper + + enum('ascending', 'descending') + """ + _schema = {'$ref': '#/definitions/SortOrder'} + + def __init__(self, *args): + super(SortOrder, self).__init__(*args) + + +class Spec(VegaLiteSchema): + """Spec schema wrapper + + anyOf(:class:`FacetedUnitSpec`, :class:`LayerSpec`, :class:`RepeatSpec`, :class:`FacetSpec`, + :class:`ConcatSpecGenericSpec`, :class:`VConcatSpecGenericSpec`, + :class:`HConcatSpecGenericSpec`) + Any specification in Vega-Lite. + """ + _schema = {'$ref': '#/definitions/Spec'} + + def __init__(self, *args, **kwds): + super(Spec, self).__init__(*args, **kwds) + + +class ConcatSpecGenericSpec(Spec): + """ConcatSpecGenericSpec schema wrapper + + Mapping(required=[concat]) + Base interface for a generalized concatenation specification. + + Attributes + ---------- + + concat : List(:class:`Spec`) + A list of views to be concatenated. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. - For ``"each"``, subviews will be aligned into a + clean grid structure, but each row or column may be of variable size. - For + ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: - the general (wrappable) ``concat`` operator (not + ``hconcat`` / ``vconcat`` ) - the ``facet`` and ``repeat`` operator with one + field/repetition definition (without row/column nesting) + + 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) + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/ConcatSpec'} + + 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) + + +class FacetSpec(Spec): + """FacetSpec schema wrapper + + Mapping(required=[facet, spec]) + Base interface for a facet specification. + + Attributes + ---------- + + facet : anyOf(:class:`FacetFieldDefFieldName`, :class:`FacetMappingFieldName`) + Definition for how to facet the data. One of: 1) `a field definition for faceting + the plot by one field + `__ 2) `An object that + maps row and column channels to their field definitions + `__ + spec : anyOf(:class:`LayerSpec`, :class:`FacetedUnitSpec`) + A specification of the view that gets faceted. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. - For ``"each"``, subviews will be aligned into a + clean grid structure, but each row or column may be of variable size. - For + ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: - the general (wrappable) ``concat`` operator (not + ``hconcat`` / ``vconcat`` ) - the ``facet`` and ``repeat`` operator with one + field/repetition definition (without row/column nesting) + + 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) + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + 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) + + +class FacetedUnitSpec(NormalizedSpec, Spec): + """FacetedUnitSpec schema wrapper + + Mapping(required=[mark]) + Unit spec that can have a composite mark and row or column channels (shorthand for a facet + spec). + + Attributes + ---------- + + mark : :class:`AnyMark` + A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, + ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and + ``"text"`` ) or a `mark definition object + `__. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. - For ``"each"``, subviews will be aligned into a + clean grid structure, but each row or column may be of variable size. - For + ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + data : anyOf(:class:`Data`, 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 of this mark for commenting purpose. + encoding : :class:`FacetedEncoding` + A key-value mapping between encoding channels and definition of fields. + height : anyOf(float, string, :class:`Step`) + The height of a visualization. + + + * For a plot with a continuous y-field, height should be a number. - For a plot with + either a discrete y-field or no y-field, 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. (No y-field is equivalent to having one discrete step.) - To + enable responsive sizing on height, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousHeight`` for a plot with a + continuous y-field and ``config.view.discreteHeight`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + height of a single view and the ``"container"`` option cannot be used. + + **See also:** `height `__ + documentation. + name : string + Name of the visualization for later reference. + projection : :class:`Projection` + 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` + Scale, axis, and legend resolutions for view composition specifications. + selection : Mapping(required=[]) + A key-value mapping between selection names and definitions. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + view : :class:`ViewBackground` + An object defining the view background's fill and stroke. + + **Default value:** none (transparent) + width : anyOf(float, string, :class:`Step`) + The width of a visualization. + + + * For a plot with a continuous x-field, width should be a number. - For a plot with + either a discrete x-field or no x-field, 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. (No x-field is equivalent to having one discrete step.) - To enable + responsive sizing on width, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousWidth`` for a plot with a + continuous x-field and ``config.view.discreteWidth`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view and the ``"container"`` option cannot be used. + + **See also:** `width `__ + 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, projection=Undefined, resolve=Undefined, selection=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, projection=projection, + resolve=resolve, selection=selection, spacing=spacing, + title=title, transform=transform, view=view, width=width, + **kwds) + + +class HConcatSpecGenericSpec(Spec): + """HConcatSpecGenericSpec schema wrapper + + Mapping(required=[hconcat]) + Base interface for a horizontal concatenation specification. + + Attributes + ---------- + + hconcat : List(:class:`Spec`) + A list of views to be concatenated and put into a row. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : boolean + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + **Default value:** ``false`` + data : anyOf(:class:`Data`, 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + 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 for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/HConcatSpec'} + + 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) + + +class LayerSpec(NormalizedSpec, Spec): + """LayerSpec schema wrapper + + Mapping(required=[layer]) + A full layered plot specification, which may contains ``encoding`` and ``projection`` + properties that will be applied to underlying unit (single-view) specifications. + + Attributes + ---------- + + layer : List(anyOf(:class:`LayerSpec`, :class:`UnitSpec`)) + 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 `__ and place a layer + inside a facet. + data : anyOf(:class:`Data`, 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 of this mark for commenting purpose. + encoding : :class:`SharedEncoding` + A shared key-value mapping between encoding channels and definition of fields in the + underlying layers. + height : anyOf(float, string, :class:`Step`) + The height of a visualization. + + + * For a plot with a continuous y-field, height should be a number. - For a plot with + either a discrete y-field or no y-field, 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. (No y-field is equivalent to having one discrete step.) - To + enable responsive sizing on height, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousHeight`` for a plot with a + continuous y-field and ``config.view.discreteHeight`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + height of a single view and the ``"container"`` option cannot be used. + + **See also:** `height `__ + documentation. + name : string + Name of the visualization for later reference. + projection : :class:`Projection` + An object defining properties of the geographic projection shared by underlying + layers. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + view : :class:`ViewBackground` + An object defining the view background's fill and stroke. + + **Default value:** none (transparent) + width : anyOf(float, string, :class:`Step`) + The width of a visualization. + + + * For a plot with a continuous x-field, width should be a number. - For a plot with + either a discrete x-field or no x-field, 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. (No x-field is equivalent to having one discrete step.) - To enable + responsive sizing on width, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousWidth`` for a plot with a + continuous x-field and ``config.view.discreteWidth`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view and the ``"container"`` option cannot be used. + + **See also:** `width `__ + 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) + + +class RepeatSpec(NormalizedSpec, Spec): + """RepeatSpec schema wrapper + + anyOf(:class:`NonLayerRepeatSpec`, :class:`LayerRepeatSpec`) + """ + _schema = {'$ref': '#/definitions/RepeatSpec'} + + def __init__(self, *args, **kwds): + super(RepeatSpec, self).__init__(*args, **kwds) + + +class LayerRepeatSpec(RepeatSpec): + """LayerRepeatSpec schema wrapper + + Mapping(required=[repeat, spec]) + + Attributes + ---------- + + repeat : :class:`LayerRepeatMapping` + 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 + number of columns to control the wrapping. 2) An object that maps ``"row"`` and/or + ``"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`) + 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 + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. - For ``"each"``, subviews will be aligned into a + clean grid structure, but each row or column may be of variable size. - For + ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: - the general (wrappable) ``concat`` operator (not + ``hconcat`` / ``vconcat`` ) - the ``facet`` and ``repeat`` operator with one + field/repetition definition (without row/column nesting) + + 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) + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + 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) + + +class NonLayerRepeatSpec(RepeatSpec): + """NonLayerRepeatSpec schema wrapper + + Mapping(required=[repeat, spec]) + Base interface for a repeat specification. + + Attributes + ---------- + + repeat : anyOf(List(string), :class:`RepeatMapping`) + 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 + number of columns to control the wrapping. 2) An object that maps ``"row"`` and/or + ``"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:`Spec` + 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 + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. - For ``"each"``, subviews will be aligned into a + clean grid structure, but each row or column may be of variable size. - For + ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: - the general (wrappable) ``concat`` operator (not + ``hconcat`` / ``vconcat`` ) - the ``facet`` and ``repeat`` operator with one + field/repetition definition (without row/column nesting) + + 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) + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + 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) + + +class SphereGenerator(Generator): + """SphereGenerator schema wrapper + + Mapping(required=[sphere]) + + Attributes + ---------- + + sphere : anyOf(boolean, Mapping(required=[])) + Generate sphere GeoJSON data for the full globe. + name : string + Provide a placeholder name and bind data at runtime. + """ + _schema = {'$ref': '#/definitions/SphereGenerator'} + + def __init__(self, sphere=Undefined, name=Undefined, **kwds): + super(SphereGenerator, self).__init__(sphere=sphere, name=name, **kwds) + + +class StackOffset(VegaLiteSchema): + """StackOffset schema wrapper + + enum('zero', 'center', 'normalize') + """ + _schema = {'$ref': '#/definitions/StackOffset'} + + def __init__(self, *args): + super(StackOffset, self).__init__(*args) + + +class StandardType(VegaLiteSchema): + """StandardType schema wrapper + + enum('quantitative', 'ordinal', 'temporal', 'nominal') + """ + _schema = {'$ref': '#/definitions/StandardType'} + + def __init__(self, *args): + super(StandardType, self).__init__(*args) + + +class Step(VegaLiteSchema): + """Step schema wrapper + + Mapping(required=[step]) + + Attributes + ---------- + + step : float + The size (width/height) per discrete step. + """ + _schema = {'$ref': '#/definitions/Step'} + + def __init__(self, step=Undefined, **kwds): + super(Step, self).__init__(step=step, **kwds) + + +class Stream(VegaLiteSchema): + """Stream schema wrapper + + anyOf(:class:`EventStream`, :class:`DerivedStream`, :class:`MergedStream`) + """ + _schema = {'$ref': '#/definitions/Stream'} + + def __init__(self, *args, **kwds): + super(Stream, self).__init__(*args, **kwds) + + +class DerivedStream(Stream): + """DerivedStream schema wrapper + + Mapping(required=[stream]) + + Attributes + ---------- + + stream : :class:`Stream` + + between : List(:class:`Stream`) + + consume : boolean + + debounce : float + + filter : anyOf(:class:`Expr`, List(:class:`Expr`)) + + markname : string + + marktype : :class:`MarkType` + + 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) + + +class EventStream(Stream): + """EventStream schema wrapper + + anyOf(Mapping(required=[type]), Mapping(required=[source, type])) + """ + _schema = {'$ref': '#/definitions/EventStream'} + + def __init__(self, *args, **kwds): + super(EventStream, self).__init__(*args, **kwds) + + +class MergedStream(Stream): + """MergedStream schema wrapper + + Mapping(required=[merge]) + + Attributes + ---------- + + merge : List(:class:`Stream`) + + between : List(:class:`Stream`) + + consume : boolean + + debounce : float + + filter : anyOf(:class:`Expr`, List(:class:`Expr`)) + + markname : string + + marktype : :class:`MarkType` + + 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) + + +class StringFieldDef(VegaLiteSchema): + """StringFieldDef schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"time"`` for temporal fields and ordinal and nominal fields + with ``timeUnit``. - ``"number"`` for quantitative fields as well as ordinal and + nominal fields without ``timeUnit``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/StringFieldDef'} + + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, field=Undefined, + format=Undefined, formatType=Undefined, labelExpr=Undefined, timeUnit=Undefined, + title=Undefined, type=Undefined, **kwds): + super(StringFieldDef, self).__init__(aggregate=aggregate, band=band, bin=bin, field=field, + format=format, formatType=formatType, labelExpr=labelExpr, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class StringFieldDefWithCondition(VegaLiteSchema): + """StringFieldDefWithCondition schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefstringExprRef`, + List(:class:`ConditionalValueDefstringExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"time"`` for temporal fields and ordinal and nominal fields + with ``timeUnit``. - ``"number"`` for quantitative fields as well as ordinal and + nominal fields without ``timeUnit``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/StringFieldDefWithCondition'} + + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(StringFieldDefWithCondition, self).__init__(aggregate=aggregate, band=band, bin=bin, + condition=condition, field=field, + format=format, formatType=formatType, + labelExpr=labelExpr, timeUnit=timeUnit, + title=title, type=type, **kwds) + + +class StringValueDefWithCondition(VegaLiteSchema): + """StringValueDefWithCondition schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ 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) + + +class StrokeCap(VegaLiteSchema): + """StrokeCap schema wrapper + + enum('butt', 'round', 'square') + """ + _schema = {'$ref': '#/definitions/StrokeCap'} + + def __init__(self, *args): + super(StrokeCap, self).__init__(*args) + + +class StrokeJoin(VegaLiteSchema): + """StrokeJoin schema wrapper + + enum('miter', 'round', 'bevel') + """ + _schema = {'$ref': '#/definitions/StrokeJoin'} + + def __init__(self, *args): + super(StrokeJoin, self).__init__(*args) + + +class StyleConfigIndex(VegaLiteSchema): + """StyleConfigIndex schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + arc : :class:`RectConfig` + Arc-specific Config + area : :class:`AreaConfig` + Area-Specific Config + bar : :class:`BarConfig` + Bar-Specific Config + circle : :class:`MarkConfig` + Circle-Specific Config + geoshape : :class:`MarkConfig` + Geoshape-Specific Config + image : :class:`RectConfig` + Image-specific Config + line : :class:`LineConfig` + Line-Specific Config + mark : :class:`MarkConfig` + Mark Config + point : :class:`MarkConfig` + Point-Specific Config + rect : :class:`RectConfig` + Rect-Specific Config + rule : :class:`MarkConfig` + Rule-Specific Config + square : :class:`MarkConfig` + Square-Specific Config + text : :class:`MarkConfig` + Text-Specific Config + tick : :class:`TickConfig` + Tick-Specific Config + trail : :class:`LineConfig` + Trail-Specific Config + group-subtitle : :class:`MarkConfig` + Default style for chart subtitles + group-title : :class:`MarkConfig` + Default style for chart titles + guide-label : :class:`MarkConfig` + Default style for axis, legend, and header labels. + guide-title : :class:`MarkConfig` + 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) + + +class SymbolShape(VegaLiteSchema): + """SymbolShape schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/SymbolShape'} + + def __init__(self, *args): + super(SymbolShape, self).__init__(*args) + + +class Text(VegaLiteSchema): + """Text schema wrapper + + anyOf(string, List(string)) + """ + _schema = {'$ref': '#/definitions/Text'} + + def __init__(self, *args, **kwds): + super(Text, self).__init__(*args, **kwds) + + +class TextBaseline(VegaLiteSchema): + """TextBaseline schema wrapper + + anyOf(string, :class:`Baseline`, string, string) + """ + _schema = {'$ref': '#/definitions/TextBaseline'} + + def __init__(self, *args, **kwds): + super(TextBaseline, self).__init__(*args, **kwds) + + +class Baseline(TextBaseline): + """Baseline schema wrapper + + enum('top', 'middle', 'bottom') + """ + _schema = {'$ref': '#/definitions/Baseline'} + + def __init__(self, *args): + super(Baseline, self).__init__(*args) + + +class TextDef(VegaLiteSchema): + """TextDef schema wrapper + + anyOf(:class:`FieldOrDatumDefWithConditionStringFieldDefText`, + :class:`FieldOrDatumDefWithConditionStringDatumDefText`, + :class:`ValueDefWithConditionStringFieldDefText`) + """ + _schema = {'$ref': '#/definitions/TextDef'} + + def __init__(self, *args, **kwds): + super(TextDef, self).__init__(*args, **kwds) + + +class FieldOrDatumDefWithConditionStringDatumDefText(TextDef): + """FieldOrDatumDefWithConditionStringDatumDefText schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + condition : anyOf(:class:`ConditionalValueDefTextExprRef`, + List(:class:`ConditionalValueDefTextExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + 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. + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"time"`` for temporal fields and ordinal and nominal fields + with ``timeUnit``. - ``"number"`` for quantitative fields as well as ordinal and + nominal fields without ``timeUnit``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} + + def __init__(self, band=Undefined, condition=Undefined, datum=Undefined, format=Undefined, + formatType=Undefined, labelExpr=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionStringDatumDefText, self).__init__(band=band, + condition=condition, + datum=datum, format=format, + formatType=formatType, + labelExpr=labelExpr, + type=type, **kwds) + + +class FieldOrDatumDefWithConditionStringFieldDefText(TextDef): + """FieldOrDatumDefWithConditionStringFieldDefText schema wrapper + + Mapping(required=[]) + A FieldDef with Condition :raw-html:`` { condition: {value: ...}, field: + ..., ... } + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + condition : anyOf(:class:`ConditionalValueDefTextExprRef`, + List(:class:`ConditionalValueDefTextExprRef`)) + One or more value definition(s) with `a selection or a test predicate + `__. + + **Note:** A field definition's ``condition`` property can only contain `conditional + value definitions `__ + since Vega-Lite only allows at most one encoded field per encoding channel. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + format : anyOf(string, :class:`Dictunknown`) + When used with the default ``"number"`` and ``"time"`` format type, the text + formatting pattern for labels of guides (axes, legends, headers) and text marks. + + + * If the format type is ``"number"`` (e.g., for quantitative fields), this is D3's + `number format pattern `__. - If + the format type is ``"time"`` (e.g., for temporal fields), this is D3's `time + format pattern `__. + + See the `format documentation `__ + for more examples. + + When used with a `custom formatType + `__, this + value will be passed as ``format`` alongside ``datum.value`` to the registered + function. + + **Default value:** Derived from `numberFormat + `__ config for number + format and from `timeFormat + `__ config for time + format. + formatType : string + The format type for labels. One of ``"number"``, ``"time"``, or a `registered custom + format type + `__. + + **Default value:** - ``"time"`` for temporal fields and ordinal and nominal fields + with ``timeUnit``. - ``"number"`` for quantitative fields as well as ordinal and + nominal fields without ``timeUnit``. + labelExpr : string + `Vega expression `__ for customizing + labels text. + + **Note:** The label text and value can be assessed via the ``label`` and ``value`` + properties of the axis's backing ``datum`` object. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/FieldOrDatumDefWithCondition'} + + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, condition=Undefined, + field=Undefined, format=Undefined, formatType=Undefined, labelExpr=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(FieldOrDatumDefWithConditionStringFieldDefText, self).__init__(aggregate=aggregate, + band=band, bin=bin, + condition=condition, + field=field, format=format, + formatType=formatType, + labelExpr=labelExpr, + timeUnit=timeUnit, + title=title, type=type, + **kwds) + + +class TextDirection(VegaLiteSchema): + """TextDirection schema wrapper + + enum('ltr', 'rtl') + """ + _schema = {'$ref': '#/definitions/TextDirection'} + + def __init__(self, *args): + super(TextDirection, self).__init__(*args) + + +class TickConfig(AnyMarkConfig): + """TickConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : anyOf(:class:`Align`, :class:`ExprRef`) + 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`) + + aria : anyOf(boolean, :class:`ExprRef`) + + ariaRole : anyOf(string, :class:`ExprRef`) + + ariaRoleDescription : anyOf(string, :class:`ExprRef`) + + aspect : anyOf(boolean, :class:`ExprRef`) + + 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`) + 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 + ``"line-bottom"`` values operate similarly to ``"top"`` and ``"bottom"``, but are + calculated relative to the ``lineHeight`` rather than ``fontSize`` alone. + + For range marks, the vertical alignment of the marks. One of ``"top"``, + ``"middle"``, ``"bottom"``. + + **Note:** Expression reference is *not* supported for range marks. + blend : anyOf(:class:`Blend`, :class:`ExprRef`) + + color : anyOf(:class:`Color`, :class:`Gradient`, :class:`ExprRef`) + Default color. + + **Default value:** :raw-html:`■` + ``"#4682b4"`` + + **Note:** - This property cannot be used in a `style config + `__. - The ``fill`` + and ``stroke`` properties have higher precedence than ``color`` and will override + ``color``. + cornerRadius : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusBottomRight : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopLeft : anyOf(float, :class:`ExprRef`) + + cornerRadiusTopRight : anyOf(float, :class:`ExprRef`) + + cursor : anyOf(:class:`Cursor`, :class:`ExprRef`) + + description : anyOf(string, :class:`ExprRef`) + + dir : anyOf(:class:`TextDirection`, :class:`ExprRef`) + + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + ellipsis : anyOf(string, :class:`ExprRef`) + + endAngle : anyOf(float, :class:`ExprRef`) + + fill : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + 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`) + + filled : boolean + 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 + as ``geoshape`` marks for `graticule + `__ data sources; + otherwise, ``true``. + + **Note:** This property cannot be used in a `style config + `__. + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + height : anyOf(float, :class:`ExprRef`) + + href : anyOf(:class:`URI`, :class:`ExprRef`) + + innerRadius : anyOf(float, :class:`ExprRef`) + The inner radius in pixels of arc marks. ``innerRadius`` is an alias for + ``radius2``. + interpolate : anyOf(:class:`Interpolate`, :class:`ExprRef`) + + invalid : enum('filter', None) + Defines how Vega-Lite should handle marks for invalid values ( ``null`` and ``NaN`` + ). - If set to ``"filter"`` (default), all data items with null values will be + skipped (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`) + + lineBreak : anyOf(string, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + 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) + 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` + The orientation of a non-stacked bar, tick, area, and line charts. The value is + either horizontal (default) or vertical. - For bar, rule and tick, this determines + whether the size of the bar and tick should be applied to x or y dimension. - For + area, this property determines the orient property of the Vega output. - For line + and trail marks, this property determines the sort order of the points in 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`) + The outer radius in pixels of arc marks. ``outerRadius`` is an alias for ``radius``. + padAngle : anyOf(float, :class:`ExprRef`) + + radius : anyOf(float, :class:`ExprRef`) + 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. + radius2 : anyOf(float, :class:`ExprRef`) + The secondary (inner) radius in pixels of arc marks. + shape : anyOf(anyOf(:class:`SymbolShape`, string), :class:`ExprRef`) + + size : anyOf(float, :class:`ExprRef`) + Default size for marks. - For ``point`` / ``circle`` / ``square``, this represents + the pixel area of the marks. Note that this value sets the area of the symbol; the + side lengths will increase with the square root of this value. - For ``bar``, this + represents the band size of the bar, in pixels. - For ``text``, this represents the + font size, in pixels. + + **Default value:** - ``30`` for point, circle, square marks; width/height's ``step`` + - ``2`` for bar marks with discrete dimensions; - ``5`` for bar marks with + continuous dimensions; - ``11`` for text marks. + smooth : anyOf(boolean, :class:`ExprRef`) + + startAngle : anyOf(float, :class:`ExprRef`) + + stroke : anyOf(:class:`Color`, :class:`Gradient`, None, :class:`ExprRef`) + 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`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOffset : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + tension : anyOf(float, :class:`ExprRef`) + + text : anyOf(:class:`Text`, :class:`ExprRef`) + + theta : anyOf(float, :class:`ExprRef`) + 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`) + The end angle of arc marks in radians. A value of 0 indicates up or “north”, + increasing values proceed clockwise. + thickness : float + Thickness of the tick mark. + + **Default value:** ``1`` + timeUnitBand : float + 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. + timeUnitBandPosition : float + Default relative band position for a time unit. If set to ``0``, the marks will be + positioned at the beginning of the time unit band step. If set to ``0.5``, the marks + will be positioned in the middle of the time unit band step. + tooltip : anyOf(float, string, boolean, :class:`TooltipContent`, :class:`ExprRef`, None) + The tooltip text string to show upon mouse hover or an object defining which fields + should the tooltip be derived from. + + + * If ``tooltip`` is ``true`` or ``{"content": "encoding"}``, then all fields from + ``encoding`` will be used. - If ``tooltip`` is ``{"content": "data"}``, then all + fields that appear in the highlighted data point will be used. - If set to + ``null`` or ``false``, then no tooltip will be used. + + See the `tooltip `__ + documentation for a detailed discussion about tooltip in Vega-Lite. + + **Default value:** ``null`` + url : anyOf(:class:`URI`, :class:`ExprRef`) + + width : anyOf(float, :class:`ExprRef`) + + x : anyOf(float, string, :class:`ExprRef`) + 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 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 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 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, timeUnitBand=Undefined, + timeUnitBandPosition=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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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`) + """ + _schema = {'$ref': '#/definitions/TickCount'} + + def __init__(self, *args, **kwds): + super(TickCount, self).__init__(*args, **kwds) + + +class TimeInterval(TickCount): + """TimeInterval schema wrapper + + enum('millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'year') + """ + _schema = {'$ref': '#/definitions/TimeInterval'} + + def __init__(self, *args): + super(TimeInterval, self).__init__(*args) + + +class TimeIntervalStep(TickCount): + """TimeIntervalStep schema wrapper + + Mapping(required=[interval, step]) + + Attributes + ---------- + + interval : :class:`TimeInterval` + + step : float + + """ + _schema = {'$ref': '#/definitions/TimeIntervalStep'} + + def __init__(self, interval=Undefined, step=Undefined, **kwds): + super(TimeIntervalStep, self).__init__(interval=interval, step=step, **kwds) + + +class TimeUnit(VegaLiteSchema): + """TimeUnit schema wrapper + + anyOf(:class:`SingleTimeUnit`, :class:`MultiTimeUnit`) + """ + _schema = {'$ref': '#/definitions/TimeUnit'} + + def __init__(self, *args, **kwds): + super(TimeUnit, self).__init__(*args, **kwds) + + +class MultiTimeUnit(TimeUnit): + """MultiTimeUnit schema wrapper + + anyOf(:class:`LocalMultiTimeUnit`, :class:`UtcMultiTimeUnit`) + """ + _schema = {'$ref': '#/definitions/MultiTimeUnit'} + + def __init__(self, *args, **kwds): + super(MultiTimeUnit, self).__init__(*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', + 'monthdatehoursminutesseconds', 'weekday', 'weeksdayhours', 'weekdayhoursminutes', + 'weekdayhoursminutesseconds', 'dayhours', 'dayhoursminutes', 'dayhoursminutesseconds', + 'hoursminutes', 'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds') + """ + _schema = {'$ref': '#/definitions/LocalMultiTimeUnit'} + + def __init__(self, *args): + super(LocalMultiTimeUnit, self).__init__(*args) + + +class SingleTimeUnit(TimeUnit): + """SingleTimeUnit schema wrapper + + anyOf(:class:`LocalSingleTimeUnit`, :class:`UtcSingleTimeUnit`) + """ + _schema = {'$ref': '#/definitions/SingleTimeUnit'} + + def __init__(self, *args, **kwds): + super(SingleTimeUnit, self).__init__(*args, **kwds) + + +class LocalSingleTimeUnit(SingleTimeUnit): + """LocalSingleTimeUnit schema wrapper + + enum('year', 'quarter', 'month', 'week', 'day', 'dayofyear', 'date', 'hours', 'minutes', + 'seconds', 'milliseconds') + """ + _schema = {'$ref': '#/definitions/LocalSingleTimeUnit'} + + def __init__(self, *args): + super(LocalSingleTimeUnit, self).__init__(*args) + + +class TimeUnitParams(VegaLiteSchema): + """TimeUnitParams schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + maxbins : float + 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` + Defines how date-time values should be binned. + utc : boolean + True to use UTC timezone. Equivalent to using a ``utc`` prefixed ``TimeUnit``. + """ + _schema = {'$ref': '#/definitions/TimeUnitParams'} + + def __init__(self, maxbins=Undefined, step=Undefined, unit=Undefined, utc=Undefined, **kwds): + super(TimeUnitParams, self).__init__(maxbins=maxbins, step=step, unit=unit, utc=utc, **kwds) + + +class TitleAnchor(VegaLiteSchema): + """TitleAnchor schema wrapper + + enum(None, 'start', 'middle', 'end') + """ + _schema = {'$ref': '#/definitions/TitleAnchor'} + + def __init__(self, *args): + super(TitleAnchor, self).__init__(*args) + + +class TitleConfig(VegaLiteSchema): + """TitleConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + align : :class:`Align` + Horizontal text alignment for title text. One of ``"left"``, ``"center"``, or + ``"right"``. + anchor : anyOf(:class:`TitleAnchor`, :class:`ExprRef`) + + angle : anyOf(float, :class:`ExprRef`) + + aria : anyOf(boolean, :class:`ExprRef`) + + baseline : :class:`TextBaseline` + 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`) + + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + frame : anyOf(anyOf(:class:`TitleFrame`, string), :class:`ExprRef`) + + limit : anyOf(float, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + offset : anyOf(float, :class:`ExprRef`) + + orient : anyOf(:class:`TitleOrient`, :class:`ExprRef`) + + subtitleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + subtitleFont : anyOf(string, :class:`ExprRef`) + + subtitleFontSize : anyOf(float, :class:`ExprRef`) + + subtitleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + subtitleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + subtitleLineHeight : anyOf(float, :class:`ExprRef`) + + subtitlePadding : anyOf(float, :class:`ExprRef`) + + zindex : anyOf(float, :class:`ExprRef`) + + """ + _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) + + +class TitleFrame(VegaLiteSchema): + """TitleFrame schema wrapper + + enum('bounds', 'group') + """ + _schema = {'$ref': '#/definitions/TitleFrame'} + + def __init__(self, *args): + super(TitleFrame, self).__init__(*args) + + +class TitleOrient(VegaLiteSchema): + """TitleOrient schema wrapper + + enum('none', 'left', 'right', 'top', 'bottom') + """ + _schema = {'$ref': '#/definitions/TitleOrient'} + + def __init__(self, *args): + super(TitleOrient, self).__init__(*args) + + +class TitleParams(VegaLiteSchema): + """TitleParams schema wrapper + + Mapping(required=[text]) + + Attributes + ---------- + + text : anyOf(:class:`Text`, :class:`ExprRef`) + The title text. + align : :class:`Align` + Horizontal text alignment for title text. One of ``"left"``, ``"center"``, or + ``"right"``. + anchor : :class:`TitleAnchor` + 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. + + **Default value:** ``"middle"`` for `single + `__ and `layered + `__ views. ``"start"`` for other + composite views. + + **Note:** `For now `__, ``anchor`` is + only customizable only for `single + `__ and `layered + `__ views. For other composite + views, ``anchor`` is always ``"start"``. + angle : anyOf(float, :class:`ExprRef`) + + aria : anyOf(boolean, :class:`ExprRef`) + + baseline : :class:`TextBaseline` + 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`) + + dx : anyOf(float, :class:`ExprRef`) + + dy : anyOf(float, :class:`ExprRef`) + + font : anyOf(string, :class:`ExprRef`) + + fontSize : anyOf(float, :class:`ExprRef`) + + fontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + fontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + frame : anyOf(anyOf(:class:`TitleFrame`, string), :class:`ExprRef`) + + limit : anyOf(float, :class:`ExprRef`) + + lineHeight : anyOf(float, :class:`ExprRef`) + + offset : anyOf(float, :class:`ExprRef`) + + orient : anyOf(:class:`TitleOrient`, :class:`ExprRef`) + + style : anyOf(string, List(string)) + A `mark style property `__ + to apply to the title text mark. + + **Default value:** ``"group-title"``. + subtitle : :class:`Text` + The subtitle Text. + subtitleColor : anyOf(anyOf(None, :class:`Color`), :class:`ExprRef`) + + subtitleFont : anyOf(string, :class:`ExprRef`) + + subtitleFontSize : anyOf(float, :class:`ExprRef`) + + subtitleFontStyle : anyOf(:class:`FontStyle`, :class:`ExprRef`) + + subtitleFontWeight : anyOf(:class:`FontWeight`, :class:`ExprRef`) + + subtitleLineHeight : anyOf(float, :class:`ExprRef`) + + subtitlePadding : anyOf(float, :class:`ExprRef`) + + zindex : 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/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) + + +class TooltipContent(VegaLiteSchema): + """TooltipContent schema wrapper + + Mapping(required=[content]) + + Attributes + ---------- + + content : enum('encoding', 'data') + + """ + _schema = {'$ref': '#/definitions/TooltipContent'} + + def __init__(self, content=Undefined, **kwds): + super(TooltipContent, self).__init__(content=content, **kwds) + + +class TopLevelSpec(VegaLiteSchema): + """TopLevelSpec schema wrapper + + anyOf(:class:`TopLevelUnitSpec`, :class:`TopLevelFacetSpec`, :class:`TopLevelLayerSpec`, + :class:`TopLevelRepeatSpec`, :class:`TopLevelNormalizedConcatSpecGenericSpec`, + :class:`TopLevelNormalizedVConcatSpecGenericSpec`, + :class:`TopLevelNormalizedHConcatSpecGenericSpec`) + 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'} + + def __init__(self, *args, **kwds): + super(TopLevelSpec, self).__init__(*args, **kwds) + + +class TopLevelFacetSpec(TopLevelSpec): + """TopLevelFacetSpec schema wrapper + + Mapping(required=[data, facet, spec]) + + Attributes + ---------- + + data : anyOf(:class:`Data`, 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`) + Definition for how to facet the data. One of: 1) `a field definition for faceting + the plot by one field + `__ 2) `An object that + maps row and column channels to their field definitions + `__ + spec : anyOf(:class:`LayerSpec`, :class:`UnitSpecWithFrame`) + A specification of the view that gets faceted. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. - For ``"each"``, subviews will be aligned into a + clean grid structure, but each row or column may be of variable size. - For + ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + 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`) + CSS color property to use as the background of the entire view. + + **Default value:** ``"white"`` + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: - the general (wrappable) ``concat`` operator (not + ``hconcat`` / ``vconcat`` ) - the ``facet`` and ``repeat`` operator with one + field/repetition definition (without row/column nesting) + + 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` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + datasets : :class:`Datasets` + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + padding : anyOf(:class:`Padding`, :class:`ExprRef`) + 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:`Parameter`) + Dynamic variables that parameterize a visualization. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : :class:`Dictunknown` + 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 + URL to `JSON schema `__ for a Vega-Lite specification. + Unless you have a reason to change this, use + ``https://vega.github.io/schema/vega-lite/v4.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) + + +class TopLevelLayerSpec(TopLevelSpec): + """TopLevelLayerSpec schema wrapper + + Mapping(required=[layer]) + + Attributes + ---------- + + layer : List(anyOf(:class:`LayerSpec`, :class:`UnitSpec`)) + 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 `__ and place a layer + inside a facet. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + 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`) + CSS color property to use as the background of the entire view. + + **Default value:** ``"white"`` + config : :class:`Config` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + data : anyOf(:class:`Data`, 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` + 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 of this mark for commenting purpose. + encoding : :class:`SharedEncoding` + A shared key-value mapping between encoding channels and definition of fields in the + underlying layers. + height : anyOf(float, string, :class:`Step`) + The height of a visualization. + + + * For a plot with a continuous y-field, height should be a number. - For a plot with + either a discrete y-field or no y-field, 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. (No y-field is equivalent to having one discrete step.) - To + enable responsive sizing on height, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousHeight`` for a plot with a + continuous y-field and ``config.view.discreteHeight`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + height of a single view and the ``"container"`` option cannot be used. + + **See also:** `height `__ + documentation. + name : string + Name of the visualization for later reference. + padding : anyOf(:class:`Padding`, :class:`ExprRef`) + 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:`Parameter`) + Dynamic variables that parameterize a visualization. + projection : :class:`Projection` + An object defining properties of the geographic projection shared by underlying + layers. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : :class:`Dictunknown` + 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` + An object defining the view background's fill and stroke. + + **Default value:** none (transparent) + width : anyOf(float, string, :class:`Step`) + The width of a visualization. + + + * For a plot with a continuous x-field, width should be a number. - For a plot with + either a discrete x-field or no x-field, 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. (No x-field is equivalent to having one discrete step.) - To enable + responsive sizing on width, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousWidth`` for a plot with a + continuous x-field and ``config.view.discreteWidth`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view and the ``"container"`` option cannot be used. + + **See also:** `width `__ + documentation. + $schema : string + URL to `JSON schema `__ for a Vega-Lite specification. + Unless you have a reason to change this, use + ``https://vega.github.io/schema/vega-lite/v4.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) + + +class TopLevelNormalizedConcatSpecGenericSpec(TopLevelSpec): + """TopLevelNormalizedConcatSpecGenericSpec schema wrapper + + Mapping(required=[concat]) + + Attributes + ---------- + + concat : List(:class:`NormalizedSpec`) + A list of views to be concatenated. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. - For ``"each"``, subviews will be aligned into a + clean grid structure, but each row or column may be of variable size. - For + ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + 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`) + CSS color property to use as the background of the entire view. + + **Default value:** ``"white"`` + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + columns : float + The number of columns to include in the view composition layout. + + **Default value** : ``undefined`` -- An infinite number of columns (a single row) + will be assumed. This is equivalent to ``hconcat`` (for ``concat`` ) and to using + the ``column`` channel (for ``facet`` and ``repeat`` ). + + **Note** : + + 1) This property is only for: - the general (wrappable) ``concat`` operator (not + ``hconcat`` / ``vconcat`` ) - the ``facet`` and ``repeat`` operator with one + field/repetition definition (without row/column nesting) + + 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` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + data : anyOf(:class:`Data`, 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` + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + padding : anyOf(:class:`Padding`, :class:`ExprRef`) + 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:`Parameter`) + Dynamic variables that parameterize a visualization. + resolve : :class:`Resolve` + Scale, axis, and legend resolutions for view composition specifications. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : :class:`Dictunknown` + 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 + URL to `JSON schema `__ for a Vega-Lite specification. + Unless you have a reason to change this, use + ``https://vega.github.io/schema/vega-lite/v4.json``. Setting the ``$schema`` + property allows automatic validation and autocomplete in editors that support JSON + schema. + """ + _schema = {'$ref': '#/definitions/TopLevelNormalizedConcatSpec'} + + 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(TopLevelNormalizedConcatSpecGenericSpec, 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 TopLevelNormalizedHConcatSpecGenericSpec(TopLevelSpec): + """TopLevelNormalizedHConcatSpecGenericSpec schema wrapper + + Mapping(required=[hconcat]) + + Attributes + ---------- + + hconcat : List(:class:`NormalizedSpec`) + A list of views to be concatenated and put into a row. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + 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`) + CSS color property to use as the background of the entire view. + + **Default value:** ``"white"`` + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : boolean + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + **Default value:** ``false`` + config : :class:`Config` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + data : anyOf(:class:`Data`, 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` + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + padding : anyOf(:class:`Padding`, :class:`ExprRef`) + 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:`Parameter`) + Dynamic variables that parameterize a visualization. + resolve : :class:`Resolve` + 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 for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : :class:`Dictunknown` + 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 + URL to `JSON schema `__ for a Vega-Lite specification. + Unless you have a reason to change this, use + ``https://vega.github.io/schema/vega-lite/v4.json``. Setting the ``$schema`` + property allows automatic validation and autocomplete in editors that support JSON + schema. + """ + _schema = {'$ref': '#/definitions/TopLevelNormalizedHConcatSpec'} + + 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(TopLevelNormalizedHConcatSpecGenericSpec, 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 TopLevelNormalizedVConcatSpecGenericSpec(TopLevelSpec): + """TopLevelNormalizedVConcatSpecGenericSpec schema wrapper + + Mapping(required=[vconcat]) + + Attributes + ---------- + + vconcat : List(:class:`NormalizedSpec`) + A list of views to be concatenated and put into a column. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + 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`) + CSS color property to use as the background of the entire view. + + **Default value:** ``"white"`` + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : boolean + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + **Default value:** ``false`` + config : :class:`Config` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + data : anyOf(:class:`Data`, 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` + 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + padding : anyOf(:class:`Padding`, :class:`ExprRef`) + 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:`Parameter`) + Dynamic variables that parameterize a visualization. + resolve : :class:`Resolve` + 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 for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : :class:`Dictunknown` + 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 + URL to `JSON schema `__ for a Vega-Lite specification. + Unless you have a reason to change this, use + ``https://vega.github.io/schema/vega-lite/v4.json``. Setting the ``$schema`` + property allows automatic validation and autocomplete in editors that support JSON + schema. + """ + _schema = {'$ref': '#/definitions/TopLevelNormalizedVConcatSpec'} + + 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(TopLevelNormalizedVConcatSpecGenericSpec, 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 TopLevelRepeatSpec(TopLevelSpec): + """TopLevelRepeatSpec schema wrapper + + anyOf(Mapping(required=[repeat, spec]), Mapping(required=[repeat, spec])) + """ + _schema = {'$ref': '#/definitions/TopLevelRepeatSpec'} + + def __init__(self, *args, **kwds): + super(TopLevelRepeatSpec, self).__init__(*args, **kwds) + + +class TopLevelUnitSpec(TopLevelSpec): + """TopLevelUnitSpec schema wrapper + + Mapping(required=[data, mark]) + + Attributes + ---------- + + data : anyOf(:class:`Data`, 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` + A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, + ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and + ``"text"`` ) or a `mark definition object + `__. + align : anyOf(:class:`LayoutAlign`, :class:`RowColLayoutAlign`) + The alignment to apply to grid rows and columns. The supported string values are + ``"all"``, ``"each"``, and ``"none"``. + + + * For ``"none"``, a flow layout will be used, in which adjacent subviews are simply + placed one after the other. - For ``"each"``, subviews will be aligned into a + clean grid structure, but each row or column may be of variable size. - For + ``"all"``, subviews will be aligned and each row or column will be sized + identically based on the maximum observed size. String values for this property + will be applied to both grid rows and columns. + + Alternatively, an object value of the form ``{"row": string, "column": string}`` can + be used to supply different alignments for rows and columns. + + **Default value:** ``"all"``. + autosize : anyOf(:class:`AutosizeType`, :class:`AutoSizeParams`) + 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`) + CSS color property to use as the background of the entire view. + + **Default value:** ``"white"`` + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : anyOf(boolean, :class:`RowColboolean`) + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + An object value of the form ``{"row": boolean, "column": boolean}`` can be used to + supply different centering values for rows and columns. + + **Default value:** ``false`` + config : :class:`Config` + Vega-Lite configuration object. This property can only be defined at the top-level + of a specification. + datasets : :class:`Datasets` + 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 of this mark for commenting purpose. + encoding : :class:`FacetedEncoding` + A key-value mapping between encoding channels and definition of fields. + height : anyOf(float, string, :class:`Step`) + The height of a visualization. + + + * For a plot with a continuous y-field, height should be a number. - For a plot with + either a discrete y-field or no y-field, 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. (No y-field is equivalent to having one discrete step.) - To + enable responsive sizing on height, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousHeight`` for a plot with a + continuous y-field and ``config.view.discreteHeight`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + height of a single view and the ``"container"`` option cannot be used. + + **See also:** `height `__ + documentation. + name : string + Name of the visualization for later reference. + padding : anyOf(:class:`Padding`, :class:`ExprRef`) + 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:`Parameter`) + Dynamic variables that parameterize a visualization. + projection : :class:`Projection` + 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` + Scale, axis, and legend resolutions for view composition specifications. + selection : Mapping(required=[]) + A key-value mapping between selection names and definitions. + spacing : anyOf(float, :class:`RowColnumber`) + 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. + + **Default value** : Depends on ``"spacing"`` property of `the view composition + configuration `__ ( + ``20`` by default) + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + usermeta : :class:`Dictunknown` + 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` + An object defining the view background's fill and stroke. + + **Default value:** none (transparent) + width : anyOf(float, string, :class:`Step`) + The width of a visualization. + + + * For a plot with a continuous x-field, width should be a number. - For a plot with + either a discrete x-field or no x-field, 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. (No x-field is equivalent to having one discrete step.) - To enable + responsive sizing on width, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousWidth`` for a plot with a + continuous x-field and ``config.view.discreteWidth`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view and the ``"container"`` option cannot be used. + + **See also:** `width `__ + documentation. + $schema : string + URL to `JSON schema `__ for a Vega-Lite specification. + Unless you have a reason to change this, use + ``https://vega.github.io/schema/vega-lite/v4.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, selection=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, + selection=selection, spacing=spacing, title=title, + transform=transform, usermeta=usermeta, view=view, + width=width, **kwds) + + +class TopoDataFormat(DataFormat): + """TopoDataFormat schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + feature : string + 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 + 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) + 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 + name, and the value to the desired data type (one of ``"number"``, ``"boolean"``, + ``"date"``, or null (do not parse the field)). For example, ``"parse": + {"modified_on": "date"}`` parses the ``modified_on`` field in each input record a + Date value. + + For ``"date"``, we parse data based using Javascript's `Date.parse() + `__. + For Specific date formats can be provided (e.g., ``{foo: "date:'%m%d%Y'"}`` ), using + the `d3-time-format syntax `__. + UTC date format parsing is supported similarly (e.g., ``{foo: "utc:'%m%d%Y'"}`` ). + See more about `UTC time + `__ + type : string + 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) + + +class Transform(VegaLiteSchema): + """Transform schema wrapper + + anyOf(:class:`AggregateTransform`, :class:`BinTransform`, :class:`CalculateTransform`, + :class:`DensityTransform`, :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`) + """ + _schema = {'$ref': '#/definitions/Transform'} + + def __init__(self, *args, **kwds): + super(Transform, self).__init__(*args, **kwds) + + +class AggregateTransform(Transform): + """AggregateTransform schema wrapper + + Mapping(required=[aggregate]) + + Attributes + ---------- + + aggregate : List(:class:`AggregatedFieldDef`) + Array of objects that define fields to aggregate. + groupby : List(:class:`FieldName`) + 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) + + +class BinTransform(Transform): + """BinTransform schema wrapper + + Mapping(required=[bin, field, as]) + + Attributes + ---------- + + bin : anyOf(boolean, :class:`BinParams`) + An object indicating bin properties, or simply ``true`` for using default bin + parameters. + field : :class:`FieldName` + The data field to bin. + as : anyOf(:class:`FieldName`, List(:class:`FieldName`)) + 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): + super(BinTransform, self).__init__(bin=bin, field=field, **kwds) + + +class CalculateTransform(Transform): + """CalculateTransform schema wrapper + + Mapping(required=[calculate, as]) + + Attributes + ---------- + + calculate : string + A `expression `__ + string. Use the variable ``datum`` to refer to the current data object. + as : :class:`FieldName` + The field for storing the computed formula value. + """ + _schema = {'$ref': '#/definitions/CalculateTransform'} + + def __init__(self, calculate=Undefined, **kwds): + super(CalculateTransform, self).__init__(calculate=calculate, **kwds) + + +class DensityTransform(Transform): + """DensityTransform schema wrapper + + Mapping(required=[density]) + + Attributes + ---------- + + density : :class:`FieldName` + 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 + A boolean flag indicating if the output values should be probability estimates + (false) or smoothed counts (true). + + **Default value:** ``false`` + cumulative : boolean + A boolean flag indicating whether to produce density estimates (false) or cumulative + density estimates (true). + + **Default value:** ``false`` + extent : List([float, 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`) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + maxsteps : float + The maximum number of samples to take along the extent domain for plotting the + density. + + **Default value:** ``200`` + minsteps : float + The minimum number of samples to take along the extent domain for plotting the + density. + + **Default value:** ``25`` + steps : float + The exact number of samples to take along the extent domain for plotting the + 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`, :class:`FieldName`]) + 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) + + +class FilterTransform(Transform): + """FilterTransform schema wrapper + + Mapping(required=[filter]) + + Attributes + ---------- + + filter : :class:`PredicateComposition` + The ``filter`` property must be a predication definition, which can take one of the + following forms: + + 1) an `expression `__ + string, where ``datum`` can be used to refer to the current data object. For + example, ``{filter: "datum.b2 > 60"}`` would make the output data includes only + items that have values in the field ``b2`` over 60. + + 2) one of the `field predicates + `__ : `equal + `__, `lt + `__, `lte + `__, `gt + `__, `gte + `__, `range + `__, `oneOf + `__, or + `valid `__, + + 3) a `selection predicate + `__, which + define the names of a selection that the data point should belong to (or a logical + composition of selections). + + 4) a `logical composition + `__ of (1), (2), + or (3). + """ + _schema = {'$ref': '#/definitions/FilterTransform'} + + def __init__(self, filter=Undefined, **kwds): + super(FilterTransform, self).__init__(filter=filter, **kwds) + + +class FlattenTransform(Transform): + """FlattenTransform schema wrapper + + Mapping(required=[flatten]) + + Attributes + ---------- + + flatten : List(:class:`FieldName`) + 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`) + 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): + super(FlattenTransform, self).__init__(flatten=flatten, **kwds) + + +class FoldTransform(Transform): + """FoldTransform schema wrapper + + Mapping(required=[fold]) + + Attributes + ---------- + + fold : List(:class:`FieldName`) + An array of data fields indicating the properties to fold. + as : List([:class:`FieldName`, :class:`FieldName`]) + 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): + super(FoldTransform, self).__init__(fold=fold, **kwds) + + +class ImputeTransform(Transform): + """ImputeTransform schema wrapper + + Mapping(required=[impute, key]) + + Attributes + ---------- + + impute : :class:`FieldName` + The data field for which the missing values should be imputed. + key : :class:`FieldName` + 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), anyOf(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 + rows preceding or following the current data object. For example, the value ``[-5, + 5]`` indicates that the window should include five objects preceding and five + objects following the current object. + + **Default value:** : ``[null, null]`` indicating that the window includes all + objects. + 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(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 + `__. + + If provided, this will be used in addition to the key values observed within the + input data. If not provided, the values will be derived from all unique values of + the ``key`` field. For ``impute`` in ``encoding``, the key field is the x-field if + the y-field is imputed, or vice versa. + + If there is no impute grouping, this property *must* be specified. + method : :class:`ImputeMethod` + The imputation method to use for the field value of imputed data objects. One of + ``"value"``, ``"mean"``, ``"median"``, ``"max"`` or ``"min"``. + + **Default value:** ``"value"`` + 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) + + +class JoinAggregateTransform(Transform): + """JoinAggregateTransform schema wrapper + + Mapping(required=[joinaggregate]) + + Attributes + ---------- + + joinaggregate : List(:class:`JoinAggregateFieldDef`) + The definition of the fields in the join aggregate, and what calculations to use. + groupby : List(:class:`FieldName`) + 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) + + +class LoessTransform(Transform): + """LoessTransform schema wrapper + + Mapping(required=[loess, on]) + + Attributes + ---------- + + loess : :class:`FieldName` + The data field of the dependent variable to smooth. + on : :class:`FieldName` + 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`) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + as : List([:class:`FieldName`, :class:`FieldName`]) + 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) + + +class LookupTransform(Transform): + """LookupTransform schema wrapper + + Mapping(required=[lookup, from]) + + Attributes + ---------- + + lookup : string + Key in primary data source. + default : string + The default value to use if lookup fails. + + **Default value:** ``null`` + as : anyOf(:class:`FieldName`, List(:class:`FieldName`)) + 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 + specified (those field names will be used); if ``from.fields`` has not been + specified, ``as`` must be a string. + + 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`) + Data source or selection for secondary data reference. + """ + _schema = {'$ref': '#/definitions/LookupTransform'} + + def __init__(self, lookup=Undefined, default=Undefined, **kwds): + super(LookupTransform, self).__init__(lookup=lookup, default=default, **kwds) + + +class PivotTransform(Transform): + """PivotTransform schema wrapper + + Mapping(required=[pivot, value]) + + Attributes + ---------- + + pivot : :class:`FieldName` + The data field to pivot on. The unique values of this field become new field names + in the output stream. + value : :class:`FieldName` + 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`) + 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 : string + 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) + + +class QuantileTransform(Transform): + """QuantileTransform schema wrapper + + Mapping(required=[quantile]) + + Attributes + ---------- + + quantile : :class:`FieldName` + The data field for which to perform quantile estimation. + groupby : List(:class:`FieldName`) + The data fields to group by. If not specified, a single group containing all data + objects will be used. + probs : List(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`, :class:`FieldName`]) + 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) + + +class RegressionTransform(Transform): + """RegressionTransform schema wrapper + + Mapping(required=[regression, on]) + + Attributes + ---------- + + on : :class:`FieldName` + The data field of the independent variable to use a predictor. + regression : :class:`FieldName` + The data field of the dependent variable to predict. + extent : List([float, 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`) + 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') + The functional form of the regression model. One of ``"linear"``, ``"log"``, + ``"exp"``, ``"pow"``, ``"quad"``, or ``"poly"``. + + **Default value:** ``"linear"`` + order : float + The polynomial order (number of coefficients) for the 'poly' method. + + **Default value:** ``3`` + params : boolean + 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 + intercept term and then including terms of increasing order) and an ``rSquared`` + value (indicating the total variance explained by the model). + + **Default value:** ``false`` + as : List([:class:`FieldName`, :class:`FieldName`]) + 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) + + +class SampleTransform(Transform): + """SampleTransform schema wrapper + + Mapping(required=[sample]) + + Attributes + ---------- + + sample : float + The maximum number of data objects to include in the sample. + + **Default value:** ``1000`` + """ + _schema = {'$ref': '#/definitions/SampleTransform'} + + def __init__(self, sample=Undefined, **kwds): + super(SampleTransform, self).__init__(sample=sample, **kwds) + + +class StackTransform(Transform): + """StackTransform schema wrapper + + Mapping(required=[stack, groupby, as]) + + Attributes + ---------- + + groupby : List(:class:`FieldName`) + The data fields to group by. + stack : :class:`FieldName` + The field which is stacked. + offset : enum('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`) + Field that determines the order of leaves in the stacked charts. + as : anyOf(:class:`FieldName`, List([:class:`FieldName`, :class:`FieldName`])) + 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) + + +class TimeUnitTransform(Transform): + """TimeUnitTransform schema wrapper + + Mapping(required=[timeUnit, field, as]) + + Attributes + ---------- + + field : :class:`FieldName` + The data field to apply time unit. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + The timeUnit. + as : :class:`FieldName` + The output field to write the timeUnit value. + """ + _schema = {'$ref': '#/definitions/TimeUnitTransform'} + + def __init__(self, field=Undefined, timeUnit=Undefined, **kwds): + super(TimeUnitTransform, self).__init__(field=field, timeUnit=timeUnit, **kwds) + + +class Type(VegaLiteSchema): + """Type schema wrapper + + enum('quantitative', 'ordinal', 'temporal', 'nominal', 'geojson') + Data type based on level of measurement + """ + _schema = {'$ref': '#/definitions/Type'} + + def __init__(self, *args): + super(Type, self).__init__(*args) + + +class TypeForShape(VegaLiteSchema): + """TypeForShape schema wrapper + + enum('nominal', 'ordinal', 'geojson') + """ + _schema = {'$ref': '#/definitions/TypeForShape'} + + def __init__(self, *args): + super(TypeForShape, self).__init__(*args) + + +class TypedFieldDef(VegaLiteSchema): + """TypedFieldDef schema wrapper + + Mapping(required=[]) + Definition object for a data field, its type and transformation of an encoding channel. + + Attributes + ---------- + + aggregate : :class:`Aggregate` + Aggregation function for the field (e.g., ``"mean"``, ``"sum"``, ``"median"``, + ``"min"``, ``"max"``, ``"count"`` ). + + **Default value:** ``undefined`` (None) + + **See also:** `aggregate `__ + documentation. + band : float + For rect-based marks ( ``rect``, ``bar``, and ``image`` ), mark size relative to + bandwidth of `band scales + `__, bins or time units. If + set to ``1``, the mark size is set to the bandwidth, the bin interval, or the time + unit interval. If set to ``0.5``, the mark size is half of the bandwidth or the time + unit interval. + + For other marks, relative position on a band of a stacked, binned, time unit or band + scale. If set to ``0``, the marks will be positioned at the beginning of the band. + If set to ``0.5``, the marks will be positioned in the middle of the band. + bin : anyOf(boolean, :class:`BinParams`, string, None) + A flag for binning a ``quantitative`` field, `an object defining binning parameters + `__, or indicating that the + data for ``x`` or ``y`` channel are binned before they are imported into Vega-Lite ( + ``"binned"`` ). + + + If ``true``, default `binning parameters + `__ will be applied. + + If ``"binned"``, this indicates that the data for the ``x`` (or ``y`` ) channel are + already binned. You can map the bin-start field to ``x`` (or ``y`` ) and the bin-end + field to ``x2`` (or ``y2`` ). The scale and axis will be formatted similar to + binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also + set the axis's `tickMinStep + `__ property. + + **Default value:** ``false`` + + **See also:** `bin `__ + documentation. + field : :class:`Field` + **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 + `__ operator. + + **See also:** `field `__ + documentation. + + **Notes:** 1) Dots ( ``.`` ) and brackets ( ``[`` and ``]`` ) can be used to access + nested objects (e.g., ``"field": "foo.bar"`` and ``"field": "foo['bar']"`` ). If + field names contain dots or brackets but are not nested, you can use ``\\`` to + escape dots and brackets (e.g., ``"a\\.b"`` and ``"a\\[0\\]"`` ). See more details + about escaping in the `field documentation + `__. 2) ``field`` is not required + if ``aggregate`` is ``count``. + timeUnit : anyOf(:class:`TimeUnit`, :class:`TimeUnitParams`) + Time unit (e.g., ``year``, ``yearmonth``, ``month``, ``hours`` ) for a temporal + field. or `a temporal field that gets casted as ordinal + `__. + + **Default value:** ``undefined`` (None) + + **See also:** `timeUnit `__ + documentation. + 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 + `__ property in + the `config `__ or `fieldTitle + function via the compile function's options + `__. + + 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` + 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' + `__. + + 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 + has no specified ``aggregate`` (except ``argmin`` and ``argmax`` ), ``bin``, scale + type, custom ``sort`` order, nor ``timeUnit`` or (2) if you wish to use an ordinal + scale for a field with ``bin`` or ``timeUnit``. + + **Default value:** + + 1) For a data ``field``, ``"nominal"`` is the default data type unless the field + encoding has ``aggregate``, ``channel``, ``bin``, scale type, ``sort``, or + ``timeUnit`` that satisfies the following criteria: - ``"quantitative"`` is the + default type if (1) the encoded field contains ``bin`` or ``aggregate`` except + ``"argmin"`` and ``"argmax"``, (2) the encoding channel is ``latitude`` or + ``longitude`` channel or (3) if the specified scale type is `a quantitative scale + `__. - ``"temporal"`` is the + default type if (1) the encoded field contains ``timeUnit`` or (2) the specified + scale type is a time or utc scale - ``ordinal""`` is the default type if (1) the + encoded field contains a `custom sort order + `__, + (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 + `__ + + **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 `__, the + ``type`` property can be either ``"quantitative"`` (for using a linear bin scale) or + `"ordinal" (for using an ordinal bin scale) + `__. - When using with + `timeUnit `__, the ``type`` + property can be either ``"temporal"`` (default, for using a temporal scale) or + `"ordinal" (for using an ordinal scale) + `__. - When using with + `aggregate `__, 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 `__ + documentation. + """ + _schema = {'$ref': '#/definitions/TypedFieldDef'} + + def __init__(self, aggregate=Undefined, band=Undefined, bin=Undefined, field=Undefined, + timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): + super(TypedFieldDef, self).__init__(aggregate=aggregate, band=band, bin=bin, field=field, + timeUnit=timeUnit, title=title, type=type, **kwds) + + +class URI(VegaLiteSchema): + """URI schema wrapper + + string + """ + _schema = {'$ref': '#/definitions/URI'} + + def __init__(self, *args): + super(URI, self).__init__(*args) + + +class UnitSpec(VegaLiteSchema): + """UnitSpec schema wrapper + + Mapping(required=[mark]) + A unit specification, which can contain either `primitive marks or composite marks + `__. + + Attributes + ---------- + + mark : :class:`AnyMark` + A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, + ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and + ``"text"`` ) or a `mark definition object + `__. + data : anyOf(:class:`Data`, 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 of this mark for commenting purpose. + encoding : :class:`Encoding` + A key-value mapping between encoding channels and definition of fields. + height : anyOf(float, string, :class:`Step`) + **Deprecated:** Please avoid using width in a unit spec that's a part of a layer + spec. + name : string + Name of the visualization for later reference. + projection : :class:`Projection` + 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. + selection : Mapping(required=[]) + A key-value mapping between selection names and definitions. + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + view : :class:`ViewBackground` + **Deprecated:** Please avoid using width in a unit spec that's a part of a layer + spec. + width : anyOf(float, string, :class:`Step`) + **Deprecated:** Please avoid using width in a unit spec that's a part of a layer + spec. + """ + _schema = {'$ref': '#/definitions/UnitSpec'} + + def __init__(self, mark=Undefined, data=Undefined, description=Undefined, encoding=Undefined, + height=Undefined, name=Undefined, projection=Undefined, selection=Undefined, + title=Undefined, transform=Undefined, view=Undefined, width=Undefined, **kwds): + super(UnitSpec, self).__init__(mark=mark, data=data, description=description, encoding=encoding, + height=height, name=name, projection=projection, + selection=selection, title=title, transform=transform, view=view, + width=width, **kwds) + + +class UnitSpecWithFrame(VegaLiteSchema): + """UnitSpecWithFrame schema wrapper + + Mapping(required=[mark]) + + Attributes + ---------- + + mark : :class:`AnyMark` + A string describing the mark type (one of ``"bar"``, ``"circle"``, ``"square"``, + ``"tick"``, ``"line"``, ``"area"``, ``"point"``, ``"rule"``, ``"geoshape"``, and + ``"text"`` ) or a `mark definition object + `__. + data : anyOf(:class:`Data`, 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 of this mark for commenting purpose. + encoding : :class:`Encoding` + A key-value mapping between encoding channels and definition of fields. + height : anyOf(float, string, :class:`Step`) + The height of a visualization. + + + * For a plot with a continuous y-field, height should be a number. - For a plot with + either a discrete y-field or no y-field, 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. (No y-field is equivalent to having one discrete step.) - To + enable responsive sizing on height, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousHeight`` for a plot with a + continuous y-field and ``config.view.discreteHeight`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + height of a single view and the ``"container"`` option cannot be used. + + **See also:** `height `__ + documentation. + name : string + Name of the visualization for later reference. + projection : :class:`Projection` + 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. + selection : Mapping(required=[]) + A key-value mapping between selection names and definitions. + title : anyOf(:class:`Text`, :class:`TitleParams`) + Title for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + view : :class:`ViewBackground` + An object defining the view background's fill and stroke. + + **Default value:** none (transparent) + width : anyOf(float, string, :class:`Step`) + The width of a visualization. + + + * For a plot with a continuous x-field, width should be a number. - For a plot with + either a discrete x-field or no x-field, 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. (No x-field is equivalent to having one discrete step.) - To enable + responsive sizing on width, it should be set to ``"container"``. + + **Default value:** Based on ``config.view.continuousWidth`` for a plot with a + continuous x-field and ``config.view.discreteWidth`` otherwise. + + **Note:** For plots with `row and column channels + `__, this represents the + width of a single view and the ``"container"`` option cannot be used. + + **See also:** `width `__ + documentation. + """ + _schema = {'$ref': '#/definitions/UnitSpecWithFrame'} + + def __init__(self, mark=Undefined, data=Undefined, description=Undefined, encoding=Undefined, + height=Undefined, name=Undefined, projection=Undefined, selection=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, + projection=projection, selection=selection, title=title, + transform=transform, view=view, width=width, **kwds) + + +class UrlData(DataSource): + """UrlData schema wrapper + + Mapping(required=[url]) + + Attributes + ---------- + + url : string + 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` + An object that specifies the format for parsing the data. + name : string + Provide a placeholder name and bind data at runtime. + """ + _schema = {'$ref': '#/definitions/UrlData'} + + def __init__(self, url=Undefined, format=Undefined, name=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', + '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/UtcMultiTimeUnit'} + + def __init__(self, *args): + super(UtcMultiTimeUnit, self).__init__(*args) + + +class UtcSingleTimeUnit(SingleTimeUnit): + """UtcSingleTimeUnit schema wrapper + + enum('utcyear', 'utcquarter', 'utcmonth', 'utcweek', 'utcday', 'utcdayofyear', 'utcdate', + 'utchours', 'utcminutes', 'utcseconds', 'utcmilliseconds') + """ + _schema = {'$ref': '#/definitions/UtcSingleTimeUnit'} + + def __init__(self, *args): + super(UtcSingleTimeUnit, self).__init__(*args) + + +class VConcatSpecGenericSpec(Spec): + """VConcatSpecGenericSpec schema wrapper + + Mapping(required=[vconcat]) + Base interface for a vertical concatenation specification. + + Attributes + ---------- + + vconcat : List(:class:`Spec`) + A list of views to be concatenated and put into a column. + bounds : enum('full', 'flush') + The bounds calculation method to use for determining the extent of a sub-plot. One + of ``full`` (the default) or ``flush``. + + + * If set to ``full``, the entire calculated bounds (including axes, title, and + legend) will be used. - If set to ``flush``, only the specified width and height + values for the sub-view will be used. The ``flush`` setting can be useful when + attempting to place sub-plots without axes or legends into a uniform grid + structure. + + **Default value:** ``"full"`` + center : boolean + Boolean flag indicating if subviews should be centered relative to their respective + rows or columns. + + **Default value:** ``false`` + data : anyOf(:class:`Data`, 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 of this mark for commenting purpose. + name : string + Name of the visualization for later reference. + resolve : :class:`Resolve` + 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 for the plot. + transform : List(:class:`Transform`) + An array of data transformations such as filter and new field calculation. + """ + _schema = {'$ref': '#/definitions/VConcatSpec'} + + 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): + """ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefGradientstringnullExprRef`, + List(:class:`ConditionalValueDefGradientstringnullExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(:class:`Gradient`, string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ValueDefWithConditionMarkPropFieldOrDatumDefGradientstringnull, self).__init__(condition=condition, + value=value, + **kwds) + + +class ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull(MarkPropDefstringnullTypeForShape, ShapeDef): + """ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDefTypeForShape`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDefWithCondition,(string|null)>'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ValueDefWithConditionMarkPropFieldOrDatumDefTypeForShapestringnull, self).__init__(condition=condition, + value=value, + **kwds) + + +class ValueDefWithConditionMarkPropFieldOrDatumDefnumber(MarkPropDefnumber, NumericMarkPropDef): + """ValueDefWithConditionMarkPropFieldOrDatumDefnumber schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberExprRef`, List(:class:`ConditionalValueDefnumberExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ValueDefWithConditionMarkPropFieldOrDatumDefnumber, self).__init__(condition=condition, + value=value, **kwds) + + +class ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray(MarkPropDefnumberArray, NumericArrayMarkPropDef): + """ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefnumberArrayExprRef`, + List(:class:`ConditionalValueDefnumberArrayExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(List(float), :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ValueDefWithConditionMarkPropFieldOrDatumDefnumberArray, self).__init__(condition=condition, + value=value, + **kwds) + + +class ValueDefWithConditionMarkPropFieldOrDatumDefstringnull(VegaLiteSchema): + """ValueDefWithConditionMarkPropFieldOrDatumDefstringnull schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalMarkPropFieldOrDatumDef`, + :class:`ConditionalValueDefstringnullExprRef`, + List(:class:`ConditionalValueDefstringnullExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(string, None, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ValueDefWithConditionMarkPropFieldOrDatumDefstringnull, self).__init__(condition=condition, + value=value, **kwds) + + +class ValueDefWithConditionStringFieldDefText(TextDef): + """ValueDefWithConditionStringFieldDefText schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + condition : anyOf(:class:`ConditionalStringFieldDef`, + :class:`ConditionalValueDefTextExprRef`, List(:class:`ConditionalValueDefTextExprRef`)) + A field definition or one or more value definition(s) with a selection predicate. + value : anyOf(:class:`Text`, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDefWithCondition'} + + def __init__(self, condition=Undefined, value=Undefined, **kwds): + super(ValueDefWithConditionStringFieldDefText, self).__init__(condition=condition, value=value, + **kwds) + + +class ValueDefnumber(VegaLiteSchema): + """ValueDefnumber schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : float + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDef'} + + def __init__(self, value=Undefined, **kwds): + super(ValueDefnumber, self).__init__(value=value, **kwds) + + +class ValueDefnumberExprRef(VegaLiteSchema): + """ValueDefnumberExprRef schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDef<(number|ExprRef)>'} + + def __init__(self, value=Undefined, **kwds): + super(ValueDefnumberExprRef, self).__init__(value=value, **kwds) + + +class ValueDefnumberwidthheightExprRef(VegaLiteSchema): + """ValueDefnumberwidthheightExprRef schema wrapper + + Mapping(required=[value]) + Definition object for a constant value (primitive value or gradient definition) of an + encoding channel. + + Attributes + ---------- + + value : anyOf(float, string, string, :class:`ExprRef`) + A constant value in visual domain (e.g., ``"red"`` / ``"#0099ff"`` / `gradient + definition `__ for color, + values between ``0`` to ``1`` for opacity). + """ + _schema = {'$ref': '#/definitions/ValueDef<(number|"width"|"height"|ExprRef)>'} + + def __init__(self, value=Undefined, **kwds): + super(ValueDefnumberwidthheightExprRef, self).__init__(value=value, **kwds) + + +class Vector2DateTime(SelectionInitInterval): + """Vector2DateTime schema wrapper + + List([:class:`DateTime`, :class:`DateTime`]) + """ + _schema = {'$ref': '#/definitions/Vector2'} + + def __init__(self, *args): + super(Vector2DateTime, self).__init__(*args) + + +class Vector2Vector2number(VegaLiteSchema): + """Vector2Vector2number schema wrapper + + List([:class:`Vector2number`, :class:`Vector2number`]) + """ + _schema = {'$ref': '#/definitions/Vector2>'} + + def __init__(self, *args): + super(Vector2Vector2number, self).__init__(*args) + + +class Vector2boolean(SelectionInitInterval): + """Vector2boolean schema wrapper + + List([boolean, boolean]) + """ + _schema = {'$ref': '#/definitions/Vector2'} + + def __init__(self, *args): + super(Vector2boolean, self).__init__(*args) + + +class Vector2number(SelectionInitInterval): + """Vector2number schema wrapper + + List([float, float]) + """ + _schema = {'$ref': '#/definitions/Vector2'} + + def __init__(self, *args): + super(Vector2number, self).__init__(*args) + + +class Vector2string(SelectionInitInterval): + """Vector2string schema wrapper + + List([string, string]) + """ + _schema = {'$ref': '#/definitions/Vector2'} + + def __init__(self, *args): + super(Vector2string, self).__init__(*args) + + +class Vector3number(VegaLiteSchema): + """Vector3number schema wrapper + + List([float, float, float]) + """ + _schema = {'$ref': '#/definitions/Vector3'} + + def __init__(self, *args): + super(Vector3number, self).__init__(*args) + + +class ViewBackground(VegaLiteSchema): + """ViewBackground schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + cornerRadius : anyOf(float, :class:`ExprRef`) + + cursor : :class:`Cursor` + The mouse cursor used over the view. Any valid `CSS cursor type + `__ can be used. + fill : anyOf(:class:`Color`, None, :class:`ExprRef`) + The fill color. + + **Default value:** ``undefined`` + fillOpacity : anyOf(float, :class:`ExprRef`) + + opacity : anyOf(float, :class:`ExprRef`) + 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`) + The stroke color. + + **Default value:** ``"#ddd"`` + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + style : anyOf(string, List(string)) + 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 + `__. If style is an + array, later styles will override earlier styles. + + **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) + + +class ViewConfig(VegaLiteSchema): + """ViewConfig schema wrapper + + Mapping(required=[]) + + Attributes + ---------- + + clip : boolean + 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 + arc marks. + + **Default value:** ``200`` + continuousWidth : float + The default width when the plot has a continuous field for x or longitude, or has + arc marks. + + **Default value:** ``200`` + cornerRadius : anyOf(float, :class:`ExprRef`) + + cursor : :class:`Cursor` + The mouse cursor used over the view. Any valid `CSS cursor type + `__ can be used. + discreteHeight : anyOf(float, Mapping(required=[step])) + 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])) + 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`) + The fill color. + + **Default value:** ``undefined`` + fillOpacity : anyOf(float, :class:`ExprRef`) + + height : float + Default height + + **Deprecated:** Since Vega-Lite 4.0. Please use continuousHeight and discreteHeight + instead. + opacity : anyOf(float, :class:`ExprRef`) + 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`) + The stroke color. + + **Default value:** ``"#ddd"`` + strokeCap : anyOf(:class:`StrokeCap`, :class:`ExprRef`) + + strokeDash : anyOf(List(float), :class:`ExprRef`) + + strokeDashOffset : anyOf(float, :class:`ExprRef`) + + strokeJoin : anyOf(:class:`StrokeJoin`, :class:`ExprRef`) + + strokeMiterLimit : anyOf(float, :class:`ExprRef`) + + strokeOpacity : anyOf(float, :class:`ExprRef`) + + strokeWidth : anyOf(float, :class:`ExprRef`) + + width : float + Default width + + **Deprecated:** Since Vega-Lite 4.0. Please use continuousWidth and discreteWidth + instead. + """ + _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, height=Undefined, + opacity=Undefined, step=Undefined, stroke=Undefined, strokeCap=Undefined, + strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, + strokeMiterLimit=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, + width=Undefined, **kwds): + super(ViewConfig, self).__init__(clip=clip, continuousHeight=continuousHeight, + continuousWidth=continuousWidth, cornerRadius=cornerRadius, + cursor=cursor, discreteHeight=discreteHeight, + discreteWidth=discreteWidth, fill=fill, + fillOpacity=fillOpacity, height=height, opacity=opacity, + step=step, stroke=stroke, strokeCap=strokeCap, + strokeDash=strokeDash, strokeDashOffset=strokeDashOffset, + strokeJoin=strokeJoin, strokeMiterLimit=strokeMiterLimit, + strokeOpacity=strokeOpacity, strokeWidth=strokeWidth, + width=width, **kwds) + + +class WindowEventType(VegaLiteSchema): + """WindowEventType schema wrapper + + anyOf(:class:`EventType`, string) + """ + _schema = {'$ref': '#/definitions/WindowEventType'} + + def __init__(self, *args, **kwds): + super(WindowEventType, self).__init__(*args, **kwds) + + +class EventType(WindowEventType): + """EventType schema wrapper + + enum('click', 'dblclick', 'dragenter', 'dragleave', 'dragover', 'keydown', 'keypress', + 'keyup', 'mousedown', 'mousemove', 'mouseout', 'mouseover', 'mouseup', 'mousewheel', + 'timer', 'touchend', 'touchmove', 'touchstart', 'wheel') + """ + _schema = {'$ref': '#/definitions/EventType'} + + def __init__(self, *args): + super(EventType, self).__init__(*args) + + +class WindowFieldDef(VegaLiteSchema): + """WindowFieldDef schema wrapper + + Mapping(required=[op, as]) + + Attributes + ---------- + + op : anyOf(:class:`AggregateOp`, :class:`WindowOnlyOp`) + 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 `__. + field : :class:`FieldName` + 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"``. + param : float + Parameter values for the window functions. Parameter values can be omitted for + operations that do not accept a parameter. + + See the list of all supported operations and their parameters `here + `__. + as : :class:`FieldName` + The output name for the window operation. + """ + _schema = {'$ref': '#/definitions/WindowFieldDef'} + + def __init__(self, op=Undefined, field=Undefined, param=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') + """ + _schema = {'$ref': '#/definitions/WindowOnlyOp'} + + def __init__(self, *args): + super(WindowOnlyOp, self).__init__(*args) + + +class WindowTransform(Transform): + """WindowTransform schema wrapper + + Mapping(required=[window]) + + Attributes + ---------- + + window : List(:class:`WindowFieldDef`) + The definition of the fields in the window, and what calculations to use. + frame : List(anyOf(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 + following the current data object. The default value is ``[null, 0]``, indicating + that the sliding window includes the current object and all preceding objects. The + value ``[-5, 5]`` indicates that the window should include five objects preceding + and five objects following the current object. Finally, ``[null, null]`` indicates + that the window frame should always include all data objects. If you this frame and + want to assign the same value to add objects, you can use the simpler `join + aggregate transform `__. + The only operators affected are the aggregation operations and the ``first_value``, + ``last_value``, and ``nth_value`` window operations. The other window operations are + not affected by this. + + **Default value:** : ``[null, 0]`` (includes the current object and all preceding + objects) + groupby : List(:class:`FieldName`) + The data fields for partitioning the data objects into separate windows. If + unspecified, all data points will be in a single window. + ignorePeers : boolean + 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 + defined by offset values only. This setting only affects those operations that + depend on the window frame, namely aggregation operations and the first_value, + last_value, and nth_value window operations. + + **Default value:** ``false`` + sort : List(:class:`SortField`) + 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) + diff --git a/runtime/Lib/site-packages/altair/vegalite/v4/schema/mixins.py b/runtime/Lib/site-packages/altair/vegalite/v4/schema/mixins.py new file mode 100644 index 0000000000000000000000000000000000000000..bb1860f2935056e5a7a7caf7ce3c776111dae454 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v4/schema/mixins.py @@ -0,0 +1,1318 @@ +# The contents of this file are automatically written by +# tools/generate_schema_wrapper.py. Do not modify directly. +from . import core +from altair.utils import use_signature +from altair.utils.schemapi import Undefined + + +class MarkMethodMixin(object): + """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, + 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, + timeUnitBand=Undefined, timeUnitBandPosition=Undefined, tooltip=Undefined, + url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, + xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, + **kwds): + """Set the chart's mark to 'arc' + + For information on additional arguments, 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, + 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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + 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, 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'area' + + For information on additional arguments, 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, + 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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + 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, + 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, + timeUnitBand=Undefined, timeUnitBandPosition=Undefined, tooltip=Undefined, + url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, + xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, + **kwds): + """Set the chart's mark to 'bar' + + For information on additional arguments, 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, + 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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + 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, 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'image' + + For information on additional arguments, 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, + 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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + 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, 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'line' + + For information on additional arguments, 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, + 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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + 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, 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'point' + + For information on additional arguments, 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, + 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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + 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, 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'rect' + + For information on additional arguments, 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, + 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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + 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, 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'rule' + + For information on additional arguments, 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, + 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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + 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, 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'text' + + For information on additional arguments, 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, + 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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + 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, 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'tick' + + For information on additional arguments, 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, + 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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + 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, 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'trail' + + For information on additional arguments, 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, + 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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + 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, 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, + y2Offset=Undefined, yOffset=Undefined, **kwds): + """Set the chart's mark to 'circle' + + For information on additional arguments, 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, + 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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + 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, 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, timeUnitBand=Undefined, timeUnitBandPosition=Undefined, + tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, + x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, + y2Offset=Undefined, yOffset=Undefined, **kwds): + """Set the chart's mark to 'square' + + For information on additional arguments, 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, + 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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + 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, 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, + timeUnitBand=Undefined, timeUnitBandPosition=Undefined, tooltip=Undefined, + url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, + xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, + yOffset=Undefined, **kwds): + """Set the chart's mark to 'geoshape' + + For information on additional arguments, 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, + 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, timeUnitBand=timeUnitBand, + timeUnitBandPosition=timeUnitBandPosition, 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) + 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, + median=Undefined, opacity=Undefined, orient=Undefined, outliers=Undefined, + rule=Undefined, size=Undefined, ticks=Undefined, **kwds): + """Set the chart's mark to 'boxplot' + + For information on additional arguments, see :class:`BoxPlotDef` + """ + kwds = dict(box=box, clip=clip, color=color, extent=extent, median=median, opacity=opacity, + orient=orient, outliers=outliers, rule=rule, size=size, ticks=ticks, **kwds) + copy = self.copy(deep=False) + 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): + """Set the chart's mark to 'errorbar' + + For information on additional arguments, 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) + 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): + """Set the chart's mark to 'errorband' + + For information on additional arguments, 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) + if any(val is not Undefined for val in kwds.values()): + copy.mark = core.ErrorBandDef(type="errorband", **kwds) + else: + copy.mark = "errorband" + return copy + + +class ConfigMethodMixin(object): + """A mixin class that defines config methods""" + + @use_signature(core.Config) + def configure(self, *args, **kwargs): + copy = self.copy(deep=False) + copy.config = core.Config(*args, **kwargs) + return copy + + @use_signature(core.RectConfig) + def configure_arc(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["arc"] = core.RectConfig(*args, **kwargs) + return copy + + @use_signature(core.AreaConfig) + def configure_area(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["area"] = core.AreaConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axis(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axis"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisBand(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisBand"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisBottom(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisBottom"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisDiscrete(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisDiscrete"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisLeft(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisLeft"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisPoint(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisPoint"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisQuantitative(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisQuantitative"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisRight(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisRight"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisTemporal(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisTemporal"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisTop(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisTop"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisX(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisX"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisXBand(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisXBand"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisXDiscrete(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisXDiscrete"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisXPoint(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisXPoint"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisXQuantitative(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisXQuantitative"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisXTemporal(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisXTemporal"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisY(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisY"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisYBand(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisYBand"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisYDiscrete(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisYDiscrete"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisYPoint(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisYPoint"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisYQuantitative(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisYQuantitative"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.AxisConfig) + def configure_axisYTemporal(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["axisYTemporal"] = core.AxisConfig(*args, **kwargs) + return copy + + @use_signature(core.BarConfig) + def configure_bar(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["bar"] = core.BarConfig(*args, **kwargs) + return copy + + @use_signature(core.BoxPlotConfig) + def configure_boxplot(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["boxplot"] = core.BoxPlotConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_circle(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["circle"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.CompositionConfig) + def configure_concat(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["concat"] = core.CompositionConfig(*args, **kwargs) + return copy + + @use_signature(core.ErrorBandConfig) + def configure_errorband(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["errorband"] = core.ErrorBandConfig(*args, **kwargs) + return copy + + @use_signature(core.ErrorBarConfig) + def configure_errorbar(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["errorbar"] = core.ErrorBarConfig(*args, **kwargs) + return copy + + @use_signature(core.CompositionConfig) + def configure_facet(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["facet"] = core.CompositionConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_geoshape(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["geoshape"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.HeaderConfig) + def configure_header(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["header"] = core.HeaderConfig(*args, **kwargs) + return copy + + @use_signature(core.HeaderConfig) + def configure_headerColumn(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["headerColumn"] = core.HeaderConfig(*args, **kwargs) + return copy + + @use_signature(core.HeaderConfig) + def configure_headerFacet(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["headerFacet"] = core.HeaderConfig(*args, **kwargs) + return copy + + @use_signature(core.HeaderConfig) + def configure_headerRow(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["headerRow"] = core.HeaderConfig(*args, **kwargs) + return copy + + @use_signature(core.RectConfig) + def configure_image(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["image"] = core.RectConfig(*args, **kwargs) + return copy + + @use_signature(core.LegendConfig) + def configure_legend(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["legend"] = core.LegendConfig(*args, **kwargs) + return copy + + @use_signature(core.LineConfig) + def configure_line(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["line"] = core.LineConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_mark(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["mark"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_point(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["point"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.ProjectionConfig) + def configure_projection(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["projection"] = core.ProjectionConfig(*args, **kwargs) + return copy + + @use_signature(core.RangeConfig) + def configure_range(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["range"] = core.RangeConfig(*args, **kwargs) + return copy + + @use_signature(core.RectConfig) + def configure_rect(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["rect"] = core.RectConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_rule(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["rule"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.ScaleConfig) + def configure_scale(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["scale"] = core.ScaleConfig(*args, **kwargs) + return copy + + @use_signature(core.SelectionConfig) + def configure_selection(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["selection"] = core.SelectionConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_square(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["square"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.MarkConfig) + def configure_text(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["text"] = core.MarkConfig(*args, **kwargs) + return copy + + @use_signature(core.TickConfig) + def configure_tick(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["tick"] = core.TickConfig(*args, **kwargs) + return copy + + @use_signature(core.TitleConfig) + def configure_title(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["title"] = core.TitleConfig(*args, **kwargs) + return copy + + @use_signature(core.LineConfig) + def configure_trail(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["trail"] = core.LineConfig(*args, **kwargs) + return copy + + @use_signature(core.ViewConfig) + def configure_view(self, *args, **kwargs): + copy = self.copy(deep=['config']) + if copy.config is Undefined: + copy.config = core.Config() + copy.config["view"] = core.ViewConfig(*args, **kwargs) + return copy \ No newline at end of file diff --git a/runtime/Lib/site-packages/altair/vegalite/v4/schema/vega-lite-schema.json b/runtime/Lib/site-packages/altair/vegalite/v4/schema/vega-lite-schema.json new file mode 100644 index 0000000000000000000000000000000000000000..dc73fa4aaa0cab7ab95c7e7ba09b16e64a8c7d29 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v4/schema/vega-lite-schema.json @@ -0,0 +1,32017 @@ +{ + "$ref": "#/definitions/TopLevelSpec", + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "Aggregate": { + "anyOf": [ + { + "$ref": "#/definitions/NonArgAggregateOp" + }, + { + "$ref": "#/definitions/ArgmaxDef" + }, + { + "$ref": "#/definitions/ArgminDef" + } + ] + }, + "AggregateOp": { + "enum": [ + "argmax", + "argmin", + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep" + ], + "type": "string" + }, + "AggregateTransform": { + "additionalProperties": false, + "properties": { + "aggregate": { + "description": "Array of objects that define fields to aggregate.", + "items": { + "$ref": "#/definitions/AggregatedFieldDef" + }, + "type": "array" + }, + "groupby": { + "description": "The data fields to group by. If not specified, a single group containing all data objects will be used.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + } + }, + "required": [ + "aggregate" + ], + "type": "object" + }, + "AggregatedFieldDef": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The output field names to use for each aggregated field." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "The data field for which to compute aggregate function. This is required for all aggregation operations except `\"count\"`." + }, + "op": { + "$ref": "#/definitions/AggregateOp", + "description": "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." + } + }, + "required": [ + "op", + "as" + ], + "type": "object" + }, + "Align": { + "enum": [ + "left", + "center", + "right" + ], + "type": "string" + }, + "AllSortString": { + "anyOf": [ + { + "$ref": "#/definitions/SortOrder" + }, + { + "$ref": "#/definitions/SortByChannel" + }, + { + "$ref": "#/definitions/SortByChannelDesc" + } + ] + }, + "AnyMark": { + "anyOf": [ + { + "$ref": "#/definitions/CompositeMark" + }, + { + "$ref": "#/definitions/CompositeMarkDef" + }, + { + "$ref": "#/definitions/Mark" + }, + { + "$ref": "#/definitions/MarkDef" + } + ] + }, + "AnyMarkConfig": { + "anyOf": [ + { + "$ref": "#/definitions/MarkConfig<>" + }, + { + "$ref": "#/definitions/AreaConfig" + }, + { + "$ref": "#/definitions/BarConfig" + }, + { + "$ref": "#/definitions/RectConfig" + }, + { + "$ref": "#/definitions/LineConfig" + }, + { + "$ref": "#/definitions/TickConfig" + } + ] + }, + "AreaConfig": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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 `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "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.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](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": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "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).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "endAngle": { + "anyOf": [ + { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`." + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"basis\"`: a B-spline, with control point duplication on the ends. - `\"basis-open\"`: an open B-spline; may not intersect the start or end. - `\"basis-closed\"`: a closed B-spline, as in a loop. - `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends. - `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points. - `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop. - `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline. - `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`). - If set to `\"filter\"` (default), all data items with null values will be skipped (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.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "line": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/OverlayMarkDef" + } + ], + "description": "A flag for overlaying line on top of area marks, or an object defining the properties of the overlayed lines.\n\n- If this value is an empty object (`{}`) or `true`, lines with default properties will be used.\n\n- If this value is `false`, no lines would be automatically added to area marks.\n\n__Default value:__ `false`." + }, + "lineBreak": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. - For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension. - For area, this property determines the orient property of the Vega output. - For line and trail marks, this property determines the sort order of the points in 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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "point": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/OverlayMarkDef" + }, + { + "const": "transparent", + "type": "string" + } + ], + "description": "A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points.\n\n- If this property is `\"transparent\"`, transparent points will be used (for enhancing tooltips and selections).\n\n- If this property is an empty object (`{}`) or `true`, filled points with default properties will be used.\n\n- If this property is `false`, no points would be automatically added to line or area marks.\n\n__Default value:__ `false`." + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties." + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default size for marks. - For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value. - For `bar`, this represents the band size of the bar, in pixels. - For `text`, this represents the font size, in pixels.\n\n__Default value:__ - `30` for point, circle, square marks; width/height's `step` - `2` for bar marks with discrete dimensions; - `5` for bar marks with continuous dimensions; - `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "startAngle": { + "anyOf": [ + { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "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.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tension": { + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- 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.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "timeUnitBand": { + "description": "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.", + "type": "number" + }, + "timeUnitBandPosition": { + "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used. - If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used. - If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "ArgmaxDef": { + "additionalProperties": false, + "properties": { + "argmax": { + "type": "string" + } + }, + "required": [ + "argmax" + ], + "type": "object" + }, + "ArgminDef": { + "additionalProperties": false, + "properties": { + "argmin": { + "type": "string" + } + }, + "required": [ + "argmin" + ], + "type": "object" + }, + "AutoSizeParams": { + "additionalProperties": false, + "properties": { + "contains": { + "description": "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 added. In contrast, the `\"padding\"` setting includes the padding within the view size calculations, such that the width and height settings indicate the **total** intended size of the view.\n\n__Default value__: `\"content\"`", + "enum": [ + "content", + "padding" + ], + "type": "string" + }, + "resize": { + "description": "A boolean flag indicating if autosize layout should be re-calculated on every view update.\n\n__Default value__: `false`", + "type": "boolean" + }, + "type": { + "$ref": "#/definitions/AutosizeType", + "description": "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 descriptions of each.\n\n__Default value__: `\"pad\"`" + } + }, + "type": "object" + }, + "AutosizeType": { + "enum": [ + "pad", + "none", + "fit", + "fit-x", + "fit-y" + ], + "type": "string" + }, + "Axis": { + "additionalProperties": false, + "properties": { + "aria": { + "anyOf": [ + { + "description": "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.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "bandPosition": { + "anyOf": [ + { + "description": "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.\n\n __Default value:__ `0.5`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domain": { + "anyOf": [ + { + "description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for the domain line's ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Color of axis domain line.\n\n__Default value:__ `\"gray\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainDash": { + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed domain lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainDashOffset": { + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the domain dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainOpacity": { + "anyOf": [ + { + "description": "Opacity of the axis domain line.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainWidth": { + "anyOf": [ + { + "description": "Stroke width of axis domain line\n\n__Default value:__ `1`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "format": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Dict" + } + ], + "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). - If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + }, + "formatType": { + "description": "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).\n\n__Default value:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "grid": { + "description": "A boolean flag indicating if grid lines should be included as part of the axis\n\n__Default value:__ `true` for [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous) that are not binned; otherwise, `false`.", + "type": "boolean" + }, + "gridCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for grid lines' ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gridColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Color of gridlines.\n\n__Default value:__ `\"lightGray\"`." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisColor" + } + ] + }, + "gridDash": { + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed grid lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumberArray" + } + ] + }, + "gridDashOffset": { + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the grid dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "gridOpacity": { + "anyOf": [ + { + "description": "The stroke opacity of grid (value between [0,1])\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "gridWidth": { + "anyOf": [ + { + "description": "The grid width, in pixels.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment of axis tick labels, overriding the default setting for the current axis orientation." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisLabelAlign" + } + ] + }, + "labelAngle": { + "anyOf": [ + { + "description": "The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline", + "description": "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." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisLabelBaseline" + } + ] + }, + "labelBound": { + "anyOf": [ + { + "description": "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 number, it specifies the pixel tolerance: the maximum amount by which a label bounding box may exceed the axis range.\n\n__Default value:__ `false`.", + "type": [ + "number", + "boolean" + ] + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the tick label, can be in hex color code or regular color name." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisColor" + } + ] + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the axis's backing `datum` object.", + "type": "string" + }, + "labelFlush": { + "description": "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 applied instead. If this property is a number, it also indicates the number of pixels by which to offset the first and last labels; for example, a value of 2 will flush-align the first and last labels and also push them 2 pixels outward from the center of the axis. The additional adjustment can sometimes help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`.", + "type": [ + "boolean", + "number" + ] + }, + "labelFlushOffset": { + "anyOf": [ + { + "description": "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.\n\n__Default value:__ `0`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFont": { + "anyOf": [ + { + "description": "The font of the tick label.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisString" + } + ] + }, + "labelFontSize": { + "anyOf": [ + { + "description": "The font size of the label, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style of the title." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisLabelFontStyle" + } + ] + }, + "labelFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "Font weight of axis tick labels." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisLabelFontWeight" + } + ] + }, + "labelLimit": { + "anyOf": [ + { + "description": "Maximum allowed pixel width of axis tick labels.\n\n__Default value:__ `180`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelLineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line label text or label text with `\"line-top\"` or `\"line-bottom\"` baseline.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelOffset": { + "anyOf": [ + { + "description": "Position offset in pixels to apply to labels, in addition to tickOffset.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelOpacity": { + "anyOf": [ + { + "description": "The opacity of the labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelOverlap": { + "anyOf": [ + { + "$ref": "#/definitions/LabelOverlap" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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 axes). If set to `\"greedy\"`, a linear scan of the labels is performed, removing any labels that overlaps with the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true` for non-nominal fields with non-log scales; `\"greedy\"` for log scales; otherwise `false`." + }, + "labelPadding": { + "anyOf": [ + { + "description": "The padding in pixels between labels and ticks.\n\n__Default value:__ `2`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelSeparation": { + "anyOf": [ + { + "description": "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.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labels": { + "anyOf": [ + { + "description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "maxExtent": { + "anyOf": [ + { + "description": "The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles.\n\n__Default value:__ `undefined`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "minExtent": { + "anyOf": [ + { + "description": "The minimum extent in pixels that axis ticks and labels should use. This determines a minimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "offset": { + "description": "The offset, in pixels, by which to displace the axis from the edge of the enclosing group or data rectangle.\n\n__Default value:__ derived from the [axis config](https://vega.github.io/vega-lite/docs/config.html#facet-scale-config)'s `offset` (`0` by default)", + "type": "number" + }, + "orient": { + "anyOf": [ + { + "$ref": "#/definitions/AxisOrient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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).\n\n__Default value:__ `\"bottom\"` for x-axes and `\"left\"` for y-axes." + }, + "position": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__Default value__: `0`" + }, + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "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 style is an array, later styles will override earlier styles.\n\n__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": [ + { + "description": "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", + "enum": [ + "center", + "extent" + ], + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for the tick lines' ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the axis's tick.\n\n__Default value:__ `\"gray\"`" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisColor" + } + ] + }, + "tickCount": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/TimeInterval" + }, + { + "$ref": "#/definitions/TimeIntervalStep" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\nFor scales of type `\"time\"` or `\"utc\"`, the tick count can instead be a time interval specifier. Legal string values are `\"millisecond\"`, `\"second\"`, `\"minute\"`, `\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, and `\"year\"`. Alternatively, an object-valued interval specifier of the form `{\"interval\": \"month\", \"step\": 3}` includes a desired number of interval steps. Here, ticks are generated for each quarter (Jan, Apr, Jul, Oct) boundary.\n\n__Default value__: Determine using a formula `ceil(width/40)` for x and `ceil(height/40)` for y.", + "minimum": 0 + }, + "tickDash": { + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed tick mark lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumberArray" + } + ] + }, + "tickDashOffset": { + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the tick mark dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "tickExtra": { + "anyOf": [ + { + "description": "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`.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickMinStep": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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": [ + { + "description": "Position offset in pixels to apply to ticks, labels, and gridlines.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickOpacity": { + "anyOf": [ + { + "description": "Opacity of the ticks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "tickRound": { + "anyOf": [ + { + "description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickSize": { + "anyOf": [ + { + "description": "The size in pixels of axis ticks.\n\n__Default value:__ `5`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "tickWidth": { + "anyOf": [ + { + "description": "The width, in pixels, of ticks.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "ticks": { + "anyOf": [ + { + "description": "Boolean value that determines whether the axis should include ticks.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "titleAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment of axis titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleAnchor": { + "anyOf": [ + { + "$ref": "#/definitions/TitleAnchor", + "description": "Text anchor position for placing axis titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleAngle": { + "anyOf": [ + { + "description": "Angle in degrees of axis titles.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline", + "description": "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." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Color of the title, can be in hex color code or regular color name." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFont": { + "anyOf": [ + { + "description": "Font of the title. (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontSize": { + "anyOf": [ + { + "description": "Font size of the title.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style of the title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleLimit": { + "anyOf": [ + { + "description": "Maximum allowed pixel width of axis titles.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleLineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleOpacity": { + "anyOf": [ + { + "description": "Opacity of the axis title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titlePadding": { + "anyOf": [ + { + "description": "The padding, in pixels, between title and axis.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleX": { + "anyOf": [ + { + "description": "X-coordinate of the axis title relative to the axis group.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleY": { + "anyOf": [ + { + "description": "Y-coordinate of the axis title relative to the axis group.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "translate": { + "anyOf": [ + { + "description": "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 adjustments may be undesirable, in which case translate can be changed (for example, to zero).\n\n__Default value:__ `0.5`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "values": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Explicitly set the visible axis tick values." + }, + "zindex": { + "description": "A non-negative integer indicating the z-index of the axis. If zindex is 0, axes should be drawn behind all chart elements. To put them in front, set `zindex` to `1` or more.\n\n__Default value:__ `0` (behind the marks).", + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "AxisConfig": { + "additionalProperties": false, + "properties": { + "aria": { + "anyOf": [ + { + "description": "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.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "bandPosition": { + "anyOf": [ + { + "description": "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.\n\n __Default value:__ `0.5`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "disable": { + "description": "Disable axis by default.", + "type": "boolean" + }, + "domain": { + "anyOf": [ + { + "description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for the domain line's ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Color of axis domain line.\n\n__Default value:__ `\"gray\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainDash": { + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed domain lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainDashOffset": { + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the domain dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainOpacity": { + "anyOf": [ + { + "description": "Opacity of the axis domain line.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "domainWidth": { + "anyOf": [ + { + "description": "Stroke width of axis domain line\n\n__Default value:__ `1`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "format": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Dict" + } + ], + "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). - If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + }, + "formatType": { + "description": "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).\n\n__Default value:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "grid": { + "description": "A boolean flag indicating if grid lines should be included as part of the axis\n\n__Default value:__ `true` for [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous) that are not binned; otherwise, `false`.", + "type": "boolean" + }, + "gridCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for grid lines' ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gridColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Color of gridlines.\n\n__Default value:__ `\"lightGray\"`." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisColor" + } + ] + }, + "gridDash": { + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed grid lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumberArray" + } + ] + }, + "gridDashOffset": { + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the grid dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "gridOpacity": { + "anyOf": [ + { + "description": "The stroke opacity of grid (value between [0,1])\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "gridWidth": { + "anyOf": [ + { + "description": "The grid width, in pixels.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment of axis tick labels, overriding the default setting for the current axis orientation." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisLabelAlign" + } + ] + }, + "labelAngle": { + "anyOf": [ + { + "description": "The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline", + "description": "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." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisLabelBaseline" + } + ] + }, + "labelBound": { + "anyOf": [ + { + "description": "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 number, it specifies the pixel tolerance: the maximum amount by which a label bounding box may exceed the axis range.\n\n__Default value:__ `false`.", + "type": [ + "number", + "boolean" + ] + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the tick label, can be in hex color code or regular color name." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisColor" + } + ] + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the axis's backing `datum` object.", + "type": "string" + }, + "labelFlush": { + "description": "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 applied instead. If this property is a number, it also indicates the number of pixels by which to offset the first and last labels; for example, a value of 2 will flush-align the first and last labels and also push them 2 pixels outward from the center of the axis. The additional adjustment can sometimes help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`.", + "type": [ + "boolean", + "number" + ] + }, + "labelFlushOffset": { + "anyOf": [ + { + "description": "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.\n\n__Default value:__ `0`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFont": { + "anyOf": [ + { + "description": "The font of the tick label.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisString" + } + ] + }, + "labelFontSize": { + "anyOf": [ + { + "description": "The font size of the label, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style of the title." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisLabelFontStyle" + } + ] + }, + "labelFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "Font weight of axis tick labels." + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisLabelFontWeight" + } + ] + }, + "labelLimit": { + "anyOf": [ + { + "description": "Maximum allowed pixel width of axis tick labels.\n\n__Default value:__ `180`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelLineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line label text or label text with `\"line-top\"` or `\"line-bottom\"` baseline.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelOffset": { + "anyOf": [ + { + "description": "Position offset in pixels to apply to labels, in addition to tickOffset.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelOpacity": { + "anyOf": [ + { + "description": "The opacity of the labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelOverlap": { + "anyOf": [ + { + "$ref": "#/definitions/LabelOverlap" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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 axes). If set to `\"greedy\"`, a linear scan of the labels is performed, removing any labels that overlaps with the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true` for non-nominal fields with non-log scales; `\"greedy\"` for log scales; otherwise `false`." + }, + "labelPadding": { + "anyOf": [ + { + "description": "The padding in pixels between labels and ticks.\n\n__Default value:__ `2`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "labelSeparation": { + "anyOf": [ + { + "description": "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.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labels": { + "anyOf": [ + { + "description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "maxExtent": { + "anyOf": [ + { + "description": "The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles.\n\n__Default value:__ `undefined`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "minExtent": { + "anyOf": [ + { + "description": "The minimum extent in pixels that axis ticks and labels should use. This determines a minimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "offset": { + "description": "The offset, in pixels, by which to displace the axis from the edge of the enclosing group or data rectangle.\n\n__Default value:__ derived from the [axis config](https://vega.github.io/vega-lite/docs/config.html#facet-scale-config)'s `offset` (`0` by default)", + "type": "number" + }, + "orient": { + "anyOf": [ + { + "$ref": "#/definitions/AxisOrient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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).\n\n__Default value:__ `\"bottom\"` for x-axes and `\"left\"` for y-axes." + }, + "position": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__Default value__: `0`" + }, + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "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 style is an array, later styles will override earlier styles.\n\n__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": [ + { + "description": "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", + "enum": [ + "center", + "extent" + ], + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for the tick lines' ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the axis's tick.\n\n__Default value:__ `\"gray\"`" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisColor" + } + ] + }, + "tickCount": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/TimeInterval" + }, + { + "$ref": "#/definitions/TimeIntervalStep" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\nFor scales of type `\"time\"` or `\"utc\"`, the tick count can instead be a time interval specifier. Legal string values are `\"millisecond\"`, `\"second\"`, `\"minute\"`, `\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, and `\"year\"`. Alternatively, an object-valued interval specifier of the form `{\"interval\": \"month\", \"step\": 3}` includes a desired number of interval steps. Here, ticks are generated for each quarter (Jan, Apr, Jul, Oct) boundary.\n\n__Default value__: Determine using a formula `ceil(width/40)` for x and `ceil(height/40)` for y.", + "minimum": 0 + }, + "tickDash": { + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed tick mark lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumberArray" + } + ] + }, + "tickDashOffset": { + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the tick mark dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "tickExtra": { + "anyOf": [ + { + "description": "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`.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickMinStep": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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": [ + { + "description": "Position offset in pixels to apply to ticks, labels, and gridlines.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickOpacity": { + "anyOf": [ + { + "description": "Opacity of the ticks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "tickRound": { + "anyOf": [ + { + "description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickSize": { + "anyOf": [ + { + "description": "The size in pixels of axis ticks.\n\n__Default value:__ `5`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "tickWidth": { + "anyOf": [ + { + "description": "The width, in pixels, of ticks.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ConditionalAxisNumber" + } + ] + }, + "ticks": { + "anyOf": [ + { + "description": "Boolean value that determines whether the axis should include ticks.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "titleAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment of axis titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleAnchor": { + "anyOf": [ + { + "$ref": "#/definitions/TitleAnchor", + "description": "Text anchor position for placing axis titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleAngle": { + "anyOf": [ + { + "description": "Angle in degrees of axis titles.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline", + "description": "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." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Color of the title, can be in hex color code or regular color name." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFont": { + "anyOf": [ + { + "description": "Font of the title. (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontSize": { + "anyOf": [ + { + "description": "Font size of the title.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style of the title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleLimit": { + "anyOf": [ + { + "description": "Maximum allowed pixel width of axis titles.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleLineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleOpacity": { + "anyOf": [ + { + "description": "Opacity of the axis title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titlePadding": { + "anyOf": [ + { + "description": "The padding, in pixels, between title and axis.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleX": { + "anyOf": [ + { + "description": "X-coordinate of the axis title relative to the axis group.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleY": { + "anyOf": [ + { + "description": "Y-coordinate of the axis title relative to the axis group.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "translate": { + "anyOf": [ + { + "description": "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 adjustments may be undesirable, in which case translate can be changed (for example, to zero).\n\n__Default value:__ `0.5`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "values": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Explicitly set the visible axis tick values." + }, + "zindex": { + "description": "A non-negative integer indicating the z-index of the axis. If zindex is 0, axes should be drawn behind all chart elements. To put them in front, set `zindex` to `1` or more.\n\n__Default value:__ `0` (behind the marks).", + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "AxisOrient": { + "enum": [ + "top", + "bottom", + "left", + "right" + ], + "type": "string" + }, + "AxisResolveMap": { + "additionalProperties": false, + "properties": { + "x": { + "$ref": "#/definitions/ResolveMode" + }, + "y": { + "$ref": "#/definitions/ResolveMode" + } + }, + "type": "object" + }, + "BarConfig": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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 `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "binSpacing": { + "description": "Offset between bars for binned field. The ideal value for this is either 0 (preferred by statisticians) or 1 (Vega-Lite default, D3 example style).\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "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.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](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`." + }, + "continuousBandSize": { + "description": "The default size of the bars on continuous scales.\n\n__Default value:__ `5`", + "minimum": 0, + "type": "number" + }, + "cornerRadius": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusEnd": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- For vertical bars, top-left and top-right corner radius. - For horizontal bars, top-right and bottom-right corner radius." + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "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).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "discreteBandSize": { + "description": "The default size of the bars with discrete dimensions. If unspecified, the default size is `step-2`, which provides 2 pixel offset between bars.", + "minimum": 0, + "type": "number" + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "endAngle": { + "anyOf": [ + { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`." + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"basis\"`: a B-spline, with control point duplication on the ends. - `\"basis-open\"`: an open B-spline; may not intersect the start or end. - `\"basis-closed\"`: a closed B-spline, as in a loop. - `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends. - `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points. - `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop. - `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline. - `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`). - If set to `\"filter\"` (default), all data items with null values will be skipped (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.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineBreak": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. - For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension. - For area, this property determines the orient property of the Vega output. - For line and trail marks, this property determines the sort order of the points in 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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties." + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default size for marks. - For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value. - For `bar`, this represents the band size of the bar, in pixels. - For `text`, this represents the font size, in pixels.\n\n__Default value:__ - `30` for point, circle, square marks; width/height's `step` - `2` for bar marks with discrete dimensions; - `5` for bar marks with continuous dimensions; - `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "startAngle": { + "anyOf": [ + { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "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.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tension": { + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- 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.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "timeUnitBand": { + "description": "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.", + "type": "number" + }, + "timeUnitBandPosition": { + "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used. - If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used. - If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "BaseTitleNoValueRefs": { + "additionalProperties": false, + "properties": { + "align": { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment for title text. One of `\"left\"`, `\"center\"`, or `\"right\"`." + }, + "anchor": { + "anyOf": [ + { + "$ref": "#/definitions/TitleAnchor", + "description": "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." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "angle": { + "anyOf": [ + { + "description": "Angle in degrees of title and subtitle text.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "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.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "baseline": { + "$ref": "#/definitions/TextBaseline", + "description": "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": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Text color for title text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dx": { + "anyOf": [ + { + "description": "Delta offset for title and subtitle text x-coordinate.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "Delta offset for title and subtitle text y-coordinate.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "font": { + "anyOf": [ + { + "description": "Font name for title text.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "Font size in pixels for title text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style for title text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "frame": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/TitleFrame" + }, + { + "type": "string" + } + ], + "description": "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)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum allowed length in pixels of title and subtitle text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "offset": { + "anyOf": [ + { + "description": "The orthogonal offset in pixels by which to displace the title group from its position along the edge of the chart.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "orient": { + "anyOf": [ + { + "$ref": "#/definitions/TitleOrient", + "description": "Default title orientation (`\"top\"`, `\"bottom\"`, `\"left\"`, or `\"right\"`)" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Text color for subtitle text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleFont": { + "anyOf": [ + { + "description": "Font name for subtitle text.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleFontSize": { + "anyOf": [ + { + "description": "Font size in pixels for subtitle text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style for subtitle text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleLineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line subtitle text.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitlePadding": { + "anyOf": [ + { + "description": "The padding in pixels between title and subtitle text.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "zindex": { + "anyOf": [ + { + "description": "The integer z-index indicating the layering of the title group relative to other axis, mark, and legend groups.\n\n__Default value:__ `0`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + } + }, + "type": "object" + }, + "Baseline": { + "enum": [ + "top", + "middle", + "bottom" + ], + "type": "string" + }, + "BinExtent": { + "anyOf": [ + { + "items": [ + { + "type": "number" + }, + { + "type": "number" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + { + "$ref": "#/definitions/SelectionExtent" + } + ] + }, + "BinParams": { + "additionalProperties": false, + "description": "Binning properties or boolean flag for determining whether to bin data or not.", + "properties": { + "anchor": { + "description": "A value in the binned domain at which to anchor the bins, shifting the bin boundaries if necessary to ensure that a boundary aligns with the anchor value.\n\n__Default value:__ the minimum bin extent value", + "type": "number" + }, + "base": { + "description": "The number base to use for automatic bin determination (default is base 10).\n\n__Default value:__ `10`", + "type": "number" + }, + "binned": { + "description": "When set to `true`, Vega-Lite treats the input data as already binned.", + "type": "boolean" + }, + "divide": { + "description": "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 method can check if bin sizes of 2 (= 10/5), 5 (= 10/2), or 1 (= 10/(5*2)) might also satisfy the given constraints.\n\n__Default value:__ `[5, 2]`", + "items": [ + { + "type": "number" + }, + { + "type": "number" + } + ], + "maxItems": 2, + "minItems": 1, + "type": "array" + }, + "extent": { + "$ref": "#/definitions/BinExtent", + "description": "A two-element (`[min, max]`) array indicating the range of desired bin values." + }, + "maxbins": { + "description": "Maximum number of bins.\n\n__Default value:__ `6` for `row`, `column` and `shape` channels; `10` for other channels", + "minimum": 2, + "type": "number" + }, + "minstep": { + "description": "A minimum allowable step size (particularly useful for integer values).", + "type": "number" + }, + "nice": { + "description": "If true, attempts to make the bin boundaries use human-friendly boundaries, such as multiples of ten.\n\n__Default value:__ `true`", + "type": "boolean" + }, + "step": { + "description": "An exact step size to use between bins.\n\n__Note:__ If provided, options such as maxbins will be ignored.", + "type": "number" + }, + "steps": { + "description": "An array of allowable step sizes to choose from.", + "items": { + "type": "number" + }, + "minItems": 1, + "type": "array" + } + }, + "type": "object" + }, + "BinTransform": { + "additionalProperties": false, + "properties": { + "as": { + "anyOf": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + } + ], + "description": "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\"`." + }, + "bin": { + "anyOf": [ + { + "const": true, + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + } + ], + "description": "An object indicating bin properties, or simply `true` for using default bin parameters." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "The data field to bin." + } + }, + "required": [ + "bin", + "field", + "as" + ], + "type": "object" + }, + "BindCheckbox": { + "additionalProperties": false, + "properties": { + "debounce": { + "type": "number" + }, + "element": { + "$ref": "#/definitions/Element" + }, + "input": { + "const": "checkbox", + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "input" + ], + "type": "object" + }, + "BindRadioSelect": { + "additionalProperties": false, + "properties": { + "debounce": { + "type": "number" + }, + "element": { + "$ref": "#/definitions/Element" + }, + "input": { + "enum": [ + "radio", + "select" + ], + "type": "string" + }, + "labels": { + "items": { + "type": "string" + }, + "type": "array" + }, + "name": { + "type": "string" + }, + "options": { + "items": { + }, + "type": "array" + }, + "type": { + "type": "string" + } + }, + "required": [ + "input", + "options" + ], + "type": "object" + }, + "BindRange": { + "additionalProperties": false, + "properties": { + "debounce": { + "type": "number" + }, + "element": { + "$ref": "#/definitions/Element" + }, + "input": { + "const": "range", + "type": "string" + }, + "max": { + "type": "number" + }, + "min": { + "type": "number" + }, + "name": { + "type": "string" + }, + "step": { + "type": "number" + }, + "type": { + "type": "string" + } + }, + "required": [ + "input" + ], + "type": "object" + }, + "Binding": { + "anyOf": [ + { + "$ref": "#/definitions/BindCheckbox" + }, + { + "$ref": "#/definitions/BindRadioSelect" + }, + { + "$ref": "#/definitions/BindRange" + }, + { + "$ref": "#/definitions/InputBinding" + } + ] + }, + "Blend": { + "enum": [ + null, + "multiply", + "screen", + "overlay", + "darken", + "lighten", + "color-dodge", + "color-burn", + "hard-light", + "soft-light", + "difference", + "exclusion", + "hue", + "saturation", + "color", + "luminosity" + ], + "type": [ + "null", + "string" + ] + }, + "BoxPlot": { + "const": "boxplot", + "type": "string" + }, + "BoxPlotConfig": { + "additionalProperties": false, + "properties": { + "box": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "extent": { + "anyOf": [ + { + "const": "min-max", + "type": "string" + }, + { + "type": "number" + } + ], + "description": "The extent of the whiskers. Available options include: - `\"min-max\"`: min and max are the lower and upper whiskers respectively. - A number representing multiple of the interquartile range. This number will be multiplied by the IQR to determine whisker boundary, which spans from the smallest data to the largest data within the range _[Q1 - k * IQR, Q3 + k * IQR]_ where _Q1_ and _Q3_ are the first and third quartiles while _IQR_ is the interquartile range (_Q3-Q1_).\n\n__Default value:__ `1.5`." + }, + "median": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "outliers": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "rule": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "size": { + "description": "Size of the box and median tick of a box plot", + "type": "number" + }, + "ticks": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + } + }, + "type": "object" + }, + "BoxPlotDef": { + "additionalProperties": false, + "properties": { + "box": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "clip": { + "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", + "type": "boolean" + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](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": [ + { + "const": "min-max", + "type": "string" + }, + { + "type": "number" + } + ], + "description": "The extent of the whiskers. Available options include: - `\"min-max\"`: min and max are the lower and upper whiskers respectively. - A number representing multiple of the interquartile range. This number will be multiplied by the IQR to determine whisker boundary, which spans from the smallest data to the largest data within the range _[Q1 - k * IQR, Q3 + k * IQR]_ where _Q1_ and _Q3_ are the first and third quartiles while _IQR_ is the interquartile range (_Q3-Q1_).\n\n__Default value:__ `1.5`." + }, + "median": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "opacity": { + "description": "The opacity (value between [0,1]) of the mark.", + "type": "number" + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "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.\n\n__Default value:__ `\"vertical\"`." + }, + "outliers": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "rule": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "size": { + "description": "Size of the box and median tick of a box plot", + "type": "number" + }, + "ticks": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "type": { + "$ref": "#/definitions/BoxPlot", + "description": "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\"`)." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "BrushConfig": { + "additionalProperties": false, + "properties": { + "cursor": { + "$ref": "#/definitions/Cursor", + "description": "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": { + "$ref": "#/definitions/Color", + "description": "The fill color of the interval mark.\n\n__Default value:__ `\"#333333\"`" + }, + "fillOpacity": { + "description": "The fill opacity of the interval mark (a value between `0` and `1`).\n\n__Default value:__ `0.125`", + "type": "number" + }, + "stroke": { + "$ref": "#/definitions/Color", + "description": "The stroke color of the interval mark.\n\n__Default value:__ `\"#ffffff\"`" + }, + "strokeDash": { + "description": "An array of alternating stroke and space lengths, for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "strokeDashOffset": { + "description": "The offset (in pixels) with which to begin drawing the stroke dash array.", + "type": "number" + }, + "strokeOpacity": { + "description": "The stroke opacity of the interval mark (a value between `0` and `1`).", + "type": "number" + }, + "strokeWidth": { + "description": "The stroke width of the interval mark.", + "type": "number" + } + }, + "type": "object" + }, + "CalculateTransform": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The field for storing the computed formula value." + }, + "calculate": { + "description": "A [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string. Use the variable `datum` to refer to the current data object.", + "type": "string" + } + }, + "required": [ + "calculate", + "as" + ], + "type": "object" + }, + "Categorical": { + "enum": [ + "accent", + "category10", + "category20", + "category20b", + "category20c", + "dark2", + "paired", + "pastel1", + "pastel2", + "set1", + "set2", + "set3", + "tableau10", + "tableau20" + ], + "type": "string" + }, + "Color": { + "anyOf": [ + { + "$ref": "#/definitions/ColorName" + }, + { + "$ref": "#/definitions/HexColor" + }, + { + "type": "string" + } + ] + }, + "ColorDef": { + "$ref": "#/definitions/MarkPropDef<(Gradient|string|null)>" + }, + "ColorName": { + "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", + "ghostwhite", + "gold", + "goldenrod", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "limegreen", + "linen", + "magenta", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "oldlace", + "olivedrab", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "whitesmoke", + "yellowgreen", + "rebeccapurple" + ], + "type": "string" + }, + "ColorScheme": { + "anyOf": [ + { + "$ref": "#/definitions/Categorical" + }, + { + "$ref": "#/definitions/SequentialSingleHue" + }, + { + "$ref": "#/definitions/SequentialMultiHue" + }, + { + "$ref": "#/definitions/Diverging" + }, + { + "$ref": "#/definitions/Cyclical" + } + ] + }, + "Encoding": { + "additionalProperties": false, + "properties": { + "angle": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Rotation angle of point and text marks." + }, + "color": { + "$ref": "#/definitions/ColorDef", + "description": "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\"`.\n\n__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.\n\n_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)." + }, + "description": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "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": [ + { + "$ref": "#/definitions/FieldDefWithoutScale" + }, + { + "items": { + "$ref": "#/definitions/FieldDefWithoutScale" + }, + "type": "array" + } + ], + "description": "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": { + "$ref": "#/definitions/ColorDef", + "description": "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.\n\n_Note:_ The `fill` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified." + }, + "fillOpacity": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Fill opacity of the marks.\n\n__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": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "A URL to load upon mouse click." + }, + "key": { + "$ref": "#/definitions/FieldDefWithoutScale", + "description": "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": { + "$ref": "#/definitions/LatLongDef", + "description": "Latitude position of geographically projected marks." + }, + "latitude2": { + "$ref": "#/definitions/Position2Def", + "description": "Latitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "longitude": { + "$ref": "#/definitions/LatLongDef", + "description": "Longitude position of geographically projected marks." + }, + "longitude2": { + "$ref": "#/definitions/Position2Def", + "description": "Longitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "opacity": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Opacity of the marks.\n\n__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": [ + { + "$ref": "#/definitions/OrderFieldDef" + }, + { + "items": { + "$ref": "#/definitions/OrderFieldDef" + }, + "type": "array" + }, + { + "$ref": "#/definitions/OrderValueDef" + } + ], + "description": "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.\n\n__Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating additional aggregation grouping." + }, + "radius": { + "$ref": "#/definitions/PolarDef", + "description": "The outer radius in pixels of arc marks." + }, + "radius2": { + "$ref": "#/definitions/Position2Def", + "description": "The inner radius in pixels of arc marks." + }, + "shape": { + "$ref": "#/definitions/ShapeDef", + "description": "Shape of the mark.\n\n1. 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.)\n\n2. For `geoshape` marks it should be a field definition of the geojson data\n\n__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": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "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": { + "$ref": "#/definitions/ColorDef", + "description": "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.\n\n_Note:_ The `stroke` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified." + }, + "strokeDash": { + "$ref": "#/definitions/NumericArrayMarkPropDef", + "description": "Stroke dash of the marks.\n\n__Default value:__ `[1,0]` (No dash)." + }, + "strokeOpacity": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Stroke opacity of the marks.\n\n__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": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Stroke width of the marks.\n\n__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": { + "$ref": "#/definitions/TextDef", + "description": "Text of the `text` mark." + }, + "theta": { + "$ref": "#/definitions/PolarDef", + "description": "- 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.)\n\n- For text marks, polar coordinate angle in radians." + }, + "theta2": { + "$ref": "#/definitions/Position2Def", + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + }, + { + "items": { + "$ref": "#/definitions/StringFieldDef" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "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).\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite." + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "The URL of an image mark." + }, + "x": { + "$ref": "#/definitions/PositionDef", + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "$ref": "#/definitions/Position2Def", + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "xError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ], + "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "xError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ], + "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "y": { + "$ref": "#/definitions/PositionDef", + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "$ref": "#/definitions/Position2Def", + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "yError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ], + "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "yError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ], + "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + } + }, + "type": "object" + }, + "CompositeMark": { + "anyOf": [ + { + "$ref": "#/definitions/BoxPlot" + }, + { + "$ref": "#/definitions/ErrorBar" + }, + { + "$ref": "#/definitions/ErrorBand" + } + ] + }, + "CompositeMarkDef": { + "anyOf": [ + { + "$ref": "#/definitions/BoxPlotDef" + }, + { + "$ref": "#/definitions/ErrorBarDef" + }, + { + "$ref": "#/definitions/ErrorBandDef" + } + ] + }, + "CompositionConfig": { + "additionalProperties": false, + "properties": { + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "spacing": { + "description": "The default spacing in pixels between composed sub-views.\n\n__Default value__: `20`", + "type": "number" + } + }, + "type": "object" + }, + "ConditionalMarkPropFieldOrDatumDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate" + }, + { + "$ref": "#/definitions/ConditionalSelection" + } + ] + }, + "ConditionalMarkPropFieldOrDatumDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalSelection>" + } + ] + }, + "ConditionalStringFieldDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate" + }, + { + "$ref": "#/definitions/ConditionalSelection" + } + ] + }, + "ConditionalValueDef<(Gradient|string|null|ExprRef)>": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalSelection>" + } + ] + }, + "ConditionalValueDef<(Text|ExprRef)>": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalSelection>" + } + ] + }, + "ConditionalValueDef<(number[]|ExprRef)>": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalSelection>" + } + ] + }, + "ConditionalValueDef<(number|ExprRef)>": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalSelection>" + } + ] + }, + "ConditionalValueDef<(string|ExprRef)>": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalSelection>" + } + ] + }, + "ConditionalValueDef<(string|null|ExprRef)>": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalSelection>" + } + ] + }, + "ConditionalValueDef": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate>" + }, + { + "$ref": "#/definitions/ConditionalSelection>" + } + ] + }, + "ConditionalAxisColor": { + "$ref": "#/definitions/ConditionalAxisProperty<(Color|null)>" + }, + "ConditionalAxisLabelAlign": { + "$ref": "#/definitions/ConditionalAxisProperty<(Align|null)>" + }, + "ConditionalAxisLabelBaseline": { + "$ref": "#/definitions/ConditionalAxisProperty<(TextBaseline|null)>" + }, + "ConditionalAxisLabelFontStyle": { + "$ref": "#/definitions/ConditionalAxisProperty<(FontStyle|null)>" + }, + "ConditionalAxisLabelFontWeight": { + "$ref": "#/definitions/ConditionalAxisProperty<(FontWeight|null)>" + }, + "ConditionalAxisNumber": { + "$ref": "#/definitions/ConditionalAxisProperty<(number|null)>" + }, + "ConditionalAxisNumberArray": { + "$ref": "#/definitions/ConditionalAxisProperty<(number[]|null)>" + }, + "ConditionalAxisProperty<(Align|null)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "type": "null" + } + ], + "description": "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)." + } + }, + "required": [ + "condition", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "condition", + "expr" + ], + "type": "object" + } + ] + }, + "ConditionalAxisProperty<(Color|null)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "type": "null" + } + ], + "description": "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)." + } + }, + "required": [ + "condition", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "condition", + "expr" + ], + "type": "object" + } + ] + }, + "ConditionalAxisProperty<(FontStyle|null)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle" + }, + { + "type": "null" + } + ], + "description": "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)." + } + }, + "required": [ + "condition", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "condition", + "expr" + ], + "type": "object" + } + ] + }, + "ConditionalAxisProperty<(FontWeight|null)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight" + }, + { + "type": "null" + } + ], + "description": "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)." + } + }, + "required": [ + "condition", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "condition", + "expr" + ], + "type": "object" + } + ] + }, + "ConditionalAxisProperty<(TextBaseline|null)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "type": "null" + } + ], + "description": "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)." + } + }, + "required": [ + "condition", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "condition", + "expr" + ], + "type": "object" + } + ] + }, + "ConditionalAxisProperty<(number[]|null)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "value": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "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)." + } + }, + "required": [ + "condition", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "condition", + "expr" + ], + "type": "object" + } + ] + }, + "ConditionalAxisProperty<(number|null)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "value": { + "description": "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).", + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "condition", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "condition", + "expr" + ], + "type": "object" + } + ] + }, + "ConditionalAxisProperty<(string|null)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "value": { + "description": "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).", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "condition", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>" + }, + "type": "array" + } + ] + }, + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "condition", + "expr" + ], + "type": "object" + } + ] + }, + "ConditionalAxisString": { + "$ref": "#/definitions/ConditionalAxisProperty<(string|null)>" + }, + "ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "type": "null" + } + ], + "description": "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)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + } + }, + "required": [ + "expr", + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "type": "null" + } + ], + "description": "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)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + } + }, + "required": [ + "expr", + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle" + }, + { + "type": "null" + } + ], + "description": "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)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + } + }, + "required": [ + "expr", + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight" + }, + { + "type": "null" + } + ], + "description": "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)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + } + }, + "required": [ + "expr", + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "type": "null" + } + ], + "description": "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)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + } + }, + "required": [ + "expr", + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "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)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + } + }, + "required": [ + "expr", + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "description": "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).", + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + } + }, + "required": [ + "expr", + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "description": "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).", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + } + }, + "required": [ + "expr", + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "test" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/TypeForShape", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "test" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "test" + ], + "type": "object" + } + ] + }, + "ConditionalPredicate": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Dict" + } + ], + "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). - If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + }, + "formatType": { + "description": "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).\n\n__Default value:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the axis's backing `datum` object.", + "type": "string" + }, + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "test" + ], + "type": "object" + }, + "ConditionalPredicate>": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalPredicate>": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalPredicate>": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalPredicate>": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalPredicate>": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalPredicate>": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalPredicate>": { + "additionalProperties": false, + "properties": { + "test": { + "$ref": "#/definitions/PredicateComposition", + "description": "Predicate for triggering the condition" + }, + "value": { + "description": "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).", + "type": "number" + } + }, + "required": [ + "test", + "value" + ], + "type": "object" + }, + "ConditionalSelection": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "selection" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "selection" + ], + "type": "object" + } + ] + }, + "ConditionalSelection>": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/TypeForShape", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "selection" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "legend": { + "anyOf": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "selection" + ], + "type": "object" + } + ] + }, + "ConditionalSelection": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Dict" + } + ], + "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). - If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + }, + "formatType": { + "description": "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).\n\n__Default value:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the axis's backing `datum` object.", + "type": "string" + }, + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "required": [ + "selection" + ], + "type": "object" + }, + "ConditionalSelection>": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "required": [ + "selection", + "value" + ], + "type": "object" + }, + "ConditionalSelection>": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "required": [ + "selection", + "value" + ], + "type": "object" + }, + "ConditionalSelection>": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "value": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "required": [ + "selection", + "value" + ], + "type": "object" + }, + "ConditionalSelection>": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "required": [ + "selection", + "value" + ], + "type": "object" + }, + "ConditionalSelection>": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "required": [ + "selection", + "value" + ], + "type": "object" + }, + "ConditionalSelection>": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "required": [ + "selection", + "value" + ], + "type": "object" + }, + "ConditionalSelection>": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "A [selection name](https://vega.github.io/vega-lite/docs/selection.html), or a series of [composed selections](https://vega.github.io/vega-lite/docs/selection.html#compose)." + }, + "value": { + "description": "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).", + "type": "number" + } + }, + "required": [ + "selection", + "value" + ], + "type": "object" + }, + "Config": { + "additionalProperties": false, + "properties": { + "arc": { + "$ref": "#/definitions/RectConfig", + "description": "Arc-specific Config" + }, + "area": { + "$ref": "#/definitions/AreaConfig", + "description": "Area-Specific Config" + }, + "aria": { + "description": "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.\n\n__Default value:__ `true`.", + "type": "boolean" + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "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.\n\n__Default value__: `pad`" + }, + "axis": { + "$ref": "#/definitions/AxisConfig", + "description": "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": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for axes with \"band\" scales." + }, + "axisBottom": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for x-axis along the bottom edge of the chart." + }, + "axisDiscrete": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for axes with \"point\" or \"band\" scales." + }, + "axisLeft": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for y-axis along the left edge of the chart." + }, + "axisPoint": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for axes with \"point\" scales." + }, + "axisQuantitative": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for quantitative axes." + }, + "axisRight": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for y-axis along the right edge of the chart." + }, + "axisTemporal": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for temporal axes." + }, + "axisTop": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for x-axis along the top edge of the chart." + }, + "axisX": { + "$ref": "#/definitions/AxisConfig", + "description": "X-axis specific config." + }, + "axisXBand": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for x-axes with \"band\" scales." + }, + "axisXDiscrete": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for x-axes with \"point\" or \"band\" scales." + }, + "axisXPoint": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for x-axes with \"point\" scales." + }, + "axisXQuantitative": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for x-quantitative axes." + }, + "axisXTemporal": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for x-temporal axes." + }, + "axisY": { + "$ref": "#/definitions/AxisConfig", + "description": "Y-axis specific config." + }, + "axisYBand": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for y-axes with \"band\" scales." + }, + "axisYDiscrete": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for y-axes with \"point\" or \"band\" scales." + }, + "axisYPoint": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for y-axes with \"point\" scales." + }, + "axisYQuantitative": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for y-quantitative axes." + }, + "axisYTemporal": { + "$ref": "#/definitions/AxisConfig", + "description": "Config for y-temporal axes." + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "bar": { + "$ref": "#/definitions/BarConfig", + "description": "Bar-Specific Config" + }, + "boxplot": { + "$ref": "#/definitions/BoxPlotConfig", + "description": "Box Config" + }, + "circle": { + "$ref": "#/definitions/MarkConfig", + "description": "Circle-Specific Config" + }, + "concat": { + "$ref": "#/definitions/CompositionConfig", + "description": "Default configuration for all concatenation and repeat view composition operators (`concat`, `hconcat`, `vconcat`, and `repeat`)" + }, + "countTitle": { + "description": "Default axis and legend title for count fields.\n\n__Default value:__ `'Count of Records`.", + "type": "string" + }, + "customFormatTypes": { + "description": "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).", + "type": "boolean" + }, + "errorband": { + "$ref": "#/definitions/ErrorBandConfig", + "description": "ErrorBand Config" + }, + "errorbar": { + "$ref": "#/definitions/ErrorBarConfig", + "description": "ErrorBar Config" + }, + "facet": { + "$ref": "#/definitions/CompositionConfig", + "description": "Default configuration for the `facet` view composition operator" + }, + "fieldTitle": { + "description": "Defines how Vega-Lite generates title for fields. There are three possible styles: - `\"verbal\"` (Default) - displays function in a verbal style (e.g., \"Sum of field\", \"Year-month of date\", \"field (binned)\"). - `\"function\"` - displays function using parentheses and capitalized texts (e.g., \"SUM(field)\", \"YEARMONTH(date)\", \"BIN(field)\"). - `\"plain\"` - displays only the field name without functions (e.g., \"field\", \"date\", \"field\").", + "enum": [ + "verbal", + "functional", + "plain" + ], + "type": "string" + }, + "font": { + "description": "Default font for all text marks, titles, and labels.", + "type": "string" + }, + "geoshape": { + "$ref": "#/definitions/MarkConfig", + "description": "Geoshape-Specific Config" + }, + "header": { + "$ref": "#/definitions/HeaderConfig", + "description": "Header configuration, which determines default properties for all [headers](https://vega.github.io/vega-lite/docs/header.html).\n\nFor 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": { + "$ref": "#/definitions/HeaderConfig", + "description": "Header configuration, which determines default properties for column [headers](https://vega.github.io/vega-lite/docs/header.html).\n\nFor 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": { + "$ref": "#/definitions/HeaderConfig", + "description": "Header configuration, which determines default properties for non-row/column facet [headers](https://vega.github.io/vega-lite/docs/header.html).\n\nFor 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": { + "$ref": "#/definitions/HeaderConfig", + "description": "Header configuration, which determines default properties for row [headers](https://vega.github.io/vega-lite/docs/header.html).\n\nFor 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": { + "$ref": "#/definitions/RectConfig", + "description": "Image-specific Config" + }, + "legend": { + "$ref": "#/definitions/LegendConfig", + "description": "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": { + "$ref": "#/definitions/LineConfig", + "description": "Line-Specific Config" + }, + "lineBreak": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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." + }, + "mark": { + "$ref": "#/definitions/MarkConfig", + "description": "Mark Config" + }, + "numberFormat": { + "description": "D3 Number format for guide labels and text marks. For example `\"s\"` for SI units. Use [D3's number format pattern](https://github.com/d3/d3-format#locale_format).", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" + }, + "point": { + "$ref": "#/definitions/MarkConfig", + "description": "Point-Specific Config" + }, + "projection": { + "$ref": "#/definitions/ProjectionConfig", + "description": "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": { + "$ref": "#/definitions/RangeConfig", + "description": "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": { + "$ref": "#/definitions/RectConfig", + "description": "Rect-Specific Config" + }, + "rule": { + "$ref": "#/definitions/MarkConfig", + "description": "Rule-Specific Config" + }, + "scale": { + "$ref": "#/definitions/ScaleConfig", + "description": "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": { + "$ref": "#/definitions/SelectionConfig", + "description": "An object hash for defining default properties for each type of selections." + }, + "square": { + "$ref": "#/definitions/MarkConfig", + "description": "Square-Specific Config" + }, + "style": { + "$ref": "#/definitions/StyleConfigIndex", + "description": "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": { + "$ref": "#/definitions/MarkConfig", + "description": "Text-Specific Config" + }, + "tick": { + "$ref": "#/definitions/TickConfig", + "description": "Tick-Specific Config" + }, + "timeFormat": { + "description": "Default time format for raw time values (without time units) in text marks, legend labels and header labels.\n\n__Default value:__ `\"%b %d, %Y\"` __Note:__ Axes automatically determine the format for each label automatically so this config does not affect axes.", + "type": "string" + }, + "title": { + "$ref": "#/definitions/TitleConfig", + "description": "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)." + }, + "trail": { + "$ref": "#/definitions/LineConfig", + "description": "Trail-Specific Config" + }, + "view": { + "$ref": "#/definitions/ViewConfig", + "description": "Default properties for [single view plots](https://vega.github.io/vega-lite/docs/spec.html#single)." + } + }, + "type": "object" + }, + "CsvDataFormat": { + "additionalProperties": false, + "properties": { + "parse": { + "anyOf": [ + { + "$ref": "#/definitions/Parse" + }, + { + "type": "null" + } + ], + "description": "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 name, and the value to the desired data type (one of `\"number\"`, `\"boolean\"`, `\"date\"`, or null (do not parse the field)). For example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each input record a Date value.\n\nFor `\"date\"`, we parse data based using Javascript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: \"date:'%m%d%Y'\"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). 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": { + "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\n\n__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.", + "enum": [ + "csv", + "tsv" + ], + "type": "string" + } + }, + "type": "object" + }, + "Cursor": { + "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" + ], + "type": "string" + }, + "Cyclical": { + "enum": [ + "rainbow", + "sinebow" + ], + "type": "string" + }, + "Data": { + "anyOf": [ + { + "$ref": "#/definitions/DataSource" + }, + { + "$ref": "#/definitions/Generator" + } + ] + }, + "DataFormat": { + "anyOf": [ + { + "$ref": "#/definitions/CsvDataFormat" + }, + { + "$ref": "#/definitions/DsvDataFormat" + }, + { + "$ref": "#/definitions/JsonDataFormat" + }, + { + "$ref": "#/definitions/TopoDataFormat" + } + ] + }, + "DataSource": { + "anyOf": [ + { + "$ref": "#/definitions/UrlData" + }, + { + "$ref": "#/definitions/InlineData" + }, + { + "$ref": "#/definitions/NamedData" + } + ] + }, + "Datasets": { + "$ref": "#/definitions/Dict" + }, + "DateTime": { + "additionalProperties": false, + "description": "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.", + "properties": { + "date": { + "description": "Integer value representing the date (day of the month) from 1-31.", + "maximum": 31, + "minimum": 1, + "type": "number" + }, + "day": { + "anyOf": [ + { + "$ref": "#/definitions/Day" + }, + { + "type": "string" + } + ], + "description": "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\"`).\n\n**Warning:** A DateTime definition object with `day`** should not be combined with `year`, `quarter`, `month`, or `date`." + }, + "hours": { + "description": "Integer value representing the hour of a day from 0-23.", + "maximum": 24, + "minimum": 0, + "type": "number" + }, + "milliseconds": { + "description": "Integer value representing the millisecond segment of time.", + "maximum": 1000, + "minimum": 0, + "type": "number" + }, + "minutes": { + "description": "Integer value representing the minute segment of time from 0-59.", + "maximum": 60, + "minimum": 0, + "type": "number" + }, + "month": { + "anyOf": [ + { + "$ref": "#/definitions/Month" + }, + { + "type": "string" + } + ], + "description": "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\"`)." + }, + "quarter": { + "description": "Integer value representing the quarter of the year (from 1-4).", + "maximum": 4, + "minimum": 1, + "type": "number" + }, + "seconds": { + "description": "Integer value representing the second segment (0-59) of a time value", + "maximum": 60, + "minimum": 0, + "type": "number" + }, + "utc": { + "description": "A boolean flag indicating if date time is in utc time. If false, the date time is in local time", + "type": "boolean" + }, + "year": { + "description": "Integer value representing the year.", + "type": "number" + } + }, + "type": "object" + }, + "DatumDef": { + "additionalProperties": false, + "properties": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "Day": { + "maximum": 7, + "minimum": 1, + "type": "number" + }, + "DensityTransform": { + "additionalProperties": false, + "properties": { + "as": { + "description": "The output fields for the sample value and corresponding density estimate.\n\n__Default value:__ `[\"value\", \"density\"]`", + "items": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "$ref": "#/definitions/FieldName" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "bandwidth": { + "description": "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.", + "type": "number" + }, + "counts": { + "description": "A boolean flag indicating if the output values should be probability estimates (false) or smoothed counts (true).\n\n__Default value:__ `false`", + "type": "boolean" + }, + "cumulative": { + "description": "A boolean flag indicating whether to produce density estimates (false) or cumulative density estimates (true).\n\n__Default value:__ `false`", + "type": "boolean" + }, + "density": { + "$ref": "#/definitions/FieldName", + "description": "The data field for which to perform density estimation." + }, + "extent": { + "description": "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.", + "items": [ + { + "type": "number" + }, + { + "type": "number" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "groupby": { + "description": "The data fields to group by. If not specified, a single group containing all data objects will be used.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "maxsteps": { + "description": "The maximum number of samples to take along the extent domain for plotting the density.\n\n__Default value:__ `200`", + "type": "number" + }, + "minsteps": { + "description": "The minimum number of samples to take along the extent domain for plotting the density.\n\n__Default value:__ `25`", + "type": "number" + }, + "steps": { + "description": "The exact number of samples to take along the extent domain for plotting the 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.", + "type": "number" + } + }, + "required": [ + "density" + ], + "type": "object" + }, + "DerivedStream": { + "additionalProperties": false, + "properties": { + "between": { + "items": { + "$ref": "#/definitions/Stream" + }, + "type": "array" + }, + "consume": { + "type": "boolean" + }, + "debounce": { + "type": "number" + }, + "filter": { + "anyOf": [ + { + "$ref": "#/definitions/Expr" + }, + { + "items": { + "$ref": "#/definitions/Expr" + }, + "type": "array" + } + ] + }, + "markname": { + "type": "string" + }, + "marktype": { + "$ref": "#/definitions/MarkType" + }, + "stream": { + "$ref": "#/definitions/Stream" + }, + "throttle": { + "type": "number" + } + }, + "required": [ + "stream" + ], + "type": "object" + }, + "Dict": { + "additionalProperties": { + "$ref": "#/definitions/InlineDataset" + }, + "type": "object" + }, + "Dict": { + "additionalProperties": { + "$ref": "#/definitions/SelectionInit" + }, + "type": "object" + }, + "Dict": { + "additionalProperties": { + "$ref": "#/definitions/SelectionInitInterval" + }, + "type": "object" + }, + "Dict": { + "additionalProperties": { + }, + "type": "object" + }, + "Diverging": { + "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" + ], + "type": "string" + }, + "DomainUnionWith": { + "additionalProperties": false, + "properties": { + "unionWith": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + } + ], + "description": "Customized domain values to be union with the field's values.\n\n1) `domain` for _quantitative_ fields can take one of the following forms:\n\n- a two-element array with minimum and maximum values. - an array with more than two entries, for [Piecewise quantitative scales](https://vega.github.io/vega-lite/docs/scale.html#piecewise). (Alternatively, the `domainMid` property can be set for a diverging scale.) - a string value `\"unaggregated\"`, if the input field is aggregated, to indicate that the domain should include the raw data values prior to the aggregation.\n\n2) `domain` for _temporal_ fields can be a two-element array minimum and maximum values, in the form of either timestamps or the [DateTime definition objects](https://vega.github.io/vega-lite/docs/types.html#datetime).\n\n3) `domain` for _ordinal_ and _nominal_ fields can be an array that lists valid input values." + } + }, + "required": [ + "unionWith" + ], + "type": "object" + }, + "DsvDataFormat": { + "additionalProperties": false, + "properties": { + "delimiter": { + "description": "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.", + "maxLength": 1, + "minLength": 1, + "type": "string" + }, + "parse": { + "anyOf": [ + { + "$ref": "#/definitions/Parse" + }, + { + "type": "null" + } + ], + "description": "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 name, and the value to the desired data type (one of `\"number\"`, `\"boolean\"`, `\"date\"`, or null (do not parse the field)). For example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each input record a Date value.\n\nFor `\"date\"`, we parse data based using Javascript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: \"date:'%m%d%Y'\"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). 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": { + "const": "dsv", + "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\n\n__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.", + "type": "string" + } + }, + "required": [ + "delimiter" + ], + "type": "object" + }, + "Element": { + "type": "string" + }, + "EncodingSortField": { + "additionalProperties": false, + "description": "A sort definition for sorting a discrete scale in an encoding field definition.", + "properties": { + "field": { + "$ref": "#/definitions/Field", + "description": "The data [field](https://vega.github.io/vega-lite/docs/field.html) to sort by.\n\n__Default value:__ If unspecified, defaults to the field specified in the outer data reference." + }, + "op": { + "$ref": "#/definitions/NonArgAggregateOp", + "description": "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 aggregation is required when there are multiple values of the sort field for each encoded data field. The input data objects will be aggregated, grouped by the encoded data field.\n\nFor a full list of operations, please see the documentation for [aggregate](https://vega.github.io/vega-lite/docs/aggregate.html#ops).\n\n__Default value:__ `\"sum\"` for stacked plots. Otherwise, `\"min\"`." + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/SortOrder" + }, + { + "type": "null" + } + ], + "description": "The sort order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." + } + }, + "type": "object" + }, + "EncodingSortField": { + "additionalProperties": false, + "description": "A sort definition for sorting a discrete scale in an encoding field definition.", + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "The data [field](https://vega.github.io/vega-lite/docs/field.html) to sort by.\n\n__Default value:__ If unspecified, defaults to the field specified in the outer data reference." + }, + "op": { + "$ref": "#/definitions/NonArgAggregateOp", + "description": "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 aggregation is required when there are multiple values of the sort field for each encoded data field. The input data objects will be aggregated, grouped by the encoded data field.\n\nFor a full list of operations, please see the documentation for [aggregate](https://vega.github.io/vega-lite/docs/aggregate.html#ops).\n\n__Default value:__ `\"sum\"` for stacked plots. Otherwise, `\"min\"`." + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/SortOrder" + }, + { + "type": "null" + } + ], + "description": "The sort order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." + } + }, + "type": "object" + }, + "ErrorBand": { + "const": "errorband", + "type": "string" + }, + "ErrorBandConfig": { + "additionalProperties": false, + "properties": { + "band": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "borders": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "extent": { + "$ref": "#/definitions/ErrorBarExtent", + "description": "The extent of the band. Available options include: - `\"ci\"`: Extend the band to the confidence interval of the mean. - `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean. - `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean. - `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method for the error band. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes at the midpoint of each pair of adjacent x-values. - `\"step-before\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes before the x-value. - `\"step-after\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes after the x-value. - `\"basis\"`: a B-spline, with control point duplication on the ends. - `\"basis-open\"`: an open B-spline; may not intersect the start or end. - `\"basis-closed\"`: a closed B-spline, as in a loop. - `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends. - `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points. - `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop. - `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline. - `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "tension": { + "description": "The tension parameter for the interpolation type of the error band.", + "maximum": 1, + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "ErrorBandDef": { + "additionalProperties": false, + "properties": { + "band": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "borders": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "clip": { + "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", + "type": "boolean" + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](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": { + "$ref": "#/definitions/ErrorBarExtent", + "description": "The extent of the band. Available options include: - `\"ci\"`: Extend the band to the confidence interval of the mean. - `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean. - `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean. - `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method for the error band. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes at the midpoint of each pair of adjacent x-values. - `\"step-before\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes before the x-value. - `\"step-after\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes after the x-value. - `\"basis\"`: a B-spline, with control point duplication on the ends. - `\"basis-open\"`: an open B-spline; may not intersect the start or end. - `\"basis-closed\"`: a closed B-spline, as in a loop. - `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends. - `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points. - `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop. - `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline. - `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "opacity": { + "description": "The opacity (value between [0,1]) of the mark.", + "type": "number" + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "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": { + "description": "The tension parameter for the interpolation type of the error band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "type": { + "$ref": "#/definitions/ErrorBand", + "description": "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\"`)." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "ErrorBar": { + "const": "errorbar", + "type": "string" + }, + "ErrorBarConfig": { + "additionalProperties": false, + "properties": { + "extent": { + "$ref": "#/definitions/ErrorBarExtent", + "description": "The extent of the rule. Available options include: - `\"ci\"`: Extend the rule to the confidence interval of the mean. - `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean. - `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean. - `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + }, + "rule": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "size": { + "description": "Size of the ticks of an error bar", + "type": "number" + }, + "thickness": { + "description": "Thickness of the ticks and the bar of an error bar", + "type": "number" + }, + "ticks": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + } + }, + "type": "object" + }, + "ErrorBarDef": { + "additionalProperties": false, + "properties": { + "clip": { + "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", + "type": "boolean" + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](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": { + "$ref": "#/definitions/ErrorBarExtent", + "description": "The extent of the rule. Available options include: - `\"ci\"`: Extend the rule to the confidence interval of the mean. - `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean. - `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean. - `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." + }, + "opacity": { + "description": "The opacity (value between [0,1]) of the mark.", + "type": "number" + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "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": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "size": { + "description": "Size of the ticks of an error bar", + "type": "number" + }, + "thickness": { + "description": "Thickness of the ticks and the bar of an error bar", + "type": "number" + }, + "ticks": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/MarkConfig" + } + ] + }, + "type": { + "$ref": "#/definitions/ErrorBar", + "description": "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\"`)." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "ErrorBarExtent": { + "enum": [ + "ci", + "iqr", + "stderr", + "stdev" + ], + "type": "string" + }, + "EventStream": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "between": { + "items": { + "$ref": "#/definitions/Stream" + }, + "type": "array" + }, + "consume": { + "type": "boolean" + }, + "debounce": { + "type": "number" + }, + "filter": { + "anyOf": [ + { + "$ref": "#/definitions/Expr" + }, + { + "items": { + "$ref": "#/definitions/Expr" + }, + "type": "array" + } + ] + }, + "markname": { + "type": "string" + }, + "marktype": { + "$ref": "#/definitions/MarkType" + }, + "source": { + "enum": [ + "view", + "scope" + ], + "type": "string" + }, + "throttle": { + "type": "number" + }, + "type": { + "$ref": "#/definitions/EventType" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "between": { + "items": { + "$ref": "#/definitions/Stream" + }, + "type": "array" + }, + "consume": { + "type": "boolean" + }, + "debounce": { + "type": "number" + }, + "filter": { + "anyOf": [ + { + "$ref": "#/definitions/Expr" + }, + { + "items": { + "$ref": "#/definitions/Expr" + }, + "type": "array" + } + ] + }, + "markname": { + "type": "string" + }, + "marktype": { + "$ref": "#/definitions/MarkType" + }, + "source": { + "const": "window", + "type": "string" + }, + "throttle": { + "type": "number" + }, + "type": { + "$ref": "#/definitions/WindowEventType" + } + }, + "required": [ + "source", + "type" + ], + "type": "object" + } + ] + }, + "EventType": { + "enum": [ + "click", + "dblclick", + "dragenter", + "dragleave", + "dragover", + "keydown", + "keypress", + "keyup", + "mousedown", + "mousemove", + "mouseout", + "mouseover", + "mouseup", + "mousewheel", + "timer", + "touchend", + "touchmove", + "touchstart", + "wheel" + ], + "type": "string" + }, + "Expr": { + "type": "string" + }, + "ExprOrSignalRef": { + "$ref": "#/definitions/ExprRef" + }, + "ExprRef": { + "additionalProperties": false, + "properties": { + "expr": { + "description": "Vega expression (which can refer to Vega-Lite parameters).", + "type": "string" + } + }, + "required": [ + "expr" + ], + "type": "object" + }, + "FacetEncodingFieldDef": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other. - For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size. - For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": { + "$ref": "#/definitions/Header", + "description": "An object defining properties of a facet's header." + }, + "sort": { + "anyOf": [ + { + "$ref": "#/definitions/SortArray" + }, + { + "$ref": "#/definitions/SortOrder" + }, + { + "$ref": "#/definitions/EncodingSortField" + }, + { + "type": "null" + } + ], + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "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.\n\n__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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "FacetFieldDef": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": { + "$ref": "#/definitions/Header", + "description": "An object defining properties of a facet's header." + }, + "sort": { + "anyOf": [ + { + "$ref": "#/definitions/SortArray" + }, + { + "$ref": "#/definitions/SortOrder" + }, + { + "$ref": "#/definitions/EncodingSortField" + }, + { + "type": "null" + } + ], + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "FacetFieldDef": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": { + "$ref": "#/definitions/Header", + "description": "An object defining properties of a facet's header." + }, + "sort": { + "anyOf": [ + { + "$ref": "#/definitions/SortArray" + }, + { + "$ref": "#/definitions/SortOrder" + }, + { + "$ref": "#/definitions/EncodingSortField" + }, + { + "type": "null" + } + ], + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "FacetMapping": { + "additionalProperties": false, + "properties": { + "column": { + "$ref": "#/definitions/FacetFieldDef", + "description": "A field definition for the horizontal facet of trellis plots." + }, + "row": { + "$ref": "#/definitions/FacetFieldDef", + "description": "A field definition for the vertical facet of trellis plots." + } + }, + "type": "object" + }, + "FacetMapping": { + "additionalProperties": false, + "properties": { + "column": { + "$ref": "#/definitions/FacetFieldDef", + "description": "A field definition for the horizontal facet of trellis plots." + }, + "row": { + "$ref": "#/definitions/FacetFieldDef", + "description": "A field definition for the vertical facet of trellis plots." + } + }, + "type": "object" + }, + "FacetedEncoding": { + "additionalProperties": false, + "properties": { + "angle": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Rotation angle of point and text marks." + }, + "color": { + "$ref": "#/definitions/ColorDef", + "description": "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\"`.\n\n__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.\n\n_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": { + "$ref": "#/definitions/RowColumnEncodingFieldDef", + "description": "A field definition for the horizontal facet of trellis plots." + }, + "description": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "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": [ + { + "$ref": "#/definitions/FieldDefWithoutScale" + }, + { + "items": { + "$ref": "#/definitions/FieldDefWithoutScale" + }, + "type": "array" + } + ], + "description": "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": { + "$ref": "#/definitions/FacetEncodingFieldDef", + "description": "A field definition for the (flexible) facet of trellis plots.\n\nIf either `row` or `column` is specified, this channel will be ignored." + }, + "fill": { + "$ref": "#/definitions/ColorDef", + "description": "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.\n\n_Note:_ The `fill` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified." + }, + "fillOpacity": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Fill opacity of the marks.\n\n__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": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "A URL to load upon mouse click." + }, + "key": { + "$ref": "#/definitions/FieldDefWithoutScale", + "description": "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": { + "$ref": "#/definitions/LatLongDef", + "description": "Latitude position of geographically projected marks." + }, + "latitude2": { + "$ref": "#/definitions/Position2Def", + "description": "Latitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "longitude": { + "$ref": "#/definitions/LatLongDef", + "description": "Longitude position of geographically projected marks." + }, + "longitude2": { + "$ref": "#/definitions/Position2Def", + "description": "Longitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." + }, + "opacity": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Opacity of the marks.\n\n__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": [ + { + "$ref": "#/definitions/OrderFieldDef" + }, + { + "items": { + "$ref": "#/definitions/OrderFieldDef" + }, + "type": "array" + }, + { + "$ref": "#/definitions/OrderValueDef" + } + ], + "description": "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.\n\n__Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating additional aggregation grouping." + }, + "radius": { + "$ref": "#/definitions/PolarDef", + "description": "The outer radius in pixels of arc marks." + }, + "radius2": { + "$ref": "#/definitions/Position2Def", + "description": "The inner radius in pixels of arc marks." + }, + "row": { + "$ref": "#/definitions/RowColumnEncodingFieldDef", + "description": "A field definition for the vertical facet of trellis plots." + }, + "shape": { + "$ref": "#/definitions/ShapeDef", + "description": "Shape of the mark.\n\n1. 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.)\n\n2. For `geoshape` marks it should be a field definition of the geojson data\n\n__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": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "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": { + "$ref": "#/definitions/ColorDef", + "description": "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.\n\n_Note:_ The `stroke` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified." + }, + "strokeDash": { + "$ref": "#/definitions/NumericArrayMarkPropDef", + "description": "Stroke dash of the marks.\n\n__Default value:__ `[1,0]` (No dash)." + }, + "strokeOpacity": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Stroke opacity of the marks.\n\n__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": { + "$ref": "#/definitions/NumericMarkPropDef", + "description": "Stroke width of the marks.\n\n__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": { + "$ref": "#/definitions/TextDef", + "description": "Text of the `text` mark." + }, + "theta": { + "$ref": "#/definitions/PolarDef", + "description": "- 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.)\n\n- For text marks, polar coordinate angle in radians." + }, + "theta2": { + "$ref": "#/definitions/Position2Def", + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + }, + { + "items": { + "$ref": "#/definitions/StringFieldDef" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "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).\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite." + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + } + ], + "description": "The URL of an image mark." + }, + "x": { + "$ref": "#/definitions/PositionDef", + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "$ref": "#/definitions/Position2Def", + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "xError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ], + "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "xError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ], + "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "y": { + "$ref": "#/definitions/PositionDef", + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "$ref": "#/definitions/Position2Def", + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "yError": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ], + "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + }, + "yError2": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/ValueDef" + } + ], + "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." + } + }, + "type": "object" + }, + "FacetedUnitSpec": { + "additionalProperties": false, + "description": "Unit spec that can have a composite mark and row or column channels (shorthand for a facet spec).", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other. - For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size. - For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/FacetedEncoding", + "description": "A key-value mapping between encoding channels and definition of fields." + }, + "height": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The height of a visualization.\n\n- For a plot with a continuous y-field, height should be a number. - For a plot with either a discrete y-field or no y-field, 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. (No y-field is equivalent to having one discrete step.) - To enable responsive sizing on height, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousHeight` for a plot with a continuous y-field and `config.view.discreteHeight` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`height`](https://vega.github.io/vega-lite/docs/size.html) documentation." + }, + "mark": { + "$ref": "#/definitions/AnyMark", + "description": "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)." + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "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": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "selection": { + "additionalProperties": { + "$ref": "#/definitions/SelectionDef" + }, + "description": "A key-value mapping between selection names and definitions.", + "type": "object" + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "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.\n\n__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": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The width of a visualization.\n\n- For a plot with a continuous x-field, width should be a number. - For a plot with either a discrete x-field or no x-field, 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. (No x-field is equivalent to having one discrete step.) - To enable responsive sizing on width, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousWidth` for a plot with a continuous x-field and `config.view.discreteWidth` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`width`](https://vega.github.io/vega-lite/docs/size.html) documentation." + } + }, + "required": [ + "mark" + ], + "type": "object" + }, + "Field": { + "anyOf": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ] + }, + "FieldDefWithoutScale": { + "$ref": "#/definitions/TypedFieldDef", + "description": "Field Def without scale (and without bin: \"binned\" support)." + }, + "FieldEqualPredicate": { + "additionalProperties": false, + "properties": { + "equal": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The value that the field should be equal to." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit for the field to be tested." + } + }, + "required": [ + "equal", + "field" + ], + "type": "object" + }, + "FieldGTEPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." + }, + "gte": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The value that the field should be greater than or equals to." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit for the field to be tested." + } + }, + "required": [ + "field", + "gte" + ], + "type": "object" + }, + "FieldGTPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." + }, + "gt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The value that the field should be greater than." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit for the field to be tested." + } + }, + "required": [ + "field", + "gt" + ], + "type": "object" + }, + "FieldLTEPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." + }, + "lte": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The value that the field should be less than or equals to." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit for the field to be tested." + } + }, + "required": [ + "field", + "lte" + ], + "type": "object" + }, + "FieldLTPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." + }, + "lt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The value that the field should be less than." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit for the field to be tested." + } + }, + "required": [ + "field", + "lt" + ], + "type": "object" + }, + "FieldName": { + "type": "string" + }, + "FieldOneOfPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." + }, + "oneOf": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + } + ], + "description": "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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit for the field to be tested." + } + }, + "required": [ + "field", + "oneOf" + ], + "type": "object" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "properties": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "properties": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "properties": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "properties": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "FieldOrDatumDefWithCondition,(string|null)>": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/TypeForShape", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "properties": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "format": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Dict" + } + ], + "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). - If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + }, + "formatType": { + "description": "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).\n\n__Default value:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the axis's backing `datum` object.", + "type": "string" + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Dict" + } + ], + "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). - If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + }, + "formatType": { + "description": "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).\n\n__Default value:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the axis's backing `datum` object.", + "type": "string" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "FieldOrDatumDefWithCondition": { + "additionalProperties": false, + "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Dict" + } + ], + "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). - If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + }, + "formatType": { + "description": "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).\n\n__Default value:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the axis's backing `datum` object.", + "type": "string" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "FieldRangePredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." + }, + "range": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "An array of inclusive minimum and maximum values for a field value of a data item to be included in the filtered data.", + "maxItems": 2, + "minItems": 2 + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit for the field to be tested." + } + }, + "required": [ + "field", + "range" + ], + "type": "object" + }, + "FieldValidPredicate": { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "Field to be tested." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "Time unit for the field to be tested." + }, + "valid": { + "description": "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).", + "type": "boolean" + } + }, + "required": [ + "field", + "valid" + ], + "type": "object" + }, + "FilterTransform": { + "additionalProperties": false, + "properties": { + "filter": { + "$ref": "#/definitions/PredicateComposition", + "description": "The `filter` property must be a predication definition, which can take one of the following forms:\n\n1) an [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string, where `datum` can be used to refer to the current data object. For example, `{filter: \"datum.b2 > 60\"}` would make the output data includes only items that have values in the field `b2` over 60.\n\n2) one of the [field predicates](https://vega.github.io/vega-lite/docs/predicate.html#field-predicate): [`equal`](https://vega.github.io/vega-lite/docs/predicate.html#field-equal-predicate), [`lt`](https://vega.github.io/vega-lite/docs/predicate.html#lt-predicate), [`lte`](https://vega.github.io/vega-lite/docs/predicate.html#lte-predicate), [`gt`](https://vega.github.io/vega-lite/docs/predicate.html#gt-predicate), [`gte`](https://vega.github.io/vega-lite/docs/predicate.html#gte-predicate), [`range`](https://vega.github.io/vega-lite/docs/predicate.html#range-predicate), [`oneOf`](https://vega.github.io/vega-lite/docs/predicate.html#one-of-predicate), or [`valid`](https://vega.github.io/vega-lite/docs/predicate.html#valid-predicate),\n\n3) a [selection predicate](https://vega.github.io/vega-lite/docs/predicate.html#selection-predicate), which define the names of a selection that the data point should belong to (or a logical composition of selections).\n\n4) a [logical composition](https://vega.github.io/vega-lite/docs/predicate.html#composition) of (1), (2), or (3)." + } + }, + "required": [ + "filter" + ], + "type": "object" + }, + "Fit": { + "anyOf": [ + { + "$ref": "#/definitions/GeoJsonFeature" + }, + { + "$ref": "#/definitions/GeoJsonFeatureCollection" + }, + { + "items": { + "$ref": "#/definitions/GeoJsonFeature" + }, + "type": "array" + } + ] + }, + "FlattenTransform": { + "additionalProperties": false, + "properties": { + "as": { + "description": "The output field names for extracted array values.\n\n__Default value:__ The field name of the corresponding array field", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "flatten": { + "description": "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.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + } + }, + "required": [ + "flatten" + ], + "type": "object" + }, + "FoldTransform": { + "additionalProperties": false, + "properties": { + "as": { + "description": "The output field names for the key and value properties produced by the fold transform. __Default value:__ `[\"key\", \"value\"]`", + "items": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "$ref": "#/definitions/FieldName" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "fold": { + "description": "An array of data fields indicating the properties to fold.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + } + }, + "required": [ + "fold" + ], + "type": "object" + }, + "FontStyle": { + "type": "string" + }, + "FontWeight": { + "enum": [ + "normal", + "bold", + "lighter", + "bolder", + 100, + 200, + 300, + 400, + 500, + 600, + 700, + 800, + 900 + ], + "type": [ + "string", + "number" + ] + }, + "Generator": { + "anyOf": [ + { + "$ref": "#/definitions/SequenceGenerator" + }, + { + "$ref": "#/definitions/SphereGenerator" + }, + { + "$ref": "#/definitions/GraticuleGenerator" + } + ] + }, + "NormalizedConcatSpec": { + "additionalProperties": false, + "description": "Base interface for a generalized concatenation specification.", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other. - For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size. - For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "concat": { + "description": "A list of views to be concatenated.", + "items": { + "$ref": "#/definitions/NormalizedSpec" + }, + "type": "array" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "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.\n\n__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": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "concat" + ], + "type": "object" + }, + "ConcatSpec": { + "additionalProperties": false, + "description": "Base interface for a generalized concatenation specification.", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other. - For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size. - For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "concat": { + "description": "A list of views to be concatenated.", + "items": { + "$ref": "#/definitions/Spec" + }, + "type": "array" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "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.\n\n__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": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "concat" + ], + "type": "object" + }, + "NormalizedFacetSpec": { + "additionalProperties": false, + "description": "Base interface for a facet specification.", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other. - For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size. - For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "facet": { + "anyOf": [ + { + "$ref": "#/definitions/FacetFieldDef" + }, + { + "$ref": "#/definitions/FacetMapping" + } + ], + "description": "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)" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "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.\n\n__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)" + }, + "spec": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/FacetedUnitSpec" + } + ], + "description": "A specification of the view that gets faceted." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "facet", + "spec" + ], + "type": "object" + }, + "FacetSpec": { + "additionalProperties": false, + "description": "Base interface for a facet specification.", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other. - For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size. - For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "facet": { + "anyOf": [ + { + "$ref": "#/definitions/FacetFieldDef" + }, + { + "$ref": "#/definitions/FacetMapping" + } + ], + "description": "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)" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "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.\n\n__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)" + }, + "spec": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/FacetedUnitSpec" + } + ], + "description": "A specification of the view that gets faceted." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "facet", + "spec" + ], + "type": "object" + }, + "NormalizedHConcatSpec": { + "additionalProperties": false, + "description": "Base interface for a horizontal concatenation specification.", + "properties": { + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "hconcat": { + "description": "A list of views to be concatenated and put into a row.", + "items": { + "$ref": "#/definitions/NormalizedSpec" + }, + "type": "array" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "hconcat" + ], + "type": "object" + }, + "HConcatSpec": { + "additionalProperties": false, + "description": "Base interface for a horizontal concatenation specification.", + "properties": { + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "hconcat": { + "description": "A list of views to be concatenated and put into a row.", + "items": { + "$ref": "#/definitions/Spec" + }, + "type": "array" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "hconcat" + ], + "type": "object" + }, + "NormalizedSpec": { + "anyOf": [ + { + "$ref": "#/definitions/FacetedUnitSpec" + }, + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/RepeatSpec" + }, + { + "$ref": "#/definitions/NormalizedFacetSpec" + }, + { + "$ref": "#/definitions/NormalizedConcatSpec" + }, + { + "$ref": "#/definitions/NormalizedVConcatSpec" + }, + { + "$ref": "#/definitions/NormalizedHConcatSpec" + } + ], + "description": "Any specification in Vega-Lite." + }, + "Spec": { + "anyOf": [ + { + "$ref": "#/definitions/FacetedUnitSpec" + }, + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/RepeatSpec" + }, + { + "$ref": "#/definitions/FacetSpec" + }, + { + "$ref": "#/definitions/ConcatSpec" + }, + { + "$ref": "#/definitions/VConcatSpec" + }, + { + "$ref": "#/definitions/HConcatSpec" + } + ], + "description": "Any specification in Vega-Lite." + }, + "NormalizedVConcatSpec": { + "additionalProperties": false, + "description": "Base interface for a vertical concatenation specification.", + "properties": { + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "vconcat": { + "description": "A list of views to be concatenated and put into a column.", + "items": { + "$ref": "#/definitions/NormalizedSpec" + }, + "type": "array" + } + }, + "required": [ + "vconcat" + ], + "type": "object" + }, + "VConcatSpec": { + "additionalProperties": false, + "description": "Base interface for a vertical concatenation specification.", + "properties": { + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "vconcat": { + "description": "A list of views to be concatenated and put into a column.", + "items": { + "$ref": "#/definitions/Spec" + }, + "type": "array" + } + }, + "required": [ + "vconcat" + ], + "type": "object" + }, + "GeoJsonFeature": { + }, + "GeoJsonFeatureCollection": { + }, + "Gradient": { + "anyOf": [ + { + "$ref": "#/definitions/LinearGradient" + }, + { + "$ref": "#/definitions/RadialGradient" + } + ] + }, + "GradientStop": { + "additionalProperties": false, + "properties": { + "color": { + "$ref": "#/definitions/Color", + "description": "The color value at this point in the gradient." + }, + "offset": { + "description": "The offset fraction for the color stop, indicating its position within the gradient.", + "type": "number" + } + }, + "required": [ + "offset", + "color" + ], + "type": "object" + }, + "GraticuleGenerator": { + "additionalProperties": false, + "properties": { + "graticule": { + "anyOf": [ + { + "const": true, + "type": "boolean" + }, + { + "$ref": "#/definitions/GraticuleParams" + } + ], + "description": "Generate graticule GeoJSON data for geographic reference lines." + }, + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + } + }, + "required": [ + "graticule" + ], + "type": "object" + }, + "GraticuleParams": { + "additionalProperties": false, + "properties": { + "extent": { + "$ref": "#/definitions/Vector2>", + "description": "Sets both the major and minor extents to the same values." + }, + "extentMajor": { + "$ref": "#/definitions/Vector2>", + "description": "The major extent of the graticule as a two-element array of coordinates." + }, + "extentMinor": { + "$ref": "#/definitions/Vector2>", + "description": "The minor extent of the graticule as a two-element array of coordinates." + }, + "precision": { + "description": "The precision of the graticule in degrees.\n\n__Default value:__ `2.5`", + "type": "number" + }, + "step": { + "$ref": "#/definitions/Vector2", + "description": "Sets both the major and minor step angles to the same values." + }, + "stepMajor": { + "$ref": "#/definitions/Vector2", + "description": "The major step angles of the graticule.\n\n\n__Default value:__ `[90, 360]`" + }, + "stepMinor": { + "$ref": "#/definitions/Vector2", + "description": "The minor step angles of the graticule.\n\n__Default value:__ `[10, 10]`" + } + }, + "type": "object" + }, + "Header": { + "additionalProperties": false, + "description": "Headers of row / column channels for faceted plots.", + "properties": { + "format": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Dict" + } + ], + "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). - If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + }, + "formatType": { + "description": "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).\n\n__Default value:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Horizontal text alignment of header labels. One of `\"left\"`, `\"center\"`, or `\"right\"`." + }, + "labelAnchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "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." + }, + "labelAngle": { + "description": "The rotation angle of the header labels.\n\n__Default value:__ `0` for column header, `-90` for row header.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + "labelBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The color of the header label, can be in hex color code or regular color name." + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the header's backing `datum` object.", + "type": "string" + }, + "labelFont": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font of the header label." + }, + "labelFontSize": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font size of the header label, in pixels.", + "minimum": 0 + }, + "labelFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font style of the header label." + }, + "labelFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font weight of the header label." + }, + "labelLimit": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The maximum length of the header label in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit" + }, + "labelLineHeight": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Line height in pixels for multi-line header labels or title text with `\"line-top\"` or `\"line-bottom\"` baseline." + }, + "labelOrient": { + "$ref": "#/definitions/Orient", + "description": "The orientation of the header label. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`." + }, + "labelPadding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The padding, in pixel, between facet header's label and the plot.\n\n__Default value:__ `10`" + }, + "labels": { + "description": "A boolean flag indicating if labels should be included as part of the header.\n\n__Default value:__ `true`.", + "type": "boolean" + }, + "orient": { + "$ref": "#/definitions/Orient", + "description": "Shortcut for setting both labelOrient and titleOrient." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "titleAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Horizontal text alignment (to the anchor) of header titles." + }, + "titleAnchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "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." + }, + "titleAngle": { + "description": "The rotation angle of the header title.\n\n__Default value:__ `0`.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + "titleBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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 `\"bottom\"`, but are calculated relative to the `titleLineHeight` rather than `titleFontSize` alone.\n\n__Default value:__ `\"middle\"`" + }, + "titleColor": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Color of the header title, can be in hex color code or regular color name." + }, + "titleFont": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Font of the header title. (e.g., `\"Helvetica Neue\"`)." + }, + "titleFontSize": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Font size of the header title.", + "minimum": 0 + }, + "titleFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font style of the header title." + }, + "titleFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The maximum length of the header title in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit" + }, + "titleLineHeight": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Line height in pixels for multi-line header title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline." + }, + "titleOrient": { + "$ref": "#/definitions/Orient", + "description": "The orientation of the header title. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`." + }, + "titlePadding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The padding, in pixel, between facet header's title and the label.\n\n__Default value:__ `10`" + } + }, + "type": "object" + }, + "HeaderConfig": { + "additionalProperties": false, + "properties": { + "format": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Dict" + } + ], + "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). - If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + }, + "formatType": { + "description": "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).\n\n__Default value:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Horizontal text alignment of header labels. One of `\"left\"`, `\"center\"`, or `\"right\"`." + }, + "labelAnchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "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." + }, + "labelAngle": { + "description": "The rotation angle of the header labels.\n\n__Default value:__ `0` for column header, `-90` for row header.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + "labelBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The color of the header label, can be in hex color code or regular color name." + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the header's backing `datum` object.", + "type": "string" + }, + "labelFont": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font of the header label." + }, + "labelFontSize": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font size of the header label, in pixels.", + "minimum": 0 + }, + "labelFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font style of the header label." + }, + "labelFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font weight of the header label." + }, + "labelLimit": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The maximum length of the header label in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit" + }, + "labelLineHeight": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Line height in pixels for multi-line header labels or title text with `\"line-top\"` or `\"line-bottom\"` baseline." + }, + "labelOrient": { + "$ref": "#/definitions/Orient", + "description": "The orientation of the header label. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`." + }, + "labelPadding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The padding, in pixel, between facet header's label and the plot.\n\n__Default value:__ `10`" + }, + "labels": { + "description": "A boolean flag indicating if labels should be included as part of the header.\n\n__Default value:__ `true`.", + "type": "boolean" + }, + "orient": { + "$ref": "#/definitions/Orient", + "description": "Shortcut for setting both labelOrient and titleOrient." + }, + "title": { + "description": "Set to null to disable title for the axis, legend, or header.", + "type": "null" + }, + "titleAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Horizontal text alignment (to the anchor) of header titles." + }, + "titleAnchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "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." + }, + "titleAngle": { + "description": "The rotation angle of the header title.\n\n__Default value:__ `0`.", + "maximum": 360, + "minimum": -360, + "type": "number" + }, + "titleBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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 `\"bottom\"`, but are calculated relative to the `titleLineHeight` rather than `titleFontSize` alone.\n\n__Default value:__ `\"middle\"`" + }, + "titleColor": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Color of the header title, can be in hex color code or regular color name." + }, + "titleFont": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Font of the header title. (e.g., `\"Helvetica Neue\"`)." + }, + "titleFontSize": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Font size of the header title.", + "minimum": 0 + }, + "titleFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The font style of the header title." + }, + "titleFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The maximum length of the header title in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit" + }, + "titleLineHeight": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Line height in pixels for multi-line header title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline." + }, + "titleOrient": { + "$ref": "#/definitions/Orient", + "description": "The orientation of the header title. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`." + }, + "titlePadding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The padding, in pixel, between facet header's title and the label.\n\n__Default value:__ `10`" + } + }, + "type": "object" + }, + "HexColor": { + "format": "color-hex", + "type": "string" + }, + "ImputeMethod": { + "enum": [ + "value", + "median", + "max", + "min", + "mean" + ], + "type": "string" + }, + "ImputeParams": { + "additionalProperties": false, + "properties": { + "frame": { + "description": "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 rows preceding or following the current data object. For example, the value `[-5, 5]` indicates that the window should include five objects preceding and five objects following the current object.\n\n__Default value:__: `[null, null]` indicating that the window includes all objects.", + "items": [ + { + "type": [ + "null", + "number" + ] + }, + { + "type": [ + "null", + "number" + ] + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "keyvals": { + "anyOf": [ + { + "items": { + }, + "type": "array" + }, + { + "$ref": "#/definitions/ImputeSequence" + } + ], + "description": "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).\n\nIf provided, this will be used in addition to the key values observed within the input data. If not provided, the values will be derived from all unique values of the `key` field. For `impute` in `encoding`, the key field is the x-field if the y-field is imputed, or vice versa.\n\nIf there is no impute grouping, this property _must_ be specified." + }, + "method": { + "$ref": "#/definitions/ImputeMethod", + "description": "The imputation method to use for the field value of imputed data objects. One of `\"value\"`, `\"mean\"`, `\"median\"`, `\"max\"` or `\"min\"`.\n\n__Default value:__ `\"value\"`" + }, + "value": { + "description": "The field value to use when the imputation `method` is `\"value\"`." + } + }, + "type": "object" + }, + "ImputeSequence": { + "additionalProperties": false, + "properties": { + "start": { + "description": "The starting value of the sequence. __Default value:__ `0`", + "type": "number" + }, + "step": { + "description": "The step value between sequence entries. __Default value:__ `1` or `-1` if `stop < start`", + "type": "number" + }, + "stop": { + "description": "The ending value(exclusive) of the sequence.", + "type": "number" + } + }, + "required": [ + "stop" + ], + "type": "object" + }, + "ImputeTransform": { + "additionalProperties": false, + "properties": { + "frame": { + "description": "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 rows preceding or following the current data object. For example, the value `[-5, 5]` indicates that the window should include five objects preceding and five objects following the current object.\n\n__Default value:__: `[null, null]` indicating that the window includes all objects.", + "items": [ + { + "type": [ + "null", + "number" + ] + }, + { + "type": [ + "null", + "number" + ] + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "groupby": { + "description": "An optional array of fields by which to group the values. Imputation will then be performed on a per-group basis.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "impute": { + "$ref": "#/definitions/FieldName", + "description": "The data field for which the missing values should be imputed." + }, + "key": { + "$ref": "#/definitions/FieldName", + "description": "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." + }, + "keyvals": { + "anyOf": [ + { + "items": { + }, + "type": "array" + }, + { + "$ref": "#/definitions/ImputeSequence" + } + ], + "description": "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).\n\nIf provided, this will be used in addition to the key values observed within the input data. If not provided, the values will be derived from all unique values of the `key` field. For `impute` in `encoding`, the key field is the x-field if the y-field is imputed, or vice versa.\n\nIf there is no impute grouping, this property _must_ be specified." + }, + "method": { + "$ref": "#/definitions/ImputeMethod", + "description": "The imputation method to use for the field value of imputed data objects. One of `\"value\"`, `\"mean\"`, `\"median\"`, `\"max\"` or `\"min\"`.\n\n__Default value:__ `\"value\"`" + }, + "value": { + "description": "The field value to use when the imputation `method` is `\"value\"`." + } + }, + "required": [ + "impute", + "key" + ], + "type": "object" + }, + "InlineData": { + "additionalProperties": false, + "properties": { + "format": { + "$ref": "#/definitions/DataFormat", + "description": "An object that specifies the format for parsing the data." + }, + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + }, + "values": { + "$ref": "#/definitions/InlineDataset", + "description": "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." + } + }, + "required": [ + "values" + ], + "type": "object" + }, + "InlineDataset": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "type": "object" + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "object" + } + ] + }, + "InputBinding": { + "additionalProperties": false, + "properties": { + "autocomplete": { + "type": "string" + }, + "debounce": { + "type": "number" + }, + "element": { + "$ref": "#/definitions/Element" + }, + "input": { + "type": "string" + }, + "name": { + "type": "string" + }, + "placeholder": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "Interpolate": { + "enum": [ + "basis", + "basis-open", + "basis-closed", + "bundle", + "cardinal", + "cardinal-open", + "cardinal-closed", + "catmull-rom", + "linear", + "linear-closed", + "monotone", + "natural", + "step", + "step-before", + "step-after" + ], + "maximum": 900, + "minimum": 100, + "type": "string" + }, + "IntervalSelection": { + "additionalProperties": false, + "properties": { + "bind": { + "const": "scales", + "description": "Establishes a two-way binding between the interval selection and the scales used within the same view. This allows a user to interactively pan and zoom the view.\n\n__See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation.", + "type": "string" + }, + "clear": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. Can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + }, + "empty": { + "description": "By default, `all` data values are considered to lie within an empty selection. When set to `none`, empty selections contain no data values.", + "enum": [ + "all", + "none" + ], + "type": "string" + }, + "encodings": { + "description": "An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/SingleDefUnitChannel" + }, + "type": "array" + }, + "fields": { + "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "init": { + "$ref": "#/definitions/SelectionInitIntervalMapping", + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and arrays of initial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation." + }, + "mark": { + "$ref": "#/definitions/BrushConfig", + "description": "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.\n\n__See also:__ [`mark`](https://vega.github.io/vega-lite/docs/selection-mark.html) documentation." + }, + "on": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + } + ], + "description": "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](https://vega.github.io/vega/docs/event-streams/#between-filters)." + }, + "resolve": { + "$ref": "#/definitions/SelectionResolution", + "description": "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.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + }, + "translate": { + "description": "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 include a start and end event to trigger continuous panning.\n\n__Default value:__ `true`, which corresponds to `[mousedown, window:mouseup] > window:mousemove!` which corresponds to clicks and dragging within an interval selection to reposition it.\n\n__See also:__ [`translate`](https://vega.github.io/vega-lite/docs/translate.html) documentation.", + "type": [ + "string", + "boolean" + ] + }, + "type": { + "const": "interval", + "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports three selection types:\n\n- `\"single\"` -- to select a single discrete data value on `click`. - `\"multi\"` -- to select multiple discrete data value; 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`.", + "type": "string" + }, + "zoom": { + "description": "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` events are supported.\n\n__Default value:__ `true`, which corresponds to `wheel!`.\n\n__See also:__ [`zoom`](https://vega.github.io/vega-lite/docs/zoom.html) documentation.", + "type": [ + "string", + "boolean" + ] + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "IntervalSelectionConfig": { + "additionalProperties": false, + "properties": { + "bind": { + "const": "scales", + "description": "Establishes a two-way binding between the interval selection and the scales used within the same view. This allows a user to interactively pan and zoom the view.\n\n__See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation.", + "type": "string" + }, + "clear": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. Can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + }, + "empty": { + "description": "By default, `all` data values are considered to lie within an empty selection. When set to `none`, empty selections contain no data values.", + "enum": [ + "all", + "none" + ], + "type": "string" + }, + "encodings": { + "description": "An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/SingleDefUnitChannel" + }, + "type": "array" + }, + "fields": { + "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "init": { + "$ref": "#/definitions/SelectionInitIntervalMapping", + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and arrays of initial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation." + }, + "mark": { + "$ref": "#/definitions/BrushConfig", + "description": "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.\n\n__See also:__ [`mark`](https://vega.github.io/vega-lite/docs/selection-mark.html) documentation." + }, + "on": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + } + ], + "description": "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](https://vega.github.io/vega/docs/event-streams/#between-filters)." + }, + "resolve": { + "$ref": "#/definitions/SelectionResolution", + "description": "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.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + }, + "translate": { + "description": "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 include a start and end event to trigger continuous panning.\n\n__Default value:__ `true`, which corresponds to `[mousedown, window:mouseup] > window:mousemove!` which corresponds to clicks and dragging within an interval selection to reposition it.\n\n__See also:__ [`translate`](https://vega.github.io/vega-lite/docs/translate.html) documentation.", + "type": [ + "string", + "boolean" + ] + }, + "zoom": { + "description": "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` events are supported.\n\n__Default value:__ `true`, which corresponds to `wheel!`.\n\n__See also:__ [`zoom`](https://vega.github.io/vega-lite/docs/zoom.html) documentation.", + "type": [ + "string", + "boolean" + ] + } + }, + "type": "object" + }, + "JoinAggregateFieldDef": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The output name for the join aggregate operation." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "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\"`." + }, + "op": { + "$ref": "#/definitions/AggregateOp", + "description": "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)." + } + }, + "required": [ + "op", + "as" + ], + "type": "object" + }, + "JoinAggregateTransform": { + "additionalProperties": false, + "properties": { + "groupby": { + "description": "The data fields for partitioning the data objects into separate groups. If unspecified, all data points will be in a single group.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "joinaggregate": { + "description": "The definition of the fields in the join aggregate, and what calculations to use.", + "items": { + "$ref": "#/definitions/JoinAggregateFieldDef" + }, + "type": "array" + } + }, + "required": [ + "joinaggregate" + ], + "type": "object" + }, + "JsonDataFormat": { + "additionalProperties": false, + "properties": { + "parse": { + "anyOf": [ + { + "$ref": "#/definitions/Parse" + }, + { + "type": "null" + } + ], + "description": "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 name, and the value to the desired data type (one of `\"number\"`, `\"boolean\"`, `\"date\"`, or null (do not parse the field)). For example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each input record a Date value.\n\nFor `\"date\"`, we parse data based using Javascript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: \"date:'%m%d%Y'\"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). 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": { + "description": "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": { + "const": "json", + "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\n\n__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.", + "type": "string" + } + }, + "type": "object" + }, + "LabelOverlap": { + "anyOf": [ + { + "type": "boolean" + }, + { + "const": "parity", + "type": "string" + }, + { + "const": "greedy", + "type": "string" + } + ] + }, + "LatLongDef": { + "anyOf": [ + { + "$ref": "#/definitions/LatLongFieldDef" + }, + { + "$ref": "#/definitions/DatumDef" + }, + { + "$ref": "#/definitions/NumericValueDef" + } + ] + }, + "LatLongFieldDef": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", + "type": "null" + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "const": "quantitative", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation.", + "type": "string" + } + }, + "type": "object" + }, + "LayerRepeatMapping": { + "additionalProperties": false, + "properties": { + "column": { + "description": "An array of fields to be repeated horizontally.", + "items": { + "type": "string" + }, + "type": "array" + }, + "layer": { + "description": "An array of fields to be repeated as layers.", + "items": { + "type": "string" + }, + "type": "array" + }, + "row": { + "description": "An array of fields to be repeated vertically.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "layer" + ], + "type": "object" + }, + "LayerRepeatSpec": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other. - For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size. - For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "repeat": { + "$ref": "#/definitions/LayerRepeatMapping", + "description": "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 number of columns to control the wrapping. 2) An object that maps `\"row\"` and/or `\"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." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "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.\n\n__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)" + }, + "spec": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/UnitSpec" + } + ], + "description": "A specification of the view that gets repeated." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "repeat", + "spec" + ], + "type": "object" + }, + "LayerSpec": { + "additionalProperties": false, + "description": "A full layered plot specification, which may contains `encoding` and `projection` properties that will be applied to underlying unit (single-view) specifications.", + "properties": { + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/SharedEncoding", + "description": "A shared key-value mapping between encoding channels and definition of fields in the underlying layers." + }, + "height": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The height of a visualization.\n\n- For a plot with a continuous y-field, height should be a number. - For a plot with either a discrete y-field or no y-field, 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. (No y-field is equivalent to having one discrete step.) - To enable responsive sizing on height, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousHeight` for a plot with a continuous y-field and `config.view.discreteHeight` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`height`](https://vega.github.io/vega-lite/docs/size.html) documentation." + }, + "layer": { + "description": "Layer or single view specifications to be layered.\n\n__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.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/UnitSpec" + } + ] + }, + "type": "array" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "An object defining properties of the geographic projection shared by underlying layers." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The width of a visualization.\n\n- For a plot with a continuous x-field, width should be a number. - For a plot with either a discrete x-field or no x-field, 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. (No x-field is equivalent to having one discrete step.) - To enable responsive sizing on width, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousWidth` for a plot with a continuous x-field and `config.view.discreteWidth` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`width`](https://vega.github.io/vega-lite/docs/size.html) documentation." + } + }, + "required": [ + "layer" + ], + "type": "object" + }, + "LayoutAlign": { + "enum": [ + "all", + "each", + "none" + ], + "type": "string" + }, + "Legend": { + "additionalProperties": false, + "description": "Properties of a legend or boolean flag for determining whether to show it.", + "properties": { + "aria": { + "anyOf": [ + { + "description": "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.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "clipHeight": { + "anyOf": [ + { + "description": "The height in pixels to clip symbol legend entries and limit their size.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "columnPadding": { + "anyOf": [ + { + "description": "The horizontal padding in pixels between symbol legend entries.\n\n__Default value:__ `10`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "columns": { + "anyOf": [ + { + "description": "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.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadius": { + "anyOf": [ + { + "description": "Corner radius for the full legend.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "direction": { + "$ref": "#/definitions/Orientation", + "description": "The direction of the legend, one of `\"vertical\"` or `\"horizontal\"`.\n\n__Default value:__ - For top-/bottom-`orient`ed legends, `\"horizontal\"` - 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": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Background fill color for the full legend." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "format": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Dict" + } + ], + "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). - If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + }, + "formatType": { + "description": "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).\n\n__Default value:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "gradientLength": { + "anyOf": [ + { + "description": "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.\n\n__Default value:__ `200`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientOpacity": { + "anyOf": [ + { + "description": "Opacity of the color gradient.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientStrokeColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the gradient stroke, can be in hex color code or regular color name.\n\n__Default value:__ `\"lightGray\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientStrokeWidth": { + "anyOf": [ + { + "description": "The width of the gradient stroke, in pixels.\n\n__Default value:__ `0`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientThickness": { + "anyOf": [ + { + "description": "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.\n\n__Default value:__ `16`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gridAlign": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign", + "description": "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).\n\n__Default value:__ `\"each\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "The alignment of the legend label, can be left, center, or right." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline", + "description": "The position of the baseline of legend label, can be `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`.\n\n__Default value:__ `\"middle\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the legend label, can be in hex color code or regular color name." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the legend's backing `datum` object.", + "type": "string" + }, + "labelFont": { + "anyOf": [ + { + "description": "The font of the legend label.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFontSize": { + "anyOf": [ + { + "description": "The font size of legend label.\n\n__Default value:__ `10`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style of legend label." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "The font weight of legend label." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelLimit": { + "anyOf": [ + { + "description": "Maximum allowed pixel width of legend tick labels.\n\n__Default value:__ `160`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelOffset": { + "anyOf": [ + { + "description": "The offset of the legend label.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelOpacity": { + "anyOf": [ + { + "description": "Opacity of labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelOverlap": { + "anyOf": [ + { + "$ref": "#/definitions/LabelOverlap", + "description": "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 `\"greedy\"`, a linear scan of the labels is performed, removing any label that overlaps with the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelPadding": { + "anyOf": [ + { + "description": "Padding in pixels between the legend and legend labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelSeparation": { + "anyOf": [ + { + "description": "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.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "legendX": { + "anyOf": [ + { + "description": "Custom x-position for legend with orient \"none\".", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "legendY": { + "anyOf": [ + { + "description": "Custom y-position for legend with orient \"none\".", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "offset": { + "anyOf": [ + { + "description": "The offset in pixels by which to displace the legend from the data rectangle and axes.\n\n__Default value:__ `18`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "orient": { + "$ref": "#/definitions/LegendOrient", + "description": "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\"`.\n\n__Default value:__ `\"right\"`" + }, + "padding": { + "anyOf": [ + { + "description": "The padding between the border and content of the legend group.\n\n__Default value:__ `0`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "rowPadding": { + "anyOf": [ + { + "description": "The vertical padding in pixels between symbol legend entries.\n\n__Default value:__ `2`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Border stroke color for the full legend." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolDash": { + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed symbol strokes.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolDashOffset": { + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the symbol stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolFillColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the legend symbol," + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolLimit": { + "anyOf": [ + { + "description": "The maximum number of allowed entries for a symbol legend. Additional entries will be dropped.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolOffset": { + "anyOf": [ + { + "description": "Horizontal pixel offset for legend symbols.\n\n__Default value:__ `0`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolOpacity": { + "anyOf": [ + { + "description": "Opacity of the legend symbols.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolSize": { + "anyOf": [ + { + "description": "The size of the legend symbol, in pixels.\n\n__Default value:__ `100`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolStrokeColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Stroke color for legend symbols." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolStrokeWidth": { + "anyOf": [ + { + "description": "The width of the symbol's stroke.\n\n__Default value:__ `1.5`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolType": { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape", + "description": "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 shapes `arrow`, `wedge`, or `triangle`. Alternatively, a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) can be provided. 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.\n\n__Default value:__ `\"circle\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickCount": { + "anyOf": [ + { + "$ref": "#/definitions/TickCount", + "description": "The desired number of tick values for quantitative legends." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickMinStep": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__Default value__: `undefined`" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "titleAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment for legend titles.\n\n__Default value:__ `\"left\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleAnchor": { + "anyOf": [ + { + "$ref": "#/definitions/TitleAnchor", + "description": "Text anchor position for placing legend titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline", + "description": "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 `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone.\n\n__Default value:__ `\"top\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the legend title, can be in hex color code or regular color name." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFont": { + "anyOf": [ + { + "description": "The font of the legend title.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontSize": { + "anyOf": [ + { + "description": "The font size of the legend title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style of the legend title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleLimit": { + "anyOf": [ + { + "description": "Maximum allowed pixel width of legend titles.\n\n__Default value:__ `180`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleLineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleOpacity": { + "anyOf": [ + { + "description": "Opacity of the legend title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleOrient": { + "anyOf": [ + { + "$ref": "#/definitions/Orient", + "description": "Orientation of the legend title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titlePadding": { + "anyOf": [ + { + "description": "The padding, in pixels, between title and legend.\n\n__Default value:__ `5`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "type": { + "description": "The type of the legend. Use `\"symbol\"` to create a discrete legend and `\"gradient\"` for a continuous color gradient.\n\n__Default value:__ `\"gradient\"` for non-binned quantitative fields and temporal fields; `\"symbol\"` otherwise.", + "enum": [ + "symbol", + "gradient" + ], + "type": "string" + }, + "values": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Explicitly set the visible legend values." + }, + "zindex": { + "description": "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.", + "minimum": 0, + "type": "number" + } + }, + "type": "object" + }, + "LegendBinding": { + "anyOf": [ + { + "const": "legend", + "type": "string" + }, + { + "$ref": "#/definitions/LegendStreamBinding" + } + ] + }, + "LegendConfig": { + "additionalProperties": false, + "properties": { + "aria": { + "anyOf": [ + { + "description": "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.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "clipHeight": { + "anyOf": [ + { + "description": "The height in pixels to clip symbol legend entries and limit their size.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "columnPadding": { + "anyOf": [ + { + "description": "The horizontal padding in pixels between symbol legend entries.\n\n__Default value:__ `10`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "columns": { + "anyOf": [ + { + "description": "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.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadius": { + "anyOf": [ + { + "description": "Corner radius for the full legend.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "direction": { + "$ref": "#/definitions/Orientation", + "description": "The direction of the legend, one of `\"vertical\"` or `\"horizontal\"`.\n\n__Default value:__ - For top-/bottom-`orient`ed legends, `\"horizontal\"` - 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": { + "description": "Disable legend by default", + "type": "boolean" + }, + "fillColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Background fill color for the full legend." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientDirection": { + "anyOf": [ + { + "$ref": "#/definitions/Orientation", + "description": "The default direction (`\"horizontal\"` or `\"vertical\"`) for gradient legends.\n\n__Default value:__ `\"vertical\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientHorizontalMaxLength": { + "description": "Max legend length for a horizontal gradient when `config.legend.gradientLength` is undefined.\n\n__Default value:__ `200`", + "type": "number" + }, + "gradientHorizontalMinLength": { + "description": "Min legend length for a horizontal gradient when `config.legend.gradientLength` is undefined.\n\n__Default value:__ `100`", + "type": "number" + }, + "gradientLabelLimit": { + "anyOf": [ + { + "description": "The maximum allowed length in pixels of color ramp gradient labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientLabelOffset": { + "anyOf": [ + { + "description": "Vertical offset in pixels for color ramp gradient labels.\n\n__Default value:__ `2`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientLength": { + "anyOf": [ + { + "description": "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.\n\n__Default value:__ `200`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientOpacity": { + "anyOf": [ + { + "description": "Opacity of the color gradient.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientStrokeColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the gradient stroke, can be in hex color code or regular color name.\n\n__Default value:__ `\"lightGray\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientStrokeWidth": { + "anyOf": [ + { + "description": "The width of the gradient stroke, in pixels.\n\n__Default value:__ `0`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientThickness": { + "anyOf": [ + { + "description": "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.\n\n__Default value:__ `16`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "gradientVerticalMaxLength": { + "description": "Max legend length for a vertical gradient when `config.legend.gradientLength` is undefined.\n\n__Default value:__ `200`", + "type": "number" + }, + "gradientVerticalMinLength": { + "description": "Min legend length for a vertical gradient when `config.legend.gradientLength` is undefined.\n\n__Default value:__ `100`", + "type": "number" + }, + "gridAlign": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign", + "description": "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).\n\n__Default value:__ `\"each\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "The alignment of the legend label, can be left, center, or right." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline", + "description": "The position of the baseline of legend label, can be `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`.\n\n__Default value:__ `\"middle\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the legend label, can be in hex color code or regular color name." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFont": { + "anyOf": [ + { + "description": "The font of the legend label.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFontSize": { + "anyOf": [ + { + "description": "The font size of legend label.\n\n__Default value:__ `10`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style of legend label." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "The font weight of legend label." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelLimit": { + "anyOf": [ + { + "description": "Maximum allowed pixel width of legend tick labels.\n\n__Default value:__ `160`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelOffset": { + "anyOf": [ + { + "description": "The offset of the legend label.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelOpacity": { + "anyOf": [ + { + "description": "Opacity of labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelOverlap": { + "anyOf": [ + { + "$ref": "#/definitions/LabelOverlap" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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 scan of the labels is performed, removing any label that overlaps with the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `\"greedy\"` for `log scales otherwise `true`." + }, + "labelPadding": { + "anyOf": [ + { + "description": "Padding in pixels between the legend and legend labels.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "labelSeparation": { + "anyOf": [ + { + "description": "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.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "layout": { + "$ref": "#/definitions/ExprRef" + }, + "legendX": { + "anyOf": [ + { + "description": "Custom x-position for legend with orient \"none\".", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "legendY": { + "anyOf": [ + { + "description": "Custom y-position for legend with orient \"none\".", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "offset": { + "anyOf": [ + { + "description": "The offset in pixels by which to displace the legend from the data rectangle and axes.\n\n__Default value:__ `18`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "orient": { + "$ref": "#/definitions/LegendOrient", + "description": "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\"`.\n\n__Default value:__ `\"right\"`" + }, + "padding": { + "anyOf": [ + { + "description": "The padding between the border and content of the legend group.\n\n__Default value:__ `0`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "rowPadding": { + "anyOf": [ + { + "description": "The vertical padding in pixels between symbol legend entries.\n\n__Default value:__ `2`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Border stroke color for the full legend." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "Border stroke dash pattern for the full legend.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "Border stroke width for the full legend.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolBaseFillColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Default fill color for legend symbols. Only applied if there is no `\"fill\"` scale color encoding for the legend.\n\n__Default value:__ `\"transparent\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolBaseStrokeColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Default stroke color for legend symbols. Only applied if there is no `\"fill\"` scale color encoding for the legend.\n\n__Default value:__ `\"gray\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolDash": { + "anyOf": [ + { + "description": "An array of alternating [stroke, space] lengths for dashed symbol strokes.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolDashOffset": { + "anyOf": [ + { + "description": "The pixel offset at which to start drawing with the symbol stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolDirection": { + "anyOf": [ + { + "$ref": "#/definitions/Orientation", + "description": "The default direction (`\"horizontal\"` or `\"vertical\"`) for symbol legends.\n\n__Default value:__ `\"vertical\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolFillColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the legend symbol," + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolLimit": { + "anyOf": [ + { + "description": "The maximum number of allowed entries for a symbol legend. Additional entries will be dropped.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolOffset": { + "anyOf": [ + { + "description": "Horizontal pixel offset for legend symbols.\n\n__Default value:__ `0`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolOpacity": { + "anyOf": [ + { + "description": "Opacity of the legend symbols.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolSize": { + "anyOf": [ + { + "description": "The size of the legend symbol, in pixels.\n\n__Default value:__ `100`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolStrokeColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Stroke color for legend symbols." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolStrokeWidth": { + "anyOf": [ + { + "description": "The width of the symbol's stroke.\n\n__Default value:__ `1.5`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "symbolType": { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape", + "description": "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 shapes `arrow`, `wedge`, or `triangle`. Alternatively, a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) can be provided. 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.\n\n__Default value:__ `\"circle\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tickCount": { + "anyOf": [ + { + "$ref": "#/definitions/TickCount", + "description": "The desired number of tick values for quantitative legends." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "title": { + "description": "Set to null to disable title for the axis, legend, or header.", + "type": "null" + }, + "titleAlign": { + "anyOf": [ + { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment for legend titles.\n\n__Default value:__ `\"left\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleAnchor": { + "anyOf": [ + { + "$ref": "#/definitions/TitleAnchor", + "description": "Text anchor position for placing legend titles." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleBaseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline", + "description": "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 `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone.\n\n__Default value:__ `\"top\"`." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "The color of the legend title, can be in hex color code or regular color name." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFont": { + "anyOf": [ + { + "description": "The font of the legend title.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontSize": { + "anyOf": [ + { + "description": "The font size of the legend title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style of the legend title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleLimit": { + "anyOf": [ + { + "description": "Maximum allowed pixel width of legend titles.\n\n__Default value:__ `180`.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleLineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleOpacity": { + "anyOf": [ + { + "description": "Opacity of the legend title.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titleOrient": { + "anyOf": [ + { + "$ref": "#/definitions/Orient", + "description": "Orientation of the legend title." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "titlePadding": { + "anyOf": [ + { + "description": "The padding, in pixels, between title and legend.\n\n__Default value:__ `5`.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "unselectedOpacity": { + "description": "The opacity of unselected legend entries.\n\n__Default value:__ 0.35.", + "type": "number" + }, + "zindex": { + "anyOf": [ + { + "description": "The integer z-index indicating the layering of the legend group relative to other axis, mark, and legend groups.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + } + }, + "type": "object" + }, + "LegendOrient": { + "enum": [ + "none", + "left", + "right", + "top", + "bottom", + "top-left", + "top-right", + "bottom-left", + "bottom-right" + ], + "type": "string" + }, + "LegendResolveMap": { + "additionalProperties": false, + "properties": { + "angle": { + "$ref": "#/definitions/ResolveMode" + }, + "color": { + "$ref": "#/definitions/ResolveMode" + }, + "fill": { + "$ref": "#/definitions/ResolveMode" + }, + "fillOpacity": { + "$ref": "#/definitions/ResolveMode" + }, + "opacity": { + "$ref": "#/definitions/ResolveMode" + }, + "shape": { + "$ref": "#/definitions/ResolveMode" + }, + "size": { + "$ref": "#/definitions/ResolveMode" + }, + "stroke": { + "$ref": "#/definitions/ResolveMode" + }, + "strokeDash": { + "$ref": "#/definitions/ResolveMode" + }, + "strokeOpacity": { + "$ref": "#/definitions/ResolveMode" + }, + "strokeWidth": { + "$ref": "#/definitions/ResolveMode" + } + }, + "type": "object" + }, + "LegendStreamBinding": { + "additionalProperties": false, + "properties": { + "legend": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Stream" + } + ] + } + }, + "required": [ + "legend" + ], + "type": "object" + }, + "LineConfig": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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 `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "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.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](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": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "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).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "endAngle": { + "anyOf": [ + { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`." + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"basis\"`: a B-spline, with control point duplication on the ends. - `\"basis-open\"`: an open B-spline; may not intersect the start or end. - `\"basis-closed\"`: a closed B-spline, as in a loop. - `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends. - `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points. - `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop. - `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline. - `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`). - If set to `\"filter\"` (default), all data items with null values will be skipped (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.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineBreak": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. - For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension. - For area, this property determines the orient property of the Vega output. - For line and trail marks, this property determines the sort order of the points in 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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "point": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/OverlayMarkDef" + }, + { + "const": "transparent", + "type": "string" + } + ], + "description": "A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points.\n\n- If this property is `\"transparent\"`, transparent points will be used (for enhancing tooltips and selections).\n\n- If this property is an empty object (`{}`) or `true`, filled points with default properties will be used.\n\n- If this property is `false`, no points would be automatically added to line or area marks.\n\n__Default value:__ `false`." + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties." + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default size for marks. - For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value. - For `bar`, this represents the band size of the bar, in pixels. - For `text`, this represents the font size, in pixels.\n\n__Default value:__ - `30` for point, circle, square marks; width/height's `step` - `2` for bar marks with discrete dimensions; - `5` for bar marks with continuous dimensions; - `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "startAngle": { + "anyOf": [ + { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "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.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tension": { + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- 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.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "timeUnitBand": { + "description": "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.", + "type": "number" + }, + "timeUnitBandPosition": { + "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used. - If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used. - If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "LinearGradient": { + "additionalProperties": false, + "properties": { + "gradient": { + "const": "linear", + "description": "The type of gradient. Use `\"linear\"` for a linear gradient.", + "type": "string" + }, + "id": { + "type": "string" + }, + "stops": { + "description": "An array of gradient stops defining the gradient color sequence.", + "items": { + "$ref": "#/definitions/GradientStop" + }, + "type": "array" + }, + "x1": { + "description": "The starting x-coordinate, in normalized [0, 1] coordinates, of the linear gradient.\n\n__Default value:__ `0`", + "type": "number" + }, + "x2": { + "description": "The ending x-coordinate, in normalized [0, 1] coordinates, of the linear gradient.\n\n__Default value:__ `1`", + "type": "number" + }, + "y1": { + "description": "The starting y-coordinate, in normalized [0, 1] coordinates, of the linear gradient.\n\n__Default value:__ `0`", + "type": "number" + }, + "y2": { + "description": "The ending y-coordinate, in normalized [0, 1] coordinates, of the linear gradient.\n\n__Default value:__ `0`", + "type": "number" + } + }, + "required": [ + "gradient", + "stops" + ], + "type": "object" + }, + "LocalMultiTimeUnit": { + "enum": [ + "yearquarter", + "yearquartermonth", + "yearmonth", + "yearmonthdate", + "yearmonthdatehours", + "yearmonthdatehoursminutes", + "yearmonthdatehoursminutesseconds", + "yearweek", + "yearweekday", + "yearweekdayhours", + "yearweekdayhoursminutes", + "yearweekdayhoursminutesseconds", + "yeardayofyear", + "quartermonth", + "monthdate", + "monthdatehours", + "monthdatehoursminutes", + "monthdatehoursminutesseconds", + "weekday", + "weeksdayhours", + "weekdayhoursminutes", + "weekdayhoursminutesseconds", + "dayhours", + "dayhoursminutes", + "dayhoursminutesseconds", + "hoursminutes", + "hoursminutesseconds", + "minutesseconds", + "secondsmilliseconds" + ], + "type": "string" + }, + "LocalSingleTimeUnit": { + "enum": [ + "year", + "quarter", + "month", + "week", + "day", + "dayofyear", + "date", + "hours", + "minutes", + "seconds", + "milliseconds" + ], + "type": "string" + }, + "LoessTransform": { + "additionalProperties": false, + "properties": { + "as": { + "description": "The output field names for the smoothed points generated by the loess transform.\n\n__Default value:__ The field names of the input x and y values.", + "items": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "$ref": "#/definitions/FieldName" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "bandwidth": { + "description": "A bandwidth parameter in the range `[0, 1]` that determines the amount of smoothing.\n\n__Default value:__ `0.3`", + "type": "number" + }, + "groupby": { + "description": "The data fields to group by. If not specified, a single group containing all data objects will be used.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "loess": { + "$ref": "#/definitions/FieldName", + "description": "The data field of the dependent variable to smooth." + }, + "on": { + "$ref": "#/definitions/FieldName", + "description": "The data field of the independent variable to use a predictor." + } + }, + "required": [ + "loess", + "on" + ], + "type": "object" + }, + "LogicalAnd": { + "additionalProperties": false, + "properties": { + "and": { + "items": { + "$ref": "#/definitions/PredicateComposition" + }, + "type": "array" + } + }, + "required": [ + "and" + ], + "type": "object" + }, + "SelectionAnd": { + "additionalProperties": false, + "properties": { + "and": { + "items": { + "$ref": "#/definitions/SelectionComposition" + }, + "type": "array" + } + }, + "required": [ + "and" + ], + "type": "object" + }, + "PredicateComposition": { + "anyOf": [ + { + "$ref": "#/definitions/LogicalNot" + }, + { + "$ref": "#/definitions/LogicalAnd" + }, + { + "$ref": "#/definitions/LogicalOr" + }, + { + "$ref": "#/definitions/Predicate" + } + ] + }, + "SelectionComposition": { + "anyOf": [ + { + "$ref": "#/definitions/SelectionNot" + }, + { + "$ref": "#/definitions/SelectionAnd" + }, + { + "$ref": "#/definitions/SelectionOr" + }, + { + "type": "string" + } + ] + }, + "LogicalNot": { + "additionalProperties": false, + "properties": { + "not": { + "$ref": "#/definitions/PredicateComposition" + } + }, + "required": [ + "not" + ], + "type": "object" + }, + "SelectionNot": { + "additionalProperties": false, + "properties": { + "not": { + "$ref": "#/definitions/SelectionComposition" + } + }, + "required": [ + "not" + ], + "type": "object" + }, + "LogicalOr": { + "additionalProperties": false, + "properties": { + "or": { + "items": { + "$ref": "#/definitions/PredicateComposition" + }, + "type": "array" + } + }, + "required": [ + "or" + ], + "type": "object" + }, + "SelectionOr": { + "additionalProperties": false, + "properties": { + "or": { + "items": { + "$ref": "#/definitions/SelectionComposition" + }, + "type": "array" + } + }, + "required": [ + "or" + ], + "type": "object" + }, + "LookupData": { + "additionalProperties": false, + "properties": { + "data": { + "$ref": "#/definitions/Data", + "description": "Secondary data source to lookup in." + }, + "fields": { + "description": "Fields in foreign data or selection to lookup. If not specified, the entire object is queried.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "key": { + "$ref": "#/definitions/FieldName", + "description": "Key in data to lookup." + } + }, + "required": [ + "data", + "key" + ], + "type": "object" + }, + "LookupSelection": { + "additionalProperties": false, + "properties": { + "fields": { + "description": "Fields in foreign data or selection to lookup. If not specified, the entire object is queried.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "key": { + "$ref": "#/definitions/FieldName", + "description": "Key in data to lookup." + }, + "selection": { + "description": "Selection name to look up.", + "type": "string" + } + }, + "required": [ + "key", + "selection" + ], + "type": "object" + }, + "LookupTransform": { + "additionalProperties": false, + "properties": { + "as": { + "anyOf": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + } + ], + "description": "The output fields on which to store the looked up data values.\n\nFor data lookups, this property may be left blank if `from.fields` has been specified (those field names will be used); if `from.fields` has not been specified, `as` must be a string.\n\nFor 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`." + }, + "default": { + "description": "The default value to use if lookup fails.\n\n__Default value:__ `null`", + "type": "string" + }, + "from": { + "anyOf": [ + { + "$ref": "#/definitions/LookupData" + }, + { + "$ref": "#/definitions/LookupSelection" + } + ], + "description": "Data source or selection for secondary data reference." + }, + "lookup": { + "description": "Key in primary data source.", + "type": "string" + } + }, + "required": [ + "lookup", + "from" + ], + "type": "object" + }, + "Mark": { + "description": "All types of primitive marks.", + "enum": [ + "arc", + "area", + "bar", + "image", + "line", + "point", + "rect", + "rule", + "text", + "tick", + "trail", + "circle", + "square", + "geoshape" + ], + "type": "string" + }, + "MarkConfig<>": { + "additionalProperties": false, + "properties": { + "align": { + "$ref": "#/definitions/Align", + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + "aria": { + "description": "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.", + "type": "boolean" + }, + "ariaRole": { + "description": "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.", + "type": "string" + }, + "ariaRoleDescription": { + "description": "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.", + "type": "string" + }, + "aspect": { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + "baseline": { + "$ref": "#/definitions/TextBaseline", + "description": "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 `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "blend": { + "$ref": "#/definitions/Blend", + "description": "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.\n\n__Default value: `\"source-over\"`" + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + } + ], + "description": "Default color.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](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": { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + "cornerRadiusBottomLeft": { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + "cornerRadiusBottomRight": { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + "cornerRadiusTopLeft": { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + "cornerRadiusTopRight": { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + "cursor": { + "$ref": "#/definitions/Cursor", + "description": "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": { + "description": "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).", + "type": "string" + }, + "dir": { + "$ref": "#/definitions/TextDirection", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + "dx": { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "dy": { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + "ellipsis": { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + "endAngle": { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + "fontSize": { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + "fontStyle": { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + "fontWeight": { + "$ref": "#/definitions/FontWeight", + "description": "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": { + "description": "Height of the marks.", + "type": "number" + }, + "href": { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + "innerRadius": { + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.", + "type": "number" + }, + "interpolate": { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"basis\"`: a B-spline, with control point duplication on the ends. - `\"basis-open\"`: an open B-spline; may not intersect the start or end. - `\"basis-closed\"`: a closed B-spline, as in a loop. - `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends. - `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points. - `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop. - `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline. - `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`). - If set to `\"filter\"` (default), all data items with null values will be skipped (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.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + "lineBreak": { + "description": "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.", + "type": "string" + }, + "lineHeight": { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + "opacity": { + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. - For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension. - For area, this property determines the orient property of the Vega output. - For line and trail marks, this property determines the sort order of the points in 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": { + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.", + "type": "number" + }, + "padAngle": { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + "radius": { + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.", + "type": "number" + }, + "radius2": { + "description": "The secondary (inner) radius in pixels of arc marks.", + "type": "number" + }, + "shape": { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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.)\n\n__Default value:__ `\"circle\"`" + }, + "size": { + "description": "Default size for marks. - For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value. - For `bar`, this represents the band size of the bar, in pixels. - For `text`, this represents the font size, in pixels.\n\n__Default value:__ - `30` for point, circle, square marks; width/height's `step` - `2` for bar marks with discrete dimensions; - `5` for bar marks with continuous dimensions; - `11` for text marks.", + "minimum": 0, + "type": "number" + }, + "smooth": { + "description": "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.", + "type": "boolean" + }, + "startAngle": { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + "strokeDash": { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + "strokeDashOffset": { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + "strokeJoin": { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + "strokeMiterLimit": { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + "strokeOffset": { + "description": "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.", + "type": "number" + }, + "strokeOpacity": { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "strokeWidth": { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + "tension": { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + "text": { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + "theta": { + "description": "- 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.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + "theta2": { + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise.", + "type": "number" + }, + "timeUnitBand": { + "description": "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.", + "type": "number" + }, + "timeUnitBandPosition": { + "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used. - If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used. - If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "url": { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + "width": { + "description": "Width of the marks.", + "type": "number" + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "MarkConfig": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "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 `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "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.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "Default color.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](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": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "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).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "endAngle": { + "anyOf": [ + { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`." + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"basis\"`: a B-spline, with control point duplication on the ends. - `\"basis-open\"`: an open B-spline; may not intersect the start or end. - `\"basis-closed\"`: a closed B-spline, as in a loop. - `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends. - `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points. - `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop. - `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline. - `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`). - If set to `\"filter\"` (default), all data items with null values will be skipped (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.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "lineBreak": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. - For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension. - For area, this property determines the orient property of the Vega output. - For line and trail marks, this property determines the sort order of the points in 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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties." + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "Default size for marks. - For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value. - For `bar`, this represents the band size of the bar, in pixels. - For `text`, this represents the font size, in pixels.\n\n__Default value:__ - `30` for point, circle, square marks; width/height's `step` - `2` for bar marks with discrete dimensions; - `5` for bar marks with continuous dimensions; - `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "startAngle": { + "anyOf": [ + { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "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.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "tension": { + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "- 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.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "timeUnitBand": { + "description": "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.", + "type": "number" + }, + "timeUnitBandPosition": { + "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used. - If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used. - If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "width": { + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprOrSignalRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "MarkConfig": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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 `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "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.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](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": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "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).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "endAngle": { + "anyOf": [ + { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`." + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"basis\"`: a B-spline, with control point duplication on the ends. - `\"basis-open\"`: an open B-spline; may not intersect the start or end. - `\"basis-closed\"`: a closed B-spline, as in a loop. - `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends. - `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points. - `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop. - `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline. - `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`). - If set to `\"filter\"` (default), all data items with null values will be skipped (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.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineBreak": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. - For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension. - For area, this property determines the orient property of the Vega output. - For line and trail marks, this property determines the sort order of the points in 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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties." + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default size for marks. - For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value. - For `bar`, this represents the band size of the bar, in pixels. - For `text`, this represents the font size, in pixels.\n\n__Default value:__ - `30` for point, circle, square marks; width/height's `step` - `2` for bar marks with discrete dimensions; - `5` for bar marks with continuous dimensions; - `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "startAngle": { + "anyOf": [ + { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "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.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tension": { + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- 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.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "timeUnitBand": { + "description": "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.", + "type": "number" + }, + "timeUnitBandPosition": { + "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used. - If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used. - If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "MarkDef": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "bandSize": { + "description": "The width of the ticks.\n\n__Default value:__ 3/4 of step (width step for horizontal ticks and height step for vertical ticks).", + "minimum": 0, + "type": "number" + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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 `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "binSpacing": { + "description": "Offset between bars for binned field. The ideal value for this is either 0 (preferred by statisticians) or 1 (Vega-Lite default, D3 example style).\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "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.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "clip": { + "description": "Whether a mark be clipped to the enclosing group’s width and height.", + "type": "boolean" + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](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`." + }, + "continuousBandSize": { + "description": "The default size of the bars on continuous scales.\n\n__Default value:__ `5`", + "minimum": 0, + "type": "number" + }, + "cornerRadius": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusEnd": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- For vertical bars, top-left and top-right corner radius. - For horizontal bars, top-right and bottom-right corner radius." + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "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).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "discreteBandSize": { + "description": "The default size of the bars with discrete dimensions. If unspecified, the default size is `step-2`, which provides 2 pixel offset between bars.", + "minimum": 0, + "type": "number" + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`." + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"basis\"`: a B-spline, with control point duplication on the ends. - `\"basis-open\"`: an open B-spline; may not intersect the start or end. - `\"basis-closed\"`: a closed B-spline, as in a loop. - `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends. - `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points. - `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop. - `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline. - `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`). - If set to `\"filter\"` (default), all data items with null values will be skipped (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.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "line": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/OverlayMarkDef" + } + ], + "description": "A flag for overlaying line on top of area marks, or an object defining the properties of the overlayed lines.\n\n- If this value is an empty object (`{}`) or `true`, lines with default properties will be used.\n\n- If this value is `false`, no lines would be automatically added to area marks.\n\n__Default value:__ `false`." + }, + "lineBreak": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. - For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension. - For area, this property determines the orient property of the Vega output. - For line and trail marks, this property determines the sort order of the points in 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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "point": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/OverlayMarkDef" + }, + { + "const": "transparent", + "type": "string" + } + ], + "description": "A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points.\n\n- If this property is `\"transparent\"`, transparent points will be used (for enhancing tooltips and selections).\n\n- If this property is an empty object (`{}`) or `true`, filled points with default properties will be used.\n\n- If this property is `false`, no points would be automatically added to line or area marks.\n\n__Default value:__ `false`." + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties." + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks." + }, + "radius2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for radius2." + }, + "radiusOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for radius." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default size for marks. - For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value. - For `bar`, this represents the band size of the bar, in pixels. - For `text`, this represents the font size, in pixels.\n\n__Default value:__ - `30` for point, circle, square marks; width/height's `step` - `2` for bar marks with discrete dimensions; - `5` for bar marks with continuous dimensions; - `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "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.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "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](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is an array, later styles will override earlier styles. Any [mark properties](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) explicitly defined within the `encoding` will override a style default.\n\n__Default value:__ The mark's name. For example, a bar mark will have style `\"bar\"` by default. __Note:__ Any specified style will augment the default style. 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": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- 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.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "theta2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for theta2." + }, + "thetaOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for theta." + }, + "thickness": { + "description": "Thickness of the tick mark.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "timeUnitBand": { + "description": "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.", + "type": "number" + }, + "timeUnitBandPosition": { + "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used. - If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used. - If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "type": { + "$ref": "#/definitions/Mark", + "description": "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\"`)." + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for x2-position." + }, + "xOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for x-position." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for y2-position." + }, + "yOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for y-position." + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "MarkPropDef<(Gradient|string|null)>": { + "anyOf": [ + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/ValueDefWithCondition" + } + ] + }, + "MarkPropDef<(string|null),TypeForShape>": { + "anyOf": [ + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition,(string|null)>" + }, + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/ValueDefWithCondition,(string|null)>" + } + ] + }, + "MarkPropDef": { + "anyOf": [ + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/ValueDefWithCondition" + } + ] + }, + "MarkPropDef": { + "anyOf": [ + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/ValueDefWithCondition" + } + ] + }, + "MarkType": { + "enum": [ + "arc", + "area", + "image", + "group", + "line", + "path", + "rect", + "rule", + "shape", + "symbol", + "text", + "trail" + ], + "type": "string" + }, + "MergedStream": { + "additionalProperties": false, + "properties": { + "between": { + "items": { + "$ref": "#/definitions/Stream" + }, + "type": "array" + }, + "consume": { + "type": "boolean" + }, + "debounce": { + "type": "number" + }, + "filter": { + "anyOf": [ + { + "$ref": "#/definitions/Expr" + }, + { + "items": { + "$ref": "#/definitions/Expr" + }, + "type": "array" + } + ] + }, + "markname": { + "type": "string" + }, + "marktype": { + "$ref": "#/definitions/MarkType" + }, + "merge": { + "items": { + "$ref": "#/definitions/Stream" + }, + "type": "array" + }, + "throttle": { + "type": "number" + } + }, + "required": [ + "merge" + ], + "type": "object" + }, + "Month": { + "maximum": 12, + "minimum": 1, + "type": "number" + }, + "MultiSelection": { + "additionalProperties": false, + "properties": { + "bind": { + "$ref": "#/definitions/LegendBinding", + "description": "When set, a selection is populated by interacting with the corresponding legend. Direct manipulation interaction is disabled by default; to re-enable it, set the selection's [`on`](https://vega.github.io/vega-lite/docs/selection.html#common-selection-properties) property.\n\nLegend bindings are restricted to selections that only specify a single field or encoding." + }, + "clear": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. Can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + }, + "empty": { + "description": "By default, `all` data values are considered to lie within an empty selection. When set to `none`, empty selections contain no data values.", + "enum": [ + "all", + "none" + ], + "type": "string" + }, + "encodings": { + "description": "An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/SingleDefUnitChannel" + }, + "type": "array" + }, + "fields": { + "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "init": { + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and an initial value (or array of values).\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation.", + "items": { + "$ref": "#/definitions/SelectionInitMapping" + }, + "type": "array" + }, + "nearest": { + "description": "When true, an invisible voronoi diagram is computed to accelerate discrete selection. The data value _nearest_ the mouse cursor is added to the selection.\n\n__See also:__ [`nearest`](https://vega.github.io/vega-lite/docs/nearest.html) documentation.", + "type": "boolean" + }, + "on": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + } + ], + "description": "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](https://vega.github.io/vega/docs/event-streams/#between-filters)." + }, + "resolve": { + "$ref": "#/definitions/SelectionResolution", + "description": "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.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + }, + "toggle": { + "description": "Controls whether data values should be toggled or only ever inserted into multi selections. Can be `true`, `false` (for insertion only), or a [Vega expression](https://vega.github.io/vega/docs/expressions/).\n\n__Default value:__ `true`, which corresponds to `event.shiftKey` (i.e., data values are toggled when a user interacts with the shift-key pressed).\n\nSetting the value to the Vega expression `\"true\"` will toggle data values without the user pressing the shift-key.\n\n__See also:__ [`toggle`](https://vega.github.io/vega-lite/docs/toggle.html) documentation.", + "type": [ + "string", + "boolean" + ] + }, + "type": { + "const": "multi", + "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports three selection types:\n\n- `\"single\"` -- to select a single discrete data value on `click`. - `\"multi\"` -- to select multiple discrete data value; 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`.", + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "MultiSelectionConfig": { + "additionalProperties": false, + "properties": { + "bind": { + "$ref": "#/definitions/LegendBinding", + "description": "When set, a selection is populated by interacting with the corresponding legend. Direct manipulation interaction is disabled by default; to re-enable it, set the selection's [`on`](https://vega.github.io/vega-lite/docs/selection.html#common-selection-properties) property.\n\nLegend bindings are restricted to selections that only specify a single field or encoding." + }, + "clear": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. Can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + }, + "empty": { + "description": "By default, `all` data values are considered to lie within an empty selection. When set to `none`, empty selections contain no data values.", + "enum": [ + "all", + "none" + ], + "type": "string" + }, + "encodings": { + "description": "An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/SingleDefUnitChannel" + }, + "type": "array" + }, + "fields": { + "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "init": { + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and an initial value (or array of values).\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation.", + "items": { + "$ref": "#/definitions/SelectionInitMapping" + }, + "type": "array" + }, + "nearest": { + "description": "When true, an invisible voronoi diagram is computed to accelerate discrete selection. The data value _nearest_ the mouse cursor is added to the selection.\n\n__See also:__ [`nearest`](https://vega.github.io/vega-lite/docs/nearest.html) documentation.", + "type": "boolean" + }, + "on": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + } + ], + "description": "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](https://vega.github.io/vega/docs/event-streams/#between-filters)." + }, + "resolve": { + "$ref": "#/definitions/SelectionResolution", + "description": "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.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + }, + "toggle": { + "description": "Controls whether data values should be toggled or only ever inserted into multi selections. Can be `true`, `false` (for insertion only), or a [Vega expression](https://vega.github.io/vega/docs/expressions/).\n\n__Default value:__ `true`, which corresponds to `event.shiftKey` (i.e., data values are toggled when a user interacts with the shift-key pressed).\n\nSetting the value to the Vega expression `\"true\"` will toggle data values without the user pressing the shift-key.\n\n__See also:__ [`toggle`](https://vega.github.io/vega-lite/docs/toggle.html) documentation.", + "type": [ + "string", + "boolean" + ] + } + }, + "type": "object" + }, + "MultiTimeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/LocalMultiTimeUnit" + }, + { + "$ref": "#/definitions/UtcMultiTimeUnit" + } + ] + }, + "NamedData": { + "additionalProperties": false, + "properties": { + "format": { + "$ref": "#/definitions/DataFormat", + "description": "An object that specifies the format for parsing the data." + }, + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "NonArgAggregateOp": { + "enum": [ + "average", + "count", + "distinct", + "max", + "mean", + "median", + "min", + "missing", + "product", + "q1", + "q3", + "ci0", + "ci1", + "stderr", + "stdev", + "stdevp", + "sum", + "valid", + "values", + "variance", + "variancep" + ], + "type": "string" + }, + "NonLayerRepeatSpec": { + "additionalProperties": false, + "description": "Base interface for a repeat specification.", + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other. - For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size. - For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "repeat": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/definitions/RepeatMapping" + } + ], + "description": "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 number of columns to control the wrapping. 2) An object that maps `\"row\"` and/or `\"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." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "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.\n\n__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)" + }, + "spec": { + "$ref": "#/definitions/Spec", + "description": "A specification of the view that gets repeated." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + } + }, + "required": [ + "repeat", + "spec" + ], + "type": "object" + }, + "NumericArrayMarkPropDef": { + "$ref": "#/definitions/MarkPropDef" + }, + "NumericMarkPropDef": { + "$ref": "#/definitions/MarkPropDef" + }, + "NumericValueDef": { + "$ref": "#/definitions/ValueDef<(number|ExprRef)>" + }, + "OrderFieldDef": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": { + "$ref": "#/definitions/SortOrder", + "description": "The sort order. One of `\"ascending\"` (default) or `\"descending\"`." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "OrderValueDef": { + "additionalProperties": false, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "Orient": { + "enum": [ + "left", + "right", + "top", + "bottom" + ], + "type": "string" + }, + "Orientation": { + "enum": [ + "horizontal", + "vertical" + ], + "type": "string" + }, + "OverlayMarkDef": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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 `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "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.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "clip": { + "description": "Whether a mark be clipped to the enclosing group’s width and height.", + "type": "boolean" + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](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": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "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).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "endAngle": { + "anyOf": [ + { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`." + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"basis\"`: a B-spline, with control point duplication on the ends. - `\"basis-open\"`: an open B-spline; may not intersect the start or end. - `\"basis-closed\"`: a closed B-spline, as in a loop. - `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends. - `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points. - `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop. - `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline. - `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`). - If set to `\"filter\"` (default), all data items with null values will be skipped (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.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineBreak": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. - For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension. - For area, this property determines the orient property of the Vega output. - For line and trail marks, this property determines the sort order of the points in 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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties." + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks." + }, + "radius2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for radius2." + }, + "radiusOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for radius." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default size for marks. - For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value. - For `bar`, this represents the band size of the bar, in pixels. - For `text`, this represents the font size, in pixels.\n\n__Default value:__ - `30` for point, circle, square marks; width/height's `step` - `2` for bar marks with discrete dimensions; - `5` for bar marks with continuous dimensions; - `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "startAngle": { + "anyOf": [ + { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "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.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "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](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is an array, later styles will override earlier styles. Any [mark properties](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) explicitly defined within the `encoding` will override a style default.\n\n__Default value:__ The mark's name. For example, a bar mark will have style `\"bar\"` by default. __Note:__ Any specified style will augment the default style. 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": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- 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.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "theta2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for theta2." + }, + "thetaOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for theta." + }, + "timeUnitBand": { + "description": "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.", + "type": "number" + }, + "timeUnitBandPosition": { + "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used. - If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used. - If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for x2-position." + }, + "xOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for x-position." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2Offset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for y2-position." + }, + "yOffset": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Offset for y-position." + } + }, + "type": "object" + }, + "Padding": { + "anyOf": [ + { + "type": "number" + }, + { + "additionalProperties": false, + "properties": { + "bottom": { + "type": "number" + }, + "left": { + "type": "number" + }, + "right": { + "type": "number" + }, + "top": { + "type": "number" + } + }, + "type": "object" + } + ], + "minimum": 0 + }, + "Parameter": { + "additionalProperties": false, + "properties": { + "bind": { + "$ref": "#/definitions/Binding", + "description": "Binds the parameter to an external input element such as a slider, selection list or radio button group." + }, + "description": { + "description": "A text description of the parameter, useful for inline documentation.", + "type": "string" + }, + "expr": { + "$ref": "#/definitions/Expr", + "description": "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." + }, + "name": { + "description": "Required. A unique name for the 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\".", + "type": "string" + }, + "value": { + "description": "The initial value of the parameter.\n\n__Default value:__ `undefined`" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "Parse": { + "additionalProperties": { + "$ref": "#/definitions/ParseValue" + }, + "type": "object" + }, + "ParseValue": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "const": "string", + "type": "string" + }, + { + "const": "boolean", + "type": "string" + }, + { + "const": "date", + "type": "string" + }, + { + "const": "number", + "type": "string" + } + ] + }, + "PivotTransform": { + "additionalProperties": false, + "properties": { + "groupby": { + "description": "The optional data fields to group by. If not specified, a single group containing all data objects will be used.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "limit": { + "description": "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`", + "type": "number" + }, + "op": { + "description": "The aggregation operation to apply to grouped `value` field values. __Default value:__ `sum`", + "type": "string" + }, + "pivot": { + "$ref": "#/definitions/FieldName", + "description": "The data field to pivot on. The unique values of this field become new field names in the output stream." + }, + "value": { + "$ref": "#/definitions/FieldName", + "description": "The data field to populate pivoted fields. The aggregate values of this field become the values of the new pivoted fields." + } + }, + "required": [ + "pivot", + "value" + ], + "type": "object" + }, + "PolarDef": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDefBase" + }, + { + "$ref": "#/definitions/PositionDatumDefBase" + }, + { + "$ref": "#/definitions/PositionValueDef" + } + ] + }, + "Position2Def": { + "anyOf": [ + { + "$ref": "#/definitions/SecondaryFieldDef" + }, + { + "$ref": "#/definitions/DatumDef" + }, + { + "$ref": "#/definitions/PositionValueDef" + } + ] + }, + "PositionDatumDef": { + "additionalProperties": false, + "properties": { + "axis": { + "anyOf": [ + { + "$ref": "#/definitions/Axis" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "impute": { + "anyOf": [ + { + "$ref": "#/definitions/ImputeParams" + }, + { + "type": "null" + } + ], + "description": "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 the `Impute` Operation.\n\n__See also:__ [`impute`](https://vega.github.io/vega-lite/docs/impute.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "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.\n\n`stack` can be one of the following values: - `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart). - `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
    -`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)). - `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "PositionDatumDefBase": { + "additionalProperties": false, + "properties": { + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "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.\n\n`stack` can be one of the following values: - `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart). - `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
    -`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)). - `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "PositionDef": { + "anyOf": [ + { + "$ref": "#/definitions/PositionFieldDef" + }, + { + "$ref": "#/definitions/PositionDatumDef" + }, + { + "$ref": "#/definitions/PositionValueDef" + } + ] + }, + "PositionFieldDef": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "axis": { + "anyOf": [ + { + "$ref": "#/definitions/Axis" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/ImputeParams" + }, + { + "type": "null" + } + ], + "description": "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 the `Impute` Operation.\n\n__See also:__ [`impute`](https://vega.github.io/vega-lite/docs/impute.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "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.\n\n`stack` can be one of the following values: - `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart). - `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
    -`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)). - `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "PositionFieldDefBase": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "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.\n\n`stack` can be one of the following values: - `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart). - `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
    -`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)). - `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "PositionValueDef": { + "$ref": "#/definitions/ValueDef<(number|\"width\"|\"height\"|ExprRef)>" + }, + "Predicate": { + "anyOf": [ + { + "$ref": "#/definitions/FieldEqualPredicate" + }, + { + "$ref": "#/definitions/FieldRangePredicate" + }, + { + "$ref": "#/definitions/FieldOneOfPredicate" + }, + { + "$ref": "#/definitions/FieldLTPredicate" + }, + { + "$ref": "#/definitions/FieldGTPredicate" + }, + { + "$ref": "#/definitions/FieldLTEPredicate" + }, + { + "$ref": "#/definitions/FieldGTEPredicate" + }, + { + "$ref": "#/definitions/FieldValidPredicate" + }, + { + "$ref": "#/definitions/SelectionPredicate" + }, + { + "type": "string" + } + ] + }, + "PrimitiveValue": { + "type": [ + "number", + "string", + "boolean", + "null" + ] + }, + "Projection": { + "additionalProperties": false, + "properties": { + "center": { + "$ref": "#/definitions/Vector2", + "description": "The projection's center, a two-element array of longitude and latitude in degrees.\n\n__Default value:__ `[0, 0]`" + }, + "clipAngle": { + "description": "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.", + "type": "number" + }, + "clipExtent": { + "$ref": "#/definitions/Vector2>", + "description": "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": { + "type": "number" + }, + "distance": { + "type": "number" + }, + "extent": { + "$ref": "#/definitions/Vector2>" + }, + "fit": { + "anyOf": [ + { + "$ref": "#/definitions/Fit" + }, + { + "items": { + "$ref": "#/definitions/Fit" + }, + "type": "array" + } + ] + }, + "fraction": { + "type": "number" + }, + "lobes": { + "type": "number" + }, + "parallel": { + "type": "number" + }, + "parallels": { + "description": "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.", + "items": { + "type": "number" + }, + "type": "array" + }, + "pointRadius": { + "description": "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.\n\n__Default value:__ `4.5`", + "type": "number" + }, + "precision": { + "description": "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…`.", + "type": "number" + }, + "radius": { + "type": "number" + }, + "ratio": { + "type": "number" + }, + "reflectX": { + "type": "boolean" + }, + "reflectY": { + "type": "boolean" + }, + "rotate": { + "anyOf": [ + { + "$ref": "#/definitions/Vector2" + }, + { + "$ref": "#/definitions/Vector3" + } + ], + "description": "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.)\n\n__Default value:__ `[0, 0, 0]`" + }, + "scale": { + "description": "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.", + "type": "number" + }, + "size": { + "$ref": "#/definitions/Vector2" + }, + "spacing": { + "type": "number" + }, + "tilt": { + "type": "number" + }, + "translate": { + "$ref": "#/definitions/Vector2", + "description": "The projection’s translation offset as a two-element array `[tx, ty]`." + }, + "type": { + "$ref": "#/definitions/ProjectionType", + "description": "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](https://vega.github.io/vega-lite/docs/projection.html#projection-types).\n\n__Default value:__ `mercator`" + } + }, + "type": "object" + }, + "ProjectionConfig": { + "$ref": "#/definitions/Projection", + "description": "Any property of Projection can be in config" + }, + "ProjectionType": { + "enum": [ + "albers", + "albersUsa", + "azimuthalEqualArea", + "azimuthalEquidistant", + "conicConformal", + "conicEqualArea", + "conicEquidistant", + "equalEarth", + "equirectangular", + "gnomonic", + "identity", + "mercator", + "naturalEarth1", + "orthographic", + "stereographic", + "transverseMercator" + ], + "type": "string" + }, + "QuantileTransform": { + "additionalProperties": false, + "properties": { + "as": { + "description": "The output field names for the probability and quantile values.\n\n__Default value:__ `[\"prob\", \"value\"]`", + "items": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "$ref": "#/definitions/FieldName" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "groupby": { + "description": "The data fields to group by. If not specified, a single group containing all data objects will be used.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "probs": { + "description": "An array of probabilities in the range (0, 1) for which to compute quantile values. If not specified, the *step* parameter will be used.", + "items": { + "type": "number" + }, + "type": "array" + }, + "quantile": { + "$ref": "#/definitions/FieldName", + "description": "The data field for which to perform quantile estimation." + }, + "step": { + "description": "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.", + "type": "number" + } + }, + "required": [ + "quantile" + ], + "type": "object" + }, + "RadialGradient": { + "additionalProperties": false, + "properties": { + "gradient": { + "const": "radial", + "description": "The type of gradient. Use `\"radial\"` for a radial gradient.", + "type": "string" + }, + "id": { + "type": "string" + }, + "r1": { + "description": "The radius length, in normalized [0, 1] coordinates, of the inner circle for the gradient.\n\n__Default value:__ `0`", + "type": "number" + }, + "r2": { + "description": "The radius length, in normalized [0, 1] coordinates, of the outer circle for the gradient.\n\n__Default value:__ `0.5`", + "type": "number" + }, + "stops": { + "description": "An array of gradient stops defining the gradient color sequence.", + "items": { + "$ref": "#/definitions/GradientStop" + }, + "type": "array" + }, + "x1": { + "description": "The x-coordinate, in normalized [0, 1] coordinates, for the center of the inner circle for the gradient.\n\n__Default value:__ `0.5`", + "type": "number" + }, + "x2": { + "description": "The x-coordinate, in normalized [0, 1] coordinates, for the center of the outer circle for the gradient.\n\n__Default value:__ `0.5`", + "type": "number" + }, + "y1": { + "description": "The y-coordinate, in normalized [0, 1] coordinates, for the center of the inner circle for the gradient.\n\n__Default value:__ `0.5`", + "type": "number" + }, + "y2": { + "description": "The y-coordinate, in normalized [0, 1] coordinates, for the center of the outer circle for the gradient.\n\n__Default value:__ `0.5`", + "type": "number" + } + }, + "required": [ + "gradient", + "stops" + ], + "type": "object" + }, + "RangeConfig": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/RangeScheme" + }, + { + "type": "array" + } + ] + }, + "properties": { + "category": { + "anyOf": [ + { + "$ref": "#/definitions/RangeScheme" + }, + { + "items": { + "$ref": "#/definitions/Color" + }, + "type": "array" + } + ], + "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for categorical data." + }, + "diverging": { + "anyOf": [ + { + "$ref": "#/definitions/RangeScheme" + }, + { + "items": { + "$ref": "#/definitions/Color" + }, + "type": "array" + } + ], + "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for diverging quantitative ramps." + }, + "heatmap": { + "anyOf": [ + { + "$ref": "#/definitions/RangeScheme" + }, + { + "items": { + "$ref": "#/definitions/Color" + }, + "type": "array" + } + ], + "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for quantitative heatmaps." + }, + "ordinal": { + "anyOf": [ + { + "$ref": "#/definitions/RangeScheme" + }, + { + "items": { + "$ref": "#/definitions/Color" + }, + "type": "array" + } + ], + "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for rank-ordered data." + }, + "ramp": { + "anyOf": [ + { + "$ref": "#/definitions/RangeScheme" + }, + { + "items": { + "$ref": "#/definitions/Color" + }, + "type": "array" + } + ], + "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for sequential quantitative ramps." + }, + "symbol": { + "description": "Array of [symbol](https://vega.github.io/vega/docs/marks/symbol/) names or paths for the default shape palette.", + "items": { + "$ref": "#/definitions/SymbolShape" + }, + "type": "array" + } + }, + "type": "object" + }, + "RangeEnum": { + "enum": [ + "width", + "height", + "symbol", + "category", + "ordinal", + "ramp", + "diverging", + "heatmap" + ], + "type": "string" + }, + "RangeRaw": { + "items": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/RangeRawArray" + } + ] + }, + "type": "array" + }, + "RangeRawArray": { + "items": { + "type": "number" + }, + "type": "array" + }, + "RangeScheme": { + "anyOf": [ + { + "$ref": "#/definitions/RangeEnum" + }, + { + "$ref": "#/definitions/RangeRaw" + }, + { + "additionalProperties": false, + "properties": { + "count": { + "type": "number" + }, + "extent": { + "items": { + "type": "number" + }, + "type": "array" + }, + "scheme": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ColorScheme" + } + ] + } + }, + "required": [ + "scheme" + ], + "type": "object" + } + ] + }, + "RectConfig": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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 `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "binSpacing": { + "description": "Offset between bars for binned field. The ideal value for this is either 0 (preferred by statisticians) or 1 (Vega-Lite default, D3 example style).\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "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.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](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`." + }, + "continuousBandSize": { + "description": "The default size of the bars on continuous scales.\n\n__Default value:__ `5`", + "minimum": 0, + "type": "number" + }, + "cornerRadius": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "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).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "discreteBandSize": { + "description": "The default size of the bars with discrete dimensions. If unspecified, the default size is `step-2`, which provides 2 pixel offset between bars.", + "minimum": 0, + "type": "number" + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "endAngle": { + "anyOf": [ + { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`." + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"basis\"`: a B-spline, with control point duplication on the ends. - `\"basis-open\"`: an open B-spline; may not intersect the start or end. - `\"basis-closed\"`: a closed B-spline, as in a loop. - `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends. - `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points. - `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop. - `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline. - `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`). - If set to `\"filter\"` (default), all data items with null values will be skipped (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.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineBreak": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. - For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension. - For area, this property determines the orient property of the Vega output. - For line and trail marks, this property determines the sort order of the points in 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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties." + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default size for marks. - For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value. - For `bar`, this represents the band size of the bar, in pixels. - For `text`, this represents the font size, in pixels.\n\n__Default value:__ - `30` for point, circle, square marks; width/height's `step` - `2` for bar marks with discrete dimensions; - `5` for bar marks with continuous dimensions; - `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "startAngle": { + "anyOf": [ + { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "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.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tension": { + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- 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.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "timeUnitBand": { + "description": "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.", + "type": "number" + }, + "timeUnitBandPosition": { + "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used. - If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used. - If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "RegressionTransform": { + "additionalProperties": false, + "properties": { + "as": { + "description": "The output field names for the smoothed points generated by the regression transform.\n\n__Default value:__ The field names of the input x and y values.", + "items": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "$ref": "#/definitions/FieldName" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "extent": { + "description": "A [min, max] domain over the independent (x) field for the starting and ending points of the generated trend line.", + "items": [ + { + "type": "number" + }, + { + "type": "number" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "groupby": { + "description": "The data fields to group by. If not specified, a single group containing all data objects will be used.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "method": { + "description": "The functional form of the regression model. One of `\"linear\"`, `\"log\"`, `\"exp\"`, `\"pow\"`, `\"quad\"`, or `\"poly\"`.\n\n__Default value:__ `\"linear\"`", + "enum": [ + "linear", + "log", + "exp", + "pow", + "quad", + "poly" + ], + "type": "string" + }, + "on": { + "$ref": "#/definitions/FieldName", + "description": "The data field of the independent variable to use a predictor." + }, + "order": { + "description": "The polynomial order (number of coefficients) for the 'poly' method.\n\n__Default value:__ `3`", + "type": "number" + }, + "params": { + "description": "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 intercept term and then including terms of increasing order) and an `rSquared` value (indicating the total variance explained by the model).\n\n__Default value:__ `false`", + "type": "boolean" + }, + "regression": { + "$ref": "#/definitions/FieldName", + "description": "The data field of the dependent variable to predict." + } + }, + "required": [ + "regression", + "on" + ], + "type": "object" + }, + "RepeatMapping": { + "additionalProperties": false, + "properties": { + "column": { + "description": "An array of fields to be repeated horizontally.", + "items": { + "type": "string" + }, + "type": "array" + }, + "row": { + "description": "An array of fields to be repeated vertically.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "RepeatRef": { + "additionalProperties": false, + "description": "Reference to a repeated value.", + "properties": { + "repeat": { + "enum": [ + "row", + "column", + "repeat", + "layer" + ], + "type": "string" + } + }, + "required": [ + "repeat" + ], + "type": "object" + }, + "RepeatSpec": { + "anyOf": [ + { + "$ref": "#/definitions/NonLayerRepeatSpec" + }, + { + "$ref": "#/definitions/LayerRepeatSpec" + } + ] + }, + "Resolve": { + "additionalProperties": false, + "description": "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\"`.", + "properties": { + "axis": { + "$ref": "#/definitions/AxisResolveMap" + }, + "legend": { + "$ref": "#/definitions/LegendResolveMap" + }, + "scale": { + "$ref": "#/definitions/ScaleResolveMap" + } + }, + "type": "object" + }, + "ResolveMode": { + "enum": [ + "independent", + "shared" + ], + "type": "string" + }, + "RowCol": { + "additionalProperties": false, + "properties": { + "column": { + "$ref": "#/definitions/LayoutAlign" + }, + "row": { + "$ref": "#/definitions/LayoutAlign" + } + }, + "type": "object" + }, + "RowCol": { + "additionalProperties": false, + "properties": { + "column": { + "type": "boolean" + }, + "row": { + "type": "boolean" + } + }, + "type": "object" + }, + "RowCol": { + "additionalProperties": false, + "properties": { + "column": { + "type": "number" + }, + "row": { + "type": "number" + } + }, + "type": "object" + }, + "RowColumnEncodingFieldDef": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "align": { + "$ref": "#/definitions/LayoutAlign", + "description": "The alignment to apply to row/column facet's subplot. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other. - For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size. - For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "center": { + "description": "Boolean flag indicating if facet's subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": { + "$ref": "#/definitions/Header", + "description": "An object defining properties of a facet's header." + }, + "sort": { + "anyOf": [ + { + "$ref": "#/definitions/SortArray" + }, + { + "$ref": "#/definitions/SortOrder" + }, + { + "$ref": "#/definitions/EncodingSortField" + }, + { + "type": "null" + } + ], + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." + }, + "spacing": { + "description": "The spacing in pixels between facet's sub-views.\n\n__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)", + "type": "number" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "SampleTransform": { + "additionalProperties": false, + "properties": { + "sample": { + "description": "The maximum number of data objects to include in the sample.\n\n__Default value:__ `1000`", + "type": "number" + } + }, + "required": [ + "sample" + ], + "type": "object" + }, + "Scale": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The alignment of the steps within the scale range.\n\nThis value must lie in the range `[0,1]`. A value of `0.5` indicates that the steps should be centered within the range. A value of `0` or `1` may be used to shift the bands to one side, say to position them adjacent to an axis.\n\n__Default value:__ `0.5`" + }, + "base": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The logarithm base of the `log` scale (default `10`)." + }, + "bins": { + "$ref": "#/definitions/ScaleBins", + "description": "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: - An [array](../types/#Array) literal of bin boundary values. For example, `[0, 5, 10, 15, 20]`. The array must include both starting and ending boundaries. The previous example uses five values to indicate a total of four bin intervals: [0-5), [5-10), [10-15), [15-20]. Array literals may include signal references as elements. - A [bin specification object](https://vega.github.io/vega-lite/docs/scale.html#bins) that indicates the bin _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": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "If `true`, values that exceed the data domain are clamped to either the minimum or maximum range value\n\n__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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "A constant determining the slope of the symlog function around zero. Only used for `symlog` scales.\n\n__Default value:__ `1`" + }, + "domain": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "type": "array" + }, + { + "const": "unaggregated", + "type": "string" + }, + { + "$ref": "#/definitions/SelectionExtent" + }, + { + "$ref": "#/definitions/DomainUnionWith" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Customized domain values in the form of constant values or dynamic values driven by a selection.\n\n1) Constant `domain` for _quantitative_ fields can take one of the following forms:\n\n- A two-element array with minimum and maximum values. To create a diverging scale, this two-element array can be combined with the `domainMid` property. - An array with more than two entries, for [Piecewise quantitative scales](https://vega.github.io/vega-lite/docs/scale.html#piecewise). - A string value `\"unaggregated\"`, if the input field is aggregated, to indicate that the domain should include the raw data values prior to the aggregation.\n\n2) Constant `domain` for _temporal_ fields can be a two-element array with minimum and maximum values, in the form of either timestamps or the [DateTime definition objects](https://vega.github.io/vega-lite/docs/types.html#datetime).\n\n3) Constant `domain` for _ordinal_ and _nominal_ fields can be an array that lists valid input values.\n\n4) To combine (union) specified constant domain with the field's values, `domain` can be an object with a `unionWith` property that specify constant domain to be combined. For example, `domain: {unionWith: [0, 100]}` for a quantitative scale means that the scale domain always includes `[0, 100]`, but will include other values in the fields beyond `[0, 100]`.\n\n5) Domain can also takes an object defining a field or encoding of a selection that [interactively determines](https://vega.github.io/vega-lite/docs/selection.html#scale-domains) the scale domain." + }, + "domainMax": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Sets the minimum value in the scale domain, overriding the domain property. This property is only intended for use with scales having continuous domains." + }, + "exponent": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The exponent of the `pow` scale." + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/ScaleInterpolateEnum" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/ScaleInterpolateParams" + } + ], + "description": "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 `rgb`, `hsl`, `hsl-long`, `lab`, `hcl`, `hcl-long`, `cubehelix` and `cubehelix-long` ('-long' variants use longer paths in polar coordinate spaces). If object-valued, this property accepts an object with a string-valued _type_ property and an optional numeric _gamma_ property applicable to rgb and cubehelix interpolators. For more, see the [d3-interpolate documentation](https://github.com/d3/d3-interpolate).\n\n* __Default value:__ `hcl`" + }, + "nice": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "$ref": "#/definitions/TimeInterval" + }, + { + "$ref": "#/definitions/TimeIntervalStep" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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 irregular. For example, for a domain of _[0.201479…, 0.996679…]_, a nice domain might be _[0.2, 1.0]_.\n\nFor quantitative scales such as linear, `nice` can be either a boolean flag or a number. If `nice` is a number, it will represent a desired tick count. This allows greater control over the step size used to extend the bounds, guaranteeing that the returned ticks will exactly cover the domain.\n\nFor temporal fields with time and utc scales, the `nice` value can be a string indicating the desired time interval. Legal values are `\"millisecond\"`, `\"second\"`, `\"minute\"`, `\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, and `\"year\"`. Alternatively, `time` and `utc` scales can accept an object-valued interval specifier of the form `{\"interval\": \"month\", \"step\": 3}`, which includes a desired number of interval steps. Here, the domain would snap to quarter (Jan, Apr, Jul, Oct) boundaries.\n\n__Default value:__ `true` for unbinned _quantitative_ fields; `false` otherwise." + }, + "padding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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 function as intended. Padding adjustment is performed prior to all other adjustments, including the effects of the `zero`, `nice`, `domainMin`, and `domainMax` properties.\n\nFor _[band](https://vega.github.io/vega-lite/docs/scale.html#band)_ scales, shortcut for setting `paddingInner` and `paddingOuter` to the same value.\n\nFor _[point](https://vega.github.io/vega-lite/docs/scale.html#point)_ scales, alias for `paddingOuter`.\n\n__Default value:__ For _continuous_ scales, derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `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_.", + "minimum": 0 + }, + "paddingInner": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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].\n\nFor point scale, this property is invalid as point scales do not have internal band widths (only step sizes between bands).\n\n__Default value:__ derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `bandPaddingInner`.", + "maximum": 1, + "minimum": 0 + }, + "paddingOuter": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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].\n\n__Default value:__ derived from the [scale config](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_.", + "maximum": 1, + "minimum": 0 + }, + "range": { + "anyOf": [ + { + "$ref": "#/definitions/RangeEnum" + }, + { + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "type": "array" + }, + { + "additionalProperties": false, + "properties": { + "field": { + "type": "string" + } + }, + "required": [ + "field" + ], + "type": "object" + } + ], + "description": "The range of the scale. One of:\n\n- A string indicating a [pre-defined named scale range](https://vega.github.io/vega-lite/docs/scale.html#range-config) (e.g., example, `\"symbol\"`, or `\"diverging\"`).\n\n- For [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous), two-element array indicating minimum and maximum values, or an array with more than two entries for specifying a [piecewise scale](https://vega.github.io/vega-lite/docs/scale.html#piecewise).\n\n- For [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) and [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales, an array of desired output values or an object with a `field` property representing the range values. For example, if a field `color` contains CSS color names, we can set `range` to `{field: \"color\"}`.\n\n__Notes:__\n\n1) For color scales you can also specify a color [`scheme`](https://vega.github.io/vega-lite/docs/scale.html#scheme) instead of `range`.\n\n2) 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": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "If true, reverses the order of the scale range. __Default value:__ `false`." + }, + "round": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "If `true`, rounds numeric output values to integers. This can be helpful for snapping to the pixel grid.\n\n__Default value:__ `false`." + }, + "scheme": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/SchemeParams" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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](https://vega.github.io/vega-lite/docs/scale.html#scheme-params).\n\nDiscrete color schemes may be used with [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) or [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales. Continuous color schemes are intended for use with color scales.\n\nFor the full list of supported schemes, please refer to the [Vega Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference." + }, + "type": { + "$ref": "#/definitions/ScaleType", + "description": "The type of scale. Vega-Lite supports the following categories of scale types:\n\n1) [**Continuous Scales**](https://vega.github.io/vega-lite/docs/scale.html#continuous) -- mapping continuous domains to continuous output ranges ([`\"linear\"`](https://vega.github.io/vega-lite/docs/scale.html#linear), [`\"pow\"`](https://vega.github.io/vega-lite/docs/scale.html#pow), [`\"sqrt\"`](https://vega.github.io/vega-lite/docs/scale.html#sqrt), [`\"symlog\"`](https://vega.github.io/vega-lite/docs/scale.html#symlog), [`\"log\"`](https://vega.github.io/vega-lite/docs/scale.html#log), [`\"time\"`](https://vega.github.io/vega-lite/docs/scale.html#time), [`\"utc\"`](https://vega.github.io/vega-lite/docs/scale.html#utc).\n\n2) [**Discrete Scales**](https://vega.github.io/vega-lite/docs/scale.html#discrete) -- mapping discrete domains to discrete ([`\"ordinal\"`](https://vega.github.io/vega-lite/docs/scale.html#ordinal)) or continuous ([`\"band\"`](https://vega.github.io/vega-lite/docs/scale.html#band) and [`\"point\"`](https://vega.github.io/vega-lite/docs/scale.html#point)) output ranges.\n\n3) [**Discretizing Scales**](https://vega.github.io/vega-lite/docs/scale.html#discretizing) -- mapping continuous domains to discrete output ranges [`\"bin-ordinal\"`](https://vega.github.io/vega-lite/docs/scale.html#bin-ordinal), [`\"quantile\"`](https://vega.github.io/vega-lite/docs/scale.html#quantile), [`\"quantize\"`](https://vega.github.io/vega-lite/docs/scale.html#quantize) and [`\"threshold\"`](https://vega.github.io/vega-lite/docs/scale.html#threshold).\n\n__Default value:__ please see the [scale type table](https://vega.github.io/vega-lite/docs/scale.html#type)." + }, + "zero": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "If `true`, ensures that a zero baseline value is included in the scale domain.\n\n__Default value:__ `true` for x and y channels if the quantitative field is not binned and no custom `domain` is provided; `false` otherwise.\n\n__Note:__ Log, time, and utc scales do not support `zero`." + } + }, + "type": "object" + }, + "ScaleBinParams": { + "additionalProperties": false, + "properties": { + "start": { + "description": "The starting (lowest-valued) bin boundary.\n\n__Default value:__ The lowest value of the scale domain will be used.", + "type": "number" + }, + "step": { + "description": "The step size defining the bin interval width.", + "type": "number" + }, + "stop": { + "description": "The stopping (highest-valued) bin boundary.\n\n__Default value:__ The highest value of the scale domain will be used.", + "type": "number" + } + }, + "required": [ + "step" + ], + "type": "object" + }, + "ScaleBins": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ScaleBinParams" + } + ] + }, + "ScaleConfig": { + "additionalProperties": false, + "properties": { + "bandPaddingInner": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default inner padding for `x` and `y` band-ordinal scales.\n\n__Default value:__ - `barBandPaddingInner` for bar marks (`0.1` by default) - `rectBandPaddingInner` for rect and other marks (`0` by default)", + "maximum": 1, + "minimum": 0 + }, + "bandPaddingOuter": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default outer padding for `x` and `y` band-ordinal scales.\n\n__Default value:__ `paddingInner/2` (which makes _width/height = number of unique values * step_)", + "maximum": 1, + "minimum": 0 + }, + "barBandPaddingInner": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default inner padding for `x` and `y` band-ordinal scales of `\"bar\"` marks.\n\n__Default value:__ `0.1`", + "maximum": 1, + "minimum": 0 + }, + "clamp": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "If true, values that exceed the data domain are clamped to either the minimum or maximum range value" + }, + "continuousPadding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default padding for continuous scales.\n\n__Default:__ `5` for continuous x-scale of a vertical bar and continuous y-scale of a horizontal bar.; `0` otherwise.", + "minimum": 0 + }, + "maxBandSize": { + "description": "The default max value for mapping quantitative fields to bar's size/bandSize.\n\nIf undefined (default), we will use the axis's size (width or height) - 1.", + "minimum": 0, + "type": "number" + }, + "maxFontSize": { + "description": "The default max value for mapping quantitative fields to text's size/fontSize.\n\n__Default value:__ `40`", + "minimum": 0, + "type": "number" + }, + "maxOpacity": { + "description": "Default max opacity for mapping a field to opacity.\n\n__Default value:__ `0.8`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "maxSize": { + "description": "Default max value for point size scale.", + "minimum": 0, + "type": "number" + }, + "maxStrokeWidth": { + "description": "Default max strokeWidth for the scale of strokeWidth for rule and line marks and of size for trail marks.\n\n__Default value:__ `4`", + "minimum": 0, + "type": "number" + }, + "minBandSize": { + "description": "The default min value for mapping quantitative fields to bar and tick's size/bandSize scale with zero=false.\n\n__Default value:__ `2`", + "minimum": 0, + "type": "number" + }, + "minFontSize": { + "description": "The default min value for mapping quantitative fields to tick's size/fontSize scale with zero=false\n\n__Default value:__ `8`", + "minimum": 0, + "type": "number" + }, + "minOpacity": { + "description": "Default minimum opacity for mapping a field to opacity.\n\n__Default value:__ `0.3`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "minSize": { + "description": "Default minimum value for point size scale with zero=false.\n\n__Default value:__ `9`", + "minimum": 0, + "type": "number" + }, + "minStrokeWidth": { + "description": "Default minimum strokeWidth for the scale of strokeWidth for rule and line marks and of size for trail marks with zero=false.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "pointPadding": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default outer padding for `x` and `y` point-ordinal scales.\n\n__Default value:__ `0.5` (which makes _width/height = number of unique values * step_)", + "maximum": 1, + "minimum": 0 + }, + "quantileCount": { + "description": "Default range cardinality for [`quantile`](https://vega.github.io/vega-lite/docs/scale.html#quantile) scale.\n\n__Default value:__ `4`", + "minimum": 0, + "type": "number" + }, + "quantizeCount": { + "description": "Default range cardinality for [`quantize`](https://vega.github.io/vega-lite/docs/scale.html#quantize) scale.\n\n__Default value:__ `4`", + "minimum": 0, + "type": "number" + }, + "rectBandPaddingInner": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default inner padding for `x` and `y` band-ordinal scales of `\"rect\"` marks.\n\n__Default value:__ `0`", + "maximum": 1, + "minimum": 0 + }, + "round": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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": { + "description": "Use the source data range before aggregation as scale domain instead of aggregated data for aggregate axis.\n\nThis is equivalent to setting `domain` to `\"unaggregate\"` for aggregated _quantitative_ fields by default.\n\nThis property only works with aggregate functions that produce values within the raw data domain (`\"mean\"`, `\"average\"`, `\"median\"`, `\"q1\"`, `\"q3\"`, `\"min\"`, `\"max\"`). For other aggregations that produce values outside of the raw data domain (e.g. `\"count\"`, `\"sum\"`), this property is ignored.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "xReverse": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Reverse x-scale by default (useful for right-to-left charts)." + } + }, + "type": "object" + }, + "ScaleInterpolateEnum": { + "enum": [ + "rgb", + "lab", + "hcl", + "hsl", + "hsl-long", + "hcl-long", + "cubehelix", + "cubehelix-long" + ], + "type": "string" + }, + "ScaleInterpolateParams": { + "additionalProperties": false, + "properties": { + "gamma": { + "type": "number" + }, + "type": { + "enum": [ + "rgb", + "cubehelix", + "cubehelix-long" + ], + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "ScaleResolveMap": { + "additionalProperties": false, + "properties": { + "angle": { + "$ref": "#/definitions/ResolveMode" + }, + "color": { + "$ref": "#/definitions/ResolveMode" + }, + "fill": { + "$ref": "#/definitions/ResolveMode" + }, + "fillOpacity": { + "$ref": "#/definitions/ResolveMode" + }, + "opacity": { + "$ref": "#/definitions/ResolveMode" + }, + "radius": { + "$ref": "#/definitions/ResolveMode" + }, + "shape": { + "$ref": "#/definitions/ResolveMode" + }, + "size": { + "$ref": "#/definitions/ResolveMode" + }, + "stroke": { + "$ref": "#/definitions/ResolveMode" + }, + "strokeDash": { + "$ref": "#/definitions/ResolveMode" + }, + "strokeOpacity": { + "$ref": "#/definitions/ResolveMode" + }, + "strokeWidth": { + "$ref": "#/definitions/ResolveMode" + }, + "theta": { + "$ref": "#/definitions/ResolveMode" + }, + "x": { + "$ref": "#/definitions/ResolveMode" + }, + "y": { + "$ref": "#/definitions/ResolveMode" + } + }, + "type": "object" + }, + "ScaleType": { + "enum": [ + "linear", + "log", + "pow", + "sqrt", + "symlog", + "identity", + "sequential", + "time", + "utc", + "quantile", + "quantize", + "threshold", + "bin-ordinal", + "ordinal", + "point", + "band" + ], + "type": "string" + }, + "SchemeParams": { + "additionalProperties": false, + "properties": { + "count": { + "description": "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.", + "type": "number" + }, + "extent": { + "description": "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.", + "items": { + "type": "number" + }, + "type": "array" + }, + "name": { + "description": "A color scheme name for ordinal scales (e.g., `\"category10\"` or `\"blues\"`).\n\nFor the full list of supported schemes, please refer to the [Vega Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "SecondaryFieldDef": { + "additionalProperties": false, + "description": "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`.", + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", + "type": "null" + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + } + }, + "type": "object" + }, + "SelectionConfig": { + "additionalProperties": false, + "properties": { + "interval": { + "$ref": "#/definitions/IntervalSelectionConfig", + "description": "The default definition for an [`interval`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All properties and transformations for an interval selection definition (except `type`) may be specified here.\n\nFor instance, setting `interval` to `{\"translate\": false}` disables the ability to move interval selections by default." + }, + "multi": { + "$ref": "#/definitions/MultiSelectionConfig", + "description": "The default definition for a [`multi`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All properties and transformations for a multi selection definition (except `type`) may be specified here.\n\nFor instance, setting `multi` to `{\"toggle\": \"event.altKey\"}` adds additional values to multi selections when clicking with the alt-key pressed by default." + }, + "single": { + "$ref": "#/definitions/SingleSelectionConfig", + "description": "The default definition for a [`single`](https://vega.github.io/vega-lite/docs/selection.html#type) selection. All properties and transformations for a single selection definition (except `type`) may be specified here.\n\nFor instance, setting `single` to `{\"on\": \"dblclick\"}` populates single selections on double-click by default." + } + }, + "type": "object" + }, + "SelectionDef": { + "anyOf": [ + { + "$ref": "#/definitions/SingleSelection" + }, + { + "$ref": "#/definitions/MultiSelection" + }, + { + "$ref": "#/definitions/IntervalSelection" + } + ] + }, + "SelectionExtent": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "The field name to extract selected values for, when a selection is [projected](https://vega.github.io/vega-lite/docs/project.html) over multiple fields or encodings." + }, + "selection": { + "description": "The name of a selection.", + "type": "string" + } + }, + "required": [ + "selection" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "encoding": { + "$ref": "#/definitions/SingleDefUnitChannel", + "description": "The encoding channel to extract selected values for, when a selection is [projected](https://vega.github.io/vega-lite/docs/project.html) over multiple fields or encodings." + }, + "selection": { + "description": "The name of a selection.", + "type": "string" + } + }, + "required": [ + "selection" + ], + "type": "object" + } + ] + }, + "SelectionInit": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + } + ] + }, + "SelectionInitInterval": { + "anyOf": [ + { + "$ref": "#/definitions/Vector2" + }, + { + "$ref": "#/definitions/Vector2" + }, + { + "$ref": "#/definitions/Vector2" + }, + { + "$ref": "#/definitions/Vector2" + } + ] + }, + "SelectionInitIntervalMapping": { + "$ref": "#/definitions/Dict" + }, + "SelectionInitMapping": { + "$ref": "#/definitions/Dict" + }, + "SelectionPredicate": { + "additionalProperties": false, + "properties": { + "selection": { + "$ref": "#/definitions/SelectionComposition", + "description": "Filter using a selection name or a logical composition of selection names." + } + }, + "required": [ + "selection" + ], + "type": "object" + }, + "SelectionResolution": { + "enum": [ + "global", + "union", + "intersect" + ], + "type": "string" + }, + "SequenceGenerator": { + "additionalProperties": false, + "properties": { + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + }, + "sequence": { + "$ref": "#/definitions/SequenceParams", + "description": "Generate a sequence of numbers." + } + }, + "required": [ + "sequence" + ], + "type": "object" + }, + "SequenceParams": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The name of the generated sequence field.\n\n__Default value:__ `\"data\"`" + }, + "start": { + "description": "The starting value of the sequence (inclusive).", + "type": "number" + }, + "step": { + "description": "The step value between sequence entries.\n\n__Default value:__ `1`", + "type": "number" + }, + "stop": { + "description": "The ending value of the sequence (exclusive).", + "type": "number" + } + }, + "required": [ + "start", + "stop" + ], + "type": "object" + }, + "SequentialMultiHue": { + "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", + "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" + ], + "type": "string" + }, + "SequentialSingleHue": { + "enum": [ + "blues", + "tealblues", + "teals", + "greens", + "browns", + "greys", + "purples", + "warmgreys", + "reds", + "oranges" + ], + "type": "string" + }, + "ShapeDef": { + "$ref": "#/definitions/MarkPropDef<(string|null),TypeForShape>" + }, + "SharedEncoding": { + "additionalProperties": false, + "properties": { + "angle": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "color": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "description": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Dict" + } + ], + "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). - If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + }, + "formatType": { + "description": "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).\n\n__Default value:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the axis's backing `datum` object.", + "type": "string" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/FieldDefWithoutScale" + }, + { + "items": { + "$ref": "#/definitions/FieldDefWithoutScale" + }, + "type": "array" + } + ], + "description": "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": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "fillOpacity": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "href": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Dict" + } + ], + "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). - If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + }, + "formatType": { + "description": "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).\n\n__Default value:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the axis's backing `datum` object.", + "type": "string" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "key": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "latitude": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", + "type": "null" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "const": "quantitative", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation.", + "type": "string" + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "latitude2": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", + "type": "null" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "longitude": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", + "type": "null" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "const": "quantitative", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation.", + "type": "string" + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "longitude2": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", + "type": "null" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "opacity": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/OrderFieldDef" + }, + { + "items": { + "$ref": "#/definitions/OrderFieldDef" + }, + "type": "array" + }, + { + "$ref": "#/definitions/OrderValueDef" + } + ], + "description": "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.\n\n__Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating additional aggregation grouping." + }, + "radius": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "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.\n\n`stack` can be one of the following values: - `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart). - `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
    -`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)). - `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "radius2": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", + "type": "null" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "shape": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/TypeForShape", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "size": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "stroke": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "strokeDash": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "strokeOpacity": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "strokeWidth": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Legend" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "text": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalStringFieldDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Dict" + } + ], + "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). - If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + }, + "formatType": { + "description": "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).\n\n__Default value:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the axis's backing `datum` object.", + "type": "string" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "theta": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "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.\n\n`stack` can be one of the following values: - `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart). - `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
    -`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)). - `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "theta2": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", + "type": "null" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "tooltip": { + "anyOf": [ + { + "$ref": "#/definitions/StringFieldDefWithCondition" + }, + { + "$ref": "#/definitions/StringValueDefWithCondition" + }, + { + "items": { + "$ref": "#/definitions/StringFieldDef" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "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).\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite." + }, + "url": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "condition": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" + }, + "type": "array" + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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." + }, + { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + } + ], + "description": "One or more value definition(s) with [a selection or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__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": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Dict" + } + ], + "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). - If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + }, + "formatType": { + "description": "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).\n\n__Default value:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the axis's backing `datum` object.", + "type": "string" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "x": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "axis": { + "anyOf": [ + { + "$ref": "#/definitions/Axis" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/ImputeParams" + }, + { + "type": "null" + } + ], + "description": "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 the `Impute` Operation.\n\n__See also:__ [`impute`](https://vega.github.io/vega-lite/docs/impute.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "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.\n\n`stack` can be one of the following values: - `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart). - `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
    -`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)). - `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "x2": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", + "type": "null" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "xError": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", + "type": "null" + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "value": { + "description": "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).", + "type": "number" + } + }, + "type": "object" + }, + "xError2": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", + "type": "null" + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "value": { + "description": "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).", + "type": "number" + } + }, + "type": "object" + }, + "y": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "axis": { + "anyOf": [ + { + "$ref": "#/definitions/Axis" + }, + { + "type": "null" + } + ], + "description": "An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/ImputeParams" + }, + { + "type": "null" + } + ], + "description": "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 the `Impute` Operation.\n\n__See also:__ [`impute`](https://vega.github.io/vega-lite/docs/impute.html) documentation." + }, + "scale": { + "anyOf": [ + { + "$ref": "#/definitions/Scale" + }, + { + "type": "null" + } + ], + "description": "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.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." + }, + "sort": { + "$ref": "#/definitions/Sort", + "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following: - `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript. - [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`. - [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field. - [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`). - `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." + }, + "stack": { + "anyOf": [ + { + "$ref": "#/definitions/StackOffset" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ], + "description": "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.\n\n`stack` can be one of the following values: - `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart). - `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized).
    -`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)). - `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + ], + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "y2": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", + "type": "null" + }, + "datum": { + "anyOf": [ + { + "$ref": "#/definitions/PrimitiveValue" + }, + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "$ref": "#/definitions/RepeatRef" + } + ], + "description": "A constant value in data domain." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/Type", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "yError": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", + "type": "null" + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "value": { + "description": "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).", + "type": "number" + } + }, + "type": "object" + }, + "yError2": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", + "type": "null" + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "value": { + "description": "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).", + "type": "number" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "SingleDefUnitChannel": { + "enum": [ + "x", + "y", + "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" + ], + "type": "string" + }, + "SingleSelection": { + "additionalProperties": false, + "properties": { + "bind": { + "anyOf": [ + { + "$ref": "#/definitions/Binding" + }, + { + "additionalProperties": { + "$ref": "#/definitions/Binding" + }, + "type": "object" + }, + { + "$ref": "#/definitions/LegendBinding" + } + ], + "description": "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`](https://vega.github.io/vega-lite/docs/selection.html#common-selection-properties) property.\n\nLegend bindings are restricted to selections that only specify a single field or encoding.\n\nQuery widget binding takes the form of Vega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind) or can be a mapping between projected field/encodings and binding definitions.\n\n__See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation." + }, + "clear": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. Can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + }, + "empty": { + "description": "By default, `all` data values are considered to lie within an empty selection. When set to `none`, empty selections contain no data values.", + "enum": [ + "all", + "none" + ], + "type": "string" + }, + "encodings": { + "description": "An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/SingleDefUnitChannel" + }, + "type": "array" + }, + "fields": { + "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "init": { + "$ref": "#/definitions/SelectionInitMapping", + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and initial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation." + }, + "nearest": { + "description": "When true, an invisible voronoi diagram is computed to accelerate discrete selection. The data value _nearest_ the mouse cursor is added to the selection.\n\n__See also:__ [`nearest`](https://vega.github.io/vega-lite/docs/nearest.html) documentation.", + "type": "boolean" + }, + "on": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + } + ], + "description": "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](https://vega.github.io/vega/docs/event-streams/#between-filters)." + }, + "resolve": { + "$ref": "#/definitions/SelectionResolution", + "description": "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.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + }, + "type": { + "const": "single", + "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports three selection types:\n\n- `\"single\"` -- to select a single discrete data value on `click`. - `\"multi\"` -- to select multiple discrete data value; 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`.", + "type": "string" + } + }, + "required": [ + "type" + ], + "type": "object" + }, + "SingleSelectionConfig": { + "additionalProperties": false, + "properties": { + "bind": { + "anyOf": [ + { + "$ref": "#/definitions/Binding" + }, + { + "additionalProperties": { + "$ref": "#/definitions/Binding" + }, + "type": "object" + }, + { + "$ref": "#/definitions/LegendBinding" + } + ], + "description": "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`](https://vega.github.io/vega-lite/docs/selection.html#common-selection-properties) property.\n\nLegend bindings are restricted to selections that only specify a single field or encoding.\n\nQuery widget binding takes the form of Vega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind) or can be a mapping between projected field/encodings and binding definitions.\n\n__See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation." + }, + "clear": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "description": "Clears the selection, emptying it of all values. Can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear`](https://vega.github.io/vega-lite/docs/clear.html) documentation." + }, + "empty": { + "description": "By default, `all` data values are considered to lie within an empty selection. When set to `none`, empty selections contain no data values.", + "enum": [ + "all", + "none" + ], + "type": "string" + }, + "encodings": { + "description": "An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.\n\n__See also:__ [`encodings`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/SingleDefUnitChannel" + }, + "type": "array" + }, + "fields": { + "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ [`fields`](https://vega.github.io/vega-lite/docs/project.html) documentation.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "init": { + "$ref": "#/definitions/SelectionInitMapping", + "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/project.html) and initial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation." + }, + "nearest": { + "description": "When true, an invisible voronoi diagram is computed to accelerate discrete selection. The data value _nearest_ the mouse cursor is added to the selection.\n\n__See also:__ [`nearest`](https://vega.github.io/vega-lite/docs/nearest.html) documentation.", + "type": "boolean" + }, + "on": { + "anyOf": [ + { + "$ref": "#/definitions/Stream" + }, + { + "type": "string" + } + ], + "description": "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](https://vega.github.io/vega/docs/event-streams/#between-filters)." + }, + "resolve": { + "$ref": "#/definitions/SelectionResolution", + "description": "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.\n\n__See also:__ [`resolve`](https://vega.github.io/vega-lite/docs/selection-resolve.html) documentation." + } + }, + "type": "object" + }, + "SingleTimeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/LocalSingleTimeUnit" + }, + { + "$ref": "#/definitions/UtcSingleTimeUnit" + } + ] + }, + "Sort": { + "anyOf": [ + { + "$ref": "#/definitions/SortArray" + }, + { + "$ref": "#/definitions/AllSortString" + }, + { + "$ref": "#/definitions/EncodingSortField" + }, + { + "$ref": "#/definitions/SortByEncoding" + }, + { + "type": "null" + } + ] + }, + "SortArray": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "boolean" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/definitions/DateTime" + }, + "type": "array" + } + ] + }, + "SortByChannel": { + "enum": [ + "x", + "y", + "color", + "fill", + "stroke", + "strokeWidth", + "size", + "shape", + "fillOpacity", + "strokeOpacity", + "opacity", + "text" + ], + "type": "string" + }, + "SortByChannelDesc": { + "enum": [ + "-x", + "-y", + "-color", + "-fill", + "-stroke", + "-strokeWidth", + "-size", + "-shape", + "-fillOpacity", + "-strokeOpacity", + "-opacity", + "-text" + ], + "type": "string" + }, + "SortByEncoding": { + "additionalProperties": false, + "properties": { + "encoding": { + "$ref": "#/definitions/SortByChannel", + "description": "The [encoding channel](https://vega.github.io/vega-lite/docs/encoding.html#channels) to sort by (e.g., `\"x\"`, `\"y\"`)" + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/SortOrder" + }, + { + "type": "null" + } + ], + "description": "The sort order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." + } + }, + "required": [ + "encoding" + ], + "type": "object" + }, + "SortField": { + "additionalProperties": false, + "description": "A sort definition for transform", + "properties": { + "field": { + "$ref": "#/definitions/FieldName", + "description": "The name of the field to sort." + }, + "order": { + "anyOf": [ + { + "$ref": "#/definitions/SortOrder" + }, + { + "type": "null" + } + ], + "description": "Whether to sort the field in ascending or descending order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." + } + }, + "required": [ + "field" + ], + "type": "object" + }, + "SortOrder": { + "enum": [ + "ascending", + "descending" + ], + "type": "string" + }, + "SphereGenerator": { + "additionalProperties": false, + "properties": { + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + }, + "sphere": { + "anyOf": [ + { + "const": true, + "type": "boolean" + }, + { + "additionalProperties": false, + "type": "object" + } + ], + "description": "Generate sphere GeoJSON data for the full globe." + } + }, + "required": [ + "sphere" + ], + "type": "object" + }, + "StackOffset": { + "enum": [ + "zero", + "center", + "normalize" + ], + "type": "string" + }, + "StackTransform": { + "additionalProperties": false, + "properties": { + "as": { + "anyOf": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "items": [ + { + "$ref": "#/definitions/FieldName" + }, + { + "$ref": "#/definitions/FieldName" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + } + ], + "description": "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\"`." + }, + "groupby": { + "description": "The data fields to group by.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "offset": { + "description": "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]`.\n\n__Default value:__ `\"zero\"`", + "enum": [ + "zero", + "center", + "normalize" + ], + "type": "string" + }, + "sort": { + "description": "Field that determines the order of leaves in the stacked charts.", + "items": { + "$ref": "#/definitions/SortField" + }, + "type": "array" + }, + "stack": { + "$ref": "#/definitions/FieldName", + "description": "The field which is stacked." + } + }, + "required": [ + "stack", + "groupby", + "as" + ], + "type": "object" + }, + "StandardType": { + "enum": [ + "quantitative", + "ordinal", + "temporal", + "nominal" + ], + "type": "string" + }, + "Step": { + "additionalProperties": false, + "properties": { + "step": { + "description": "The size (width/height) per discrete step.", + "type": "number" + } + }, + "required": [ + "step" + ], + "type": "object" + }, + "Stream": { + "anyOf": [ + { + "$ref": "#/definitions/EventStream" + }, + { + "$ref": "#/definitions/DerivedStream" + }, + { + "$ref": "#/definitions/MergedStream" + } + ] + }, + "StringFieldDef": { + "additionalProperties": false, + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "type": "string" + }, + { + "$ref": "#/definitions/Dict" + } + ], + "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format). - If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." + }, + "formatType": { + "description": "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).\n\n__Default value:__ - `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`. - `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", + "type": "string" + }, + "labelExpr": { + "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels text.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the axis's backing `datum` object.", + "type": "string" + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "StringFieldDefWithCondition": { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + "StringValueDefWithCondition": { + "$ref": "#/definitions/ValueDefWithCondition" + }, + "StrokeCap": { + "enum": [ + "butt", + "round", + "square" + ], + "type": "string" + }, + "StrokeJoin": { + "enum": [ + "miter", + "round", + "bevel" + ], + "type": "string" + }, + "StyleConfigIndex": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/AnyMarkConfig" + }, + { + "$ref": "#/definitions/Axis" + } + ] + }, + "properties": { + "arc": { + "$ref": "#/definitions/RectConfig", + "description": "Arc-specific Config" + }, + "area": { + "$ref": "#/definitions/AreaConfig", + "description": "Area-Specific Config" + }, + "bar": { + "$ref": "#/definitions/BarConfig", + "description": "Bar-Specific Config" + }, + "circle": { + "$ref": "#/definitions/MarkConfig", + "description": "Circle-Specific Config" + }, + "geoshape": { + "$ref": "#/definitions/MarkConfig", + "description": "Geoshape-Specific Config" + }, + "group-subtitle": { + "$ref": "#/definitions/MarkConfig", + "description": "Default style for chart subtitles" + }, + "group-title": { + "$ref": "#/definitions/MarkConfig", + "description": "Default style for chart titles" + }, + "guide-label": { + "$ref": "#/definitions/MarkConfig", + "description": "Default style for axis, legend, and header labels." + }, + "guide-title": { + "$ref": "#/definitions/MarkConfig", + "description": "Default style for axis, legend, and header titles." + }, + "image": { + "$ref": "#/definitions/RectConfig", + "description": "Image-specific Config" + }, + "line": { + "$ref": "#/definitions/LineConfig", + "description": "Line-Specific Config" + }, + "mark": { + "$ref": "#/definitions/MarkConfig", + "description": "Mark Config" + }, + "point": { + "$ref": "#/definitions/MarkConfig", + "description": "Point-Specific Config" + }, + "rect": { + "$ref": "#/definitions/RectConfig", + "description": "Rect-Specific Config" + }, + "rule": { + "$ref": "#/definitions/MarkConfig", + "description": "Rule-Specific Config" + }, + "square": { + "$ref": "#/definitions/MarkConfig", + "description": "Square-Specific Config" + }, + "text": { + "$ref": "#/definitions/MarkConfig", + "description": "Text-Specific Config" + }, + "tick": { + "$ref": "#/definitions/TickConfig", + "description": "Tick-Specific Config" + }, + "trail": { + "$ref": "#/definitions/LineConfig", + "description": "Trail-Specific Config" + } + }, + "type": "object" + }, + "SymbolShape": { + "type": "string" + }, + "Text": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ] + }, + "TextBaseline": { + "anyOf": [ + { + "const": "alphabetic", + "type": "string" + }, + { + "$ref": "#/definitions/Baseline" + }, + { + "const": "line-top", + "type": "string" + }, + { + "const": "line-bottom", + "type": "string" + } + ] + }, + "TextDef": { + "anyOf": [ + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/FieldOrDatumDefWithCondition" + }, + { + "$ref": "#/definitions/ValueDefWithCondition" + } + ] + }, + "TextDirection": { + "enum": [ + "ltr", + "rtl" + ], + "type": "string" + }, + "TickConfig": { + "additionalProperties": false, + "properties": { + "align": { + "anyOf": [ + { + "$ref": "#/definitions/Align" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "angle": { + "anyOf": [ + { + "description": "The rotation angle of the text, in degrees.", + "maximum": 360, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRole": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ariaRoleDescription": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aspect": { + "anyOf": [ + { + "description": "Whether to keep aspect ratio of image marks.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "bandSize": { + "description": "The width of the ticks.\n\n__Default value:__ 3/4 of step (width step for horizontal ticks and height step for vertical ticks).", + "minimum": 0, + "type": "number" + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/definitions/TextBaseline" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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 `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." + }, + "blend": { + "anyOf": [ + { + "$ref": "#/definitions/Blend", + "description": "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.\n\n__Default value: `\"source-over\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "color": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default color.\n\n__Default value:__ ■ `\"#4682b4\"`\n\n__Note:__ - This property cannot be used in a [style config](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": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusBottomRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopLeft": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cornerRadiusTopRight": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "anyOf": [ + { + "$ref": "#/definitions/Cursor", + "description": "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." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "description": { + "anyOf": [ + { + "description": "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).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dir": { + "anyOf": [ + { + "$ref": "#/definitions/TextDirection", + "description": "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.\n\n__Default value:__ `\"ltr\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dx": { + "anyOf": [ + { + "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "ellipsis": { + "anyOf": [ + { + "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "endAngle": { + "anyOf": [ + { + "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "filled": { + "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", + "type": "boolean" + }, + "font": { + "anyOf": [ + { + "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "The font size, in pixels.\n\n__Default value:__ `11`", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "The font style (e.g., `\"italic\"`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "anyOf": [ + { + "description": "Height of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "href": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "innerRadius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`." + }, + "interpolate": { + "anyOf": [ + { + "$ref": "#/definitions/Interpolate", + "description": "The line interpolation method to use for line and area marks. One of the following: - `\"linear\"`: piecewise linear segments, as in a polyline. - `\"linear-closed\"`: close the linear segments to form a polygon. - `\"step\"`: alternate between horizontal and vertical segments, as in a step function. - `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function. - `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function. - `\"basis\"`: a B-spline, with control point duplication on the ends. - `\"basis-open\"`: an open B-spline; may not intersect the start or end. - `\"basis-closed\"`: a closed B-spline, as in a loop. - `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends. - `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points. - `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop. - `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline. - `\"monotone\"`: cubic interpolation that preserves monotonicity in y." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "invalid": { + "description": "Defines how Vega-Lite should handle marks for invalid values (`null` and `NaN`). - If set to `\"filter\"` (default), all data items with null values will be skipped (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.", + "enum": [ + "filter", + null + ], + "type": [ + "string", + "null" + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineBreak": { + "anyOf": [ + { + "description": "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.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "order": { + "description": "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.", + "type": [ + "null", + "boolean" + ] + }, + "orient": { + "$ref": "#/definitions/Orientation", + "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical. - For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension. - For area, this property determines the orient property of the Vega output. - For line and trail marks, this property determines the sort order of the points in 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": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`." + }, + "padAngle": { + "anyOf": [ + { + "description": "The angular padding applied to sides of the arc, in radians.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "radius": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties." + }, + "radius2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The secondary (inner) radius in pixels of arc marks." + }, + "shape": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/SymbolShape" + }, + { + "type": "string" + } + ], + "description": "Shape of the point marks. 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.)\n\n__Default value:__ `\"circle\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "size": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default size for marks. - For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value. - For `bar`, this represents the band size of the bar, in pixels. - For `text`, this represents the font size, in pixels.\n\n__Default value:__ - `30` for point, circle, square marks; width/height's `step` - `2` for bar marks with discrete dimensions; - `5` for bar marks with continuous dimensions; - `11` for text marks.", + "minimum": 0 + }, + "smooth": { + "anyOf": [ + { + "description": "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.", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "startAngle": { + "anyOf": [ + { + "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOffset": { + "anyOf": [ + { + "description": "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.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "tension": { + "anyOf": [ + { + "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text", + "description": "Placeholder text if the `text` channel is not specified" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "theta": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "- 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.)\n\n- For text marks, polar coordinate angle in radians.", + "maximum": 360, + "minimum": 0 + }, + "theta2": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." + }, + "thickness": { + "description": "Thickness of the tick mark.\n\n__Default value:__ `1`", + "minimum": 0, + "type": "number" + }, + "timeUnitBand": { + "description": "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.", + "type": "number" + }, + "timeUnitBandPosition": { + "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", + "type": "number" + }, + "tooltip": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "$ref": "#/definitions/TooltipContent" + }, + { + "$ref": "#/definitions/ExprRef" + }, + { + "type": "null" + } + ], + "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used. - If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used. - If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" + }, + "url": { + "anyOf": [ + { + "$ref": "#/definitions/URI", + "description": "The URL of the image file for image marks." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "anyOf": [ + { + "description": "Width of the marks.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "x": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "x2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." + }, + "y": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + }, + "y2": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." + } + }, + "type": "object" + }, + "TickCount": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/TimeInterval" + }, + { + "$ref": "#/definitions/TimeIntervalStep" + } + ] + }, + "TimeInterval": { + "enum": [ + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "year" + ], + "type": "string" + }, + "TimeIntervalStep": { + "additionalProperties": false, + "properties": { + "interval": { + "$ref": "#/definitions/TimeInterval" + }, + "step": { + "type": "number" + } + }, + "required": [ + "interval", + "step" + ], + "type": "object" + }, + "TimeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/SingleTimeUnit" + }, + { + "$ref": "#/definitions/MultiTimeUnit" + } + ] + }, + "TimeUnitParams": { + "additionalProperties": false, + "properties": { + "maxbins": { + "description": "If no `unit` is specified, maxbins is used to infer time units.", + "type": "number" + }, + "step": { + "description": "The number of steps between bins, in terms of the least significant unit provided.", + "type": "number" + }, + "unit": { + "$ref": "#/definitions/TimeUnit", + "description": "Defines how date-time values should be binned." + }, + "utc": { + "description": "True to use UTC timezone. Equivalent to using a `utc` prefixed `TimeUnit`.", + "type": "boolean" + } + }, + "type": "object" + }, + "TimeUnitTransform": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The output field to write the timeUnit value." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "The data field to apply time unit." + }, + "timeUnit": { + "anyOf": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "The timeUnit." + } + }, + "required": [ + "timeUnit", + "field", + "as" + ], + "type": "object" + }, + "TitleAnchor": { + "enum": [ + null, + "start", + "middle", + "end" + ], + "type": [ + "null", + "string" + ] + }, + "TitleConfig": { + "$ref": "#/definitions/BaseTitleNoValueRefs" + }, + "TitleFrame": { + "enum": [ + "bounds", + "group" + ], + "type": "string" + }, + "TitleOrient": { + "enum": [ + "none", + "left", + "right", + "top", + "bottom" + ], + "type": "string" + }, + "TitleParams": { + "additionalProperties": false, + "properties": { + "align": { + "$ref": "#/definitions/Align", + "description": "Horizontal text alignment for title text. One of `\"left\"`, `\"center\"`, or `\"right\"`." + }, + "anchor": { + "$ref": "#/definitions/TitleAnchor", + "description": "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.\n\n__Default value:__ `\"middle\"` for [single](https://vega.github.io/vega-lite/docs/spec.html) and [layered](https://vega.github.io/vega-lite/docs/layer.html) views. `\"start\"` for other composite views.\n\n__Note:__ [For now](https://github.com/vega/vega-lite/issues/2875), `anchor` is only customizable only for [single](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": [ + { + "description": "Angle in degrees of title and subtitle text.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "aria": { + "anyOf": [ + { + "description": "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.\n\n__Default value:__ `true`", + "type": "boolean" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "baseline": { + "$ref": "#/definitions/TextBaseline", + "description": "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": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Text color for title text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dx": { + "anyOf": [ + { + "description": "Delta offset for title and subtitle text x-coordinate.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "dy": { + "anyOf": [ + { + "description": "Delta offset for title and subtitle text y-coordinate.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "font": { + "anyOf": [ + { + "description": "Font name for title text.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontSize": { + "anyOf": [ + { + "description": "Font size in pixels for title text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style for title text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "fontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "frame": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/TitleFrame" + }, + { + "type": "string" + } + ], + "description": "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)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "limit": { + "anyOf": [ + { + "description": "The maximum allowed length in pixels of title and subtitle text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "lineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "offset": { + "anyOf": [ + { + "description": "The orthogonal offset in pixels by which to displace the title group from its position along the edge of the chart.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "orient": { + "anyOf": [ + { + "$ref": "#/definitions/TitleOrient", + "description": "Default title orientation (`\"top\"`, `\"bottom\"`, `\"left\"`, or `\"right\"`)" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "A [mark style property](https://vega.github.io/vega-lite/docs/config.html#style) to apply to the title text mark.\n\n__Default value:__ `\"group-title\"`." + }, + "subtitle": { + "$ref": "#/definitions/Text", + "description": "The subtitle Text." + }, + "subtitleColor": { + "anyOf": [ + { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/Color" + } + ], + "description": "Text color for subtitle text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleFont": { + "anyOf": [ + { + "description": "Font name for subtitle text.", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleFontSize": { + "anyOf": [ + { + "description": "Font size in pixels for subtitle text.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleFontStyle": { + "anyOf": [ + { + "$ref": "#/definitions/FontStyle", + "description": "Font style for subtitle text." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleFontWeight": { + "anyOf": [ + { + "$ref": "#/definitions/FontWeight", + "description": "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`)." + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitleLineHeight": { + "anyOf": [ + { + "description": "Line height in pixels for multi-line subtitle text.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "subtitlePadding": { + "anyOf": [ + { + "description": "The padding in pixels between title and subtitle text.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "text": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The title text." + }, + "zindex": { + "description": "The integer z-index indicating the layering of the title group relative to other axis, mark and legend groups.\n\n__Default value:__ `0`.", + "minimum": 0, + "type": "number" + } + }, + "required": [ + "text" + ], + "type": "object" + }, + "TooltipContent": { + "additionalProperties": false, + "properties": { + "content": { + "enum": [ + "encoding", + "data" + ], + "type": "string" + } + }, + "required": [ + "content" + ], + "type": "object" + }, + "TopLevelNormalizedConcatSpec": { + "additionalProperties": false, + "properties": { + "$schema": { + "description": "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/v4.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other. - For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size. - For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "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.\n\n__Default value__: `pad`" + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "concat": { + "description": "A list of views to be concatenated.", + "items": { + "$ref": "#/definitions/NormalizedSpec" + }, + "type": "array" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "$ref": "#/definitions/Datasets", + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "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.\n\n__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": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "$ref": "#/definitions/Dict", + "description": "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." + } + }, + "required": [ + "concat" + ], + "type": "object" + }, + "TopLevelNormalizedHConcatSpec": { + "additionalProperties": false, + "properties": { + "$schema": { + "description": "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/v4.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "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.\n\n__Default value__: `pad`" + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "$ref": "#/definitions/Datasets", + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "hconcat": { + "description": "A list of views to be concatenated and put into a row.", + "items": { + "$ref": "#/definitions/NormalizedSpec" + }, + "type": "array" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "$ref": "#/definitions/Dict", + "description": "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." + } + }, + "required": [ + "hconcat" + ], + "type": "object" + }, + "TopLevelNormalizedVConcatSpec": { + "additionalProperties": false, + "properties": { + "$schema": { + "description": "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/v4.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "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.\n\n__Default value__: `pad`" + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "$ref": "#/definitions/Datasets", + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", + "type": "number" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "$ref": "#/definitions/Dict", + "description": "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." + }, + "vconcat": { + "description": "A list of views to be concatenated and put into a column.", + "items": { + "$ref": "#/definitions/NormalizedSpec" + }, + "type": "array" + } + }, + "required": [ + "vconcat" + ], + "type": "object" + }, + "TopLevelLayerSpec": { + "additionalProperties": false, + "properties": { + "$schema": { + "description": "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/v4.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "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.\n\n__Default value__: `pad`" + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "$ref": "#/definitions/Datasets", + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/SharedEncoding", + "description": "A shared key-value mapping between encoding channels and definition of fields in the underlying layers." + }, + "height": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The height of a visualization.\n\n- For a plot with a continuous y-field, height should be a number. - For a plot with either a discrete y-field or no y-field, 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. (No y-field is equivalent to having one discrete step.) - To enable responsive sizing on height, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousHeight` for a plot with a continuous y-field and `config.view.discreteHeight` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`height`](https://vega.github.io/vega-lite/docs/size.html) documentation." + }, + "layer": { + "description": "Layer or single view specifications to be layered.\n\n__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.", + "items": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/UnitSpec" + } + ] + }, + "type": "array" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "An object defining properties of the geographic projection shared by underlying layers." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "$ref": "#/definitions/Dict", + "description": "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": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The width of a visualization.\n\n- For a plot with a continuous x-field, width should be a number. - For a plot with either a discrete x-field or no x-field, 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. (No x-field is equivalent to having one discrete step.) - To enable responsive sizing on width, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousWidth` for a plot with a continuous x-field and `config.view.discreteWidth` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`width`](https://vega.github.io/vega-lite/docs/size.html) documentation." + } + }, + "required": [ + "layer" + ], + "type": "object" + }, + "TopLevelRepeatSpec": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "$schema": { + "description": "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/v4.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other. - For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size. - For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "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.\n\n__Default value__: `pad`" + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "$ref": "#/definitions/Datasets", + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" + }, + "repeat": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/definitions/RepeatMapping" + } + ], + "description": "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 number of columns to control the wrapping. 2) An object that maps `\"row\"` and/or `\"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." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "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.\n\n__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)" + }, + "spec": { + "$ref": "#/definitions/Spec", + "description": "A specification of the view that gets repeated." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "$ref": "#/definitions/Dict", + "description": "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." + } + }, + "required": [ + "repeat", + "spec" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "$schema": { + "description": "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/v4.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other. - For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size. - For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "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.\n\n__Default value__: `pad`" + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "$ref": "#/definitions/Datasets", + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" + }, + "repeat": { + "$ref": "#/definitions/LayerRepeatMapping", + "description": "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 number of columns to control the wrapping. 2) An object that maps `\"row\"` and/or `\"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." + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "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.\n\n__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)" + }, + "spec": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/UnitSpec" + } + ], + "description": "A specification of the view that gets repeated." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "$ref": "#/definitions/Dict", + "description": "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." + } + }, + "required": [ + "repeat", + "spec" + ], + "type": "object" + } + ] + }, + "TopLevelFacetSpec": { + "additionalProperties": false, + "properties": { + "$schema": { + "description": "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/v4.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other. - For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size. - For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "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.\n\n__Default value__: `pad`" + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "columns": { + "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for: - the general (wrappable) `concat` operator (not `hconcat`/`vconcat`) - the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", + "type": "number" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "$ref": "#/definitions/Datasets", + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "facet": { + "anyOf": [ + { + "$ref": "#/definitions/FacetFieldDef" + }, + { + "$ref": "#/definitions/FacetMapping" + } + ], + "description": "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)" + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" + }, + "resolve": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "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.\n\n__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)" + }, + "spec": { + "anyOf": [ + { + "$ref": "#/definitions/LayerSpec" + }, + { + "$ref": "#/definitions/UnitSpecWithFrame" + } + ], + "description": "A specification of the view that gets faceted." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "$ref": "#/definitions/Dict", + "description": "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." + } + }, + "required": [ + "data", + "facet", + "spec" + ], + "type": "object" + }, + "TopLevelSpec": { + "anyOf": [ + { + "$ref": "#/definitions/TopLevelUnitSpec" + }, + { + "$ref": "#/definitions/TopLevelFacetSpec" + }, + { + "$ref": "#/definitions/TopLevelLayerSpec" + }, + { + "$ref": "#/definitions/TopLevelRepeatSpec" + }, + { + "$ref": "#/definitions/TopLevelNormalizedConcatSpec" + }, + { + "$ref": "#/definitions/TopLevelNormalizedVConcatSpec" + }, + { + "$ref": "#/definitions/TopLevelNormalizedHConcatSpec" + } + ], + "description": "A Vega-Lite top-level specification. This is the root class for all Vega-Lite specifications. (The json schema is generated from this type.)" + }, + "TopLevelUnitSpec": { + "additionalProperties": false, + "properties": { + "$schema": { + "description": "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/v4.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", + "format": "uri", + "type": "string" + }, + "align": { + "anyOf": [ + { + "$ref": "#/definitions/LayoutAlign" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other. - For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size. - For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." + }, + "autosize": { + "anyOf": [ + { + "$ref": "#/definitions/AutosizeType" + }, + { + "$ref": "#/definitions/AutoSizeParams" + } + ], + "description": "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.\n\n__Default value__: `pad`" + }, + "background": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" + }, + "bounds": { + "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used. - If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", + "enum": [ + "full", + "flush" + ], + "type": "string" + }, + "center": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" + }, + "config": { + "$ref": "#/definitions/Config", + "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." + }, + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "$ref": "#/definitions/Datasets", + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/FacetedEncoding", + "description": "A key-value mapping between encoding channels and definition of fields." + }, + "height": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The height of a visualization.\n\n- For a plot with a continuous y-field, height should be a number. - For a plot with either a discrete y-field or no y-field, 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. (No y-field is equivalent to having one discrete step.) - To enable responsive sizing on height, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousHeight` for a plot with a continuous y-field and `config.view.discreteHeight` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`height`](https://vega.github.io/vega-lite/docs/size.html) documentation." + }, + "mark": { + "$ref": "#/definitions/AnyMark", + "description": "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)." + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "padding": { + "anyOf": [ + { + "$ref": "#/definitions/Padding" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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.\n\n__Default value__: `5`" + }, + "params": { + "description": "Dynamic variables that parameterize a visualization.", + "items": { + "$ref": "#/definitions/Parameter" + }, + "type": "array" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "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": { + "$ref": "#/definitions/Resolve", + "description": "Scale, axis, and legend resolutions for view composition specifications." + }, + "selection": { + "additionalProperties": { + "$ref": "#/definitions/SelectionDef" + }, + "description": "A key-value mapping between selection names and definitions.", + "type": "object" + }, + "spacing": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/RowCol" + } + ], + "description": "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.\n\n__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": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "usermeta": { + "$ref": "#/definitions/Dict", + "description": "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": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The width of a visualization.\n\n- For a plot with a continuous x-field, width should be a number. - For a plot with either a discrete x-field or no x-field, 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. (No x-field is equivalent to having one discrete step.) - To enable responsive sizing on width, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousWidth` for a plot with a continuous x-field and `config.view.discreteWidth` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`width`](https://vega.github.io/vega-lite/docs/size.html) documentation." + } + }, + "required": [ + "data", + "mark" + ], + "type": "object" + }, + "TopoDataFormat": { + "additionalProperties": false, + "properties": { + "feature": { + "description": "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.", + "type": "string" + }, + "mesh": { + "description": "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.", + "type": "string" + }, + "parse": { + "anyOf": [ + { + "$ref": "#/definitions/Parse" + }, + { + "type": "null" + } + ], + "description": "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 name, and the value to the desired data type (one of `\"number\"`, `\"boolean\"`, `\"date\"`, or null (do not parse the field)). For example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each input record a Date value.\n\nFor `\"date\"`, we parse data based using Javascript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: \"date:'%m%d%Y'\"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). 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": { + "const": "topojson", + "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\n\n__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.", + "type": "string" + } + }, + "type": "object" + }, + "Transform": { + "anyOf": [ + { + "$ref": "#/definitions/AggregateTransform" + }, + { + "$ref": "#/definitions/BinTransform" + }, + { + "$ref": "#/definitions/CalculateTransform" + }, + { + "$ref": "#/definitions/DensityTransform" + }, + { + "$ref": "#/definitions/FilterTransform" + }, + { + "$ref": "#/definitions/FlattenTransform" + }, + { + "$ref": "#/definitions/FoldTransform" + }, + { + "$ref": "#/definitions/ImputeTransform" + }, + { + "$ref": "#/definitions/JoinAggregateTransform" + }, + { + "$ref": "#/definitions/LoessTransform" + }, + { + "$ref": "#/definitions/LookupTransform" + }, + { + "$ref": "#/definitions/QuantileTransform" + }, + { + "$ref": "#/definitions/RegressionTransform" + }, + { + "$ref": "#/definitions/TimeUnitTransform" + }, + { + "$ref": "#/definitions/SampleTransform" + }, + { + "$ref": "#/definitions/StackTransform" + }, + { + "$ref": "#/definitions/WindowTransform" + }, + { + "$ref": "#/definitions/PivotTransform" + } + ] + }, + "Type": { + "description": "Data type based on level of measurement", + "enum": [ + "quantitative", + "ordinal", + "temporal", + "nominal", + "geojson" + ], + "type": "string" + }, + "TypeForShape": { + "enum": [ + "nominal", + "ordinal", + "geojson" + ], + "type": "string" + }, + "TypedFieldDef": { + "additionalProperties": false, + "description": "Definition object for a data field, its type and transformation of an encoding channel.", + "properties": { + "aggregate": { + "$ref": "#/definitions/Aggregate", + "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." + }, + "band": { + "description": "For rect-based marks (`rect`, `bar`, and `image`), mark size relative to bandwidth of [band scales](https://vega.github.io/vega-lite/docs/scale.html#band), bins or time units. If set to `1`, the mark size is set to the bandwidth, the bin interval, or the time unit interval. If set to `0.5`, the mark size is half of the bandwidth or the time unit interval.\n\nFor other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to `0`, the marks will be positioned at the beginning of the band. If set to `0.5`, the marks will be positioned in the middle of the band.", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + "bin": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/BinParams" + }, + { + "const": "binned", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#params), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." + }, + "field": { + "$ref": "#/definitions/Field", + "description": "__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.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details 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": [ + { + "$ref": "#/definitions/TimeUnit" + }, + { + "$ref": "#/definitions/TimeUnitParams" + } + ], + "description": "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).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "type": "null" + } + ], + "description": "A title for the field. If `null`, the title will be removed.\n\n__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.\n\n__Notes__:\n\n1) 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/docs/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." + }, + "type": { + "$ref": "#/definitions/StandardType", + "description": "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).\n\nVega-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 has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria: - `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type). - `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale - `ordinal\"\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) 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)\n\n__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`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." + } + }, + "type": "object" + }, + "URI": { + "format": "uri-reference", + "type": "string" + }, + "UnitSpec": { + "additionalProperties": false, + "description": "A unit specification, which can contain either [primitive marks or composite marks](https://vega.github.io/vega-lite/docs/mark.html#types).", + "properties": { + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/Encoding", + "description": "A key-value mapping between encoding channels and definition of fields." + }, + "height": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "__Deprecated:__ Please avoid using width in a unit spec that's a part of a layer spec." + }, + "mark": { + "$ref": "#/definitions/AnyMark", + "description": "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)." + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "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." + }, + "selection": { + "additionalProperties": { + "$ref": "#/definitions/SelectionDef" + }, + "description": "A key-value mapping between selection names and definitions.", + "type": "object" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "__Deprecated:__ Please avoid using width in a unit spec that's a part of a layer spec." + }, + "width": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "__Deprecated:__ Please avoid using width in a unit spec that's a part of a layer spec." + } + }, + "required": [ + "mark" + ], + "type": "object" + }, + "UnitSpecWithFrame": { + "additionalProperties": false, + "properties": { + "data": { + "anyOf": [ + { + "$ref": "#/definitions/Data" + }, + { + "type": "null" + } + ], + "description": "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": { + "description": "Description of this mark for commenting purpose.", + "type": "string" + }, + "encoding": { + "$ref": "#/definitions/Encoding", + "description": "A key-value mapping between encoding channels and definition of fields." + }, + "height": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The height of a visualization.\n\n- For a plot with a continuous y-field, height should be a number. - For a plot with either a discrete y-field or no y-field, 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. (No y-field is equivalent to having one discrete step.) - To enable responsive sizing on height, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousHeight` for a plot with a continuous y-field and `config.view.discreteHeight` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`height`](https://vega.github.io/vega-lite/docs/size.html) documentation." + }, + "mark": { + "$ref": "#/definitions/AnyMark", + "description": "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)." + }, + "name": { + "description": "Name of the visualization for later reference.", + "type": "string" + }, + "projection": { + "$ref": "#/definitions/Projection", + "description": "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." + }, + "selection": { + "additionalProperties": { + "$ref": "#/definitions/SelectionDef" + }, + "description": "A key-value mapping between selection names and definitions.", + "type": "object" + }, + "title": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/TitleParams" + } + ], + "description": "Title for the plot." + }, + "transform": { + "description": "An array of data transformations such as filter and new field calculation.", + "items": { + "$ref": "#/definitions/Transform" + }, + "type": "array" + }, + "view": { + "$ref": "#/definitions/ViewBackground", + "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" + }, + "width": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "container", + "type": "string" + }, + { + "$ref": "#/definitions/Step" + } + ], + "description": "The width of a visualization.\n\n- For a plot with a continuous x-field, width should be a number. - For a plot with either a discrete x-field or no x-field, 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. (No x-field is equivalent to having one discrete step.) - To enable responsive sizing on width, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousWidth` for a plot with a continuous x-field and `config.view.discreteWidth` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`width`](https://vega.github.io/vega-lite/docs/size.html) documentation." + } + }, + "required": [ + "mark" + ], + "type": "object" + }, + "UrlData": { + "additionalProperties": false, + "properties": { + "format": { + "$ref": "#/definitions/DataFormat", + "description": "An object that specifies the format for parsing the data." + }, + "name": { + "description": "Provide a placeholder name and bind data at runtime.", + "type": "string" + }, + "url": { + "description": "An URL from which to load the data set. Use the `format.type` property to ensure the loaded data is correctly parsed.", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "UtcMultiTimeUnit": { + "enum": [ + "utcyearquarter", + "utcyearquartermonth", + "utcyearmonth", + "utcyearmonthdate", + "utcyearmonthdatehours", + "utcyearmonthdatehoursminutes", + "utcyearmonthdatehoursminutesseconds", + "utcyearweek", + "utcyearweekday", + "utcyearweekdayhours", + "utcyearweekdayhoursminutes", + "utcyearweekdayhoursminutesseconds", + "utcyeardayofyear", + "utcquartermonth", + "utcmonthdate", + "utcmonthdatehours", + "utcmonthdatehoursminutes", + "utcmonthdatehoursminutesseconds", + "utcweekday", + "utcweeksdayhours", + "utcweekdayhoursminutes", + "utcweekdayhoursminutesseconds", + "utcdayhours", + "utcdayhoursminutes", + "utcdayhoursminutesseconds", + "utchoursminutes", + "utchoursminutesseconds", + "utcminutesseconds", + "utcsecondsmilliseconds" + ], + "type": "string" + }, + "UtcSingleTimeUnit": { + "enum": [ + "utcyear", + "utcquarter", + "utcmonth", + "utcweek", + "utcday", + "utcdayofyear", + "utcdate", + "utchours", + "utcminutes", + "utcseconds", + "utcmilliseconds" + ], + "type": "string" + }, + "ValueDef<(number|\"width\"|\"height\"|ExprRef)>": { + "additionalProperties": false, + "description": "Definition object for a constant value (primitive value or gradient definition) of an encoding channel.", + "properties": { + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "const": "width", + "type": "string" + }, + { + "const": "height", + "type": "string" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "ValueDef<(number|ExprRef)>": { + "additionalProperties": false, + "description": "Definition object for a constant value (primitive value or gradient definition) of an encoding channel.", + "properties": { + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "ValueDef": { + "additionalProperties": false, + "description": "Definition object for a constant value (primitive value or gradient definition) of an encoding channel.", + "properties": { + "value": { + "description": "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).", + "type": "number" + } + }, + "required": [ + "value" + ], + "type": "object" + }, + "ValueDefWithCondition": { + "additionalProperties": false, + "minProperties": 1, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Gradient" + }, + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "ValueDefWithCondition": { + "additionalProperties": false, + "minProperties": 1, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "ValueDefWithCondition": { + "additionalProperties": false, + "minProperties": 1, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + }, + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "ValueDefWithCondition": { + "additionalProperties": false, + "minProperties": 1, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + }, + "value": { + "anyOf": [ + { + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "ValueDefWithCondition,(string|null)>": { + "additionalProperties": false, + "minProperties": 1, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "ValueDefWithCondition": { + "additionalProperties": false, + "minProperties": 1, + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/definitions/ConditionalStringFieldDef" + }, + { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + { + "items": { + "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" + }, + "type": "array" + } + ], + "description": "A field definition or one or more value definition(s) with a selection predicate." + }, + "value": { + "anyOf": [ + { + "$ref": "#/definitions/Text" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "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)." + } + }, + "type": "object" + }, + "Vector2": { + "items": [ + { + "$ref": "#/definitions/DateTime" + }, + { + "$ref": "#/definitions/DateTime" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "Vector2>": { + "items": [ + { + "$ref": "#/definitions/Vector2" + }, + { + "$ref": "#/definitions/Vector2" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "Vector2": { + "items": [ + { + "type": "boolean" + }, + { + "type": "boolean" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "Vector2": { + "items": [ + { + "type": "number" + }, + { + "type": "number" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "Vector2": { + "items": [ + { + "type": "string" + }, + { + "type": "string" + } + ], + "maxItems": 2, + "minItems": 2, + "type": "array" + }, + "Vector3": { + "items": [ + { + "type": "number" + }, + { + "type": "number" + }, + { + "type": "number" + } + ], + "maxItems": 3, + "minItems": 3, + "type": "array" + }, + "ViewBackground": { + "additionalProperties": false, + "properties": { + "cornerRadius": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "$ref": "#/definitions/Cursor", + "description": "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": [ + { + "$ref": "#/definitions/Color" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The fill color.\n\n__Default value:__ `undefined`" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The stroke color.\n\n__Default value:__ `\"#ddd\"`" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "style": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "description": "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](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is an array, later styles will override earlier styles.\n\n__Default value:__ `\"cell\"` __Note:__ Any specified view background properties will augment the default style." + } + }, + "type": "object" + }, + "ViewConfig": { + "additionalProperties": false, + "properties": { + "clip": { + "description": "Whether the view should be clipped.", + "type": "boolean" + }, + "continuousHeight": { + "description": "The default height when the plot has a continuous y-field for x or latitude, or has arc marks.\n\n__Default value:__ `200`", + "type": "number" + }, + "continuousWidth": { + "description": "The default width when the plot has a continuous field for x or longitude, or has arc marks.\n\n__Default value:__ `200`", + "type": "number" + }, + "cornerRadius": { + "anyOf": [ + { + "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "cursor": { + "$ref": "#/definitions/Cursor", + "description": "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": [ + { + "type": "number" + }, + { + "additionalProperties": false, + "properties": { + "step": { + "type": "number" + } + }, + "required": [ + "step" + ], + "type": "object" + } + ], + "description": "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.\n\n__Default value:__ a step size based on `config.view.step`." + }, + "discreteWidth": { + "anyOf": [ + { + "type": "number" + }, + { + "additionalProperties": false, + "properties": { + "step": { + "type": "number" + } + }, + "required": [ + "step" + ], + "type": "object" + } + ], + "description": "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.\n\n__Default value:__ a step size based on `config.view.step`." + }, + "fill": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The fill color.\n\n__Default value:__ `undefined`" + }, + "fillOpacity": { + "anyOf": [ + { + "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "height": { + "description": "Default height\n\n__Deprecated:__ Since Vega-Lite 4.0. Please use continuousHeight and discreteHeight instead.", + "type": "number" + }, + "opacity": { + "anyOf": [ + { + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", + "maximum": 1, + "minimum": 0 + }, + "step": { + "description": "Default step size for x-/y- discrete fields.", + "type": "number" + }, + "stroke": { + "anyOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "type": "null" + }, + { + "$ref": "#/definitions/ExprRef" + } + ], + "description": "The stroke color.\n\n__Default value:__ `\"#ddd\"`" + }, + "strokeCap": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeCap", + "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDash": { + "anyOf": [ + { + "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", + "items": { + "type": "number" + }, + "type": "array" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeDashOffset": { + "anyOf": [ + { + "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeJoin": { + "anyOf": [ + { + "$ref": "#/definitions/StrokeJoin", + "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeMiterLimit": { + "anyOf": [ + { + "description": "The miter limit at which to bevel a line join.", + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeOpacity": { + "anyOf": [ + { + "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", + "maximum": 1, + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "strokeWidth": { + "anyOf": [ + { + "description": "The stroke width, in pixels.", + "minimum": 0, + "type": "number" + }, + { + "$ref": "#/definitions/ExprRef" + } + ] + }, + "width": { + "description": "Default width\n\n__Deprecated:__ Since Vega-Lite 4.0. Please use continuousWidth and discreteWidth instead.", + "type": "number" + } + }, + "type": "object" + }, + "WindowEventType": { + "anyOf": [ + { + "$ref": "#/definitions/EventType" + }, + { + "type": "string" + } + ] + }, + "WindowFieldDef": { + "additionalProperties": false, + "properties": { + "as": { + "$ref": "#/definitions/FieldName", + "description": "The output name for the window operation." + }, + "field": { + "$ref": "#/definitions/FieldName", + "description": "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\"`." + }, + "op": { + "anyOf": [ + { + "$ref": "#/definitions/AggregateOp" + }, + { + "$ref": "#/definitions/WindowOnlyOp" + } + ], + "description": "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)." + }, + "param": { + "description": "Parameter values for the window functions. Parameter values can be omitted for operations that do not accept a parameter.\n\nSee the list of all supported operations and their parameters [here](https://vega.github.io/vega-lite/docs/transforms/window.html).", + "type": "number" + } + }, + "required": [ + "op", + "as" + ], + "type": "object" + }, + "WindowOnlyOp": { + "enum": [ + "row_number", + "rank", + "dense_rank", + "percent_rank", + "cume_dist", + "ntile", + "lag", + "lead", + "first_value", + "last_value", + "nth_value" + ], + "type": "string" + }, + "WindowTransform": { + "additionalProperties": false, + "properties": { + "frame": { + "description": "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 following the current data object. The default value is `[null, 0]`, indicating that the sliding window includes the current object and all preceding objects. The value `[-5, 5]` indicates that the window should include five objects preceding and five objects following the current object. Finally, `[null, null]` indicates that the window frame should always include all data objects. If you this frame and want to assign the same value to add objects, you can use the simpler [join aggregate transform](https://vega.github.io/vega-lite/docs/joinaggregate.html). The only operators affected are the aggregation operations and the `first_value`, `last_value`, and `nth_value` window operations. The other window operations are not affected by this.\n\n__Default value:__: `[null, 0]` (includes the current object and all preceding objects)", + "items": { + "type": [ + "null", + "number" + ] + }, + "type": "array" + }, + "groupby": { + "description": "The data fields for partitioning the data objects into separate windows. If unspecified, all data points will be in a single window.", + "items": { + "$ref": "#/definitions/FieldName" + }, + "type": "array" + }, + "ignorePeers": { + "description": "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 defined by offset values only. This setting only affects those operations that depend on the window frame, namely aggregation operations and the first_value, last_value, and nth_value window operations.\n\n__Default value:__ `false`", + "type": "boolean" + }, + "sort": { + "description": "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`).", + "items": { + "$ref": "#/definitions/SortField" + }, + "type": "array" + }, + "window": { + "description": "The definition of the fields in the window, and what calculations to use.", + "items": { + "$ref": "#/definitions/WindowFieldDef" + }, + "type": "array" + } + }, + "required": [ + "window" + ], + "type": "object" + } + } +} \ No newline at end of file diff --git a/runtime/Lib/site-packages/altair/vegalite/v4/tests/__init__.py b/runtime/Lib/site-packages/altair/vegalite/v4/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_api.py b/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_api.py new file mode 100644 index 0000000000000000000000000000000000000000..450553f3c6ea480489d3f8cccc2111689846f0c6 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_api.py @@ -0,0 +1,958 @@ +"""Unit tests for altair API""" + +import io +import json +import operator +import os +import pathlib +import tempfile + +import jsonschema +import pytest +import pandas as pd + +import altair.vegalite.v4 as alt + +try: + import altair_saver # noqa: F401 +except ImportError: + altair_saver = None + + +def getargs(*args, **kwargs): + return args, kwargs + + +OP_DICT = { + "layer": operator.add, + "hconcat": operator.or_, + "vconcat": operator.and_, +} + + +def _make_chart_type(chart_type): + data = pd.DataFrame( + { + "x": [28, 55, 43, 91, 81, 53, 19, 87], + "y": [43, 91, 81, 53, 19, 87, 52, 28], + "color": list("AAAABBBB"), + } + ) + base = ( + alt.Chart(data) + .mark_point() + .encode( + x="x", + y="y", + color="color", + ) + ) + + if chart_type in ["layer", "hconcat", "vconcat", "concat"]: + func = getattr(alt, chart_type) + return func(base.mark_square(), base.mark_circle()) + elif chart_type == "facet": + return base.facet("color") + elif chart_type == "facet_encoding": + return base.encode(facet="color") + elif chart_type == "repeat": + return base.encode(alt.X(alt.repeat(), type="quantitative")).repeat(["x", "y"]) + elif chart_type == "chart": + return base + else: + raise ValueError("chart_type='{}' is not recognized".format(chart_type)) + + +@pytest.fixture +def basic_chart(): + data = pd.DataFrame( + { + "a": ["A", "B", "C", "D", "E", "F", "G", "H", "I"], + "b": [28, 55, 43, 91, 81, 53, 19, 87, 52], + } + ) + + return alt.Chart(data).mark_bar().encode(x="a", y="b") + + +def test_chart_data_types(): + def Chart(data): + return alt.Chart(data).mark_point().encode(x="x:Q", y="y:Q") + + # Url Data + data = "/path/to/my/data.csv" + dct = Chart(data).to_dict() + assert dct["data"] == {"url": data} + + # Dict Data + data = {"values": [{"x": 1, "y": 2}, {"x": 2, "y": 3}]} + with alt.data_transformers.enable(consolidate_datasets=False): + dct = Chart(data).to_dict() + assert dct["data"] == data + + with alt.data_transformers.enable(consolidate_datasets=True): + dct = Chart(data).to_dict() + name = dct["data"]["name"] + assert dct["datasets"][name] == data["values"] + + # DataFrame data + data = pd.DataFrame({"x": range(5), "y": range(5)}) + with alt.data_transformers.enable(consolidate_datasets=False): + dct = Chart(data).to_dict() + assert dct["data"]["values"] == data.to_dict(orient="records") + + with alt.data_transformers.enable(consolidate_datasets=True): + dct = Chart(data).to_dict() + name = dct["data"]["name"] + assert dct["datasets"][name] == data.to_dict(orient="records") + + # Named data object + data = alt.NamedData(name="Foo") + dct = Chart(data).to_dict() + assert dct["data"] == {"name": "Foo"} + + +def test_chart_infer_types(): + data = pd.DataFrame( + { + "x": pd.date_range("2012", periods=10, freq="Y"), + "y": range(10), + "c": list("abcabcabca"), + } + ) + + def _check_encodings(chart): + dct = chart.to_dict() + assert dct["encoding"]["x"]["type"] == "temporal" + assert dct["encoding"]["x"]["field"] == "x" + assert dct["encoding"]["y"]["type"] == "quantitative" + assert dct["encoding"]["y"]["field"] == "y" + assert dct["encoding"]["color"]["type"] == "nominal" + assert dct["encoding"]["color"]["field"] == "c" + + # Pass field names by keyword + chart = alt.Chart(data).mark_point().encode(x="x", y="y", color="c") + _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")) + ) + _check_encodings(chart) + + # pass Channel objects by value + chart = alt.Chart(data).mark_point().encode(alt.X("x"), alt.Y("y"), alt.Color("c")) + _check_encodings(chart) + + # override default types + chart = ( + alt.Chart(data) + .mark_point() + .encode(alt.X("x", type="nominal"), alt.Y("y", type="ordinal")) + ) + dct = chart.to_dict() + assert dct["encoding"]["x"]["type"] == "nominal" + assert dct["encoding"]["y"]["type"] == "ordinal" + + +@pytest.mark.parametrize( + "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"}, + ] + 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(): + data = pd.DataFrame( + { + "x": pd.date_range("2012", periods=10, freq="Y"), + "y": range(10), + "c": list("abcabcabca"), + } + ) + chart1 = alt.Chart(data).mark_line().encode(x="x", y="y", color="c") + chart2 = chart1.mark_point() + chart3 = chart1.mark_circle() + chart4 = chart1.mark_square() + + chart = chart1 + chart2 + chart3 + assert isinstance(chart, alt.LayerChart) + assert len(chart.layer) == 3 + chart += chart4 + assert len(chart.layer) == 4 + + chart = chart1 | chart2 | chart3 + assert isinstance(chart, alt.HConcatChart) + assert len(chart.hconcat) == 3 + chart |= chart4 + assert len(chart.hconcat) == 4 + + chart = chart1 & chart2 & chart3 + assert isinstance(chart, alt.VConcatChart) + assert len(chart.vconcat) == 3 + chart &= chart4 + assert len(chart.vconcat) == 4 + + +def test_selection_to_dict(): + brush = alt.selection(type="interval") + + # test some value selections + # Note: X and Y cannot have conditions + alt.Chart("path/to/data.json").mark_point().encode( + color=alt.condition(brush, alt.ColorValue("red"), alt.ColorValue("blue")), + opacity=alt.condition(brush, alt.value(0.5), alt.value(1.0)), + text=alt.condition(brush, alt.TextValue("foo"), alt.value("bar")), + ).to_dict() + + # test some field selections + # Note: X and Y cannot have conditions + # Conditions cannot both be fields + alt.Chart("path/to/data.json").mark_point().encode( + color=alt.condition(brush, alt.Color("col1:N"), alt.value("blue")), + opacity=alt.condition(brush, "col1:N", alt.value(0.5)), + text=alt.condition(brush, alt.value("abc"), alt.Text("col2:N")), + size=alt.condition(brush, alt.value(20), "col2:N"), + ).to_dict() + + +def test_selection_expression(): + selection = alt.selection_single(fields=["value"]) + + assert isinstance(selection.value, alt.expr.Expression) + assert selection.value.to_dict() == "{0}.value".format(selection.name) + + 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): + if format in ["pdf", "png"]: + out = io.BytesIO() + mode = "rb" + else: + out = io.StringIO() + mode = "r" + + 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) + content = out.read() + + if format == "json": + assert "$schema" in json.loads(content) + if format == "html": + assert content.startswith("") + + fid, filename = tempfile.mkstemp(suffix="." + format) + os.close(fid) + + # 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(): + # wrapped facet + chart1 = ( + alt.Chart("data.csv") + .mark_point() + .encode( + x="x:Q", + y="y:Q", + ) + .facet("category:N", columns=2) + ) + + dct1 = chart1.to_dict() + + assert dct1["facet"] == alt.Facet("category:N").to_dict() + assert dct1["columns"] == 2 + assert dct1["data"] == alt.UrlData("data.csv").to_dict() + + # explicit row/col facet + chart2 = ( + alt.Chart("data.csv") + .mark_point() + .encode( + x="x:Q", + y="y:Q", + ) + .facet(row="category1:Q", column="category2:Q") + ) + + dct2 = chart2.to_dict() + + assert dct2["facet"]["row"] == alt.Facet("category1:Q").to_dict() + assert dct2["facet"]["column"] == alt.Facet("category2:Q").to_dict() + assert "columns" not in dct2 + assert dct2["data"] == alt.UrlData("data.csv").to_dict() + + +def test_facet_parse(): + chart = ( + alt.Chart("data.csv") + .mark_point() + .encode(x="x:Q", y="y:Q") + .facet(row="row:N", column="column:O") + ) + dct = chart.to_dict() + assert dct["data"] == {"url": "data.csv"} + assert "data" not in dct["spec"] + assert dct["facet"] == { + "column": {"field": "column", "type": "ordinal"}, + "row": {"field": "row", "type": "nominal"}, + } + + +def test_facet_parse_data(): + data = pd.DataFrame({"x": range(5), "y": range(5), "row": list("abcab")}) + chart = ( + alt.Chart(data) + .mark_point() + .encode(x="x", y="y:O") + .facet(row="row", column="column:O") + ) + with alt.data_transformers.enable(consolidate_datasets=False): + dct = chart.to_dict() + assert "values" in dct["data"] + assert "data" not in dct["spec"] + assert dct["facet"] == { + "column": {"field": "column", "type": "ordinal"}, + "row": {"field": "row", "type": "nominal"}, + } + + with alt.data_transformers.enable(consolidate_datasets=True): + dct = chart.to_dict() + assert "datasets" in dct + assert "name" in dct["data"] + assert "data" not in dct["spec"] + assert dct["facet"] == { + "column": {"field": "column", "type": "ordinal"}, + "row": {"field": "row", "type": "nominal"}, + } + + +def test_selection(): + # test instantiation of selections + interval = alt.selection_interval(name="selec_1") + assert interval.selection.type == "interval" + assert interval.name == "selec_1" + + single = alt.selection_single(name="selec_2") + assert single.selection.type == "single" + assert single.name == "selec_2" + + multi = alt.selection_multi(name="selec_3") + assert multi.selection.type == "multi" + assert multi.name == "selec_3" + + # 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 + assert isinstance(single & multi, alt.Selection) + assert isinstance(single | multi, alt.Selection) + assert isinstance(~single, alt.Selection) + assert isinstance((single & multi)[0].group, alt.SelectionAnd) + assert isinstance((single | multi)[0].group, alt.SelectionOr) + assert isinstance((~single)[0].group, alt.SelectionNot) + + # test that default names increment (regression for #1454) + sel1 = alt.selection_single() + sel2 = alt.selection_multi() + sel3 = alt.selection_interval() + names = {s.name for s in (sel1, sel2, sel3)} + assert len(names) == 3 + + +def test_transforms(): + # aggregate transform + agg1 = alt.AggregatedFieldDef(**{"as": "x1", "op": "mean", "field": "y"}) + agg2 = alt.AggregatedFieldDef(**{"as": "x2", "op": "median", "field": "z"}) + chart = alt.Chart().transform_aggregate([agg1], ["foo"], x2="median(z)") + kwds = dict(aggregate=[agg1, agg2], groupby=["foo"]) + assert chart.transform == [alt.AggregateTransform(**kwds)] + + # bin transform + chart = alt.Chart().transform_bin("binned", field="field", bin=True) + kwds = {"as": "binned", "field": "field", "bin": True} + assert chart.transform == [alt.BinTransform(**kwds)] + + # calcualte transform + chart = alt.Chart().transform_calculate("calc", "datum.a * 4") + kwds = {"as": "calc", "calculate": "datum.a * 4"} + assert chart.transform == [alt.CalculateTransform(**kwds)] + + # density transform + chart = alt.Chart().transform_density("x", as_=["value", "density"]) + kwds = {"as": ["value", "density"], "density": "x"} + assert chart.transform == [alt.DensityTransform(**kwds)] + + # filter transform + chart = alt.Chart().transform_filter("datum.a < 4") + assert chart.transform == [alt.FilterTransform(filter="datum.a < 4")] + + # flatten transform + chart = alt.Chart().transform_flatten(["A", "B"], ["X", "Y"]) + kwds = {"as": ["X", "Y"], "flatten": ["A", "B"]} + assert chart.transform == [alt.FlattenTransform(**kwds)] + + # fold transform + chart = alt.Chart().transform_fold(["A", "B", "C"], as_=["key", "val"]) + kwds = {"as": ["key", "val"], "fold": ["A", "B", "C"]} + assert chart.transform == [alt.FoldTransform(**kwds)] + + # impute transform + chart = alt.Chart().transform_impute("field", "key", groupby=["x"]) + kwds = {"impute": "field", "key": "key", "groupby": ["x"]} + assert chart.transform == [alt.ImputeTransform(**kwds)] + + # joinaggregate transform + chart = alt.Chart().transform_joinaggregate(min="min(x)", groupby=["key"]) + kwds = { + "joinaggregate": [ + alt.JoinAggregateFieldDef(field="x", op="min", **{"as": "min"}) + ], + "groupby": ["key"], + } + assert chart.transform == [alt.JoinAggregateTransform(**kwds)] + + # loess transform + chart = alt.Chart().transform_loess("x", "y", as_=["xx", "yy"]) + kwds = {"on": "x", "loess": "y", "as": ["xx", "yy"]} + assert chart.transform == [alt.LoessTransform(**kwds)] + + # lookup transform (data) + lookup_data = alt.LookupData(alt.UrlData("foo.csv"), "id", ["rate"]) + chart = alt.Chart().transform_lookup("a", from_=lookup_data, as_="a", default="b") + kwds = {"from": lookup_data, "as": "a", "lookup": "a", "default": "b"} + assert chart.transform == [alt.LookupTransform(**kwds)] + + # lookup transform (selection) + lookup_selection = alt.LookupSelection(key="key", selection="sel") + chart = alt.Chart().transform_lookup( + "a", from_=lookup_selection, as_="a", default="b" + ) + kwds = {"from": lookup_selection, "as": "a", "lookup": "a", "default": "b"} + assert chart.transform == [alt.LookupTransform(**kwds)] + + # pivot transform + chart = alt.Chart().transform_pivot("x", "y") + assert chart.transform == [alt.PivotTransform(pivot="x", value="y")] + + # quantile transform + chart = alt.Chart().transform_quantile("x", as_=["prob", "value"]) + kwds = {"quantile": "x", "as": ["prob", "value"]} + assert chart.transform == [alt.QuantileTransform(**kwds)] + + # regression transform + chart = alt.Chart().transform_regression("x", "y", as_=["xx", "yy"]) + kwds = {"on": "x", "regression": "y", "as": ["xx", "yy"]} + assert chart.transform == [alt.RegressionTransform(**kwds)] + + # sample transform + chart = alt.Chart().transform_sample() + assert chart.transform == [alt.SampleTransform(1000)] + + # stack transform + chart = alt.Chart().transform_stack("stacked", "x", groupby=["y"]) + assert chart.transform == [ + alt.StackTransform(stack="x", groupby=["y"], **{"as": "stacked"}) + ] + + # timeUnit transform + chart = alt.Chart().transform_timeunit("foo", field="x", timeUnit="date") + kwds = {"as": "foo", "field": "x", "timeUnit": "date"} + assert chart.transform == [alt.TimeUnitTransform(**kwds)] + + # window transform + chart = alt.Chart().transform_window(xsum="sum(x)", ymin="min(y)", frame=[None, 0]) + window = [ + alt.WindowFieldDef(**{"as": "xsum", "field": "x", "op": "sum"}), + alt.WindowFieldDef(**{"as": "ymin", "field": "y", "op": "min"}), + ] + + # kwargs don't maintain order in Python < 3.6, so window list can + # be reversed + assert chart.transform == [ + alt.WindowTransform(frame=[None, 0], window=window) + ] or chart.transform == [alt.WindowTransform(frame=[None, 0], 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"]}}} + ] + + chart = base.transform_filter(selector1 | ~selector2) + assert chart.to_dict()["transform"] == [ + {"filter": {"selection": {"or": ["s1", {"not": "s2"}]}}} + ] + + chart = base.transform_filter(~selector1 | ~selector2) + assert chart.to_dict()["transform"] == [ + {"filter": {"selection": {"or": [{"not": "s1"}, {"not": "s2"}]}}} + ] + + chart = base.transform_filter(~(selector1 & selector2)) + assert chart.to_dict()["transform"] == [ + {"filter": {"selection": {"not": {"and": ["s1", "s2"]}}}} + ] + + +def test_resolve_methods(): + chart = alt.LayerChart().resolve_axis(x="shared", y="independent") + assert chart.resolve == alt.Resolve( + axis=alt.AxisResolveMap(x="shared", y="independent") + ) + + chart = alt.LayerChart().resolve_legend(color="shared", fill="independent") + assert chart.resolve == alt.Resolve( + legend=alt.LegendResolveMap(color="shared", fill="independent") + ) + + chart = alt.LayerChart().resolve_scale(x="shared", y="independent") + assert chart.resolve == alt.Resolve( + scale=alt.ScaleResolveMap(x="shared", y="independent") + ) + + +def test_layer_encodings(): + chart = alt.LayerChart().encode(x="column:Q") + assert chart.encoding.x == alt.X(shorthand="column:Q") + + +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 = {s.name: s.selection for s in selections} + 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() + + +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() + + +@pytest.mark.parametrize("charttype", [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(selection=sel) + + assert list(chart["selection"].keys()) == [sel.name] + + +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}] + } + + +def test_themes(): + chart = alt.Chart("foo.txt").mark_point() + + with alt.themes.enable("default"): + assert chart.to_dict()["config"] == { + "view": {"continuousWidth": 400, "continuousHeight": 300} + } + + with alt.themes.enable("opaque"): + assert chart.to_dict()["config"] == { + "background": "white", + "view": {"continuousWidth": 400, "continuousHeight": 300}, + } + + with alt.themes.enable("none"): + assert "config" not in chart.to_dict() + + +def test_chart_from_dict(): + base = alt.Chart("data.csv").mark_point().encode(x="x:Q", y="y:Q") + + charts = [ + base, + base + base, + base | base, + base & base, + base.facet("c:N"), + (base + base).facet(row="c:N", data="data.csv"), + base.repeat(["c", "d"]), + (base + base).repeat(row=["c", "d"]), + ] + + for chart in charts: + chart_out = alt.Chart.from_dict(chart.to_dict()) + assert type(chart_out) is type(chart) + + # test that an invalid spec leads to a schema validation error + with pytest.raises(jsonschema.ValidationError): + alt.Chart.from_dict({"invalid": "spec"}) + + +def test_consolidate_datasets(basic_chart): + subchart1 = basic_chart + subchart2 = basic_chart.copy() + subchart2.data = basic_chart.data.copy() + chart = subchart1 | subchart2 + + with alt.data_transformers.enable(consolidate_datasets=True): + dct_consolidated = chart.to_dict() + + with alt.data_transformers.enable(consolidate_datasets=False): + dct_standard = chart.to_dict() + + assert "datasets" in dct_consolidated + assert "datasets" not in dct_standard + + datasets = dct_consolidated["datasets"] + + # two dataset copies should be recognized as duplicates + assert len(datasets) == 1 + + # make sure data matches original & names are correct + name, data = datasets.popitem() + + for spec in dct_standard["hconcat"]: + assert spec["data"]["values"] == data + + 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() + + +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"} + + +def test_data_property(): + data = pd.DataFrame({"x": [1, 2, 3], "y": list("ABC")}) + chart1 = alt.Chart(data).mark_point() + chart2 = alt.Chart().mark_point().properties(data=data) + + assert chart1.to_dict() == chart2.to_dict() + + +@pytest.mark.parametrize("method", ["layer", "hconcat", "vconcat", "concat"]) +@pytest.mark.parametrize( + "data", ["data.json", pd.DataFrame({"x": range(3), "y": list("abc")})] +) +def test_subcharts_with_same_data(method, data): + func = getattr(alt, method) + + point = alt.Chart(data).mark_point().encode(x="x:Q", y="y:Q") + line = point.mark_line() + text = point.mark_text() + + chart1 = func(point, line, text) + assert chart1.data is not alt.Undefined + assert all(c.data is alt.Undefined for c in getattr(chart1, method)) + + if method != "concat": + op = OP_DICT[method] + chart2 = op(op(point, line), text) + assert chart2.data is not alt.Undefined + assert all(c.data is alt.Undefined for c in getattr(chart2, method)) + + +@pytest.mark.parametrize("method", ["layer", "hconcat", "vconcat", "concat"]) +@pytest.mark.parametrize( + "data", ["data.json", pd.DataFrame({"x": range(3), "y": list("abc")})] +) +def test_subcharts_different_data(method, data): + func = getattr(alt, method) + + point = alt.Chart(data).mark_point().encode(x="x:Q", y="y:Q") + otherdata = alt.Chart("data.csv").mark_point().encode(x="x:Q", y="y:Q") + nodata = alt.Chart().mark_point().encode(x="x:Q", y="y:Q") + + chart1 = func(point, otherdata) + assert chart1.data is alt.Undefined + assert getattr(chart1, method)[0].data is data + + chart2 = func(point, nodata) + assert chart2.data is alt.Undefined + assert getattr(chart2, method)[0].data is data + + +def test_layer_facet(basic_chart): + chart = (basic_chart + basic_chart).facet(row="row:Q") + assert chart.data is not alt.Undefined + assert chart.spec.data is alt.Undefined + for layer in chart.spec.layer: + assert layer.data is alt.Undefined + + dct = chart.to_dict() + assert "data" in dct + + +def test_layer_errors(): + toplevel_chart = alt.Chart("data.txt").mark_point().configure_legend(columns=2) + + facet_chart1 = alt.Chart("data.txt").mark_point().encode(facet="row:Q") + + facet_chart2 = alt.Chart("data.txt").mark_point().facet("row:Q") + + repeat_chart = alt.Chart("data.txt").mark_point().repeat(["A", "B", "C"]) + + simple_chart = alt.Chart("data.txt").mark_point() + + with pytest.raises(ValueError) as err: + toplevel_chart + simple_chart + assert str(err.value).startswith( + 'Objects with "config" attribute cannot be used within LayerChart.' + ) + + with pytest.raises(ValueError) as err: + repeat_chart + simple_chart + assert str(err.value) == "Repeat charts cannot be layered." + + with pytest.raises(ValueError) as err: + facet_chart1 + simple_chart + assert str(err.value) == "Faceted charts cannot be layered." + + with pytest.raises(ValueError) as err: + alt.layer(simple_chart) + facet_chart2 + assert str(err.value) == "Faceted charts cannot be layered." + + +@pytest.mark.parametrize( + "chart_type", + ["layer", "hconcat", "vconcat", "concat", "facet", "facet_encoding", "repeat"], +) +def test_resolve(chart_type): + chart = _make_chart_type(chart_type) + chart = ( + chart.resolve_scale( + x="independent", + ) + .resolve_legend(color="independent") + .resolve_axis(y="independent") + ) + dct = chart.to_dict() + assert dct["resolve"] == { + "scale": {"x": "independent"}, + "legend": {"color": "independent"}, + "axis": {"y": "independent"}, + } + + +# TODO: test vconcat, hconcat, concat, facet_encoding when schema allows them. +# This is blocked by https://github.com/vega/vega-lite/issues/5261 +@pytest.mark.parametrize("chart_type", ["chart", "layer"]) +@pytest.mark.parametrize("facet_arg", [None, "facet", "row", "column"]) +def test_facet(chart_type, facet_arg): + chart = _make_chart_type(chart_type) + if facet_arg is None: + chart = chart.facet("color:N", columns=2) + else: + chart = chart.facet(**{facet_arg: "color:N", "columns": 2}) + dct = chart.to_dict() + + assert "spec" in dct + assert dct["columns"] == 2 + expected = {"field": "color", "type": "nominal"} + if facet_arg is None or facet_arg == "facet": + 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]}} + + +def test_sphere(): + data = alt.sphere() + assert data.to_dict() == {"sphere": True} + + +def test_validate_dataset(): + d = {"data": {"values": [{}]}, "mark": {"type": "point"}} + + chart = alt.Chart.from_dict(d) + jsn = chart.to_json() + + assert jsn diff --git a/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_data.py b/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_data.py new file mode 100644 index 0000000000000000000000000000000000000000..8eae11c868c6bc0ba14edb9cc7bae6d588f1d5aa --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_data.py @@ -0,0 +1,33 @@ +import os + +import pandas as pd +import pytest + +from .. import data as alt + + +@pytest.fixture +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 TypeError: + jsonfile = {} + finally: + if jsonfile: + os.remove(jsonfile["url"]) diff --git a/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_display.py b/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_display.py new file mode 100644 index 0000000000000000000000000000000000000000..e7ccc27ff7fea82f5ae06e206520eb1d4dc74e72 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_display.py @@ -0,0 +1,69 @@ +from contextlib import contextmanager + +import pytest + +import altair.vegalite.v4 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() diff --git a/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_geo_interface.py b/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_geo_interface.py new file mode 100644 index 0000000000000000000000000000000000000000..b637b28fcfe932e07ad29a2bbd717c5f5b97244d --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_geo_interface.py @@ -0,0 +1,204 @@ +import pytest +import altair.vegalite.v4 as alt + + +def geom_obj(geom): + class Geom(object): + pass + + geom_obj = Geom() + setattr(geom_obj, "__geo_interface__", geom) + return geom_obj + + +# correct translation of Polygon geometry to Feature type +def test_geo_interface_polygon_feature(): + geom = { + "coordinates": [[(0, 0), (0, 2), (2, 2), (2, 0), (0, 0)]], + "type": "Polygon", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"]["type"] == "Feature" + + +# merge geometry with empty properties dictionary +def test_geo_interface_removal_empty_properties(): + geom = { + "geometry": { + "coordinates": [ + [[6.90, 53.48], [5.98, 51.85], [6.07, 53.51], [6.90, 53.48]] + ], + "type": "Polygon", + }, + "id": None, + "properties": {}, + "type": "Feature", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"]["type"] == "Feature" + + +# only register metadata in the properties member +def test_geo_interface_register_foreign_member(): + geom = { + "geometry": { + "coordinates": [ + [[6.90, 53.48], [5.98, 51.85], [6.07, 53.51], [6.90, 53.48]] + ], + "type": "Polygon", + }, + "id": 2, + "properties": {"foo": "bah"}, + "type": "Feature", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + with pytest.raises(KeyError): + spec["data"]["values"]["id"] + assert spec["data"]["values"]["foo"] == "bah" + + +# correct serializing of arrays and nested tuples +def test_geo_interface_serializing_arrays_tuples(): + import array as arr + + geom = { + "bbox": arr.array("d", [1, 2, 3, 4]), + "geometry": { + "coordinates": [ + tuple( + ( + tuple((6.90, 53.48)), + tuple((5.98, 51.85)), + tuple((6.07, 53.51)), + tuple((6.90, 53.48)), + ) + ) + ], + "type": "Polygon", + }, + "id": 27, + "properties": {}, + "type": "Feature", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"]["geometry"]["coordinates"][0][0] == [6.9, 53.48] + + +# overwrite existing 'type' value in properties with `Feature` +def test_geo_interface_reserved_members(): + geom = { + "geometry": { + "coordinates": [ + [[6.90, 53.48], [5.98, 51.85], [6.07, 53.51], [6.90, 53.48]] + ], + "type": "Polygon", + }, + "id": 27, + "properties": {"type": "foo"}, + "type": "Feature", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"]["type"] == "Feature" + + +# an empty FeatureCollection is valid +def test_geo_interface_empty_feature_collection(): + geom = {"type": "FeatureCollection", "features": []} + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"] == [] + + +# Features in a FeatureCollection only keep properties and geometry +def test_geo_interface_feature_collection(): + geom = { + "type": "FeatureCollection", + "features": [ + { + "geometry": { + "coordinates": [ + [[6.90, 53.48], [5.98, 51.85], [6.07, 53.51], [6.90, 53.48]] + ], + "type": "Polygon", + }, + "id": 27, + "properties": {"type": "foo", "id": 1, "geometry": 1}, + "type": "Feature", + }, + { + "geometry": { + "coordinates": [ + [[8.90, 53.48], [7.98, 51.85], [8.07, 53.51], [8.90, 53.48]] + ], + "type": "Polygon", + }, + "id": 28, + "properties": {"type": "foo", "id": 2, "geometry": 1}, + "type": "Feature", + }, + ], + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"][0]["id"] == 1 + assert spec["data"]["values"][1]["id"] == 2 + assert "coordinates" in spec["data"]["values"][0]["geometry"] + assert "coordinates" in spec["data"]["values"][1]["geometry"] + assert spec["data"]["values"][0]["type"] == "Feature" + assert spec["data"]["values"][1]["type"] == "Feature" + + +# typical output of a __geo_interface__ from geopandas GeoDataFrame +# notic that the index value is registerd as a commonly used identifier +# with the name "id" (in this case 49). Similar to serialization of a +# pandas DataFrame is the index not included in the output +def test_geo_interface_feature_collection_gdf(): + geom = { + "bbox": (19.89, -26.82, 29.43, -17.66), + "features": [ + { + "bbox": (19.89, -26.82, 29.43, -17.66), + "geometry": { + "coordinates": [ + [[6.90, 53.48], [5.98, 51.85], [6.07, 53.51], [6.90, 53.48]] + ], + "type": "Polygon", + }, + "id": "49", + "properties": { + "continent": "Africa", + "gdp_md_est": 35900.0, + "id": "BWA", + "iso_a3": "BWA", + "name": "Botswana", + "pop_est": 2214858, + }, + "type": "Feature", + } + ], + "type": "FeatureCollection", + } + feat = geom_obj(geom) + + with alt.data_transformers.enable(consolidate_datasets=False): + spec = alt.Chart(feat).mark_geoshape().to_dict() + assert spec["data"]["values"][0]["id"] == "BWA" diff --git a/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_renderers.py b/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_renderers.py new file mode 100644 index 0000000000000000000000000000000000000000..55c5e4ffb3f95df1b150d86ec619efa2c7d70aa2 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_renderers.py @@ -0,0 +1,65 @@ +"""Tests of various renderers""" + +import json + +import pytest + +import altair.vegalite.v4 as alt + + +@pytest.fixture +def chart(): + return alt.Chart("data.csv").mark_point() + + +def test_html_renderer_embed_options(chart, renderer="html"): + """Test that embed_options in renderer metadata are correctly manifest in html""" + # Short of parsing the javascript, it's difficult to parse out the + # actions. So we use string matching + + def assert_has_options(chart, **opts): + html = chart._repr_mimebundle_(None, None)["text/html"] + for key, val in opts.items(): + assert json.dumps({key: val})[1:-1] in html + + with alt.renderers.enable(renderer): + assert_has_options(chart, mode="vega-lite") + + with alt.renderers.enable(embed_options=dict(actions={"export": True})): + assert_has_options(chart, mode="vega-lite", actions={"export": True}) + + with alt.renderers.set_embed_options(actions=True): + assert_has_options(chart, mode="vega-lite", actions=True) + + +def test_mimetype_renderer_embed_options(chart, renderer="mimetype"): + # check that metadata is passed appropriately + mimetype = alt.display.VEGALITE_MIME_TYPE + spec = chart.to_dict() + with alt.renderers.enable(renderer): + # Sanity check: no metadata specified + bundle, metadata = chart._repr_mimebundle_(None, None) + assert bundle[mimetype] == spec + assert metadata == {} + with alt.renderers.set_embed_options(actions=False): + bundle, metadata = chart._repr_mimebundle_(None, None) + assert set(bundle.keys()) == {mimetype, "text/plain"} + assert bundle[mimetype] == spec + assert metadata == {mimetype: {"embed_options": {"actions": False}}} + + +def test_json_renderer_embed_options(chart, renderer="json"): + """Test that embed_options in renderer metadata are correctly manifest in html""" + mimetype = "application/json" + spec = chart.to_dict() + with alt.renderers.enable(renderer): + # Sanity check: no options specified + bundle, metadata = chart._repr_mimebundle_(None, None) + assert bundle[mimetype] == spec + assert metadata == {} + + with alt.renderers.enable(option="foo"): + bundle, metadata = chart._repr_mimebundle_(None, None) + assert set(bundle.keys()) == {mimetype, "text/plain"} + assert bundle[mimetype] == spec + assert metadata == {mimetype: {"option": "foo"}} diff --git a/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_theme.py b/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_theme.py new file mode 100644 index 0000000000000000000000000000000000000000..d159d2fa7e2e011a6818a0039f29871be1f14942 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v4/tests/test_theme.py @@ -0,0 +1,19 @@ +import pytest + +import altair.vegalite.v4 as alt +from altair.vegalite.v4.theme import VEGA_THEMES + + +@pytest.fixture +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": {"continuousWidth": 400, "continuousHeight": 300} + } diff --git a/runtime/Lib/site-packages/altair/vegalite/v4/theme.py b/runtime/Lib/site-packages/altair/vegalite/v4/theme.py new file mode 100644 index 0000000000000000000000000000000000000000..b1db45778a1640000895e852a0486826311d3df3 --- /dev/null +++ b/runtime/Lib/site-packages/altair/vegalite/v4/theme.py @@ -0,0 +1,56 @@ +"""Tools for enabling and registering chart themes""" + +from ...utils.theme import ThemeRegistry + +VEGA_THEMES = [ + "ggplot2", + "quartz", + "vox", + "fivethirtyeight", + "dark", + "latimes", + "urbaninstitute", +] + + +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": {"continuousWidth": 400, "continuousHeight": 300}}, + } + + 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. +ENTRY_POINT_GROUP = "altair.vegalite.v4.theme" # type: str +themes = ThemeRegistry(entry_point_group=ENTRY_POINT_GROUP) + +themes.register( + "default", + lambda: {"config": {"view": {"continuousWidth": 400, "continuousHeight": 300}}}, +) +themes.register( + "opaque", + lambda: { + "config": { + "background": "white", + "view": {"continuousWidth": 400, "continuousHeight": 300}, + } + }, +) +themes.register("none", lambda: {}) + +for theme in VEGA_THEMES: + themes.register(theme, VegaTheme(theme)) + +themes.enable("default")