r-tmap / r-tmap/tmap

hyperlinks in text components (e.g. tm_credits) for pdf output

Open
#794 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
907
Forks
123
PR merge metrics
No merged PRs in 30d

Description

I'm trying to insert a textbox on a map with a paragraph but I don't want the lines broken with "\n" in between the text except for a new paragraph. How do I achieve this with tmap, tm_credit or any other method please? Also can I insert a hyperlink in the tm_credit section for a map that will be saved as a pdf?

library(sf)
library(tmap)

tm_shape(NLD_muni) + tm_borders("population") + 
tm_credits("It will be great to create a textbox that is 0.2 of the enter map in Width. This box should be able to take a paragraph with many continuous lines without the use of  line breaks using forward slash n in R" ,col="gray45",size=0.3,fontfamily = "sans", fontface = "italic", bg.color =NA,bg.alpha = 0.9, position=c("left","bottom"),align = "left",width = 0.8)

This example shows what I mean under "Map Information"
image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the example with R, tmap, tm_shape, and tm_credits, then compare the rendered map with PDF output. Investigate how tm_credits handles paragraph text and hyperlinks; done would mean continuous paragraph wrapping without manual line breaks and working hyperlinks in the saved PDF.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.