Giter VIP home page Giter VIP logo

Comments (2)

koenderks avatar koenderks commented on May 29, 2024

Thanks, I will look into this! You have control over the font using myTheme[["family"]] and myTheme[["face"]], but currently not over the text size. As a quick temporary fix: The size of the text that you see depends on the dimensions of the exported figure and the quality (dpi). The map can be saved/exported in the recommended size and quality by calling:

ggplot2::ggsave(filename = "plot.png", plot = p, height = 500, width = 500, units = "mm", dpi = 100)

Or by providing cityview() with a filename directly, as is shown in the readme, like so:

myTheme <- list(
  colors = list(
    background = "#232323",
    water = NA,
    landuse = NA,
    contours = NA,
    streets = "#FF8200",
    rails = c("#FF8200", "#232323"),
    buildings = NA,
    text = "#ffffff",
    waterlines = NA
  ),
  font = list(
    family = "serif",
    face = "bold",
    append = "\u2014"
  ),
  size = list(
    borders = list(
      contours = 0.3,
      water = 0.4,
      canal = 0.5,
      river = 0.6
    ),
    streets = list(
      path = 0.2,
      residential = 0.4,
      structure = 0.5,
      tertiary = 0.7,
      secondary = 0.8,
      primary = 0.9,
      motorway = 1,
      rails = 0.75,
      runway = 3
    )
  )
)
cityview(name = "Knoxville", zoom = 0.5, theme = myTheme, filename = "plot.png")

This code gives:

hoi

from rcityviews.

koenderks avatar koenderks commented on May 29, 2024

You can now use myTheme[["font"]][["scale"]] to set the scaling factor for the font. Below is an example with scale = 0.5.

myTheme <- list(
  colors = list(
    background = "#232323",
    water = NA,
    landuse = NA,
    contours = NA,
    streets = "#FF8200",
    rails = c("#FF8200", "#232323"),
    buildings = NA,
    text = "#ffffff",
    waterlines = NA
  ),
  font = list(
    family = "serif",
    face = "bold",
    scale = 0.5,
    append = "\u2014"
  ),
  size = list(
    borders = list(
      contours = 0.3,
      water = 0.4,
      canal = 0.5,
      river = 0.6
    ),
    streets = list(
      path = 0.2,
      residential = 0.4,
      structure = 0.5,
      tertiary = 0.7,
      secondary = 0.8,
      primary = 0.9,
      motorway = 1,
      rails = 0.75,
      runway = 3
    )
  )
)
cityview(name = "Knoxville", zoom = 0.5, theme = myTheme, filename = "plot.png")

plot

Hope that helps!

from rcityviews.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.