Skip to content

Commit

Permalink
fixed 996
Browse files Browse the repository at this point in the history
  • Loading branch information
mtennekes committed Jan 2, 2025
1 parent ac179b6 commit 70b0bc8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions R/tmapScaleDiscrete.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ tmapScaleDiscrete = function(x1, scale, legend, chart, o, aes, layer, layer_args
cfun = paste0("tmapValuesColorize_", aes)
if (is.na(value.neutral)) value.neutral = VV$value.neutral else value.neutral = do.call(sfun, list(x = do.call(cfun, list(x = value.neutral, pc = o$pc)), scale = values.scale))

mfun = paste0("tmapValuesSubmit_", aes)
vvalues = do.call(mfun, list(x = vvalues, args = layer_args))
value.na = do.call(mfun, list(x = value.na, args = layer_args))
value.neutral = do.call(mfun, list(x = value.neutral, args = layer_args))


ids = match(x1, ticks)
vals = vvalues[ids]
Expand Down
5 changes: 5 additions & 0 deletions R/tmapScaleIntervals.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ tmapScaleIntervals = function(x1, scale, legend, chart, o, aes, layer, layer_arg
cfun = paste0("tmapValuesColorize_", aes)
if (is.na(value.neutral)) value.neutral = VV$value.neutral else value.neutral = do.call(sfun, list(x = do.call(cfun, list(x = value.neutral, pc = o$pc)), scale = values.scale))

mfun = paste0("tmapValuesSubmit_", aes)
vvalues = do.call(mfun, list(x = vvalues, args = layer_args))
value.na = do.call(mfun, list(x = value.na, args = layer_args))
value.neutral = do.call(mfun, list(x = value.neutral, args = layer_args))


ids = classInt::findCols(q)
vals = vvalues[ids]
Expand Down
2 changes: 1 addition & 1 deletion R/tmapScale_misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ get_scale_defaults = function(scale, o, aes, layer, cls, ct = NULL) {
} else values

value.na = if (is.na(value.na) || isTRUE(value.na)) {
m = getPalMeta(as.character(values[1]))
m = if (aes %in% c("col", "fill")) getPalMeta(as.character(values[1])) else NULL
ona = getAesOption("value.na", o, aes, layer, cls = cls)

# take option value.na instead of cols4all palette na-color in these two cases:
Expand Down

0 comments on commit 70b0bc8

Please sign in to comment.