-
Notifications
You must be signed in to change notification settings - Fork 26
Respect plot sizing metadata when present #1119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ff5e644
58721cf
2c5bc5d
9739f80
f4ae41b
0cb3ebf
bed45b0
0eb6035
a428e07
3738241
5f8d263
11542ad
16e5ac9
1bd3950
2249aa7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,9 +41,23 @@ pub struct ExecuteRequest { | |
| } | ||
|
|
||
| #[serde_with::skip_serializing_none] | ||
| #[derive(Debug, Serialize, Deserialize, Clone)] | ||
| #[derive(Debug, Serialize, Deserialize, Clone, Default)] | ||
| pub struct ExecuteRequestPositron { | ||
| pub code_location: Option<JupyterPositronLocation>, | ||
|
|
||
| /// Figure width in inches, set by Quarto | ||
| #[serde(rename = "fig-width")] | ||
| pub fig_width: Option<f64>, | ||
|
|
||
| /// Figure height in inches, set by Quarto | ||
| #[serde(rename = "fig-height")] | ||
| pub fig_height: Option<f64>, | ||
|
|
||
| /// Output area width in pixels | ||
| pub output_width_px: Option<f64>, | ||
|
|
||
| /// Device pixel ratio of the output area | ||
| pub output_pixel_ratio: Option<f64>, | ||
|
Comment on lines
45
to
+60
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe I would be ok with keeping these nested 1 layer deeper under IIUC, we could frame it as:
On the Ark side, we'd just "happen to recognize" some specific But I like the idea of containing these extension-specific-fields-that-ark-happens-to-recognize scoped to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm I think there is still an agreed upon protocol here. In this case, it seems it's one that is owned by Ark: Ark knows about these fields and Quarto is using them. So, should it be in On the frontend side, passthrough metadata is taken with a namespace string (in this case set to wdyt @jmcphers @DavisVaughan?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or the other way around,
There could be multiple namespaced sets of params, so I guess it's just a passthrough object and caller makes sure the params are appropriately namespaced (like |
||
| } | ||
|
|
||
| #[derive(Debug, Serialize, Deserialize, Clone)] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although the dependency direction would be a little weird, I'd love if we could reuse
PlotRenderSettingsfrom the plot comm for this. Looks like we only need to addoutput_width_px.At the very least, duplicating the data structure if we can't reuse it would mean that the plot settings are nicely namespaced in their own struct and keep the parent struct tidy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea at the very least it feels like this should be something like
But if @lionel- is suggesting that perhaps this should not be a part of
ExecuteRequestPositronat all, then I'd also be fine with that (I can't quite tell)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine in the execute request, just needs some consolidation as in your snippet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consolidated in bed45b0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! In this case though, I meant collecting all the plot setting fields in a nested struct in the
execute_request.positronstruct.