plotly-print 0.1.0__tar.gz → 0.2.2__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 (84) hide show
  1. {plotly_print-0.1.0 → plotly_print-0.2.2}/.cursor/rules/artifacts.mdc +1 -2
  2. {plotly_print-0.1.0 → plotly_print-0.2.2}/.cursor/rules/global.mdc +15 -7
  3. plotly_print-0.2.2/.cursor/rules/javascript.mdc +33 -0
  4. {plotly_print-0.1.0 → plotly_print-0.2.2}/AGENTS.md +2 -1
  5. {plotly_print-0.1.0 → plotly_print-0.2.2}/CONTRIBUTING.md +4 -4
  6. plotly_print-0.2.2/PKG-INFO +261 -0
  7. plotly_print-0.2.2/README.md +235 -0
  8. {plotly_print-0.1.0 → plotly_print-0.2.2}/THIRD_PARTY_NOTICES.md +5 -5
  9. plotly_print-0.2.2/assets/benchmarks/benchmark_summary.json +302 -0
  10. plotly_print-0.2.2/assets/benchmarks/compare_annotations_arrowheads.png +0 -0
  11. plotly_print-0.2.2/assets/benchmarks/compare_annotations_long_arrows.png +0 -0
  12. plotly_print-0.2.2/assets/benchmarks/compare_bar.png +0 -0
  13. plotly_print-0.2.2/assets/benchmarks/compare_barpolar.png +0 -0
  14. plotly_print-0.2.2/assets/benchmarks/compare_box.png +0 -0
  15. plotly_print-0.2.2/assets/benchmarks/compare_candlestick.png +0 -0
  16. plotly_print-0.2.2/assets/benchmarks/compare_carpet.png +0 -0
  17. plotly_print-0.2.2/assets/benchmarks/compare_contour.png +0 -0
  18. plotly_print-0.2.2/assets/benchmarks/compare_funnel.png +0 -0
  19. plotly_print-0.2.2/assets/benchmarks/compare_funnelarea.png +0 -0
  20. plotly_print-0.2.2/assets/benchmarks/compare_heatmap.png +0 -0
  21. plotly_print-0.2.2/assets/benchmarks/compare_histogram.png +0 -0
  22. plotly_print-0.2.2/assets/benchmarks/compare_histogram2d.png +0 -0
  23. plotly_print-0.2.2/assets/benchmarks/compare_icicle.png +0 -0
  24. plotly_print-0.2.2/assets/benchmarks/compare_indicator.png +0 -0
  25. plotly_print-0.2.2/assets/benchmarks/compare_ohlc.png +0 -0
  26. plotly_print-0.2.2/assets/benchmarks/compare_parcats.png +0 -0
  27. plotly_print-0.2.2/assets/benchmarks/compare_pie.png +0 -0
  28. plotly_print-0.2.2/assets/benchmarks/compare_rotated_ticks_45.png +0 -0
  29. plotly_print-0.2.2/assets/benchmarks/compare_rotated_ticks_90.png +0 -0
  30. plotly_print-0.2.2/assets/benchmarks/compare_sankey.png +0 -0
  31. plotly_print-0.2.2/assets/benchmarks/compare_scatter_line.png +0 -0
  32. plotly_print-0.2.2/assets/benchmarks/compare_scatterpolar.png +0 -0
  33. plotly_print-0.2.2/assets/benchmarks/compare_scatterternary.png +0 -0
  34. plotly_print-0.2.2/assets/benchmarks/compare_sunburst.png +0 -0
  35. plotly_print-0.2.2/assets/benchmarks/compare_table.png +0 -0
  36. plotly_print-0.2.2/assets/benchmarks/compare_table_markup.png +0 -0
  37. plotly_print-0.2.2/assets/benchmarks/compare_treemap.png +0 -0
  38. plotly_print-0.2.2/assets/benchmarks/compare_violin.png +0 -0
  39. plotly_print-0.2.2/assets/benchmarks/compare_waterfall.png +0 -0
  40. {plotly_print-0.1.0 → plotly_print-0.2.2}/benchmark/cases.py +63 -4
  41. plotly_print-0.2.2/benchmark/collage.py +71 -0
  42. plotly_print-0.2.2/benchmark/report.py +95 -0
  43. {plotly_print-0.1.0 → plotly_print-0.2.2}/benchmark/runner.py +16 -30
  44. {plotly_print-0.1.0 → plotly_print-0.2.2}/pyproject.toml +1 -2
  45. {plotly_print-0.1.0 → plotly_print-0.2.2}/src/plotly_print/engine.py +2 -2
  46. {plotly_print-0.1.0 → plotly_print-0.2.2}/src/plotly_print/js/micro_dom.js +608 -108
  47. plotly_print-0.2.2/src/plotly_print/js/plotly_comprehensive_2d.js +121 -0
  48. {plotly_print-0.1.0 → plotly_print-0.2.2}/tests/test_kaleido_visual.py +4 -4
  49. plotly_print-0.2.2/tests/test_svg_path_geometry.py +263 -0
  50. {plotly_print-0.1.0 → plotly_print-0.2.2}/tests/test_svg_transforms.py +46 -2
  51. {plotly_print-0.1.0 → plotly_print-0.2.2}/uv.lock +1 -1
  52. plotly_print-0.1.0/PKG-INFO +0 -66
  53. plotly_print-0.1.0/README.md +0 -40
  54. plotly_print-0.1.0/benchmark/collage.py +0 -89
  55. plotly_print-0.1.0/benchmark/report.py +0 -39
  56. plotly_print-0.1.0/src/plotly_print/js/plotly-cartesian.min.js +0 -149
  57. {plotly_print-0.1.0 → plotly_print-0.2.2}/.cursor/rules/markdown.mdc +0 -0
  58. {plotly_print-0.1.0 → plotly_print-0.2.2}/.github/workflows/check-tag.yml +0 -0
  59. {plotly_print-0.1.0 → plotly_print-0.2.2}/.github/workflows/publish.yml +0 -0
  60. {plotly_print-0.1.0 → plotly_print-0.2.2}/.github/workflows/quality-checks.yml +0 -0
  61. {plotly_print-0.1.0 → plotly_print-0.2.2}/.github/workflows/version-check.yml +0 -0
  62. {plotly_print-0.1.0 → plotly_print-0.2.2}/.gitignore +0 -0
  63. {plotly_print-0.1.0 → plotly_print-0.2.2}/.mdformat.toml +0 -0
  64. {plotly_print-0.1.0 → plotly_print-0.2.2}/.pre-commit-config.yaml +0 -0
  65. {plotly_print-0.1.0 → plotly_print-0.2.2}/LICENSE +0 -0
  66. {plotly_print-0.1.0 → plotly_print-0.2.2}/benchmark/__init__.py +0 -0
  67. {plotly_print-0.1.0 → plotly_print-0.2.2}/benchmark/__main__.py +0 -0
  68. {plotly_print-0.1.0 → plotly_print-0.2.2}/benchmark/compare.py +0 -0
  69. {plotly_print-0.1.0 → plotly_print-0.2.2}/src/plotly_print/__init__.py +0 -0
  70. {plotly_print-0.1.0 → plotly_print-0.2.2}/src/plotly_print/core.py +0 -0
  71. {plotly_print-0.1.0 → plotly_print-0.2.2}/src/plotly_print/fonts.py +0 -0
  72. {plotly_print-0.1.0 → plotly_print-0.2.2}/src/plotly_print/plotly_hook.py +0 -0
  73. {plotly_print-0.1.0 → plotly_print-0.2.2}/src/plotly_print/raster.py +0 -0
  74. {plotly_print-0.1.0 → plotly_print-0.2.2}/tests/test_background.py +0 -0
  75. {plotly_print-0.1.0 → plotly_print-0.2.2}/tests/test_bar.py +0 -0
  76. {plotly_print-0.1.0 → plotly_print-0.2.2}/tests/test_cartesian_types.py +0 -0
  77. {plotly_print-0.1.0 → plotly_print-0.2.2}/tests/test_comprehensive_2d.py +0 -0
  78. {plotly_print-0.1.0 → plotly_print-0.2.2}/tests/test_heatmap.py +0 -0
  79. {plotly_print-0.1.0 → plotly_print-0.2.2}/tests/test_json_types.py +0 -0
  80. {plotly_print-0.1.0 → plotly_print-0.2.2}/tests/test_legend.py +0 -0
  81. {plotly_print-0.1.0 → plotly_print-0.2.2}/tests/test_pie.py +0 -0
  82. {plotly_print-0.1.0 → plotly_print-0.2.2}/tests/test_plotly_hook.py +0 -0
  83. {plotly_print-0.1.0 → plotly_print-0.2.2}/tests/test_raster.py +0 -0
  84. {plotly_print-0.1.0 → plotly_print-0.2.2}/tests/test_scatter.py +0 -0
@@ -7,9 +7,8 @@ alwaysApply: true
7
7
 
8
8
  The repo root `.artifacts/` directory is **gitignored**. Use it for:
9
9
 
10
- - Benchmark output (`poe benchmark` writes to `.artifacts/benchmark/`)
11
10
  - LLM research notes, comparison reports, scratch exports, and other **temporary local artifacts**
12
11
 
13
12
  Do not commit files under `.artifacts/`. Nothing there is shipped on PyPI or in the wheel.
14
13
 
15
- When generating reports or large binary outputs for the user to review, prefer paths under `.artifacts/` unless they ask for another location.
14
+ When generating research or large binary outputs for the user to review (outside the benchmark), prefer paths under `.artifacts/` unless they ask for another location.
@@ -1,11 +1,13 @@
1
1
  ---
2
- description: Coding standards for every project generated from cookiecutter-python-seed
2
+ description: Coding standards for plotly-print (Python package + QuickJS micro-DOM)
3
3
  alwaysApply: true
4
4
  ---
5
5
 
6
- # Generated project standards
6
+ # Project standards
7
7
 
8
- This is a Python project generated from cookiecutter-python-seed. Treat `pyproject.toml` as the source of truth for toolchain, Python version, and dependencies. Minimum Python version is 3.12. Use uv to lock, sync, build, and bump versions.
8
+ plotly-print is a Python package (cookiecutter-python-seed layout) plus first-party QuickJS JavaScript under `src/plotly_print/js/` (micro-DOM for static Plotly rendering). Treat `pyproject.toml` as the source of truth for toolchain, Python version, and dependencies. Minimum Python version is 3.12. Use uv to lock, sync, build, and bump versions.
9
+
10
+ JS-specific conventions: `.cursor/rules/javascript.mdc` (applies under `src/plotly_print/js/`).
9
11
 
10
12
  You are a lazy senior developer. Lazy means efficient, not careless. The best code is the code never written.
11
13
 
@@ -26,9 +28,10 @@ Bug fix = root cause, not symptom. Grep every caller of the function you touch a
26
28
 
27
29
  - Match existing layout: `src/` for packages, `tests/` for tests, application entry points as already configured.
28
30
  - Do not add a dependency unless it is declared in `pyproject.toml` (or the project's lockfile). Prefer stdlib over a new package.
29
- - Style is enforced by Ruff. Follow `pyproject.toml`; the points below are the ones to apply consistently even when Ruff cannot.
31
+ - Python style is enforced by Ruff. Follow `pyproject.toml`; the points below are the ones to apply consistently even when Ruff cannot.
30
32
  - After editing Python files, run `poe format`.
31
33
  - After editing Markdown files, run `poe format_docs`.
34
+ - There is no JS formatter/linter task; match `micro_dom.js` style. Do not hand-edit vendored Plotly bundles.
32
35
 
33
36
  ## Comments and docs
34
37
 
@@ -38,15 +41,20 @@ Bug fix = root cause, not symptom. Grep every caller of the function you touch a
38
41
 
39
42
  ## Language
40
43
 
41
- - Type-hint every function and method. Do not nest annotations so deeply that they hurt readability.
44
+ Shared (Python and JS):
45
+
46
+ - ASCII only in identifiers, comments, and docs. No emojis. Non-ASCII letters are allowed only when the content is actually in another language (e.g. Polish, Russian).
42
47
  - No unnecessary imports.
48
+
49
+ Python:
50
+
51
+ - Type-hint every function and method. Do not nest annotations so deeply that they hurt readability.
43
52
  - Use f-strings for all string formatting.
44
53
  - Avoid unnecessary `Path` wrappers; join with `/` on `Path` objects.
45
- - ASCII only in identifiers, comments, and docs. No emojis. Non-ASCII letters are allowed only when the content is actually in another language (e.g. Polish, Russian).
46
54
 
47
55
  ## Quality
48
56
 
49
- - Use `poe format` / `poe format_docs` instead of hand-formatting style.
57
+ - Use `poe format` / `poe format_docs` instead of hand-formatting style (Python/Markdown).
50
58
  - Deletion over addition. Boring over clever. Fewest files possible. Shortest working diff wins, after you understand the problem.
51
59
  - No abstractions, boilerplate, or dependencies that weren't requested.
52
60
  - Question complex requests: "Do you actually need X, or does Y cover it?"
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: QuickJS micro-DOM and first-party JS (not the vendored Plotly bundle)
3
+ globs: "src/plotly_print/js/**/*.js"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # JavaScript (QuickJS)
8
+
9
+ First-party runtime JS lives under `src/plotly_print/js/`. It runs inside QuickJS via `plotly_print.engine`, not in Node or a browser.
10
+
11
+ ## Do not edit
12
+
13
+ - `plotly_comprehensive_2d.js` and any other vendored Plotly/plotly.js bundle. Treat as opaque third-party input.
14
+ - Only change first-party files such as `micro_dom.js`.
15
+
16
+ ## Style (match `micro_dom.js`)
17
+
18
+ - IIFE + `'use strict'`. No ES modules, `import`/`export`, or build step.
19
+ - Prefer ES5 that QuickJS already accepts here: `var`, `function`, prototypes. Use newer features only when the file already does (e.g. `Proxy` with a fallback).
20
+ - 4-space indent. ASCII only in identifiers and comments (no emojis, arrows, smart dashes).
21
+ - No TypeScript. No Prettier/ESLint in this repo; match existing formatting by eye.
22
+ - Same comment rules as the rest of the project: why not what; `ponytail:` for deliberate ceilings.
23
+
24
+ ## DOM / SVG stubs
25
+
26
+ - Implement the minimum Plotly/d3 actually call. Prefer attribute-backed getters (e.g. `transform` from `getAttribute('transform')`) over inventing full SVG DOM types.
27
+ - When adding a browser API stub, grep the Plotly bundle for the call shape (`baseVal.consolidate`, etc.) and return what that path reads.
28
+ - Keep geometry helpers (`parseTransform`, path flatten, bbox) shared; do not duplicate matrix math per method.
29
+
30
+ ## Tests
31
+
32
+ - JS has no separate test runner. Cover behavior from Python with `quickjs.Context` loading `micro_dom.js` (see `tests/test_svg_*.py`), or via `plotly_print.to_svg` / figure fixtures when the bug is Plotly-facing.
33
+ - After non-trivial micro-DOM changes, run the relevant `tests/test_svg_*.py` (or the smallest Plotly render check that would fail).
@@ -1,6 +1,6 @@
1
1
  # Agent instructions
2
2
 
3
- This project was generated from **cookiecutter-python-seed**.
3
+ This project was generated from **cookiecutter-python-seed**, with first-party QuickJS JavaScript for Plotly static rendering.
4
4
 
5
5
  ## Tooling
6
6
 
@@ -10,5 +10,6 @@ This project was generated from **cookiecutter-python-seed**.
10
10
  ## Standards
11
11
 
12
12
  - Always-on: `.cursor/rules/global.mdc`
13
+ - JavaScript (`src/plotly_print/js/`): `.cursor/rules/javascript.mdc`
13
14
  - Markdown (`.md` files): `.cursor/rules/markdown.mdc`
14
15
  - Local scratch output: `.cursor/rules/artifacts.mdc`
@@ -22,15 +22,15 @@ poe test
22
22
 
23
23
  ## Kaleido visual benchmark
24
24
 
25
- Compare plotly-print output to Kaleido side by side (not part of the PyPI wheel). Kaleido is in the `test` dependency group and is installed by `poe install` / `uv sync`.
25
+ Compare plotly-print to Kaleido (dev-only; not in the PyPI wheel). Kaleido is in the `test` dependency group and is installed by `poe install` / `uv sync`.
26
26
 
27
27
  ```shell
28
- poe benchmark_quick
28
+ poe benchmark
29
29
  ```
30
30
 
31
- Full gallery (all chart fixtures): `poe benchmark`.
31
+ Writes side-by-side PNGs (Kaleido / Chromium left, plotly-print / QuickJS right) and `benchmark_summary.json` under `assets/benchmarks/`, and refreshes the speed/visual sections in `README.md` (image links use absolute `raw.githubusercontent.com` URLs). Commit those assets with the README when timings or visuals change.
32
32
 
33
- Outputs are written to `.artifacts/benchmark/` (`report.md`, PNGs, `benchmark_summary.json`).
33
+ `poe test` includes a Kaleido mean-pixel-diff check for **every** chart fixture in `benchmark/cases.py` (skipped if Kaleido is not installed).
34
34
 
35
35
  ## Release
36
36
 
@@ -0,0 +1,261 @@
1
+ Metadata-Version: 2.5
2
+ Name: plotly-print
3
+ Version: 0.2.2
4
+ Summary: Lightweight, browser-less static image exporter for Plotly
5
+ Project-URL: Homepage, https://github.com/roman-kaczanowski/plotly-print
6
+ Project-URL: Repository, https://github.com/roman-kaczanowski/plotly-print
7
+ Project-URL: Issues, https://github.com/roman-kaczanowski/plotly-print/issues
8
+ Author-email: Roman Kaczanowski <roman.kaczanowski.pl@gmail.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ License-File: THIRD_PARTY_NOTICES.md
12
+ Keywords: export,headless,kaleido,plotly,png,svg,visualization
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering :: Visualization
20
+ Requires-Python: >=3.12
21
+ Requires-Dist: pillow>=9.0.0
22
+ Requires-Dist: plotly>=5.0.0
23
+ Requires-Dist: quickjs>=1.19.0
24
+ Requires-Dist: resvg-py>=0.4.0
25
+ Description-Content-Type: text/markdown
26
+
27
+ # plotly-print
28
+
29
+ [![CI](https://img.shields.io/github/actions/workflow/status/roman-kaczanowski/plotly-print/quality-checks.yml?branch=main&style=flat-square&label=CI)](https://github.com/roman-kaczanowski/plotly-print/actions/workflows/quality-checks.yml) [![PyPI](https://img.shields.io/pypi/v/plotly-print?style=flat-square)](https://pypi.org/project/plotly-print/) [![Python](https://img.shields.io/badge/python-3.12%2B-3776AB?style=flat-square&logo=python&logoColor=white)](https://docs.python.org/3/) [![License](https://img.shields.io/badge/license-MIT-green?style=flat-square)](LICENSE)
30
+
31
+ Export Plotly figures to SVG, PNG, JPEG, or WebP without launching Chrome.
32
+
33
+ plotly-print runs a bundled Plotly.js 2D build in QuickJS, then uses `resvg-py` for raster output. It works offline, has no browser process to install or manage, and can replace Plotly's image-export methods with one call.
34
+
35
+ - Browser-free: no Chrome, Chromium, or Playwright.
36
+ - Fast: avoids browser startup; see the measured [benchmarks](#benchmarks).
37
+ - Familiar: use the direct API or patch Plotly's existing `to_image` and `write_image` methods.
38
+
39
+ [Install](#installation) | [Direct API](#direct-api) | [Plotly integration](#plotly-integration) | [Benchmarks](#benchmarks)
40
+
41
+ ## Installation
42
+
43
+ ```bash
44
+ pip install plotly-print
45
+ ```
46
+
47
+ Requires Python 3.12 or newer.
48
+
49
+ ## Direct API
50
+
51
+ ```python
52
+ import plotly.express as px
53
+ import plotly_print
54
+
55
+ fig = px.scatter(x=[1, 2, 3, 4], y=[10, 11, 12, 13], title='Sales Growth')
56
+
57
+ svg = plotly_print.to_svg(fig)
58
+ png = plotly_print.to_image(fig, format='png', scale=2)
59
+ plotly_print.write_image(fig, 'chart.png')
60
+ ```
61
+
62
+ `to_image` returns bytes. `write_image` writes to a path or binary file object. Supported formats are SVG, PNG, JPEG, and WebP.
63
+
64
+ ## Plotly integration
65
+
66
+ Patch Plotly's existing image-export methods:
67
+
68
+ ```python
69
+ import plotly_print
70
+
71
+ plotly_print.register()
72
+ ```
73
+
74
+ After registration, existing calls such as `fig.write_image("chart.png")` use plotly-print. Call `plotly_print.unregister()` to restore Plotly's original methods.
75
+
76
+ plotly-print targets 2D static charts. The bundled Plotly.js build and its licenses are documented in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
77
+
78
+ <!-- BENCHMARK-START -->
79
+
80
+ ## Benchmarks
81
+
82
+ On this run, plotly-print exported all 30 chart types **12x to 33x faster** than Kaleido.
83
+
84
+ These are mean per-image PNG export times after both engines were warmed up. Timings are machine-specific; use the side-by-side images below to evaluate rendering differences.
85
+
86
+ See the [raw results](assets/benchmarks/benchmark_summary.json) or [run the benchmark locally](CONTRIBUTING.md#kaleido-visual-benchmark).
87
+
88
+ | Category | Chart Type | Kaleido | plotly-print | Speedup |
89
+ | :----------------------- | :---------------------------------------- | :-------: | :----------: | :-------: |
90
+ | **Core Cartesian** | Scatter & Line Chart | 1668.5 ms | **88.2 ms** | **18.9x** |
91
+ | **Core Cartesian** | Grouped Bar Chart | 1758.1 ms | **81.3 ms** | **21.6x** |
92
+ | **Core Cartesian** | Donut / Pie Chart | 1628.6 ms | **73.6 ms** | **22.1x** |
93
+ | **Core Cartesian** | Box Plot | 1748.2 ms | **77.1 ms** | **22.7x** |
94
+ | **Core Cartesian** | Violin Plot | 1623.8 ms | **84.1 ms** | **19.3x** |
95
+ | **Core Cartesian** | Frequency Histogram | 1878.0 ms | **62.7 ms** | **30.0x** |
96
+ | **Core Cartesian** | 2D Density Histogram | 1949.4 ms | **98.8 ms** | **19.7x** |
97
+ | **Core Cartesian** | 2D Contour Plot | 1604.9 ms | **118.7 ms** | **13.5x** |
98
+ | **Core Cartesian** | Performance Heatmap | 1832.4 ms | **87.3 ms** | **21.0x** |
99
+ | **Core Cartesian** | Ternary Phase Diagram | 1724.9 ms | **84.9 ms** | **20.3x** |
100
+ | **Financial & Business** | Candlestick Stock Chart | 1741.1 ms | **140.5 ms** | **12.4x** |
101
+ | **Financial & Business** | OHLC Financial Chart | 1670.0 ms | **131.3 ms** | **12.7x** |
102
+ | **Financial & Business** | Waterfall Profit & Loss | 1793.0 ms | **64.7 ms** | **27.7x** |
103
+ | **Financial & Business** | Sales Conversion Funnel | 1629.9 ms | **91.1 ms** | **17.9x** |
104
+ | **Financial & Business** | Funnel Area Analysis | 1694.0 ms | **61.7 ms** | **27.5x** |
105
+ | **Financial & Business** | KPI Performance Indicator | 1634.1 ms | **57.2 ms** | **28.6x** |
106
+ | **Hierarchical** | Market Cap Treemap | 1625.4 ms | **52.6 ms** | **30.9x** |
107
+ | **Hierarchical** | Global Sunburst Hierarchy | 1723.9 ms | **61.8 ms** | **27.9x** |
108
+ | **Hierarchical** | Icicle Partition Chart | 1594.7 ms | **50.2 ms** | **31.7x** |
109
+ | **Radial & Polar** | Radar Performance Comparison | 2481.9 ms | **96.5 ms** | **25.7x** |
110
+ | **Radial & Polar** | Polar Wind Rose | 1826.6 ms | **77.5 ms** | **23.6x** |
111
+ | **Specialized Diagrams** | Energy Flow Sankey Diagram | 1708.4 ms | **51.7 ms** | **33.1x** |
112
+ | **Specialized Diagrams** | Parallel Categories Diagram | 1620.2 ms | **57.0 ms** | **28.4x** |
113
+ | **Specialized Diagrams** | Formatted Data Table | 1766.4 ms | **69.9 ms** | **25.3x** |
114
+ | **Specialized Diagrams** | Carpet Coordinate Plot | 1792.2 ms | **86.1 ms** | **20.8x** |
115
+ | **Layout edge cases** | Bar chart with X labels at 45 deg | 1673.2 ms | **89.0 ms** | **18.8x** |
116
+ | **Layout edge cases** | Bar chart with X labels at 90 deg | 1883.9 ms | **87.7 ms** | **21.5x** |
117
+ | **Layout edge cases** | Annotation arrowheads (incl. circle) | 1661.6 ms | **82.4 ms** | **20.2x** |
118
+ | **Layout edge cases** | Long annotation arrows (dasharray length) | 1719.1 ms | **79.7 ms** | **21.6x** |
119
+ | **Layout edge cases** | Table cells with HTML markup and entities | 1692.5 ms | **74.8 ms** | **22.6x** |
120
+
121
+ ## Visual comparisons
122
+
123
+ Side-by-side PNGs (Kaleido left, plotly-print right):
124
+
125
+ ### Core Cartesian
126
+
127
+ #### Scatter & Line Chart (plotly-print: 88.2ms | Kaleido: 1668.5ms)
128
+
129
+ ![Scatter & Line Chart](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_scatter_line.png)
130
+
131
+ #### Grouped Bar Chart (plotly-print: 81.3ms | Kaleido: 1758.1ms)
132
+
133
+ ![Grouped Bar Chart](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_bar.png)
134
+
135
+ #### Donut / Pie Chart (plotly-print: 73.6ms | Kaleido: 1628.6ms)
136
+
137
+ ![Donut / Pie Chart](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_pie.png)
138
+
139
+ #### Box Plot (plotly-print: 77.1ms | Kaleido: 1748.2ms)
140
+
141
+ ![Box Plot](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_box.png)
142
+
143
+ #### Violin Plot (plotly-print: 84.1ms | Kaleido: 1623.8ms)
144
+
145
+ ![Violin Plot](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_violin.png)
146
+
147
+ #### Frequency Histogram (plotly-print: 62.7ms | Kaleido: 1878.0ms)
148
+
149
+ ![Frequency Histogram](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_histogram.png)
150
+
151
+ #### 2D Density Histogram (plotly-print: 98.8ms | Kaleido: 1949.4ms)
152
+
153
+ ![2D Density Histogram](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_histogram2d.png)
154
+
155
+ #### 2D Contour Plot (plotly-print: 118.7ms | Kaleido: 1604.9ms)
156
+
157
+ ![2D Contour Plot](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_contour.png)
158
+
159
+ #### Performance Heatmap (plotly-print: 87.3ms | Kaleido: 1832.4ms)
160
+
161
+ ![Performance Heatmap](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_heatmap.png)
162
+
163
+ #### Ternary Phase Diagram (plotly-print: 84.9ms | Kaleido: 1724.9ms)
164
+
165
+ ![Ternary Phase Diagram](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_scatterternary.png)
166
+
167
+ ### Financial & Business
168
+
169
+ #### Candlestick Stock Chart (plotly-print: 140.5ms | Kaleido: 1741.1ms)
170
+
171
+ ![Candlestick Stock Chart](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_candlestick.png)
172
+
173
+ #### OHLC Financial Chart (plotly-print: 131.3ms | Kaleido: 1670.0ms)
174
+
175
+ ![OHLC Financial Chart](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_ohlc.png)
176
+
177
+ #### Waterfall Profit & Loss (plotly-print: 64.7ms | Kaleido: 1793.0ms)
178
+
179
+ ![Waterfall Profit & Loss](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_waterfall.png)
180
+
181
+ #### Sales Conversion Funnel (plotly-print: 91.1ms | Kaleido: 1629.9ms)
182
+
183
+ ![Sales Conversion Funnel](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_funnel.png)
184
+
185
+ #### Funnel Area Analysis (plotly-print: 61.7ms | Kaleido: 1694.0ms)
186
+
187
+ ![Funnel Area Analysis](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_funnelarea.png)
188
+
189
+ #### KPI Performance Indicator (plotly-print: 57.2ms | Kaleido: 1634.1ms)
190
+
191
+ ![KPI Performance Indicator](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_indicator.png)
192
+
193
+ ### Hierarchical
194
+
195
+ #### Market Cap Treemap (plotly-print: 52.6ms | Kaleido: 1625.4ms)
196
+
197
+ ![Market Cap Treemap](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_treemap.png)
198
+
199
+ #### Global Sunburst Hierarchy (plotly-print: 61.8ms | Kaleido: 1723.9ms)
200
+
201
+ ![Global Sunburst Hierarchy](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_sunburst.png)
202
+
203
+ #### Icicle Partition Chart (plotly-print: 50.2ms | Kaleido: 1594.7ms)
204
+
205
+ ![Icicle Partition Chart](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_icicle.png)
206
+
207
+ ### Radial & Polar
208
+
209
+ #### Radar Performance Comparison (plotly-print: 96.5ms | Kaleido: 2481.9ms)
210
+
211
+ ![Radar Performance Comparison](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_scatterpolar.png)
212
+
213
+ #### Polar Wind Rose (plotly-print: 77.5ms | Kaleido: 1826.6ms)
214
+
215
+ ![Polar Wind Rose](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_barpolar.png)
216
+
217
+ ### Specialized Diagrams
218
+
219
+ #### Energy Flow Sankey Diagram (plotly-print: 51.7ms | Kaleido: 1708.4ms)
220
+
221
+ ![Energy Flow Sankey Diagram](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_sankey.png)
222
+
223
+ #### Parallel Categories Diagram (plotly-print: 57.0ms | Kaleido: 1620.2ms)
224
+
225
+ ![Parallel Categories Diagram](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_parcats.png)
226
+
227
+ #### Formatted Data Table (plotly-print: 69.9ms | Kaleido: 1766.4ms)
228
+
229
+ ![Formatted Data Table](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_table.png)
230
+
231
+ #### Carpet Coordinate Plot (plotly-print: 86.1ms | Kaleido: 1792.2ms)
232
+
233
+ ![Carpet Coordinate Plot](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_carpet.png)
234
+
235
+ ### Layout edge cases
236
+
237
+ #### Bar chart with X labels at 45 deg (plotly-print: 89.0ms | Kaleido: 1673.2ms)
238
+
239
+ ![Bar chart with X labels at 45 deg](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_rotated_ticks_45.png)
240
+
241
+ #### Bar chart with X labels at 90 deg (plotly-print: 87.7ms | Kaleido: 1883.9ms)
242
+
243
+ ![Bar chart with X labels at 90 deg](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_rotated_ticks_90.png)
244
+
245
+ #### Annotation arrowheads (incl. circle) (plotly-print: 82.4ms | Kaleido: 1661.6ms)
246
+
247
+ ![Annotation arrowheads (incl. circle)](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_annotations_arrowheads.png)
248
+
249
+ #### Long annotation arrows (dasharray length) (plotly-print: 79.7ms | Kaleido: 1719.1ms)
250
+
251
+ ![Long annotation arrows (dasharray length)](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_annotations_long_arrows.png)
252
+
253
+ #### Table cells with HTML markup and entities (plotly-print: 74.8ms | Kaleido: 1692.5ms)
254
+
255
+ ![Table cells with HTML markup and entities](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_table_markup.png)
256
+
257
+ <!-- BENCHMARK-END -->
258
+
259
+ ## Attribution
260
+
261
+ plotly-print is an independent project derived from [Mirage](https://github.com/ProfLear/mirage) by Benjamin Lear (MIT). Bundled plotly.js is copyright Plotly, Inc. (MIT); see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
@@ -0,0 +1,235 @@
1
+ # plotly-print
2
+
3
+ [![CI](https://img.shields.io/github/actions/workflow/status/roman-kaczanowski/plotly-print/quality-checks.yml?branch=main&style=flat-square&label=CI)](https://github.com/roman-kaczanowski/plotly-print/actions/workflows/quality-checks.yml) [![PyPI](https://img.shields.io/pypi/v/plotly-print?style=flat-square)](https://pypi.org/project/plotly-print/) [![Python](https://img.shields.io/badge/python-3.12%2B-3776AB?style=flat-square&logo=python&logoColor=white)](https://docs.python.org/3/) [![License](https://img.shields.io/badge/license-MIT-green?style=flat-square)](LICENSE)
4
+
5
+ Export Plotly figures to SVG, PNG, JPEG, or WebP without launching Chrome.
6
+
7
+ plotly-print runs a bundled Plotly.js 2D build in QuickJS, then uses `resvg-py` for raster output. It works offline, has no browser process to install or manage, and can replace Plotly's image-export methods with one call.
8
+
9
+ - Browser-free: no Chrome, Chromium, or Playwright.
10
+ - Fast: avoids browser startup; see the measured [benchmarks](#benchmarks).
11
+ - Familiar: use the direct API or patch Plotly's existing `to_image` and `write_image` methods.
12
+
13
+ [Install](#installation) | [Direct API](#direct-api) | [Plotly integration](#plotly-integration) | [Benchmarks](#benchmarks)
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ pip install plotly-print
19
+ ```
20
+
21
+ Requires Python 3.12 or newer.
22
+
23
+ ## Direct API
24
+
25
+ ```python
26
+ import plotly.express as px
27
+ import plotly_print
28
+
29
+ fig = px.scatter(x=[1, 2, 3, 4], y=[10, 11, 12, 13], title='Sales Growth')
30
+
31
+ svg = plotly_print.to_svg(fig)
32
+ png = plotly_print.to_image(fig, format='png', scale=2)
33
+ plotly_print.write_image(fig, 'chart.png')
34
+ ```
35
+
36
+ `to_image` returns bytes. `write_image` writes to a path or binary file object. Supported formats are SVG, PNG, JPEG, and WebP.
37
+
38
+ ## Plotly integration
39
+
40
+ Patch Plotly's existing image-export methods:
41
+
42
+ ```python
43
+ import plotly_print
44
+
45
+ plotly_print.register()
46
+ ```
47
+
48
+ After registration, existing calls such as `fig.write_image("chart.png")` use plotly-print. Call `plotly_print.unregister()` to restore Plotly's original methods.
49
+
50
+ plotly-print targets 2D static charts. The bundled Plotly.js build and its licenses are documented in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
51
+
52
+ <!-- BENCHMARK-START -->
53
+
54
+ ## Benchmarks
55
+
56
+ On this run, plotly-print exported all 30 chart types **12x to 33x faster** than Kaleido.
57
+
58
+ These are mean per-image PNG export times after both engines were warmed up. Timings are machine-specific; use the side-by-side images below to evaluate rendering differences.
59
+
60
+ See the [raw results](assets/benchmarks/benchmark_summary.json) or [run the benchmark locally](CONTRIBUTING.md#kaleido-visual-benchmark).
61
+
62
+ | Category | Chart Type | Kaleido | plotly-print | Speedup |
63
+ | :----------------------- | :---------------------------------------- | :-------: | :----------: | :-------: |
64
+ | **Core Cartesian** | Scatter & Line Chart | 1668.5 ms | **88.2 ms** | **18.9x** |
65
+ | **Core Cartesian** | Grouped Bar Chart | 1758.1 ms | **81.3 ms** | **21.6x** |
66
+ | **Core Cartesian** | Donut / Pie Chart | 1628.6 ms | **73.6 ms** | **22.1x** |
67
+ | **Core Cartesian** | Box Plot | 1748.2 ms | **77.1 ms** | **22.7x** |
68
+ | **Core Cartesian** | Violin Plot | 1623.8 ms | **84.1 ms** | **19.3x** |
69
+ | **Core Cartesian** | Frequency Histogram | 1878.0 ms | **62.7 ms** | **30.0x** |
70
+ | **Core Cartesian** | 2D Density Histogram | 1949.4 ms | **98.8 ms** | **19.7x** |
71
+ | **Core Cartesian** | 2D Contour Plot | 1604.9 ms | **118.7 ms** | **13.5x** |
72
+ | **Core Cartesian** | Performance Heatmap | 1832.4 ms | **87.3 ms** | **21.0x** |
73
+ | **Core Cartesian** | Ternary Phase Diagram | 1724.9 ms | **84.9 ms** | **20.3x** |
74
+ | **Financial & Business** | Candlestick Stock Chart | 1741.1 ms | **140.5 ms** | **12.4x** |
75
+ | **Financial & Business** | OHLC Financial Chart | 1670.0 ms | **131.3 ms** | **12.7x** |
76
+ | **Financial & Business** | Waterfall Profit & Loss | 1793.0 ms | **64.7 ms** | **27.7x** |
77
+ | **Financial & Business** | Sales Conversion Funnel | 1629.9 ms | **91.1 ms** | **17.9x** |
78
+ | **Financial & Business** | Funnel Area Analysis | 1694.0 ms | **61.7 ms** | **27.5x** |
79
+ | **Financial & Business** | KPI Performance Indicator | 1634.1 ms | **57.2 ms** | **28.6x** |
80
+ | **Hierarchical** | Market Cap Treemap | 1625.4 ms | **52.6 ms** | **30.9x** |
81
+ | **Hierarchical** | Global Sunburst Hierarchy | 1723.9 ms | **61.8 ms** | **27.9x** |
82
+ | **Hierarchical** | Icicle Partition Chart | 1594.7 ms | **50.2 ms** | **31.7x** |
83
+ | **Radial & Polar** | Radar Performance Comparison | 2481.9 ms | **96.5 ms** | **25.7x** |
84
+ | **Radial & Polar** | Polar Wind Rose | 1826.6 ms | **77.5 ms** | **23.6x** |
85
+ | **Specialized Diagrams** | Energy Flow Sankey Diagram | 1708.4 ms | **51.7 ms** | **33.1x** |
86
+ | **Specialized Diagrams** | Parallel Categories Diagram | 1620.2 ms | **57.0 ms** | **28.4x** |
87
+ | **Specialized Diagrams** | Formatted Data Table | 1766.4 ms | **69.9 ms** | **25.3x** |
88
+ | **Specialized Diagrams** | Carpet Coordinate Plot | 1792.2 ms | **86.1 ms** | **20.8x** |
89
+ | **Layout edge cases** | Bar chart with X labels at 45 deg | 1673.2 ms | **89.0 ms** | **18.8x** |
90
+ | **Layout edge cases** | Bar chart with X labels at 90 deg | 1883.9 ms | **87.7 ms** | **21.5x** |
91
+ | **Layout edge cases** | Annotation arrowheads (incl. circle) | 1661.6 ms | **82.4 ms** | **20.2x** |
92
+ | **Layout edge cases** | Long annotation arrows (dasharray length) | 1719.1 ms | **79.7 ms** | **21.6x** |
93
+ | **Layout edge cases** | Table cells with HTML markup and entities | 1692.5 ms | **74.8 ms** | **22.6x** |
94
+
95
+ ## Visual comparisons
96
+
97
+ Side-by-side PNGs (Kaleido left, plotly-print right):
98
+
99
+ ### Core Cartesian
100
+
101
+ #### Scatter & Line Chart (plotly-print: 88.2ms | Kaleido: 1668.5ms)
102
+
103
+ ![Scatter & Line Chart](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_scatter_line.png)
104
+
105
+ #### Grouped Bar Chart (plotly-print: 81.3ms | Kaleido: 1758.1ms)
106
+
107
+ ![Grouped Bar Chart](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_bar.png)
108
+
109
+ #### Donut / Pie Chart (plotly-print: 73.6ms | Kaleido: 1628.6ms)
110
+
111
+ ![Donut / Pie Chart](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_pie.png)
112
+
113
+ #### Box Plot (plotly-print: 77.1ms | Kaleido: 1748.2ms)
114
+
115
+ ![Box Plot](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_box.png)
116
+
117
+ #### Violin Plot (plotly-print: 84.1ms | Kaleido: 1623.8ms)
118
+
119
+ ![Violin Plot](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_violin.png)
120
+
121
+ #### Frequency Histogram (plotly-print: 62.7ms | Kaleido: 1878.0ms)
122
+
123
+ ![Frequency Histogram](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_histogram.png)
124
+
125
+ #### 2D Density Histogram (plotly-print: 98.8ms | Kaleido: 1949.4ms)
126
+
127
+ ![2D Density Histogram](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_histogram2d.png)
128
+
129
+ #### 2D Contour Plot (plotly-print: 118.7ms | Kaleido: 1604.9ms)
130
+
131
+ ![2D Contour Plot](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_contour.png)
132
+
133
+ #### Performance Heatmap (plotly-print: 87.3ms | Kaleido: 1832.4ms)
134
+
135
+ ![Performance Heatmap](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_heatmap.png)
136
+
137
+ #### Ternary Phase Diagram (plotly-print: 84.9ms | Kaleido: 1724.9ms)
138
+
139
+ ![Ternary Phase Diagram](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_scatterternary.png)
140
+
141
+ ### Financial & Business
142
+
143
+ #### Candlestick Stock Chart (plotly-print: 140.5ms | Kaleido: 1741.1ms)
144
+
145
+ ![Candlestick Stock Chart](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_candlestick.png)
146
+
147
+ #### OHLC Financial Chart (plotly-print: 131.3ms | Kaleido: 1670.0ms)
148
+
149
+ ![OHLC Financial Chart](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_ohlc.png)
150
+
151
+ #### Waterfall Profit & Loss (plotly-print: 64.7ms | Kaleido: 1793.0ms)
152
+
153
+ ![Waterfall Profit & Loss](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_waterfall.png)
154
+
155
+ #### Sales Conversion Funnel (plotly-print: 91.1ms | Kaleido: 1629.9ms)
156
+
157
+ ![Sales Conversion Funnel](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_funnel.png)
158
+
159
+ #### Funnel Area Analysis (plotly-print: 61.7ms | Kaleido: 1694.0ms)
160
+
161
+ ![Funnel Area Analysis](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_funnelarea.png)
162
+
163
+ #### KPI Performance Indicator (plotly-print: 57.2ms | Kaleido: 1634.1ms)
164
+
165
+ ![KPI Performance Indicator](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_indicator.png)
166
+
167
+ ### Hierarchical
168
+
169
+ #### Market Cap Treemap (plotly-print: 52.6ms | Kaleido: 1625.4ms)
170
+
171
+ ![Market Cap Treemap](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_treemap.png)
172
+
173
+ #### Global Sunburst Hierarchy (plotly-print: 61.8ms | Kaleido: 1723.9ms)
174
+
175
+ ![Global Sunburst Hierarchy](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_sunburst.png)
176
+
177
+ #### Icicle Partition Chart (plotly-print: 50.2ms | Kaleido: 1594.7ms)
178
+
179
+ ![Icicle Partition Chart](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_icicle.png)
180
+
181
+ ### Radial & Polar
182
+
183
+ #### Radar Performance Comparison (plotly-print: 96.5ms | Kaleido: 2481.9ms)
184
+
185
+ ![Radar Performance Comparison](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_scatterpolar.png)
186
+
187
+ #### Polar Wind Rose (plotly-print: 77.5ms | Kaleido: 1826.6ms)
188
+
189
+ ![Polar Wind Rose](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_barpolar.png)
190
+
191
+ ### Specialized Diagrams
192
+
193
+ #### Energy Flow Sankey Diagram (plotly-print: 51.7ms | Kaleido: 1708.4ms)
194
+
195
+ ![Energy Flow Sankey Diagram](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_sankey.png)
196
+
197
+ #### Parallel Categories Diagram (plotly-print: 57.0ms | Kaleido: 1620.2ms)
198
+
199
+ ![Parallel Categories Diagram](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_parcats.png)
200
+
201
+ #### Formatted Data Table (plotly-print: 69.9ms | Kaleido: 1766.4ms)
202
+
203
+ ![Formatted Data Table](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_table.png)
204
+
205
+ #### Carpet Coordinate Plot (plotly-print: 86.1ms | Kaleido: 1792.2ms)
206
+
207
+ ![Carpet Coordinate Plot](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_carpet.png)
208
+
209
+ ### Layout edge cases
210
+
211
+ #### Bar chart with X labels at 45 deg (plotly-print: 89.0ms | Kaleido: 1673.2ms)
212
+
213
+ ![Bar chart with X labels at 45 deg](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_rotated_ticks_45.png)
214
+
215
+ #### Bar chart with X labels at 90 deg (plotly-print: 87.7ms | Kaleido: 1883.9ms)
216
+
217
+ ![Bar chart with X labels at 90 deg](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_rotated_ticks_90.png)
218
+
219
+ #### Annotation arrowheads (incl. circle) (plotly-print: 82.4ms | Kaleido: 1661.6ms)
220
+
221
+ ![Annotation arrowheads (incl. circle)](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_annotations_arrowheads.png)
222
+
223
+ #### Long annotation arrows (dasharray length) (plotly-print: 79.7ms | Kaleido: 1719.1ms)
224
+
225
+ ![Long annotation arrows (dasharray length)](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_annotations_long_arrows.png)
226
+
227
+ #### Table cells with HTML markup and entities (plotly-print: 74.8ms | Kaleido: 1692.5ms)
228
+
229
+ ![Table cells with HTML markup and entities](https://raw.githubusercontent.com/roman-kaczanowski/plotly-print/main/assets/benchmarks/compare_table_markup.png)
230
+
231
+ <!-- BENCHMARK-END -->
232
+
233
+ ## Attribution
234
+
235
+ plotly-print is an independent project derived from [Mirage](https://github.com/ProfLear/mirage) by Benjamin Lear (MIT). Bundled plotly.js is copyright Plotly, Inc. (MIT); see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
@@ -2,12 +2,12 @@
2
2
 
3
3
  ## plotly.js
4
4
 
5
- File: `src/plotly_print/js/plotly-cartesian.min.js`
5
+ File: `src/plotly_print/js/plotly_comprehensive_2d.js`
6
6
 
7
- Official plotly.js **cartesian** partial (minified) v4.1.1, redistributed for offline /
8
- isolated environments. The full `plotly.min.js` shipped with the `plotly` Python package
9
- does not load in the embedded QuickJS runtime, so this smaller official partial is bundled
10
- instead.
7
+ Redistributed plotly.js build (minified) used for offline / isolated 2D static
8
+ rendering in the embedded QuickJS runtime. The full `plotly.min.js` shipped with
9
+ the `plotly` Python package does not load in that runtime, so this smaller
10
+ bundle is included instead.
11
11
 
12
12
  Copyright 2012-2026, Plotly, Inc.
13
13
  All rights reserved.