frameplot 0.2.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.
Files changed (31) hide show
  1. {frameplot-0.2.0/src/frameplot.egg-info → frameplot-0.4.0}/PKG-INFO +22 -9
  2. {frameplot-0.2.0 → frameplot-0.4.0}/README.md +21 -8
  3. {frameplot-0.2.0 → frameplot-0.4.0}/pyproject.toml +1 -1
  4. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot/api.py +5 -4
  5. frameplot-0.4.0/src/frameplot/layout/__init__.py +523 -0
  6. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot/layout/place.py +26 -18
  7. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot/layout/route.py +543 -24
  8. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot/layout/text.py +18 -12
  9. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot/model.py +3 -2
  10. frameplot-0.4.0/src/frameplot/render/png.py +26 -0
  11. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot/render/svg.py +227 -48
  12. frameplot-0.4.0/src/frameplot/theme.py +409 -0
  13. {frameplot-0.2.0 → frameplot-0.4.0/src/frameplot.egg-info}/PKG-INFO +22 -9
  14. frameplot-0.4.0/tests/test_rendering.py +965 -0
  15. frameplot-0.2.0/src/frameplot/layout/__init__.py +0 -268
  16. frameplot-0.2.0/src/frameplot/render/png.py +0 -20
  17. frameplot-0.2.0/src/frameplot/theme.py +0 -157
  18. frameplot-0.2.0/tests/test_rendering.py +0 -504
  19. {frameplot-0.2.0 → frameplot-0.4.0}/LICENSE +0 -0
  20. {frameplot-0.2.0 → frameplot-0.4.0}/setup.cfg +0 -0
  21. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot/__init__.py +0 -0
  22. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot/layout/order.py +0 -0
  23. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot/layout/rank.py +0 -0
  24. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot/layout/scc.py +0 -0
  25. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot/layout/types.py +0 -0
  26. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot/layout/validate.py +0 -0
  27. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot/render/__init__.py +0 -0
  28. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot.egg-info/SOURCES.txt +0 -0
  29. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot.egg-info/dependency_links.txt +0 -0
  30. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot.egg-info/requires.txt +0 -0
  31. {frameplot-0.2.0 → frameplot-0.4.0}/src/frameplot.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: frameplot
3
- Version: 0.2.0
3
+ Version: 0.4.0
4
4
  Summary: Turn Python-defined pipeline graphs into presentation-ready SVG and PNG diagrams.
5
5
  Author: Small Turtle 2
6
6
  License-Expression: MIT
@@ -38,9 +38,21 @@ Turn Python-defined pipeline graphs into presentation-ready SVG and PNG diagrams
38
38
 
39
39
  [한국어 README](https://github.com/smturtle2/frameplot/blob/main/README.ko.md)
40
40
 
41
- ![frameplot hero image](docs/assets/frameplot-hero-new.png)
41
+ ![frameplot hero image](docs/assets/frameplot-hero-retro.png)
42
42
 
43
- `frameplot` is a compact Python library for rendering left-to-right pipeline diagrams with clean defaults. Define nodes, edges, groups, and optional detail panels in plain Python, then export polished SVG for documentation or PNG for slides and papers.
43
+ `frameplot` is a compact Python library for rendering left-to-right pipeline diagrams with clean defaults. Define nodes, edges, groups, and optional detail panels in plain Python, then export polished SVG for documentation or high-resolution PNG for slides and papers.
44
+
45
+ ## Theme Gallery
46
+
47
+ All built-in presets stay on a white canvas. The same hero pipeline is rendered below once per theme so you can compare them directly.
48
+
49
+ | Retro | Pastel | Dark |
50
+ | --- | --- | --- |
51
+ | ![Retro theme hero](docs/assets/frameplot-hero-retro.png) | ![Pastel theme hero](docs/assets/frameplot-hero-pastel.png) | ![Dark theme hero](docs/assets/frameplot-hero-dark.png) |
52
+
53
+ | Cyberpunk | Monochrome |
54
+ | --- | --- |
55
+ | ![Cyberpunk theme hero](docs/assets/frameplot-hero-cyberpunk.png) | ![Monochrome theme hero](docs/assets/frameplot-hero-monochrome.png) |
44
56
 
45
57
  ## Why frameplot?
46
58
 
@@ -48,6 +60,7 @@ Turn Python-defined pipeline graphs into presentation-ready SVG and PNG diagrams
48
60
  - **Diagram as Code**: Define your pipeline in Python, get deterministic SVG/PNG outputs.
49
61
  - **Detail Panels**: Unique feature to expand a summary node into a lower inset mini-graph for deep dives.
50
62
  - **Deep Customization**: Fine-tune typography, spacing, colors, and corner radii via `Theme`.
63
+ - **White-Canvas Themes**: Built-in presets stay presentation-friendly on white backgrounds.
51
64
  - **Presentation Ready**: High-quality SVG for web/docs and PNG for slides or papers.
52
65
 
53
66
  ## Install
@@ -103,22 +116,22 @@ Top-level imports are the supported public API:
103
116
 
104
117
  - `to_svg() -> str`
105
118
  - `save_svg(path) -> None`
106
- - `to_png_bytes() -> bytes`
107
- - `save_png(path) -> None`
119
+ - `to_png_bytes(scale=4.0) -> bytes`
120
+ - `save_png(path, scale=4.0) -> None`
108
121
 
109
122
  ## Advanced Example: Multi-cloud Data Pipeline
110
123
 
111
- The hero image at the top is a practical example of a **Multi-cloud Data Pipeline** architecture, generated from [`examples/hero_new.py`](https://github.com/smturtle2/frameplot/blob/main/examples/hero_new.py). It showcases:
124
+ The hero image at the top and the theme gallery above are generated from [`examples/theme_heroes.py`](https://github.com/smturtle2/frameplot/blob/main/examples/theme_heroes.py), using the shared pipeline definition in [`examples/hero_pipeline.py`](https://github.com/smturtle2/frameplot/blob/main/examples/hero_pipeline.py). Together they showcase:
112
125
 
113
126
  - **Complex Routing**: Seamlessly connecting AWS (S3/Lambda) to GCP (Pub/Sub/Dataflow) services.
114
127
  - **Contextual Details**: Using a `DetailPanel` to explain the internal Spark Job Pipeline of the "Dataflow" node.
115
- - **Dark Mode Styling**: Applying a sophisticated **Slate/Zinc** dark theme for a modern look.
128
+ - **Retro Editorial Styling**: Applying the built-in `Theme.retro()` preset on a white canvas.
116
129
 
117
130
  ## Design Notes
118
131
 
119
132
  - Layout is intentionally left-to-right in v0.x.
120
133
  - Edge labels are not supported yet.
121
- - Groups are visual overlays and do not constrain layout.
134
+ - Groups stay visual overlays, and routes leaving or re-entering grouped nodes bend outside grouped areas.
122
135
  - Detail panels render as separate lower insets attached to a focus node in the main flow.
123
136
 
124
137
  ## Development
@@ -130,4 +143,4 @@ python -m pip install -e '.[dev]'
130
143
  python -m pytest -q
131
144
  ```
132
145
 
133
- Release publishing is automated through GitHub Actions and PyPI Trusted Publishing. Bump the version in `pyproject.toml`, create a tag like `v0.1.0`, and push the tag to trigger a release from `.github/workflows/workflow.yml`.
146
+ Release publishing is automated through GitHub Actions and PyPI Trusted Publishing. Bump the version in `pyproject.toml`, create a tag like `v0.4.0`, and push the tag to trigger a release from `.github/workflows/workflow.yml`.
@@ -9,9 +9,21 @@ Turn Python-defined pipeline graphs into presentation-ready SVG and PNG diagrams
9
9
 
10
10
  [한국어 README](https://github.com/smturtle2/frameplot/blob/main/README.ko.md)
11
11
 
12
- ![frameplot hero image](docs/assets/frameplot-hero-new.png)
12
+ ![frameplot hero image](docs/assets/frameplot-hero-retro.png)
13
13
 
14
- `frameplot` is a compact Python library for rendering left-to-right pipeline diagrams with clean defaults. Define nodes, edges, groups, and optional detail panels in plain Python, then export polished SVG for documentation or PNG for slides and papers.
14
+ `frameplot` is a compact Python library for rendering left-to-right pipeline diagrams with clean defaults. Define nodes, edges, groups, and optional detail panels in plain Python, then export polished SVG for documentation or high-resolution PNG for slides and papers.
15
+
16
+ ## Theme Gallery
17
+
18
+ All built-in presets stay on a white canvas. The same hero pipeline is rendered below once per theme so you can compare them directly.
19
+
20
+ | Retro | Pastel | Dark |
21
+ | --- | --- | --- |
22
+ | ![Retro theme hero](docs/assets/frameplot-hero-retro.png) | ![Pastel theme hero](docs/assets/frameplot-hero-pastel.png) | ![Dark theme hero](docs/assets/frameplot-hero-dark.png) |
23
+
24
+ | Cyberpunk | Monochrome |
25
+ | --- | --- |
26
+ | ![Cyberpunk theme hero](docs/assets/frameplot-hero-cyberpunk.png) | ![Monochrome theme hero](docs/assets/frameplot-hero-monochrome.png) |
15
27
 
16
28
  ## Why frameplot?
17
29
 
@@ -19,6 +31,7 @@ Turn Python-defined pipeline graphs into presentation-ready SVG and PNG diagrams
19
31
  - **Diagram as Code**: Define your pipeline in Python, get deterministic SVG/PNG outputs.
20
32
  - **Detail Panels**: Unique feature to expand a summary node into a lower inset mini-graph for deep dives.
21
33
  - **Deep Customization**: Fine-tune typography, spacing, colors, and corner radii via `Theme`.
34
+ - **White-Canvas Themes**: Built-in presets stay presentation-friendly on white backgrounds.
22
35
  - **Presentation Ready**: High-quality SVG for web/docs and PNG for slides or papers.
23
36
 
24
37
  ## Install
@@ -74,22 +87,22 @@ Top-level imports are the supported public API:
74
87
 
75
88
  - `to_svg() -> str`
76
89
  - `save_svg(path) -> None`
77
- - `to_png_bytes() -> bytes`
78
- - `save_png(path) -> None`
90
+ - `to_png_bytes(scale=4.0) -> bytes`
91
+ - `save_png(path, scale=4.0) -> None`
79
92
 
80
93
  ## Advanced Example: Multi-cloud Data Pipeline
81
94
 
82
- The hero image at the top is a practical example of a **Multi-cloud Data Pipeline** architecture, generated from [`examples/hero_new.py`](https://github.com/smturtle2/frameplot/blob/main/examples/hero_new.py). It showcases:
95
+ The hero image at the top and the theme gallery above are generated from [`examples/theme_heroes.py`](https://github.com/smturtle2/frameplot/blob/main/examples/theme_heroes.py), using the shared pipeline definition in [`examples/hero_pipeline.py`](https://github.com/smturtle2/frameplot/blob/main/examples/hero_pipeline.py). Together they showcase:
83
96
 
84
97
  - **Complex Routing**: Seamlessly connecting AWS (S3/Lambda) to GCP (Pub/Sub/Dataflow) services.
85
98
  - **Contextual Details**: Using a `DetailPanel` to explain the internal Spark Job Pipeline of the "Dataflow" node.
86
- - **Dark Mode Styling**: Applying a sophisticated **Slate/Zinc** dark theme for a modern look.
99
+ - **Retro Editorial Styling**: Applying the built-in `Theme.retro()` preset on a white canvas.
87
100
 
88
101
  ## Design Notes
89
102
 
90
103
  - Layout is intentionally left-to-right in v0.x.
91
104
  - Edge labels are not supported yet.
92
- - Groups are visual overlays and do not constrain layout.
105
+ - Groups stay visual overlays, and routes leaving or re-entering grouped nodes bend outside grouped areas.
93
106
  - Detail panels render as separate lower insets attached to a focus node in the main flow.
94
107
 
95
108
  ## Development
@@ -101,4 +114,4 @@ python -m pip install -e '.[dev]'
101
114
  python -m pytest -q
102
115
  ```
103
116
 
104
- Release publishing is automated through GitHub Actions and PyPI Trusted Publishing. Bump the version in `pyproject.toml`, create a tag like `v0.1.0`, and push the tag to trigger a release from `.github/workflows/workflow.yml`.
117
+ Release publishing is automated through GitHub Actions and PyPI Trusted Publishing. Bump the version in `pyproject.toml`, create a tag like `v0.4.0`, and push the tag to trigger a release from `.github/workflows/workflow.yml`.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "frameplot"
7
- version = "0.2.0"
7
+ version = "0.4.0"
8
8
  description = "Turn Python-defined pipeline graphs into presentation-ready SVG and PNG diagrams."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -8,6 +8,7 @@ from pathlib import Path
8
8
  from frameplot.layout import build_layout
9
9
  from frameplot.model import DetailPanel, Edge, Group, Node
10
10
  from frameplot.render import render_svg, save_png, svg_to_png_bytes
11
+ from frameplot.render.png import DEFAULT_PNG_SCALE
11
12
  from frameplot.theme import Theme
12
13
 
13
14
  __all__ = ["Pipeline"]
@@ -46,16 +47,16 @@ class Pipeline:
46
47
 
47
48
  Path(path).write_text(self.to_svg(), encoding="utf-8")
48
49
 
49
- def to_png_bytes(self) -> bytes:
50
+ def to_png_bytes(self, *, scale: float = DEFAULT_PNG_SCALE) -> bytes:
50
51
  """Render the pipeline to PNG bytes with CairoSVG.
51
52
 
52
53
  Raises:
53
54
  RuntimeError: If CairoSVG is not installed in the active environment.
54
55
  """
55
56
 
56
- return svg_to_png_bytes(self.to_svg())
57
+ return svg_to_png_bytes(self.to_svg(), scale=scale)
57
58
 
58
- def save_png(self, path: str | Path) -> None:
59
+ def save_png(self, path: str | Path, *, scale: float = DEFAULT_PNG_SCALE) -> None:
59
60
  """Render the pipeline to PNG and write it to `path`."""
60
61
 
61
- save_png(self.to_svg(), path)
62
+ save_png(self.to_svg(), path, scale=scale)