Coder Social home page Coder Social logo

hex sticker about r5r HOT 5 CLOSED

ipeagit avatar ipeagit commented on July 23, 2024
hex sticker

from r5r.

Comments (5)

mvpsaraiva avatar mvpsaraiva commented on July 23, 2024

Now, my productivity is gone... I'll spend two months procrastinating on a logo 😆

from r5r.

rafapereirabr avatar rafapereirabr commented on July 23, 2024

This is a rough idea with a shortest path tree as the "root" of r5r. I drawed this using vectr but ideally the logo should be a reprodducible example in R using OSM, sf, + other packages

Capture

from r5r.

rafapereirabr avatar rafapereirabr commented on July 23, 2024

Ok, this is my first result using the sample data we have in the package. Let me know what you thin.

r5r_test_b

from r5r.

rafapereirabr avatar rafapereirabr commented on July 23, 2024

Reproducible code for the hex sticker :

##### HEX sticker


### Libraries ------------------------
remotes::install_github("GuangchuangYu/hexSticker")

library(hexSticker) # https://github.com/GuangchuangYu/hexSticker
library(ggplot2)
library(sf)
library(r5r)
library(sysfonts)

# add special text font
sysfonts::font_add_google(name = "Roboto", family = "Roboto")

### setup ------------------------

# load origin/destination points
points <- read.csv(system.file("extdata/poa_hexgrid.csv", package = "r5r"))
points_sf <- sfheaders::sf_point(points, x='lon', y='lat', keep = T)

origin <- subset(points_sf, id == '89a90129977ffff')
destinations <- subset(points_sf, id %like% c('89a901299'))

# build transport network
data_path <- system.file("extdata", package = "r5r")
r5r_core <- setup_r5(data_path = data_path)


# routing
df <- detailed_itineraries(r5r_core,
                           origins = origin,
                           destinations = destinations,
                           mode = 'WALK',
                           departure_datetime = as.POSIXct("13-03-2019 14:00:00", format = "%d-%m-%Y %H:%M:%S"),
                           max_trip_duration = 30000L)


st_crs(destinations) <- st_crs(df)


### network plot  ------------------------

# plot results
test <- ggplot() +
          geom_sf(data = df, color='gray95', alpha=.2) +
          # geom_sf(data=destinations,  color='gray95', size=1) +
          # geom_sf(data=destinations,  color='navyblue', size=.6) +
          scale_x_continuous(limits = c(-51.20560, -51.18052 )) +
          scale_y_continuous(limits = c(-30.02239, -30.0002 )) +
          theme_void() +
          theme(panel.grid.major=element_line(colour="transparent"))


### save sticker  ------------------------

# big
sticker(test,

         # package name
         package= expression(paste("R"^5,"R")),  p_size=10, p_y = 1.5, p_color = "gray95", p_family="Roboto",

         # ggplot image size and position
         s_x=1, s_y=.85, s_width=1.4, s_height=1.4,

         # blue hexagon
         h_fill="#0d8bb1", h_color="white", h_size=1.3,

         ## blackhexagon
         # h_fill="gray20", h_color="gray80", h_size=1.3,

         # url
         url = "github.com/ipeaGIT/r5r", u_color= "gray95", u_family = "Roboto", u_size = 1.8,

         # save output name and resolution
         filename="./man/figures/r5r_biag.png", dpi=300 #
)

logo logo

from r5r.

rafapereirabr avatar rafapereirabr commented on July 23, 2024

I believe we can close this now. Thanks @mvpsaraiva !

from r5r.

Related Issues (20)

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.