Commit 8a8bb08
authored
Respect plot sizing metadata when present (#1119)
This change adds the ability to change the way plots are drawn using
four new values in the `positron` field of `execute_request`
- `fig-width` / `fig-height` from Quarto (takes precedence), from the
cell options
- `output_width_px` and `output_pixel_ratio` from the notebook and/or
source editor. These are device metrics that can change at any time.
Used together, these values cause most plots in notebooks and Quarto
documents to be drawn at the user's preferred size, and at the scaling
appropriate for their display.
Quarto:
<img width="764" height="466" alt="image"
src="https://github.com/user-attachments/assets/45053988-afbb-46ad-8b60-b3977efd72a6"
/>
Jupyter:
<img width="774" height="833" alt="image"
src="https://github.com/user-attachments/assets/c797ebd8-ad6d-465e-b632-9576cf4f3cd1"
/>1 parent 7f8487f commit 8a8bb08
7 files changed
Lines changed: 414 additions & 63 deletions
File tree
- crates
- amalthea/src/wire
- ark_test/src
- ark
- src
- console
- modules/positron
- plots
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
47 | 61 | | |
48 | 62 | | |
49 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1288 | 1288 | | |
1289 | 1289 | | |
1290 | 1290 | | |
1291 | | - | |
| 1291 | + | |
| 1292 | + | |
1292 | 1293 | | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
1293 | 1299 | | |
1294 | 1300 | | |
1295 | 1301 | | |
1296 | 1302 | | |
| 1303 | + | |
| 1304 | + | |
1297 | 1305 | | |
1298 | 1306 | | |
1299 | 1307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
| 424 | + | |
429 | 425 | | |
430 | 426 | | |
431 | 427 | | |
| |||
0 commit comments