This function alters the internal representation of a plot to include links back to the actual GitHub issue. This is currently implemented for viz_taskboard() and viz_gantt()

viz_linked(g, filepath)

Arguments

g

ggplot2 object returned by viz_gantt() or viz_taskboard()

filepath

Location to save resulting SVG file of ggplot2, if desired. Leave blank for function to output message precisely as needed to render in HTML RMarkdown with chunk option results = 'asis'

Value

SVG version of ggplot2 object with links to relevant GitHub issues. Either writes output to file or to console (to be captured in RMarkdown) depending on existence of filepath argument

Details

Credit goes to this Stack Overflow answer for figuring out how to do this: https://stackoverflow.com/questions/42259826/hyperlinking-text-in-a-ggplot2-visualization/42262407

Examples

# NOT RUN {
# In R, to save to file:
taskboard <- viz_taskboard(issues)
viz_linked(taskboard, "my_folder/my_file.svg")

# In RMarkdown chunk, to print as output:
```{r results = 'asis', echo = FALSE}
gantt <- viz_gantt(issues)
viz_linked(gantt)
````
# }