OVAPortableText 0.3.0__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/CHANGELOG.md +23 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/PKG-INFO +1 -1
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/docs/API_REFERENCE.md +33 -4
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/docs/PROTOCOL_ALIGNMENT.md +4 -4
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/docs/QUICKSTART.md +2 -2
- ovaportabletext-0.4.0/examples/v13_charts_demo.py +100 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/pyproject.toml +1 -1
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/__init__.py +27 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/document.py +1 -1
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/helpers.py +351 -6
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/registry.py +232 -1
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/validator.py +162 -2
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/version.py +1 -1
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_minimal_report.py +1 -1
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_v12_section_and_doughnut.py +1 -1
- ovaportabletext-0.4.0/tests/test_v13_charts.py +233 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/.gitignore +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/LICENSE +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/README.md +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/docs/EXAMPLES.md +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/docs/PUBLISHING_CHECKLIST.md +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/docs/REAL_WORLD_RECIPES.md +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/docs/TEST_MATRIX.md +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/docs/USER_TESTING_CHECKLIST.md +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/docs/VALIDATION_AND_RESOLVER.md +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/docs/native/portable_text_basics.md +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/docs/protocol/test +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/docs/protocol/v1.0.md +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/docs/protocol/v1.1.md +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/docs/protocol/v1.2.md +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/builder_numbering_roundtrip_demo.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/extended_registries_demo.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/full_report_workflow_demo.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/grid_table_demo.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/image_sources_demo.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/inline_objects_report.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/marks_and_lists_report.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/minimal_report.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/patent_valuation_style_report.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/references_and_marks_demo.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/registry_blocks_report.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/sample_outputs/generate_patent_report_sample_1.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/sample_outputs/patent_report_sample_1.json +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/save_and_load_json_demo.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/v11_layout_and_cell_image_demo.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/validation_context_demo.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/examples/validation_report.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/base.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/block_objects.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/content.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/exceptions.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/inline.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/numbering.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/py.typed +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/resolver.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/section.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/text.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/src/ova_portable_text/theme.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_blocks_and_registry.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_builder_roundtrip_and_theme.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_content_flow_helpers.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_document_validation_error_rendering.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_examples_smoke.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_extended_registries_and_resolver.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_file_io_roundtrip.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_image_asset_sources.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_inline_objects.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_mark_validation.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_marks_and_lists.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_numbering.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_pie_chart_parallel_arrays.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_resolver_debug_summary.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_resolver_semantic_figure_alias.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_roundtrip_and_runtime_version.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_section_batch_helpers.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_strict_ids.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_style_validation.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_table_dataset_validation.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_v11_grid_cell_image.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_v11_image_block_optional_id.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_v11_table_layout.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_v11_theme_layout.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_validation_context_output.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_validation_failures.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_validation_report_python_alias.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_validation_success.py +0 -0
- {ovaportabletext-0.3.0 → ovaportabletext-0.4.0}/tests/test_validator_extended_rules.py +0 -0
|
@@ -4,6 +4,29 @@
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.4.0] - 2026-05-14
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
* aligned the package with `report.v1.3`
|
|
12
|
+
* added typed chart models for `bar`, `line`, and `matrix_bubble` datasets
|
|
13
|
+
* added shared `ChartAxis`, `ChartCategory`, `MatrixBubbleCategory`, and `SizeMetric` models
|
|
14
|
+
* added chart helper functions for bar, horizontal bar, line, and matrix bubble datasets
|
|
15
|
+
* added validation coverage for v1.3 chart category references, series keys, and matrix bubble size values
|
|
16
|
+
* added tests covering v1.3 schema defaults, `pie.slices[].colorHint`, bar variants, line points, and matrix bubble output
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
* default `schemaVersion` is now `report.v1.3`
|
|
21
|
+
* package metadata and public version now reflect `v0.4.0` / `report.v1.3`
|
|
22
|
+
* `datasets.charts` now has first-class Python models for all v1.3 formal chart types while keeping the generic chart fallback
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
* preserved `pie.slices[].colorHint` while avoiding new visual-style fields for v1.3 chart types
|
|
27
|
+
* normalized legacy `sizeMetric.valueUnit` input to `sizeMetric.unit` without emitting `valueUnit` in new matrix-bubble output
|
|
28
|
+
* avoided any `chartType = "bubble"` helper for v1.3; classification bubble charts now use `chartType = "matrix_bubble"`
|
|
29
|
+
|
|
7
30
|
## [0.3.0] - 2026-04-08
|
|
8
31
|
|
|
9
32
|
### Added
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# API Reference / API 参考
|
|
2
2
|
|
|
3
|
-
This page is a practical map of the public API in OVAPortableText `v0.
|
|
4
|
-
本文档是 OVAPortableText `v0.
|
|
3
|
+
This page is a practical map of the public API in OVAPortableText `v0.4.0`, aligned to `report.v1.3`.
|
|
4
|
+
本文档是 OVAPortableText `v0.4.0` 的实用 API 地图,对齐 `report.v1.3`。
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -17,7 +17,7 @@ This page is a practical map of the public API in OVAPortableText `v0.3.0`, alig
|
|
|
17
17
|
|
|
18
18
|
Default schema version:
|
|
19
19
|
|
|
20
|
-
- `Document.schemaVersion == "report.v1.
|
|
20
|
+
- `Document.schemaVersion == "report.v1.3"`
|
|
21
21
|
|
|
22
22
|
Common arguments / 常用参数:
|
|
23
23
|
|
|
@@ -46,7 +46,7 @@ Body block objects / 正文块对象:
|
|
|
46
46
|
- `MathBlock`
|
|
47
47
|
- `CalloutBlock`
|
|
48
48
|
|
|
49
|
-
Important v1.
|
|
49
|
+
Important v1.3 note / v1.3 重点:
|
|
50
50
|
|
|
51
51
|
- `ImageBlock(imageRef="...")` remains valid
|
|
52
52
|
- `ChartBlock(chartRef="...")`, `TableBlock(tableRef="...")`, and `MathBlock(latex="...")` may now omit instance `id`
|
|
@@ -209,10 +209,39 @@ Supported length units:
|
|
|
209
209
|
- `table_layout(*column_specs)`
|
|
210
210
|
- `pie_slice(...)`
|
|
211
211
|
- `pie_chart_dataset(...)`
|
|
212
|
+
- `doughnut_chart_dataset(...)`
|
|
212
213
|
- `pie_chart_from_parallel_arrays(...)`
|
|
214
|
+
- `chart_axis(...)`
|
|
215
|
+
- `chart_category(...)`
|
|
216
|
+
- `bar_data_point(...)`
|
|
217
|
+
- `bar_series(...)`
|
|
218
|
+
- `bar_chart_dataset(...)`
|
|
219
|
+
- `horizontal_bar_chart_dataset(...)`
|
|
220
|
+
- `line_point(...)`
|
|
221
|
+
- `line_series(...)`
|
|
222
|
+
- `line_chart_dataset(...)`
|
|
223
|
+
- `matrix_bubble_category(...)`
|
|
224
|
+
- `size_metric(...)`
|
|
225
|
+
- `matrix_bubble_point(...)`
|
|
226
|
+
- `matrix_bubble_series(...)`
|
|
227
|
+
- `matrix_bubble_chart_dataset(...)`
|
|
213
228
|
- `metric_value(...)`
|
|
214
229
|
- `metric_dataset(...)`
|
|
215
230
|
|
|
231
|
+
|
|
232
|
+
### v1.3 chart models / v1.3 图表模型
|
|
233
|
+
|
|
234
|
+
`datasets.charts[]` now has typed helpers for the five formal chart types: `pie`, `doughnut`, `bar`, `line`, and `matrix_bubble`.
|
|
235
|
+
`datasets.charts[]` 现在为五类正式图表提供 typed helper:`pie`、`doughnut`、`bar`、`line`、`matrix_bubble`。
|
|
236
|
+
|
|
237
|
+
Key boundaries / 关键边界:
|
|
238
|
+
|
|
239
|
+
- horizontal bar charts still use `chartType = "bar"` with `orientation = "horizontal"`
|
|
240
|
+
- line charts use `points[].xValue / yValue / label`, not `categories[]`
|
|
241
|
+
- classification bubble charts use `chartType = "matrix_bubble"`, never `bubble`
|
|
242
|
+
- `matrix_bubble.sizeValue` uses `sizeMetric.unit`; new output does not emit `sizeMetric.valueUnit`
|
|
243
|
+
- v1.2 `pie.slices[].colorHint` remains supported; new chart types intentionally avoid visual styling fields
|
|
244
|
+
|
|
216
245
|
### Registry-backed block instances / 正文引用实例
|
|
217
246
|
|
|
218
247
|
- `image_block(image_ref=..., id=None, anchor=None)`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Protocol Alignment / 协议对齐说明
|
|
2
2
|
|
|
3
|
-
This page explains how OVAPortableText 0.
|
|
4
|
-
本文档说明 OVAPortableText 0.
|
|
3
|
+
This page explains how OVAPortableText 0.4.0 aligns with the current Report Profile v1.3 protocol maintained in this repository.
|
|
4
|
+
本文档说明 OVAPortableText 0.4.0 与当前仓库内维护的 Report Profile v1.3 正式协议之间的对齐关系。
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -20,8 +20,8 @@ The package aligns to this top-level shape:
|
|
|
20
20
|
- `glossary`
|
|
21
21
|
- `sections`
|
|
22
22
|
|
|
23
|
-
`schemaVersion` defaults to `report.v1.
|
|
24
|
-
`schemaVersion` 默认值为 `report.v1.
|
|
23
|
+
`schemaVersion` defaults to `report.v1.3`.
|
|
24
|
+
`schemaVersion` 默认值为 `report.v1.3`。
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
@@ -50,8 +50,8 @@ What happens here / 这里发生了什么:
|
|
|
50
50
|
|
|
51
51
|
## 3. Add registry-backed content / 添加引用型内容
|
|
52
52
|
|
|
53
|
-
The protocol separates top-level registries from body instances. In `report.v1.
|
|
54
|
-
协议把“顶层 registry”与“正文实例”分开处理。在 `report.v1.
|
|
53
|
+
The protocol separates top-level registries from body instances. In `report.v1.3`, image / chart / table / math instances may omit instance `id` where the protocol allows it, text blocks can carry `layout`, sections can carry `sectionRole / navigation / pagination / presentation`, and grid cells can now contain charts.
|
|
54
|
+
协议把“顶层 registry”与“正文实例”分开处理。在 `report.v1.3` 中,协议允许的图片 / 图表 / 表格 / 公式实例都可以省略实例 `id`,文本块可携带 `layout`,section 可携带 `sectionRole / navigation / pagination / presentation`,grid 单元格现在还可以放图表。
|
|
55
55
|
|
|
56
56
|
### Example / 示例
|
|
57
57
|
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from ova_portable_text import (
|
|
4
|
+
bar_chart_dataset,
|
|
5
|
+
bar_data_point,
|
|
6
|
+
bar_series,
|
|
7
|
+
chart_axis,
|
|
8
|
+
chart_category,
|
|
9
|
+
create_document,
|
|
10
|
+
line_chart_dataset,
|
|
11
|
+
line_point,
|
|
12
|
+
line_series,
|
|
13
|
+
matrix_bubble_category,
|
|
14
|
+
matrix_bubble_chart_dataset,
|
|
15
|
+
matrix_bubble_point,
|
|
16
|
+
matrix_bubble_series,
|
|
17
|
+
section,
|
|
18
|
+
size_metric,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def build_report():
|
|
23
|
+
report = create_document(title="OVA Portable Text v1.3 Charts Demo", language="en")
|
|
24
|
+
|
|
25
|
+
bar = bar_chart_dataset(
|
|
26
|
+
id="chart-patent-counts-by-year",
|
|
27
|
+
value_unit="count",
|
|
28
|
+
categories=[
|
|
29
|
+
chart_category(key="2024", en="2024", zh="2024"),
|
|
30
|
+
chart_category(key="2025", en="2025", zh="2025"),
|
|
31
|
+
],
|
|
32
|
+
series=[
|
|
33
|
+
bar_series(
|
|
34
|
+
key="applications",
|
|
35
|
+
en="Patent Applications",
|
|
36
|
+
zh="申请专利数量",
|
|
37
|
+
data=[
|
|
38
|
+
bar_data_point(category_key="2024", value=7),
|
|
39
|
+
bar_data_point(category_key="2025", value=9),
|
|
40
|
+
],
|
|
41
|
+
)
|
|
42
|
+
],
|
|
43
|
+
x_axis=chart_axis(en="Application Year", zh="申请年", value_type="year"),
|
|
44
|
+
y_axis=chart_axis(en="Patent Count", zh="专利数量", value_type="number", unit="count"),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
line = line_chart_dataset(
|
|
48
|
+
id="chart-lifecycle-line",
|
|
49
|
+
value_unit="count",
|
|
50
|
+
x_axis=chart_axis(en="Patent Count", zh="专利数量", value_type="number", unit="count"),
|
|
51
|
+
y_axis=chart_axis(en="Applicant Count", zh="申请人数量", value_type="number", unit="count"),
|
|
52
|
+
series=[
|
|
53
|
+
line_series(
|
|
54
|
+
key="lifecycle",
|
|
55
|
+
en="Lifecycle",
|
|
56
|
+
zh="生命周期",
|
|
57
|
+
points=[
|
|
58
|
+
line_point(key="2016", x_value=300, y_value=180, en="2016", zh="2016"),
|
|
59
|
+
line_point(key="2017", x_value=700, y_value=400, en="2017", zh="2017"),
|
|
60
|
+
],
|
|
61
|
+
)
|
|
62
|
+
],
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
matrix = matrix_bubble_chart_dataset(
|
|
66
|
+
id="chart-category-matrix-bubble",
|
|
67
|
+
x_axis=chart_axis(en="Technology Category", zh="技术分类", value_type="category"),
|
|
68
|
+
y_axis=chart_axis(en="Market Region", zh="市场区域", value_type="category"),
|
|
69
|
+
x_categories=[matrix_bubble_category(key="ai", en="AI", zh="人工智能")],
|
|
70
|
+
y_categories=[matrix_bubble_category(key="china", en="China", zh="中国")],
|
|
71
|
+
size_metric=size_metric(en="Patent Count", zh="专利数量", unit="count"),
|
|
72
|
+
series=[
|
|
73
|
+
matrix_bubble_series(
|
|
74
|
+
key="patent-count",
|
|
75
|
+
en="Patent Count",
|
|
76
|
+
zh="专利数量",
|
|
77
|
+
points=[
|
|
78
|
+
matrix_bubble_point(
|
|
79
|
+
key="ai-china",
|
|
80
|
+
x_category_key="ai",
|
|
81
|
+
y_category_key="china",
|
|
82
|
+
size_value=45,
|
|
83
|
+
)
|
|
84
|
+
],
|
|
85
|
+
)
|
|
86
|
+
],
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
report.add_chart_dataset(bar).add_chart_dataset(line).add_chart_dataset(matrix)
|
|
90
|
+
|
|
91
|
+
charts = section(id="sec-v13-charts", level=1, title="v1.3 Charts")
|
|
92
|
+
charts.append_chart(chart_ref="chart-patent-counts-by-year")
|
|
93
|
+
charts.append_chart(chart_ref="chart-lifecycle-line")
|
|
94
|
+
charts.append_chart(chart_ref="chart-category-matrix-bubble")
|
|
95
|
+
report.append_section(charts)
|
|
96
|
+
return report
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
if __name__ == "__main__":
|
|
100
|
+
print(build_report().to_json())
|
|
@@ -24,6 +24,9 @@ from .exceptions import DocumentValidationError, ValidationIssue, ValidationRepo
|
|
|
24
24
|
from .helpers import (
|
|
25
25
|
block_layout,
|
|
26
26
|
annotation_def,
|
|
27
|
+
bar_chart_dataset,
|
|
28
|
+
bar_data_point,
|
|
29
|
+
bar_series,
|
|
27
30
|
attachment_asset,
|
|
28
31
|
background_asset,
|
|
29
32
|
background_asset_embedded,
|
|
@@ -36,6 +39,8 @@ from .helpers import (
|
|
|
36
39
|
length_pt,
|
|
37
40
|
callout,
|
|
38
41
|
chart_block,
|
|
42
|
+
chart_axis,
|
|
43
|
+
chart_category,
|
|
39
44
|
doughnut_chart_dataset,
|
|
40
45
|
citation_ref,
|
|
41
46
|
code_span,
|
|
@@ -48,6 +53,7 @@ from .helpers import (
|
|
|
48
53
|
grid_table_dataset,
|
|
49
54
|
grid_table_row,
|
|
50
55
|
glossary_entry,
|
|
56
|
+
horizontal_bar_chart_dataset,
|
|
51
57
|
glossary_term,
|
|
52
58
|
hard_break,
|
|
53
59
|
icon_asset,
|
|
@@ -65,10 +71,17 @@ from .helpers import (
|
|
|
65
71
|
logo_asset_embedded,
|
|
66
72
|
logo_asset_from_file,
|
|
67
73
|
logo_asset_url,
|
|
74
|
+
line_chart_dataset,
|
|
75
|
+
line_point,
|
|
76
|
+
line_series,
|
|
68
77
|
marked,
|
|
69
78
|
math_block,
|
|
70
79
|
metric_dataset,
|
|
71
80
|
metric_value,
|
|
81
|
+
matrix_bubble_category,
|
|
82
|
+
matrix_bubble_chart_dataset,
|
|
83
|
+
matrix_bubble_point,
|
|
84
|
+
matrix_bubble_series,
|
|
72
85
|
number_item,
|
|
73
86
|
paragraph,
|
|
74
87
|
pie_chart_dataset,
|
|
@@ -77,6 +90,7 @@ from .helpers import (
|
|
|
77
90
|
pie_slice,
|
|
78
91
|
record_table_dataset,
|
|
79
92
|
section,
|
|
93
|
+
size_metric,
|
|
80
94
|
span,
|
|
81
95
|
strong,
|
|
82
96
|
table_block,
|
|
@@ -94,7 +108,12 @@ from .registry import (
|
|
|
94
108
|
AssetsRegistry,
|
|
95
109
|
AttachmentAsset,
|
|
96
110
|
BackgroundAsset,
|
|
111
|
+
BarChartDataset,
|
|
112
|
+
BarDataPoint,
|
|
113
|
+
BarSeries,
|
|
97
114
|
BibliographyEntry,
|
|
115
|
+
ChartAxis,
|
|
116
|
+
ChartCategory,
|
|
98
117
|
ChartDataset,
|
|
99
118
|
DatasetsRegistry,
|
|
100
119
|
FootnoteEntry,
|
|
@@ -110,13 +129,21 @@ from .registry import (
|
|
|
110
129
|
ImageSource,
|
|
111
130
|
ImageSourceEmbedded,
|
|
112
131
|
ImageSourceUrl,
|
|
132
|
+
LineChartDataset,
|
|
133
|
+
LinePoint,
|
|
134
|
+
LineSeries,
|
|
113
135
|
LogoAsset,
|
|
136
|
+
MatrixBubbleCategory,
|
|
137
|
+
MatrixBubbleChartDataset,
|
|
138
|
+
MatrixBubblePoint,
|
|
139
|
+
MatrixBubbleSeries,
|
|
114
140
|
MetricDataset,
|
|
115
141
|
MetricValue,
|
|
116
142
|
PieChartDataset,
|
|
117
143
|
PieSlice,
|
|
118
144
|
RecordTableDataset,
|
|
119
145
|
RegistryEntryBase,
|
|
146
|
+
SizeMetric,
|
|
120
147
|
TableColumn,
|
|
121
148
|
TableColumnSpec,
|
|
122
149
|
TableColumnWidth,
|
|
@@ -112,7 +112,7 @@ class Document(OvaBaseModel):
|
|
|
112
112
|
顶层 registry 即使为空也应存在
|
|
113
113
|
"""
|
|
114
114
|
|
|
115
|
-
schemaVersion: str = "report.v1.
|
|
115
|
+
schemaVersion: str = "report.v1.3"
|
|
116
116
|
strict_ids: bool = Field(default=False, exclude=True, repr=False)
|
|
117
117
|
meta: DocumentMeta = Field(default_factory=DocumentMeta)
|
|
118
118
|
theme: ThemeConfig = Field(default_factory=ThemeConfig)
|