Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
cpanse committed Sep 23, 2023
1 parent 2b0b4f5 commit b9c01e8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
17 changes: 11 additions & 6 deletions inst/shiny-examples/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@
#
# https://CRAN.R-project.org/package=recmap

# use R version >= 3.6 - grDevices::hcl; grDevices::hcl.colors; grDevices::hcl.pals;
# use R version >= 4.3 - grDevices::hcl; grDevices::hcl.colors; grDevices::hcl.pals;
# library(colorspace)
library(maps)
library(shiny)
library(recmap)

stopifnot(require(GA),
require(maps),
require(recmap))


if (Sys.info()['machine'] == "arm64" && Sys.info()['sysname'] == "Darwin"){
stopifnot(isFALSE(GA::gaControl()$useRcpp))
}

# ----- get U.S. county minimal bounding boxes ------
.get_county_mbb <-
Expand Down Expand Up @@ -255,16 +260,16 @@ shinyServer(function(input, output, session) {

#----plot input map ----
output$mapPlot <- renderPlot({
message("Plotting map ...")
M <- Map()
if (is.null(M)){return()}

op <- par(mfrow = c(1, 1), mar = c(0, 0, 0, 0))

plot(M, col.text = 'darkred')
recmap::plot.recmap(M, col.text = 'darkred')

x <- input$plot_hover$x
y <- input$plot_hover$y

if(TRUE){
C <- Cartogram()
if(is.null(C)) {return()}
Expand Down
1 change: 1 addition & 0 deletions inst/shiny-examples/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# https://CRAN.R-project.org/package=recmap



shinyUI(fluidPage(# Application title
titlePanel(
paste("https://CRAN.R-project.org/package=recmap",
Expand Down

0 comments on commit b9c01e8

Please sign in to comment.