Skip to content

Commit 2f3c8f5

Browse files
committed
make sure discreteness is set for log2 / log10 scales
Without it if the data is interpreted to be discrete and not continuous, we run into a invalid field of variant object issue.
1 parent dea5bf2 commit 2f3c8f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ggplotnim.nim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,7 @@ proc scale_x_log10*[T: int | seq[SomeNumber]](breaks: T = newSeq[float]()): Scal
917917
scKind: scTransformedData,
918918
axKind: akX,
919919
dcKind: dcContinuous,
920+
hasDiscreteness: true,
920921
trans: trans,
921922
invTrans: invTrans)
922923
result.assignBreaks(breaks)
@@ -939,6 +940,7 @@ proc scale_y_log10*[T: int | seq[SomeNumber]](breaks: T = newSeq[float]()): Scal
939940
scKind: scTransformedData,
940941
axKind: akY,
941942
dcKind: dcContinuous,
943+
hasDiscreteness: true,
942944
trans: trans,
943945
invTrans: invTrans)
944946
result.assignBreaks(breaks)
@@ -961,6 +963,7 @@ proc scale_x_log2*[T: int | seq[SomeNumber]](breaks: T = newSeq[float]()): Scale
961963
scKind: scTransformedData,
962964
axKind: akX,
963965
dcKind: dcContinuous,
966+
hasDiscreteness: true,
964967
trans: trans,
965968
invTrans: invTrans)
966969
result.assignBreaks(breaks)
@@ -983,6 +986,7 @@ proc scale_y_log2*[T: int | seq[SomeNumber]](breaks: T = newSeq[float]()): Scale
983986
scKind: scTransformedData,
984987
axKind: akY,
985988
dcKind: dcContinuous,
989+
hasDiscreteness: true,
986990
trans: trans,
987991
invTrans: invTrans)
988992
result.assignBreaks(breaks)

0 commit comments

Comments
 (0)