Skip to content

Commit

Permalink
Fix errors in a hint[Name]=on styleCheck=error styleCheck=usages (#182
Browse files Browse the repository at this point in the history
)

compilation mode (which seems reasonable to support).
  • Loading branch information
c-blake authored Sep 5, 2024
1 parent 272c3ef commit 1c15e1b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ggplotnim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3360,7 +3360,7 @@ proc determinePlotHeight(theme: Theme, filledScales: FilledScales, width, height
let xS = if theme.xRange.isSome: theme.xRange.unsafeGet else: filledScales.xScale
let xD = xS.high - xS.low
let yS = if theme.yRange.isSome: theme.yRange.unsafeGet else: filledScales.yScale
let yD = ys.high - ys.low
let yD = yS.high - yS.low
let ratio = yD / xD
let spacingLR = add(layout.left, layout.right)
doAssert spacingLR.unit == ukCentimeter
Expand Down
2 changes: 1 addition & 1 deletion src/ggplotnim/ggplot_drawing.nim
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ proc drawRaster(view: var Viewport, fg: FilledGeom, df: DataFrame) =
numY = (height / hv).round.int
cMap = fg.colorScale

let α = if fg.geom.userstyle.alpha.isSome: fg.geom.userstyle.alpha.get else: 1.0
let α = if fg.geom.userStyle.alpha.isSome: fg.geom.userStyle.alpha.get else: 1.0
let αU32 = clamp* 255.0, 0.0, 255.0).uint32
var drawCb = proc(): seq[uint32] =
result = newSeq[uint32](df.len)
Expand Down
4 changes: 2 additions & 2 deletions src/ggplotnim/postprocess_scales.nim
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,13 @@ proc fillOptFields(fg: var FilledGeom, fs: FilledScales, df: var DataFrame) =
fg.invTrans = fs.invTransC
## Assign x / y scale of *raster* data
block RasterScales:
let xCol = df[xs.getColName]
let xCol = df[xS.getColName]
if xCol.kind in {colFloat, colInt}:
fg.rasterXScale = (low: xCol.toTensor(float).min, high: xCol.toTensor(float).max)
else:
raise newException(ValueError, "The `x` data aesthetics for the raster plot is neither " &
"`float` or `int` data. Instead it is: " & $xCol.kind)
let yCol = df[ys.getColName]
let yCol = df[yS.getColName]
if yCol.kind in {colFloat, colInt}:
fg.rasterYScale = (low: yCol.toTensor(float).min, high: yCol.toTensor(float).max)
else:
Expand Down

0 comments on commit 1c15e1b

Please sign in to comment.