Commit Graph

13 Commits

Author SHA1 Message Date
lorenzo perone
f04e987df6 Fix PDF export sizing chart to zoomed viewport (#260, #18) (#319)
* Fix PDF export sizing chart to zoomed viewport

downloadPdf() read the PDF page size from getSvgDimensions(), which returns
the live #chartSvg width/height attributes. Those carry the on-screen zoomed
size (chart_wrapper.ts writes size * scale on every d3-zoom event), not the
true chart size. The SVG drawn into the page instead carried the true
dimensions (getStrippedSvg divides by the zoom scale), so the PDF page and
its contents mismatched: zooming in produced a giant page with the tree in
one corner, zooming out produced a truncated strip. See issues #260 and #18.

Fix: have getSvgContentsWithInlinedImages() return the chart's true width
and height (read from the single stripped SVG clone it already builds), and
have downloadPdf() consume those for both the jsPDF page format and the
draw target. downloadSvg()/downloadPng() were already correct and only need
to destructure contents from the new return shape. The buggy helper
getSvgDimensions() is removed.

* Add regression test for PDF export page size

Zooms the chart, exports a PDF and asserts the PDF MediaBox matches the
chart's true (unscaled) dimensions and not the live zoomed ones. Verified
to fail on the pre-fix code (pdfW == liveW) and pass after the fix
(pdfW == trueW).

* Apply prettier formatting to chart_export.spec.ts
2026-07-30 00:04:34 +02:00
Przemek Więch
ea66d5027b remove .env file from repository 2026-05-29 00:04:13 +02:00
Przemek Więch
d427300ddf Migrate from Cypress to Playwright 2026-05-08 16:18:40 +02:00
Przemek Więch
b3f5ae1c25 Migrate from create react app to vite 2025-02-05 17:05:34 +01:00
Przemek Więch
f0bb5c1273 Upgrade to react 18 2025-01-14 00:24:40 +01:00
Przemek Więch
4e68a81d2b fix cypress config 2025-01-11 23:11:23 +01:00
Przemek Więch
0bfa631ac7 Update .gitignore 2024-03-28 17:57:38 +01:00
czifumasa
f3d98338cb Improvements for events in info panel (#72)
* Improved visuals of events panel, handle family events

* Create separate package for details panel

* Improved handling of multiple event notes
2021-10-26 12:49:18 +02:00
Przemek Wiech
2276edab08 Added cypress/videos directory to .gitignore 2020-04-01 18:42:13 +02:00
Przemek Wiech
358f6c6a7d Added cypress e2e tests 2020-02-14 23:47:14 +01:00
Przemek Wiech
56f8cfbf9a Added package-lock.json to repository 2019-04-17 22:38:48 +02:00
Przemek Wiech
f0addd57a9 Migrated from react-scripts-ts to react-scripts 2019-02-06 22:57:38 +01:00
Przemek Wiech
b5775ef687 Initial version 2019-01-26 22:01:07 +01:00