Skip to content

auto margins #1722

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

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1debd94
auto margins
Fil Jun 25, 2023
a4ebdee
progress save
Fil Jun 27, 2023
2c50736
fy (and flipped y/fy)
Fil Sep 14, 2023
79fa805
impact on tests
Fil Sep 14, 2023
d7916fc
autoMarginK signature
Fil Sep 21, 2023
cd88d7f
When margins are "auto", run the dimensions calculation twice if any …
Fil Sep 22, 2023
39e2852
fix tests
Fil Sep 22, 2023
353f045
changed plots
Fil Sep 22, 2023
a7f86ae
295
Fil Sep 22, 2023
9cc55bd
we need to know if it's y or fy, to apply a margin or facet margin
Fil Sep 23, 2023
d8559ab
fix for when the axis has x positioning
Fil Sep 23, 2023
df517c3
refactor
Fil Sep 25, 2023
277734e
no special keywords
Fil Sep 25, 2023
6e48b06
coerce tick label to string before calling defaultWidth
Fil Sep 26, 2023
4dc5624
monospace
Fil Sep 26, 2023
de4251e
simpler (we'll see later if we need to change the values for monospace)
Fil Sep 26, 2023
76a23be
skeleton of tests
Fil Sep 26, 2023
8b29b78
OK!
Fil Sep 27, 2023
bacd5b9
fix a bug with aspectRatio
Fil Sep 28, 2023
350c182
don't suppose that the mark that pilots autoMargin has an initializer
Fil Sep 28, 2023
165056d
add test for aspectRatio and margins
Fil Sep 28, 2023
015711f
nicer defaults
Fil Sep 28, 2023
63070d9
typo
Fil Sep 28, 2023
a8ee323
inline & clean up
Fil Sep 28, 2023
64538a8
auto-margin top and bottom (closes #1859)
Fil Oct 3, 2023
4bec5b5
adopts the new monospace relative width (#1880)
Fil Oct 12, 2023
cb3d714
fix tests
Fil Jul 29, 2024
bb905bd
Merge branch 'main' into fil/default-margins
Fil Aug 6, 2024
1f01c40
Merge branch 'main' into fil/default-margins
Fil Aug 16, 2024
1c0f1ad
Merge branch 'main' into fil/default-margins
Fil May 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix tests
  • Loading branch information
Fil committed Jul 29, 2024
commit cb3d714843c0adfa690a9009f98e98beb4e7f6f5
14 changes: 7 additions & 7 deletions test/output/aaplCloseAxisMargins.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions test/output/aaplCloseLabel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions test/output/aaplCloseLabelTop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 0 additions & 52 deletions test/output/aspectRatioMargins.svg

This file was deleted.

48 changes: 24 additions & 24 deletions test/output/marginAspectRatio.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
<span><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="109" height="99" viewBox="0 0 109 99" style="border: 1px solid steelblue; margin-bottom: 1em;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<style>
.plot {
:where(.plot) {
--plot-background: white;
display: block;
background: white;
height: auto;
height: intrinsic;
max-width: 100%;
}

.plot text,
.plot tspan {
:where(.plot text),
:where(.plot tspan) {
white-space: pre;
}
</style>
<g aria-label="y-grid" stroke="currentColor" stroke-opacity="0.1" transform="translate(0,0.5)">
<g aria-label="y-grid" aria-hidden="true" stroke="currentColor" stroke-opacity="0.1" transform="translate(0,0.5)">
<line x1="40" x2="89" y1="69" y2="69"></line>
<line x1="40" x2="89" y1="20" y2="20"></line>
</g>
<g aria-label="y-axis tick" fill="none" stroke="currentColor" transform="translate(0,0.5)">
<g aria-label="y-axis tick" aria-hidden="true" fill="none" stroke="currentColor" transform="translate(0,0.5)">
<path transform="translate(40,69)" d="M0,0L-6,0"></path>
<path transform="translate(40,20)" d="M0,0L-6,0"></path>
</g>
<g aria-label="y-axis tick label" text-anchor="end" font-variant="tabular-nums" transform="translate(-8.5,0.5)">
<text y="0.32em" transform="translate(40,69)">1,000</text>
<text y="0.32em" transform="translate(40,20)">1,001</text>
</g>
<g aria-label="x-grid" stroke="currentColor" stroke-opacity="0.1" transform="translate(0.5,0)">
<g aria-label="x-grid" aria-hidden="true" stroke="currentColor" stroke-opacity="0.1" transform="translate(0.5,0)">
<line x1="40" x2="40" y1="20" y2="69"></line>
<line x1="89" x2="89" y1="20" y2="69"></line>
</g>
<g aria-label="x-axis tick" fill="none" stroke="currentColor" transform="translate(0.5,0)">
<g aria-label="x-axis tick" aria-hidden="true" fill="none" stroke="currentColor" transform="translate(0.5,0)">
<path transform="translate(40,69)" d="M0,0L0,6"></path>
<path transform="translate(89,69)" d="M0,0L0,6"></path>
</g>
Expand All @@ -40,36 +40,36 @@
</svg>
<svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="110" height="80" viewBox="0 0 110 80" style="border: 1px solid steelblue; margin-bottom: 1em;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<style>
.plot {
:where(.plot) {
--plot-background: white;
display: block;
background: white;
height: auto;
height: intrinsic;
max-width: 100%;
}

.plot text,
.plot tspan {
:where(.plot text),
:where(.plot tspan) {
white-space: pre;
}
</style>
<g aria-label="y-grid" stroke="currentColor" stroke-opacity="0.1" transform="translate(0,0.5)">
<g aria-label="y-grid" aria-hidden="true" stroke="currentColor" stroke-opacity="0.1" transform="translate(0,0.5)">
<line x1="60" x2="90" y1="50" y2="50"></line>
<line x1="60" x2="90" y1="20" y2="20"></line>
</g>
<g aria-label="y-axis tick" fill="none" stroke="currentColor" transform="translate(0,0.5)">
<g aria-label="y-axis tick" aria-hidden="true" fill="none" stroke="currentColor" transform="translate(0,0.5)">
<path transform="translate(60,50)" d="M0,0L-6,0"></path>
<path transform="translate(60,20)" d="M0,0L-6,0"></path>
</g>
<g aria-label="y-axis tick label" text-anchor="end" font-variant="tabular-nums" transform="translate(-8.5,0.5)">
<text y="0.32em" transform="translate(60,50)">1,000</text>
<text y="0.32em" transform="translate(60,20)">1,001</text>
</g>
<g aria-label="x-grid" stroke="currentColor" stroke-opacity="0.1" transform="translate(0.5,0)">
<g aria-label="x-grid" aria-hidden="true" stroke="currentColor" stroke-opacity="0.1" transform="translate(0.5,0)">
<line x1="60" x2="60" y1="20" y2="50"></line>
<line x1="90" x2="90" y1="20" y2="50"></line>
</g>
<g aria-label="x-axis tick" fill="none" stroke="currentColor" transform="translate(0.5,0)">
<g aria-label="x-axis tick" aria-hidden="true" fill="none" stroke="currentColor" transform="translate(0.5,0)">
<path transform="translate(60,50)" d="M0,0L0,6"></path>
<path transform="translate(90,50)" d="M0,0L0,6"></path>
</g>
Expand All @@ -80,25 +80,25 @@
</svg>
<svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="130" height="100" viewBox="0 0 130 100" style="border: 1px solid steelblue; margin-bottom: 1em;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<style>
.plot {
:where(.plot) {
--plot-background: white;
display: block;
background: white;
height: auto;
height: intrinsic;
max-width: 100%;
}

.plot text,
.plot tspan {
:where(.plot text),
:where(.plot tspan) {
white-space: pre;
}
</style>
<g aria-label="y-grid" stroke="currentColor" stroke-opacity="0.1" transform="translate(0,0.5)">
<g aria-label="y-grid" aria-hidden="true" stroke="currentColor" stroke-opacity="0.1" transform="translate(0,0.5)">
<line x1="60" x2="110" y1="70" y2="70"></line>
<line x1="60" x2="110" y1="45" y2="45"></line>
<line x1="60" x2="110" y1="20" y2="20"></line>
</g>
<g aria-label="y-axis tick" fill="none" stroke="currentColor" transform="translate(0,0.5)">
<g aria-label="y-axis tick" aria-hidden="true" fill="none" stroke="currentColor" transform="translate(0,0.5)">
<path transform="translate(60,70)" d="M0,0L-6,0"></path>
<path transform="translate(60,45)" d="M0,0L-6,0"></path>
<path transform="translate(60,20)" d="M0,0L-6,0"></path>
Expand All @@ -108,11 +108,11 @@
<text y="0.32em" transform="translate(60,45)">1,000.5</text>
<text y="0.32em" transform="translate(60,20)">1,001.0</text>
</g>
<g aria-label="x-grid" stroke="currentColor" stroke-opacity="0.1" transform="translate(0.5,0)">
<g aria-label="x-grid" aria-hidden="true" stroke="currentColor" stroke-opacity="0.1" transform="translate(0.5,0)">
<line x1="60" x2="60" y1="20" y2="70"></line>
<line x1="110" x2="110" y1="20" y2="70"></line>
</g>
<g aria-label="x-axis tick" fill="none" stroke="currentColor" transform="translate(0.5,0)">
<g aria-label="x-axis tick" aria-hidden="true" fill="none" stroke="currentColor" transform="translate(0.5,0)">
<path transform="translate(60,70)" d="M0,0L0,6"></path>
<path transform="translate(110,70)" d="M0,0L0,6"></path>
</g>
Expand Down
Loading