Skip to content

Commit 83278bf

Browse files
committed
close the loophole that would allow to pass x in the axisFy mark, or y in the axisFx mark
see #1287
1 parent 62e91e7 commit 83278bf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/marks/axis.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ function axisTickKy(
291291
...options
292292
}
293293
) {
294+
if (k === "fy" && options.x !== undefined) throw new Error("fy axes do not support the x option");
294295
return axisMark(vectorY, k, `${k}-axis tick`, data, {
295296
strokeWidth,
296297
strokeLinecap,
@@ -325,6 +326,7 @@ function axisTickKx(
325326
...options
326327
}
327328
) {
329+
if (k === "fx" && options.y !== undefined) throw new Error("fx axes do not support the y option");
328330
return axisMark(vectorX, k, `${k}-axis tick`, data, {
329331
strokeWidth,
330332
strokeLinejoin,
@@ -363,6 +365,7 @@ function axisTextKy(
363365
...options
364366
}
365367
) {
368+
if (k === "fy" && options.x !== undefined) throw new Error("fy axes do not support the x option");
366369
return axisMark(
367370
textY,
368371
k,
@@ -410,6 +413,7 @@ function axisTextKx(
410413
...options
411414
}
412415
) {
416+
if (k === "fx" && options.y !== undefined) throw new Error("fx axes do not support the y option");
413417
return axisMark(
414418
textX,
415419
k,

0 commit comments

Comments
 (0)