Skip to content

Commit baf1e48

Browse files
committed
thanks to the nice pixelRound values, snapshots don't overflow
1 parent c905a87 commit baf1e48

File tree

5 files changed

+4
-8
lines changed

5 files changed

+4
-8
lines changed

test/output/crosshairDataless.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="640" height="400" viewBox="0 0 640 400" style="overflow: visible;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1+
<figure><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="640" height="400" viewBox="0 0 640 400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
22
<style>
33
:where(.plot) {
44
--plot-background: white;

test/output/crosshairDatalessFacet.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="640" height="430" viewBox="0 0 640 430" style="overflow: visible;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1+
<figure><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="640" height="430" viewBox="0 0 640 430" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
22
<style>
33
:where(.plot) {
44
--plot-background: white;

test/output/crosshairDatalessLog.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="640" height="400" viewBox="0 0 640 400" style="overflow: visible;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1+
<figure><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="640" height="400" viewBox="0 0 640 400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
22
<style>
33
:where(.plot) {
44
--plot-background: white;

test/output/crosshairDatalessOrdinal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<figure><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="640" height="100" viewBox="0 0 640 100" style="overflow: visible;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1+
<figure><svg class="plot" fill="currentColor" font-family="system-ui, sans-serif" font-size="10" text-anchor="middle" width="640" height="100" viewBox="0 0 640 100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
22
<style>
33
:where(.plot) {
44
--plot-background: white;

test/plots/crosshair.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ function formatValue(v: any) {
8888
export async function crosshairDataless() {
8989
const crosshair = Plot.crosshair();
9090
const plot = crosshair.plot({
91-
style: "overflow: visible;",
9291
x: {type: "utc", domain: [new Date("2010-01-01"), new Date("2025-01-01")]},
9392
y: {domain: [0, 100]},
9493
marks: [Plot.frame(), Plot.gridX({tickSpacing: 25}), Plot.gridY({tickSpacing: 25})]
@@ -105,7 +104,6 @@ export async function crosshairDatalessFacet() {
105104
const penguins = await d3.csv<any>("data/penguins.csv", d3.autoType);
106105
const crosshair = Plot.crosshair();
107106
const plot = crosshair.plot({
108-
style: "overflow: visible;",
109107
inset: 10,
110108
grid: true,
111109
marks: [Plot.frame(), Plot.dot(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm", fx: "species"})]
@@ -125,7 +123,6 @@ export async function crosshairDatalessOrdinal() {
125123
}));
126124
const crosshair = Plot.crosshair();
127125
const plot = Plot.plot({
128-
style: "overflow: visible;",
129126
marginLeft: 60,
130127
label: null,
131128
y: {type: "point"},
@@ -149,7 +146,6 @@ export async function crosshairDatalessLog() {
149146
// TODO: replace with proper symlog ticks once https://github.com/d3/d3-scale/issues/162 is fixed
150147
const ticks = [-100000, -20000, -5000, -500, -100, -20, -5, 0, 5, 20, 100, 500, 5000, 20000, 100000];
151148
const plot = crosshair.plot({
152-
style: "overflow: visible;",
153149
x: {type: "symlog", domain: [-100000, 100000], ticks},
154150
y: {type: "log", domain: [0.1, 10000]},
155151
grid: true,

0 commit comments

Comments
 (0)