├── .Rbuildignore ├── .github ├── .gitignore └── workflows │ └── pkgdown.yaml ├── .gitignore ├── DESCRIPTION ├── LICENSE ├── LICENSE.md ├── NAMESPACE ├── R ├── generate_jsBlock.R ├── get_package_data.R ├── helpers.R ├── image_arrange.R ├── make_tile.R └── snap_tile.R ├── README.Rmd ├── README.md ├── _pkgdown.yml ├── cran-comments.md ├── docs ├── 404.html ├── CNAME ├── LICENSE-text.html ├── LICENSE.html ├── apple-touch-icon.png ├── authors.html ├── deps │ ├── bootstrap-5.3.1 │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.bundle.min.js.map │ │ └── bootstrap.min.css │ ├── bootstrap-toc-1.0.1 │ │ └── bootstrap-toc.min.js │ ├── clipboard.js-2.0.11 │ │ └── clipboard.min.js │ ├── data-deps.txt │ ├── font-awesome-6.4.2 │ │ ├── css │ │ │ ├── all.css │ │ │ ├── all.min.css │ │ │ ├── v4-shims.css │ │ │ └── v4-shims.min.css │ │ └── webfonts │ │ │ ├── fa-brands-400.ttf │ │ │ ├── fa-brands-400.woff2 │ │ │ ├── fa-regular-400.ttf │ │ │ ├── fa-regular-400.woff2 │ │ │ ├── fa-solid-900.ttf │ │ │ ├── fa-solid-900.woff2 │ │ │ ├── fa-v4compatibility.ttf │ │ │ └── fa-v4compatibility.woff2 │ ├── headroom-0.11.0 │ │ ├── headroom.min.js │ │ └── jQuery.headroom.min.js │ ├── jquery-3.6.0 │ │ ├── jquery-3.6.0.js │ │ ├── jquery-3.6.0.min.js │ │ └── jquery-3.6.0.min.map │ └── search-1.0.0 │ │ ├── autocomplete.jquery.min.js │ │ ├── fuse.min.js │ │ └── mark.min.js ├── favicon-48x48.png ├── favicon.ico ├── favicon.svg ├── index.html ├── katex-auto.js ├── lightswitch.js ├── link.svg ├── logo.png ├── pkgdown.js ├── pkgdown.yml ├── reference │ ├── encode_image.html │ ├── figures │ │ ├── exampletile.png │ │ ├── hsdemo.gif │ │ └── logo.png │ ├── find_imgpaths.html │ ├── find_logopaths.html │ ├── generate_hexsession_js.html │ ├── getLoaded.html │ ├── get_pkg_data.html │ ├── index.html │ ├── make_missingLogos.html │ ├── make_tile.html │ ├── pkgurls.html │ └── snap_tile.html ├── search.json ├── site.webmanifest ├── sitemap.xml ├── web-app-manifest-192x192.png └── web-app-manifest-512x512.png ├── hexsession.Rproj ├── inst ├── extdata │ ├── blankhexsm.png │ ├── hexout_example.html │ ├── rectDark.png │ ├── rectLight.png │ └── rectMed.png └── templates │ └── _hexout.qmd ├── man ├── col_arrange.Rd ├── encode_image.Rd ├── figures │ ├── exampletile.png │ ├── hsdemo.gif │ └── logo.png ├── find_imgpaths.Rd ├── find_logopaths.Rd ├── generate_hexsession_js.Rd ├── getLoaded.Rd ├── get_pkg_data.Rd ├── maincolorRGB.Rd ├── make_missingLogos.Rd ├── make_tile.Rd ├── pkgurls.Rd └── snap_tile.Rd └── pkgdown └── favicon ├── apple-touch-icon.png ├── favicon-48x48.png ├── favicon.ico ├── favicon.svg ├── site.webmanifest ├── web-app-manifest-192x192.png └── web-app-manifest-512x512.png /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^hexsession\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^LICENSE\.md$ 4 | ^README\.Rmd$ 5 | ^cran-comments\.md$ 6 | ^_pkgdown\.yml$ 7 | ^docs$ 8 | ^pkgdown$ 9 | ^\.github$ 10 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main, master] 6 | pull_request: 7 | branches: [main, master] 8 | release: 9 | types: [published] 10 | workflow_dispatch: 11 | 12 | name: pkgdown.yaml 13 | 14 | permissions: read-all 15 | 16 | jobs: 17 | pkgdown: 18 | runs-on: ubuntu-latest 19 | # Only restrict concurrency for non-PR jobs 20 | concurrency: 21 | group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} 22 | env: 23 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 24 | permissions: 25 | contents: write 26 | steps: 27 | - uses: actions/checkout@v4 28 | 29 | - uses: r-lib/actions/setup-pandoc@v2 30 | 31 | - uses: r-lib/actions/setup-r@v2 32 | with: 33 | use-public-rspm: true 34 | 35 | - uses: r-lib/actions/setup-r-dependencies@v2 36 | with: 37 | extra-packages: any::pkgdown, local::. 38 | needs: website 39 | 40 | - name: Build site 41 | run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) 42 | shell: Rscript {0} 43 | 44 | - name: Deploy to GitHub pages 🚀 45 | if: github.event_name != 'pull_request' 46 | uses: JamesIves/github-pages-deploy-action@v4.5.0 47 | with: 48 | clean: false 49 | branch: gh-pages 50 | folder: docs 51 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .Rdata 4 | .httr-oauth 5 | .DS_Store 6 | .quarto 7 | docs 8 | 9 | /.quarto/ 10 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: hexsession 2 | Title: Create a tile of logos for loaded packages 3 | Version: 0.0.0.9000 4 | Authors@R: 5 | person("Luis D.", "Verde Arregoitia", , "luis@liomys.mx", role = c("aut", "cre"), 6 | comment = c(ORCID = "0000-0001-9520-6543")) 7 | Description: Creates a responsive HTML file with tiled hex logos for all loaded packages in a session, which can be saved as a static screenshot in png format. 8 | License: MIT + file LICENSE 9 | Suggests: 10 | rsvg, 11 | testthat (>= 3.0.0) 12 | Config/testthat/edition: 3 13 | Encoding: UTF-8 14 | Roxygen: list(markdown = TRUE) 15 | RoxygenNote: 7.3.2.9000 16 | URL: https://github.com/luisDVA/hexsession, https://luisdva.github.io/hexsession/ 17 | BugReports: https://github.com/luisDVA/hexsession/issues 18 | Imports: 19 | base64enc, 20 | chromote, 21 | jsonlite, 22 | magick, 23 | purrr, 24 | htmltools, 25 | knitr 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2024 2 | COPYRIGHT HOLDER: hexsession authors 3 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2024 hexsession authors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(col_arrange) 4 | export(encode_image) 5 | export(generate_hexsession_js) 6 | export(make_tile) 7 | export(snap_tile) 8 | importFrom(base64enc,base64encode) 9 | importFrom(grDevices,convertColor) 10 | importFrom(htmltools,HTML) 11 | importFrom(jsonlite,toJSON) 12 | importFrom(knitr,is_html_output) 13 | importFrom(magick,image_data) 14 | importFrom(magick,image_read) 15 | importFrom(magick,image_scale) 16 | importFrom(purrr,map) 17 | importFrom(stats,kmeans) 18 | importFrom(utils,packageDescription) 19 | -------------------------------------------------------------------------------- /R/generate_jsBlock.R: -------------------------------------------------------------------------------- 1 | #' Generate JavaScript file for hexsession 2 | #' 3 | #' @param logopaths Vector of image paths 4 | #' @param urls Vector of URLs 5 | #' @param dark_mode Use dark mode, inherited from make_tile 6 | #' @param output_js Path to save the JavaScript file 7 | #' 8 | #' @importFrom jsonlite toJSON 9 | #' @importFrom base64enc base64encode 10 | #' 11 | #' @export 12 | generate_hexsession_js <- function(logopaths, urls, dark_mode, output_js) { 13 | encoded_paths <- vector("character", length(logopaths)) 14 | for (i in seq_along(logopaths)) { 15 | tryCatch({ 16 | encoded <- base64enc::base64encode(logopaths[i]) 17 | ext <- tolower(tools::file_ext(logopaths[i])) 18 | encoded_paths[i] <- paste0("data:image/", ext, ";base64,", encoded) 19 | }, error = function(e) { 20 | warning(paste("Error encoding file:", logopaths[i], "-", e$message)) 21 | encoded_paths[i] <- NA_character_ 22 | }) 23 | } 24 | 25 | image_url_pairs <- lapply(seq_along(encoded_paths), function(i) { 26 | list( 27 | image = encoded_paths[i], 28 | url = if (is.na(urls[i]) || urls[i] == "NA") NULL else as.character(urls[i]) 29 | ) 30 | }) 31 | 32 | image_url_pairs <- image_url_pairs[!is.na(sapply(image_url_pairs, function(x) x$image))] 33 | 34 | js_content <- sprintf(' 35 | const imageUrlPairs = %s; 36 | const darkMode = %s; 37 | 38 | document.addEventListener("DOMContentLoaded", function() { 39 | const container = document.getElementById("imageContainer"); 40 | 41 | if (darkMode) { 42 | document.documentElement.style.setProperty("--bg-color", "#1a1a1a"); 43 | document.documentElement.style.setProperty("--text-color", "#ffffff"); 44 | document.documentElement.style.setProperty("--tile-bg", "#2a2a2a"); 45 | document.documentElement.style.setProperty("--attribution-bg", "rgba(255, 255, 255, 0.1)"); 46 | document.documentElement.style.setProperty("--link-color", "#66b3ff"); 47 | } else { 48 | document.documentElement.style.setProperty("--bg-color", "#ffffff"); 49 | document.documentElement.style.setProperty("--text-color", "#000000"); 50 | document.documentElement.style.setProperty("--tile-bg", "#f0f0f0"); 51 | document.documentElement.style.setProperty("--attribution-bg", "rgba(0, 0, 0, 0.1)"); 52 | document.documentElement.style.setProperty("--link-color", "#0066cc"); 53 | } 54 | 55 | imageUrlPairs.forEach((pair, index) => { 56 | const div = document.createElement("div"); 57 | const img = document.createElement("img"); 58 | 59 | img.src = pair.image; 60 | img.alt = "Hexagon Image " + (index + 1); 61 | 62 | if (pair.url && typeof pair.url === "string") { 63 | const a = document.createElement("a"); 64 | a.href = pair.url; 65 | a.target = "_blank"; 66 | a.appendChild(img); 67 | div.appendChild(a); 68 | } else { 69 | div.appendChild(img); 70 | } 71 | 72 | container.appendChild(div); 73 | }); 74 | }); 75 | ', 76 | jsonlite::toJSON(image_url_pairs, auto_unbox = TRUE), 77 | tolower(as.character(dark_mode)) 78 | ) 79 | 80 | writeLines(js_content, output_js) 81 | } 82 | -------------------------------------------------------------------------------- /R/get_package_data.R: -------------------------------------------------------------------------------- 1 | #' Get package data 2 | #' @param packages Character vector of package names (default is NULL, uses loaded packages) 3 | #' @return A list containing logopaths and urls for the packages 4 | get_pkg_data <- function(packages = NULL) { 5 | if (is.null(packages)) { 6 | packages <- getLoaded() 7 | } else { 8 | # Check if specified packages are installed 9 | not_installed <- packages[!packages %in% installed.packages()[, "Package"]] 10 | if (length(not_installed) > 0) { 11 | stop("The following packages are not installed: ", paste(not_installed, collapse = ", ")) 12 | } 13 | } 14 | 15 | imagepaths <- find_imgpaths(packages) 16 | logopaths <- find_logopaths(imagepaths, packages) 17 | 18 | # Generate missing logos 19 | missing <- is.na(logopaths) 20 | if (any(missing)) { 21 | generated <- make_missingLogos(packages[missing], logopaths[missing]) 22 | logopaths[missing] <- generated 23 | } 24 | 25 | # Get package URLs 26 | urls <- sapply(packages, function(pkg) { 27 | desc <- packageDescription(pkg) 28 | url <- desc$URL 29 | if (is.null(url)) { 30 | paste0("https://cran.r-project.org/package=", pkg) 31 | } else { 32 | strsplit(url, ",")[[1]][1] # Use the first URL if multiple are provided 33 | } 34 | }) 35 | 36 | list(logopaths = logopaths, urls = urls) 37 | } 38 | -------------------------------------------------------------------------------- /R/helpers.R: -------------------------------------------------------------------------------- 1 | #' Get loaded packages 2 | #' @return A character vector of the attached packages (excludes base packages) 3 | getLoaded <- function() { 4 | # also exclude hexsession 5 | basepkgs <- c( 6 | "stats", "graphics", "grDevices", "utils", "datasets", 7 | "methods", "base", "hexsession" 8 | ) 9 | (.packages())[!(.packages()) %in% basepkgs] 10 | } 11 | 12 | #' Find image paths 13 | #' @param pkgnames Character vector of package names 14 | #' @return A list of image file paths for each package 15 | #' @details 16 | #' Images in svg format will be converted to png. When no image matches 'logo' 17 | #' in the file name the used is will be prompted to select likely logos. 18 | find_imgpaths <- function(pkgnames) { 19 | lapply(pkgnames, function(x) { 20 | img_files <- list.files(system.file(package = x), 21 | pattern = "\\.png$|\\.jpg$|\\.svg$", 22 | recursive = TRUE, 23 | full.names = TRUE 24 | ) 25 | 26 | # Convert SVG to PNG if necessary 27 | img_files <- lapply(img_files, function(file) { 28 | if (tools::file_ext(file) == "svg") { 29 | # Create a new filename with "converted" prefix 30 | file_dir <- tempdir() 31 | file_name <- basename(file) 32 | new_file_name <- paste0("converted_",x,"_", tools::file_path_sans_ext(file_name), ".png") 33 | png_file <- file.path(file_dir, new_file_name) 34 | 35 | # Convert SVG to PNG 36 | 37 | magick::image_write( 38 | magick::image_read_svg(file), 39 | png_file, format = "png") 40 | 41 | return(png_file) 42 | } 43 | return(file) 44 | }) 45 | 46 | unlist(img_files) 47 | }) 48 | } 49 | 50 | #' Find logo paths 51 | #' @param imagepaths List of image paths 52 | #' @param pkgnames Character vector of package names 53 | #' @return A vector of logo paths 54 | find_logopaths <- function(imagepaths, pkgnames) { 55 | logopaths <- purrr::map2(imagepaths, pkgnames, function(x, pkg) { 56 | logo_matches <- x[grepl("hex|logo", x, ignore.case = TRUE)] 57 | 58 | if (length(logo_matches) == 0 && length(x) > 0) { 59 | choices <- c(basename(x), "None of the above") 60 | 61 | choice <- utils::menu( 62 | choices = choices, 63 | title = sprintf("Package: %s - No images match 'logo'. Please select the image with the package logo:", pkg) 64 | ) 65 | 66 | if (choice > 0 && choice <= length(x)) { 67 | return(x[choice]) 68 | } else { 69 | return(NA_character_) 70 | } 71 | } else if (length(logo_matches) == 1) { 72 | return(logo_matches[1]) 73 | } else if (length(logo_matches) > 1) { 74 | choices <- c(basename(logo_matches), "None of the above") 75 | 76 | choice <- utils::menu( 77 | choices = choices, 78 | title = sprintf("Package: %s - Multiple possible logos. Please select the image to use:", pkg) 79 | ) 80 | 81 | if (choice > 0 && choice <= length(logo_matches)) { 82 | return(logo_matches[choice]) 83 | } else { 84 | return(NA_character_) 85 | } 86 | } else { 87 | return(NA_character_) 88 | } 89 | }) 90 | 91 | unlist(logopaths) 92 | } 93 | 94 | #' Get package URLs 95 | #' @param pkgnames Character vector of package names 96 | #' @importFrom utils packageDescription 97 | #' @return A vector of package URLs 98 | pkgurls <- function(pkgnames) { 99 | allurls <- purrr::map(pkgnames, \(x) { 100 | url <- packageDescription(x, fields = "URL") 101 | if (is.null(url) || all(is.na(url)) || all(url == "")) NA_character_ else url 102 | }) 103 | splturls <- purrr::map(allurls, \(x) { 104 | if (all(is.na(x))) NA_character_ else unlist(strsplit(x, ",|\n")) 105 | }) 106 | purrr::map_chr(splturls, \(x) { 107 | if (all(is.na(x))) NA_character_ else x[1] 108 | }) 109 | } 110 | 111 | #' Encode image to Base64 112 | #' @param file_path Path to an image file 113 | #' @return Base64 encoded string of the image 114 | #' @export 115 | encode_image <- function(file_path) { 116 | tryCatch( 117 | { 118 | encoded <- base64enc::base64encode(file_path) 119 | ext <- tolower(tools::file_ext(file_path)) 120 | paste0("data:image/", ext, ";base64,", encoded) 121 | }, 122 | error = function(e) { 123 | warning(paste("Error encoding file:", file_path, "-", e$message)) 124 | NULL 125 | } 126 | ) 127 | } 128 | 129 | #' Create missing logos 130 | #' @param attached_pkgs Character vector of attached package names 131 | #' @param logopaths Vector of existing logo paths 132 | #' @return Vector of paths to new logos 133 | make_missingLogos <- function(attached_pkgs, logopaths) { 134 | pending <- attached_pkgs[is.na(logopaths)] 135 | basehex <- magick::image_read(system.file("extdata", "blankhexsm.png", package = "hexsession")) 136 | 137 | 138 | create_logo <- function(pkgname) { 139 | widthhex <- magick::image_info(basehex)$width 140 | 141 | fig <- magick::image_blank(700, 700) |> 142 | magick::image_annotate(pkgname, size = 100, color = "white") |> 143 | magick::image_trim() |> 144 | magick::image_border("none") |> 145 | magick::image_resize(paste0(widthhex - 30, "x")) 146 | 147 | magick::image_composite(basehex, fig, operator = "SrcOver", gravity = "center") 148 | } 149 | 150 | logoimgs <- purrr::map(pending, create_logo) 151 | # single-logo tiles 152 | if (!is.list(logoimgs)) { 153 | logoimgs <- list(logoimgs) 154 | } 155 | 156 | imgpaths <- paste0(tempfile(), "_", pending, ".png") 157 | 158 | purrr::walk2(logoimgs, imgpaths, 159 | \(x, y) magick::image_write(x, y)) 160 | 161 | as.list(imgpaths) 162 | } 163 | -------------------------------------------------------------------------------- /R/image_arrange.R: -------------------------------------------------------------------------------- 1 | #' Extract the Most Frequent Color from an Image 2 | #' 3 | #' Internal helper. For a given image path, this functions uses k-means 4 | #' clustering to identify the most dominant color in the image. 5 | #' 6 | #' @param imgpath Character string. File path to the image. 7 | #' 8 | #' @return A data frame with one row containing the RGB values of the dominant color. 9 | #' The column name is set to the input image path. 10 | #' 11 | #' @importFrom magick image_read image_scale image_data 12 | #' @importFrom stats kmeans 13 | #' 14 | maincolorRGB <- function(imgpath) { 15 | img <- magick::image_scale(magick::image_read(imgpath), "130") 16 | imgint <- as.integer(magick::image_data(img, channels = "rgb")) 17 | img_df <- data.frame(red = c(imgint[,,1]), green = c(imgint[,,2]), blue = c(imgint[,,3])) 18 | km <- kmeans(img_df, 5) 19 | rgbout <- data.frame(km$centers[which.max(km$size),]) 20 | names(rgbout) <- paste(imgpath) 21 | rgbout 22 | } 23 | 24 | #' Arrange Images by Color 25 | #' 26 | #' Takes a vector of image paths, extracts the main color from each image using 27 | #' k-means clustering, converts the colors to the LAB color space, and sorts the 28 | #' images based on the lightness (L) component of their dominant color. 29 | #' 30 | #' @param image_paths Character vector. A vector of file paths to the images. 31 | #' 32 | #' @return A character vector of image paths, sorted by the lightness of their 33 | #' main color. 34 | #' 35 | #' @importFrom grDevices convertColor 36 | #' @importFrom purrr map 37 | #' 38 | #' @examples 39 | #' img1 <- system.file("extdata/rectLight.png", package = "hexsession") 40 | #' img2 <- system.file("extdata/rectMed.png", package = "hexsession") 41 | #' img3 <- system.file("extdata/rectDark.png", package = "hexsession") 42 | #' sorted_paths <- col_arrange(c(img1,img3,img2)) 43 | #' 44 | #' @export 45 | col_arrange <- function(image_paths) { 46 | # find most common color and convert to rgb 47 | allrgbspace <- do.call(cbind, purrr::map(image_paths, maincolorRGB)) 48 | # 'Lab' color space 49 | lab <- convertColor(t(allrgbspace), 'sRGB', 'Lab') 50 | # sort images by lightness 51 | image_paths[order(lab[, 'L'])] 52 | } 53 | -------------------------------------------------------------------------------- /R/make_tile.R: -------------------------------------------------------------------------------- 1 | #' Generate tile of package logos 2 | #' 3 | #' @description 4 | #' This function returns an interactive html tile view of the packages either 5 | #' listed in the `packages` option, or all of the loaded packages. When rendered 6 | #' interactively, the result is output in the viewer. When rendered in Quarto or 7 | #' RMarkdown, the tile becomes part of the rendered html. If local images are provided, 8 | #' only these images will be used, excluding loaded packages. 9 | #' 10 | #' @param packages Character vector of package names to include (default: NULL, which uses loaded packages) 11 | #' @param dark_mode Draw the tile on a dark background? 12 | #' @param local_images Optional character vector of local image paths to add to the tile 13 | #' @param local_urls Optional character vector of URLs for each of the local images passed 14 | #' @param color_arrange Logical, whether to arrange the images by color along the 'Lab' color space (defaults to FALSE) 15 | #' @return Path to the output file 16 | #' @importFrom jsonlite toJSON 17 | #' @importFrom base64enc base64encode 18 | #' @importFrom knitr is_html_output 19 | #' @importFrom htmltools HTML 20 | #' @export 21 | make_tile <- function(packages = NULL, local_images = NULL, 22 | local_urls = NULL, dark_mode = FALSE, 23 | color_arrange = FALSE) { 24 | temp_dir <- file.path(getwd(), "temp_hexsession") 25 | dir.create(temp_dir, showWarnings = FALSE) 26 | 27 | if (is.null(local_images)) { 28 | package_data <- get_pkg_data(packages) 29 | all_logopaths <- package_data$logopaths 30 | all_urls <- package_data$urls 31 | } else { 32 | all_logopaths <- local_images 33 | all_urls <- local_urls 34 | } 35 | 36 | # Ensure all_urls is the same length as all_logopaths 37 | if (length(all_urls) < length(all_logopaths)) { 38 | all_urls <- c(all_urls, rep(NA, length(all_logopaths) - length(all_urls))) 39 | } else if (length(all_urls) > length(all_logopaths)) { 40 | all_urls <- all_urls[1:length(all_logopaths)] 41 | } 42 | 43 | 44 | # Arrange images by color if requested 45 | if (color_arrange) { 46 | laborder <- col_arrange(all_logopaths) 47 | all_logopaths <- all_logopaths[order(match(all_logopaths,laborder))] 48 | all_urls <- all_urls[order(match(all_logopaths,laborder))] 49 | } 50 | 51 | temp_file <- file.path(temp_dir, "package_data.rds") 52 | saveRDS(list(logopaths = all_logopaths, urls = all_urls), temp_file) 53 | 54 | js_file <- file.path(temp_dir, "hexsession.js") 55 | generate_hexsession_js(all_logopaths, all_urls, dark_mode, js_file) 56 | 57 | template_path <- system.file("templates", "_hexout.qmd", package = "hexsession") 58 | file.copy(template_path, file.path(temp_dir, "_hexout.qmd"), overwrite = TRUE) 59 | 60 | quarto_call <- sprintf( 61 | 'quarto render "%s" -P dark_mode:%s', 62 | file.path(temp_dir, "_hexout.qmd"), tolower(as.character(dark_mode)) 63 | ) 64 | system(quarto_call) 65 | 66 | if (isTRUE(getOption("knitr.in.progress")) && knitr::is_html_output()) { 67 | # Read the HTML content directly 68 | html_content <- readLines(file.path(temp_dir, "_hexout.html"), warn = FALSE) 69 | 70 | # Extract just the body content 71 | body_content <- paste(html_content[grep("", html_content):grep("", html_content)], collapse = "\n") 72 | body_content <- gsub("", "", body_content) 73 | 74 | # Custom CSS 75 | custom_css <- ' 76 | 87 | ' 88 | 89 | # Create a div container with the content 90 | div_content <- sprintf( 91 | '
%s
', 92 | body_content 93 | ) 94 | # Return the HTML content directly with custom CSS 95 | return(htmltools::HTML(paste0(custom_css, div_content))) 96 | 97 | } else if (isFALSE(getOption("knitr.in.progress"))) { 98 | viewer <- getOption("viewer") 99 | viewer(file.path(temp_dir, "_hexout.html")) 100 | } 101 | } -------------------------------------------------------------------------------- /R/snap_tile.R: -------------------------------------------------------------------------------- 1 | #' Take screenshot of html image tile 2 | #' 3 | #' @param output_path Path to image file 4 | #' @param screen_width Width of the browser window 5 | #' @param screen_height Height of the browser window 6 | #' @param dark_mode Is the tile being saved dark or light mode? 7 | #' @return Path to the saved image 8 | #' @export 9 | snap_tile <- function(output_path, 10 | screen_width = 800, 11 | screen_height = 700, 12 | dark_mode = FALSE) { 13 | 14 | b_color <- if(dark_mode == TRUE) { 15 | "black" 16 | } else "white" 17 | 18 | html_path <- "temp_hexsession/hexout.html" 19 | 20 | # Check for hex tile HTML file 21 | if (!file.exists(html_path)) { 22 | stop("No file to capture. Did you create your tile of logos?") 23 | } 24 | 25 | 26 | temppath <- tempfile(fileext = ".png") 27 | 28 | screenshot <- function(b, selector) { 29 | b$screenshot( 30 | temppath, 31 | selector = selector, 32 | scale = 2, 33 | delay = 2 34 | ) 35 | } 36 | 37 | # Browser session 38 | b <- chromote::ChromoteSession$new(height = screen_height, width = screen_width) 39 | 40 | # Open the hex tile 41 | b$Page$navigate(paste0("file://", normalizePath(html_path))) 42 | Sys.sleep(1) # breathe 43 | 44 | # screenshot 45 | tryCatch({ 46 | screenshot(b, selector = "#quarto-content") 47 | }, error = function(e) { 48 | cat("Error taking screenshot:", conditionMessage(e), "\n") 49 | }) 50 | 51 | # post process 52 | tryCatch({ 53 | magick::image_read(temppath) |> 54 | magick::image_trim() |> 55 | magick::image_border(b_color, "10x10") |> 56 | magick::image_shadow() |> 57 | magick::image_write(output_path, format = "png", 58 | density = 300) 59 | 60 | cat("Image processed and saved to:", output_path, "\n") 61 | }, error = function(e) { 62 | cat("Could not process screenshot:", conditionMessage(e), "\n") 63 | }) 64 | 65 | b$close() 66 | 67 | } 68 | -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | --- 4 | 5 | 6 | 7 | ```{r, include = FALSE} 8 | knitr::opts_chunk$set( 9 | collapse = TRUE, 10 | comment = "#>", 11 | fig.path = "man/figures/README-", 12 | out.width = "100%" 13 | ) 14 | ``` 15 | 16 | # hexsession 17 | 18 | 19 | [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) 20 | [![CRAN status](https://www.r-pkg.org/badges/version/hexsession)](https://CRAN.R-project.org/package=hexsession) 21 | 22 | 23 | The goal of hexsession is to create a tile of hexagonal logos for packages installed on your machine. Tiles can be created for a set of packages specified with a character vector, or for the loaded packages in your session (all packages attached to the search path except for base packages). 24 | 25 | ## Installation 26 | 27 | You can install the development version of hexsession like so: 28 | 29 | ``` r 30 | # install.packages("remotes) 31 | remotes::install_github("luisdva/hexsession") 32 | ``` 33 | 34 | ## Using hexsession 35 | 36 | With hexsession installed, we can create a self-contained HTML file with tiled hex logos for all loaded packages in a session. If a package does not have a logo bundled in `man/figures/` or if the image cannot be found easily, a generic-looking logo with the package name will be generated. 37 | 38 | * svg files are internally converted to png 39 | * If the images bundled with a package do not match 'hex' or 'logo', or there are multiple possible options, users are prompted to specify which file to use. 40 | 41 | 42 | 43 | For a given session with libraries loaded in addition to base packages: 44 | 45 | ```{r example, eval=FALSE} 46 | library(hexsession) 47 | make_tile() 48 | 49 | # custom set of packages 50 | make_tile(packages=c("terra","sf","tidyr")) 51 | ``` 52 | 53 | The `make_tile()` function will render the HTML output in a new folder in the working directory using a Quarto template file that will also be copied to this new directory. 54 | 55 | For a session with the following packages loaded: 56 | 57 | ```{r, eval=FALSE} 58 | library(annotater) 59 | library(ggforce) 60 | library(purrr) 61 | library(forcats) 62 | library(unheadr) 63 | library(sdmTMB) 64 | library(parsnip) 65 | library(DBI) 66 | library(broom) 67 | library(vctrs) 68 | library(patchwork) 69 | 70 | 71 | hexsession::make_tile() 72 | ``` 73 | 74 | The output would look like this: 75 | ![](man/figures/hsdemo.gif) 76 | _I don't know how to show the rendered interactive file on the GitHub readme, if anyone does please let me know 😅._ 77 | 78 | Once downloaded to your machine and opened in a browser, the [hexout_example.html](inst/extdata/hexout_example.html) shows the interactive, responsive HTML version with cool hover effects that adapts to the size of the browser window and includes hyperlinks to each package website. 79 | 80 | To save a static version of the hex tile, we call `snap_tile()` with a path to the output image and optionally, height and width values to change the viewport size. 81 | 82 | The result: 83 | 84 | ![](man/figures/exampletile.png) 85 | 86 | ### Dark mode 87 | 88 | To draw the tiles on a dark background, set `dark_mode` to `TRUE` when creating or capturing your hex logos. 89 | 90 | ```{r, eval=FALSE} 91 | hexsession::make_tile(dark_mode = TRUE) 92 | hexsession::snap_tile("test.png",dark_mode = TRUE) 93 | ``` 94 | 95 | ## User-provided images and urls 96 | 97 | `make_tile` can now take vectors of additional images and their respective but optional urls to include in the hex grid. 98 | 99 | ```{r, eval=FALSE} 100 | make_tile(packages = c("tidyterra", "sf"), 101 | local_images = c("path/to/your/image1.png", 102 | "path/to/your/image2.png", 103 | local_urls = c("https://an-example.web", "https://another-example.com")) 104 | 105 | ``` 106 | 107 | ## Notes 108 | 109 | This packages depends on working installations of magick, Quarto, and chromote and thus needs a Chromium-based web browser (e.g., Chrome, Chromium, Opera, or Vivaldi) installation. 110 | 111 | hexsession is very much work in progress and highly experimental. I am still learning good-practices for packages that create files and directories, use system commands, and launch browser sessions. 112 | 113 | All feedback is welcome in any form (issues, pull requests, etc.) 114 | 115 | ### Credit and LLM disclosure statement 116 | 117 | - css and html code for the responsive hex grid comes from [this tutorial](https://css-tricks.com/hexagons-and-beyond-flexible-responsive-grid-patterns-sans-media-queries/) by Temani Afif. 118 | 119 | - the javascript code to populate the divs in the Quarto template was written with input from the Claude 3.5 Sonnet LLM running in the Continue extension in the Positron IDE. 120 | 121 | 122 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # hexsession 5 | 6 | 7 | 8 | [![Lifecycle: 9 | experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) 10 | [![CRAN 11 | status](https://www.r-pkg.org/badges/version/hexsession)](https://CRAN.R-project.org/package=hexsession) 12 | 13 | 14 | The goal of hexsession is to create a tile of hexagonal logos for 15 | packages installed on your machine. Tiles can be created for a set of 16 | packages specified with a character vector, or for the loaded packages 17 | in your session (all packages attached to the search path except for 18 | base packages). 19 | 20 | ## Installation 21 | 22 | You can install the development version of hexsession like so: 23 | 24 | ``` r 25 | # install.packages("remotes) 26 | remotes::install_github("luisdva/hexsession") 27 | ``` 28 | 29 | ## Using hexsession 30 | 31 | With hexsession installed, we can create a self-contained HTML file with 32 | tiled hex logos for all loaded packages in a session. If a package does 33 | not have a logo bundled in `man/figures/` or if the image cannot be 34 | found easily, a generic-looking logo with the package name will be 35 | generated. 36 | 37 | - svg files are internally converted to png 38 | - If the images bundled with a package do not match ‘hex’ or ‘logo’, or 39 | there are multiple possible options, users are prompted to specify 40 | which file to use. 41 | 42 | For a given session with libraries loaded in addition to base packages: 43 | 44 | ``` r 45 | library(hexsession) 46 | make_tile() 47 | 48 | # custom set of packages 49 | make_tile(packages=c("terra","sf","tidyr")) 50 | ``` 51 | 52 | The `make_tile()` function will render the HTML output in a new folder 53 | in the working directory using a Quarto template file that will also be 54 | copied to this new directory. 55 | 56 | For a session with the following packages loaded: 57 | 58 | ``` r 59 | library(annotater) 60 | library(ggforce) 61 | library(purrr) 62 | library(forcats) 63 | library(unheadr) 64 | library(sdmTMB) 65 | library(parsnip) 66 | library(DBI) 67 | library(broom) 68 | library(vctrs) 69 | library(patchwork) 70 | 71 | 72 | hexsession::make_tile() 73 | ``` 74 | 75 | The output would look like this: ![](man/figures/hsdemo.gif) *I don’t 76 | know how to show the rendered interactive file on the GitHub readme, if 77 | anyone does please let me know 😅.* 78 | 79 | Once downloaded to your machine and opened in a browser, the 80 | [hexout_example.html](inst/extdata/hexout_example.html) shows the 81 | interactive, responsive HTML version with cool hover effects that adapts 82 | to the size of the browser window and includes hyperlinks to each 83 | package website. 84 | 85 | To save a static version of the hex tile, we call `snap_tile()` with a 86 | path to the output image and optionally, height and width values to 87 | change the viewport size. 88 | 89 | The result: 90 | 91 | ![](man/figures/exampletile.png) 92 | 93 | ### Dark mode 94 | 95 | To draw the tiles on a dark background, set `dark_mode` to `TRUE` when 96 | creating or capturing your hex logos. 97 | 98 | ``` r 99 | hexsession::make_tile(dark_mode = TRUE) 100 | hexsession::snap_tile("test.png",dark_mode = TRUE) 101 | ``` 102 | 103 | ## User-provided images and urls 104 | 105 | `make_tile` can now take vectors of additional images and their 106 | respective but optional urls to include in the hex grid. 107 | 108 | ``` r 109 | make_tile(packages = c("tidyterra", "sf"), 110 | local_images = c("path/to/your/image1.png", 111 | "path/to/your/image2.png", 112 | local_urls = c("https://an-example.web", "https://another-example.com")) 113 | 114 | ``` 115 | 116 | ## Notes 117 | 118 | This packages depends on working installations of magick, Quarto, and 119 | chromote and thus needs a Chromium-based web browser (e.g., Chrome, 120 | Chromium, Opera, or Vivaldi) installation. 121 | 122 | hexsession is very much work in progress and highly experimental. I am 123 | still learning good-practices for packages that create files and 124 | directories, use system commands, and launch browser sessions. 125 | 126 | All feedback is welcome in any form (issues, pull requests, etc.) 127 | 128 | ### Credit and LLM disclosure statement 129 | 130 | - css and html code for the responsive hex grid comes from [this 131 | tutorial](https://css-tricks.com/hexagons-and-beyond-flexible-responsive-grid-patterns-sans-media-queries/) 132 | by Temani Afif. 133 | 134 | - the javascript code to populate the divs in the Quarto template was 135 | written with input from the Claude 3.5 Sonnet LLM running in the 136 | Continue extension in the Positron IDE. 137 | -------------------------------------------------------------------------------- /_pkgdown.yml: -------------------------------------------------------------------------------- 1 | url: https://luisdva.github.io/hexsession/ 2 | template: 3 | bootstrap: 5 4 | 5 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | ## R CMD check results 2 | 3 | 0 errors | 0 warnings | 1 note 4 | 5 | * This is a new release. 6 | -------------------------------------------------------------------------------- /docs/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Page not found (404) • hexsession 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Skip to contents 24 | 25 | 26 |
52 |
53 |
57 | 58 | Content not found. Please use links in the navbar. 59 | 60 |
61 |
62 | 63 | 64 |
67 | 68 | 71 | 72 |
73 |
74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | hexsession.liomys.mx 2 | -------------------------------------------------------------------------------- /docs/LICENSE-text.html: -------------------------------------------------------------------------------- 1 | 2 | License • hexsession 3 | Skip to contents 4 | 5 | 6 |
27 |
28 |
32 | 33 |
YEAR: 2024
34 | COPYRIGHT HOLDER: hexsession authors
35 | 
36 | 37 |
38 | 39 | 40 |
43 | 44 | 47 | 48 |
49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/LICENSE.html: -------------------------------------------------------------------------------- 1 | 2 | MIT License • hexsession 3 | Skip to contents 4 | 5 | 6 |
27 |
28 |
32 | 33 |
34 | 35 |

Copyright (c) 2024 hexsession authors

36 |

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

37 |

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

38 |

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

39 |
40 | 41 |
42 | 43 | 44 |
47 | 48 | 51 | 52 |
53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /docs/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/docs/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/authors.html: -------------------------------------------------------------------------------- 1 | 2 | Authors and Citation • hexsession 3 | Skip to contents 4 | 5 | 6 |
27 |
28 |
31 | 32 |
33 |

Authors

34 | 35 |
  • 36 |

    Luis D. Verde Arregoitia. Author, maintainer. 37 |

    38 |
  • 39 |
40 | 41 |
42 |

Citation

43 |

Source: DESCRIPTION

44 | 45 |

Verde Arregoitia L (2024). 46 | hexsession: Create a tile of logos for loaded packages. 47 | R package version 0.0.0.9000, https://luisdva.github.io/hexsession/, https://github.com/luisDVA/hexsession. 48 |

49 |
@Manual{,
50 |   title = {hexsession: Create a tile of logos for loaded packages},
51 |   author = {Luis D. {Verde Arregoitia}},
52 |   year = {2024},
53 |   note = {R package version 0.0.0.9000, https://luisdva.github.io/hexsession/},
54 |   url = {https://github.com/luisDVA/hexsession},
55 | }
56 |
57 | 58 |
60 | 61 | 62 |
65 | 66 | 69 | 70 |
71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /docs/deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Table of Contents v1.0.1 (http://afeld.github.io/bootstrap-toc/) 3 | * Copyright 2015 Aidan Feldman 4 | * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ 5 | !function(a){"use strict";window.Toc={helpers:{findOrFilter:function(e,t){var n=e.find(t);return e.filter(t).add(n).filter(":not([data-toc-skip])")},generateUniqueIdBase:function(e){return a(e).text().trim().replace(/\'/gi,"").replace(/[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\\n\t\b\v]/g,"-").replace(/-{2,}/g,"-").substring(0,64).replace(/^-+|-+$/gm,"").toLowerCase()||e.tagName.toLowerCase()},generateUniqueId:function(e){for(var t=this.generateUniqueIdBase(e),n=0;;n++){var r=t;if(0')},createChildNavList:function(e){var t=this.createNavList();return e.append(t),t},generateNavEl:function(e,t){var n=a('');n.attr("href","#"+e),n.text(t);var r=a("
  • ");return r.append(n),r},generateNavItem:function(e){var t=this.generateAnchor(e),n=a(e),r=n.data("toc-text")||n.text();return this.generateNavEl(t,r)},getTopLevel:function(e){for(var t=1;t<=6;t++){if(1 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/docs/deps/font-awesome-6.4.2/webfonts/fa-brands-400.ttf -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-brands-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/docs/deps/font-awesome-6.4.2/webfonts/fa-brands-400.woff2 -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/docs/deps/font-awesome-6.4.2/webfonts/fa-regular-400.ttf -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-regular-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/docs/deps/font-awesome-6.4.2/webfonts/fa-regular-400.woff2 -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/docs/deps/font-awesome-6.4.2/webfonts/fa-solid-900.ttf -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/docs/deps/font-awesome-6.4.2/webfonts/fa-solid-900.woff2 -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-v4compatibility.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/docs/deps/font-awesome-6.4.2/webfonts/fa-v4compatibility.ttf -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-v4compatibility.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/docs/deps/font-awesome-6.4.2/webfonts/fa-v4compatibility.woff2 -------------------------------------------------------------------------------- /docs/deps/headroom-0.11.0/headroom.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * headroom.js v0.11.0 - Give your page some headroom. Hide your header until you need it 3 | * Copyright (c) 2020 Nick Williams - http://wicky.nillia.ms/headroom.js 4 | * License: MIT 5 | */ 6 | 7 | !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).Headroom=n()}(this,function(){"use strict";function t(){return"undefined"!=typeof window}function d(t){return function(t){return t&&t.document&&function(t){return 9===t.nodeType}(t.document)}(t)?function(t){var n=t.document,o=n.body,s=n.documentElement;return{scrollHeight:function(){return Math.max(o.scrollHeight,s.scrollHeight,o.offsetHeight,s.offsetHeight,o.clientHeight,s.clientHeight)},height:function(){return t.innerHeight||s.clientHeight||o.clientHeight},scrollY:function(){return void 0!==t.pageYOffset?t.pageYOffset:(s||o.parentNode||o).scrollTop}}}(t):function(t){return{scrollHeight:function(){return Math.max(t.scrollHeight,t.offsetHeight,t.clientHeight)},height:function(){return Math.max(t.offsetHeight,t.clientHeight)},scrollY:function(){return t.scrollTop}}}(t)}function n(t,s,e){var n,o=function(){var n=!1;try{var t={get passive(){n=!0}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){n=!1}return n}(),i=!1,r=d(t),l=r.scrollY(),a={};function c(){var t=Math.round(r.scrollY()),n=r.height(),o=r.scrollHeight();a.scrollY=t,a.lastScrollY=l,a.direction=ls.tolerance[a.direction],e(a),l=t,i=!1}function h(){i||(i=!0,n=requestAnimationFrame(c))}var u=!!o&&{passive:!0,capture:!1};return t.addEventListener("scroll",h,u),c(),{destroy:function(){cancelAnimationFrame(n),t.removeEventListener("scroll",h,u)}}}function o(t,n){n=n||{},Object.assign(this,o.options,n),this.classes=Object.assign({},o.options.classes,n.classes),this.elem=t,this.tolerance=function(t){return t===Object(t)?t:{down:t,up:t}}(this.tolerance),this.initialised=!1,this.frozen=!1}return o.prototype={constructor:o,init:function(){return o.cutsTheMustard&&!this.initialised&&(this.addClass("initial"),this.initialised=!0,setTimeout(function(t){t.scrollTracker=n(t.scroller,{offset:t.offset,tolerance:t.tolerance},t.update.bind(t))},100,this)),this},destroy:function(){this.initialised=!1,Object.keys(this.classes).forEach(this.removeClass,this),this.scrollTracker.destroy()},unpin:function(){!this.hasClass("pinned")&&this.hasClass("unpinned")||(this.addClass("unpinned"),this.removeClass("pinned"),this.onUnpin&&this.onUnpin.call(this))},pin:function(){this.hasClass("unpinned")&&(this.addClass("pinned"),this.removeClass("unpinned"),this.onPin&&this.onPin.call(this))},freeze:function(){this.frozen=!0,this.addClass("frozen")},unfreeze:function(){this.frozen=!1,this.removeClass("frozen")},top:function(){this.hasClass("top")||(this.addClass("top"),this.removeClass("notTop"),this.onTop&&this.onTop.call(this))},notTop:function(){this.hasClass("notTop")||(this.addClass("notTop"),this.removeClass("top"),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){this.hasClass("bottom")||(this.addClass("bottom"),this.removeClass("notBottom"),this.onBottom&&this.onBottom.call(this))},notBottom:function(){this.hasClass("notBottom")||(this.addClass("notBottom"),this.removeClass("bottom"),this.onNotBottom&&this.onNotBottom.call(this))},shouldUnpin:function(t){return"down"===t.direction&&!t.top&&t.toleranceExceeded},shouldPin:function(t){return"up"===t.direction&&t.toleranceExceeded||t.top},addClass:function(t){this.elem.classList.add.apply(this.elem.classList,this.classes[t].split(" "))},removeClass:function(t){this.elem.classList.remove.apply(this.elem.classList,this.classes[t].split(" "))},hasClass:function(t){return this.classes[t].split(" ").every(function(t){return this.classList.contains(t)},this.elem)},update:function(t){t.isOutOfBounds||!0!==this.frozen&&(t.top?this.top():this.notTop(),t.bottom?this.bottom():this.notBottom(),this.shouldUnpin(t)?this.unpin():this.shouldPin(t)&&this.pin())}},o.options={tolerance:{up:0,down:0},offset:0,scroller:t()?window:null,classes:{frozen:"headroom--frozen",pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},o.cutsTheMustard=!!(t()&&function(){}.bind&&"classList"in document.documentElement&&Object.assign&&Object.keys&&requestAnimationFrame),o}); -------------------------------------------------------------------------------- /docs/deps/headroom-0.11.0/jQuery.headroom.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * headroom.js v0.9.4 - Give your page some headroom. Hide your header until you need it 3 | * Copyright (c) 2017 Nick Williams - http://wicky.nillia.ms/headroom.js 4 | * License: MIT 5 | */ 6 | 7 | !function(a){a&&(a.fn.headroom=function(b){return this.each(function(){var c=a(this),d=c.data("headroom"),e="object"==typeof b&&b;e=a.extend(!0,{},Headroom.options,e),d||(d=new Headroom(this,e),d.init(),c.data("headroom",d)),"string"==typeof b&&(d[b](),"destroy"===b&&c.removeData("headroom"))})},a("[data-headroom]").each(function(){var b=a(this);b.headroom(b.data())}))}(window.Zepto||window.jQuery); -------------------------------------------------------------------------------- /docs/deps/search-1.0.0/mark.min.js: -------------------------------------------------------------------------------- 1 | /*!*************************************************** 2 | * mark.js v8.11.1 3 | * https://markjs.io/ 4 | * Copyright (c) 2014–2018, Julian Kühnel 5 | * Released under the MIT license https://git.io/vwTVl 6 | *****************************************************/ 7 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Mark=t()}(this,function(){"use strict";var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},n=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;t(this,e),this.ctx=n,this.iframes=r,this.exclude=i,this.iframesTimeout=o}return n(e,[{key:"getContexts",value:function(){var e=[];return(void 0!==this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx]:[]).forEach(function(t){var n=e.filter(function(e){return e.contains(t)}).length>0;-1!==e.indexOf(t)||n||e.push(t)}),e}},{key:"getIframeContents",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=void 0;try{var i=e.contentWindow;if(r=i.document,!i||!r)throw new Error("iframe inaccessible")}catch(e){n()}r&&t(r)}},{key:"isIframeBlank",value:function(e){var t=e.getAttribute("src").trim();return"about:blank"===e.contentWindow.location.href&&"about:blank"!==t&&t}},{key:"observeIframeLoad",value:function(e,t,n){var r=this,i=!1,o=null,a=function a(){if(!i){i=!0,clearTimeout(o);try{r.isIframeBlank(e)||(e.removeEventListener("load",a),r.getIframeContents(e,t,n))}catch(e){n()}}};e.addEventListener("load",a),o=setTimeout(a,this.iframesTimeout)}},{key:"onIframeReady",value:function(e,t,n){try{"complete"===e.contentWindow.document.readyState?this.isIframeBlank(e)?this.observeIframeLoad(e,t,n):this.getIframeContents(e,t,n):this.observeIframeLoad(e,t,n)}catch(e){n()}}},{key:"waitForIframes",value:function(e,t){var n=this,r=0;this.forEachIframe(e,function(){return!0},function(e){r++,n.waitForIframes(e.querySelector("html"),function(){--r||t()})},function(e){e||t()})}},{key:"forEachIframe",value:function(t,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},a=t.querySelectorAll("iframe"),s=a.length,c=0;a=Array.prototype.slice.call(a);var u=function(){--s<=0&&o(c)};s||u(),a.forEach(function(t){e.matches(t,i.exclude)?u():i.onIframeReady(t,function(e){n(t)&&(c++,r(e)),u()},u)})}},{key:"createIterator",value:function(e,t,n){return document.createNodeIterator(e,t,n,!1)}},{key:"createInstanceOnIframe",value:function(t){return new e(t.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(e,t,n){if(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING){if(null===t)return!0;if(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}return!1}},{key:"getIteratorNode",value:function(e){var t=e.previousNode();return{prevNode:t,node:null===t?e.nextNode():e.nextNode()&&e.nextNode()}}},{key:"checkIframeFilter",value:function(e,t,n,r){var i=!1,o=!1;return r.forEach(function(e,t){e.val===n&&(i=t,o=e.handled)}),this.compareNodeIframe(e,t,n)?(!1!==i||o?!1===i||o||(r[i].handled=!0):r.push({val:n,handled:!0}),!0):(!1===i&&r.push({val:n,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(e,t,n,r){var i=this;e.forEach(function(e){e.handled||i.getIframeContents(e.val,function(e){i.createInstanceOnIframe(e).forEachNode(t,n,r)})})}},{key:"iterateThroughNodes",value:function(e,t,n,r,i){for(var o,a=this,s=this.createIterator(t,e,r),c=[],u=[],l=void 0,h=void 0;void 0,o=a.getIteratorNode(s),h=o.prevNode,l=o.node;)this.iframes&&this.forEachIframe(t,function(e){return a.checkIframeFilter(l,h,e,c)},function(t){a.createInstanceOnIframe(t).forEachNode(e,function(e){return u.push(e)},r)}),u.push(l);u.forEach(function(e){n(e)}),this.iframes&&this.handleOpenIframes(c,e,n,r),i()}},{key:"forEachNode",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},o=this.getContexts(),a=o.length;a||i(),o.forEach(function(o){var s=function(){r.iterateThroughNodes(e,o,t,n,function(){--a<=0&&i()})};r.iframes?r.waitForIframes(o,s):s()})}}],[{key:"matches",value:function(e,t){var n="string"==typeof t?[t]:t,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(r){var i=!1;return n.every(function(t){return!r.call(e,t)||(i=!0,!1)}),i}return!1}}]),e}(),o=function(){function o(e){t(this,o),this.ctx=e,this.ie=!1;var n=window.navigator.userAgent;(n.indexOf("MSIE")>-1||n.indexOf("Trident")>-1)&&(this.ie=!0)}return n(o,[{key:"log",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"debug",r=this.opt.log;this.opt.debug&&"object"===(void 0===r?"undefined":e(r))&&"function"==typeof r[n]&&r[n]("mark.js: "+t)}},{key:"escapeStr",value:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createRegExp",value:function(e){return"disabled"!==this.opt.wildcards&&(e=this.setupWildcardsRegExp(e)),e=this.escapeStr(e),Object.keys(this.opt.synonyms).length&&(e=this.createSynonymsRegExp(e)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),this.opt.diacritics&&(e=this.createDiacriticsRegExp(e)),e=this.createMergedBlanksRegExp(e),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.createJoinersRegExp(e)),"disabled"!==this.opt.wildcards&&(e=this.createWildcardsRegExp(e)),e=this.createAccuracyRegExp(e)}},{key:"createSynonymsRegExp",value:function(e){var t=this.opt.synonyms,n=this.opt.caseSensitive?"":"i",r=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(var i in t)if(t.hasOwnProperty(i)){var o=t[i],a="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(i):this.escapeStr(i),s="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(o):this.escapeStr(o);""!==a&&""!==s&&(e=e.replace(new RegExp("("+this.escapeStr(a)+"|"+this.escapeStr(s)+")","gm"+n),r+"("+this.processSynomyms(a)+"|"+this.processSynomyms(s)+")"+r))}return e}},{key:"processSynomyms",value:function(e){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),e}},{key:"setupWildcardsRegExp",value:function(e){return(e=e.replace(/(?:\\)*\?/g,function(e){return"\\"===e.charAt(0)?"?":""})).replace(/(?:\\)*\*/g,function(e){return"\\"===e.charAt(0)?"*":""})}},{key:"createWildcardsRegExp",value:function(e){var t="withSpaces"===this.opt.wildcards;return e.replace(/\u0001/g,t?"[\\S\\s]?":"\\S?").replace(/\u0002/g,t?"[\\S\\s]*?":"\\S*")}},{key:"setupIgnoreJoinersRegExp",value:function(e){return e.replace(/[^(|)\\]/g,function(e,t,n){var r=n.charAt(t+1);return/[(|)\\]/.test(r)||""===r?e:e+"\0"})}},{key:"createJoinersRegExp",value:function(e){var t=[],n=this.opt.ignorePunctuation;return Array.isArray(n)&&n.length&&t.push(this.escapeStr(n.join(""))),this.opt.ignoreJoiners&&t.push("\\u00ad\\u200b\\u200c\\u200d"),t.length?e.split(/\u0000+/).join("["+t.join("")+"]*"):e}},{key:"createDiacriticsRegExp",value:function(e){var t=this.opt.caseSensitive?"":"i",n=this.opt.caseSensitive?["aàáảãạăằắẳẵặâầấẩẫậäåāą","AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćč","CÇĆČ","dđď","DĐĎ","eèéẻẽẹêềếểễệëěēę","EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïī","IÌÍỈĨỊÎÏĪ","lł","LŁ","nñňń","NÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøō","OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rř","RŘ","sšśșş","SŠŚȘŞ","tťțţ","TŤȚŢ","uùúủũụưừứửữựûüůū","UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿ","YÝỲỶỸỴŸ","zžżź","ZŽŻŹ"]:["aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćčCÇĆČ","dđďDĐĎ","eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïīIÌÍỈĨỊÎÏĪ","lłLŁ","nñňńNÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rřRŘ","sšśșşSŠŚȘŞ","tťțţTŤȚŢ","uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿYÝỲỶỸỴŸ","zžżźZŽŻŹ"],r=[];return e.split("").forEach(function(i){n.every(function(n){if(-1!==n.indexOf(i)){if(r.indexOf(n)>-1)return!1;e=e.replace(new RegExp("["+n+"]","gm"+t),"["+n+"]"),r.push(n)}return!0})}),e}},{key:"createMergedBlanksRegExp",value:function(e){return e.replace(/[\s]+/gim,"[\\s]+")}},{key:"createAccuracyRegExp",value:function(e){var t=this,n=this.opt.accuracy,r="string"==typeof n?n:n.value,i="";switch(("string"==typeof n?[]:n.limiters).forEach(function(e){i+="|"+t.escapeStr(e)}),r){case"partially":default:return"()("+e+")";case"complementary":return"()([^"+(i="\\s"+(i||this.escapeStr("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿")))+"]*"+e+"[^"+i+"]*)";case"exactly":return"(^|\\s"+i+")("+e+")(?=$|\\s"+i+")"}}},{key:"getSeparatedKeywords",value:function(e){var t=this,n=[];return e.forEach(function(e){t.opt.separateWordSearch?e.split(" ").forEach(function(e){e.trim()&&-1===n.indexOf(e)&&n.push(e)}):e.trim()&&-1===n.indexOf(e)&&n.push(e)}),{keywords:n.sort(function(e,t){return t.length-e.length}),length:n.length}}},{key:"isNumeric",value:function(e){return Number(parseFloat(e))==e}},{key:"checkRanges",value:function(e){var t=this;if(!Array.isArray(e)||"[object Object]"!==Object.prototype.toString.call(e[0]))return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(e),[];var n=[],r=0;return e.sort(function(e,t){return e.start-t.start}).forEach(function(e){var i=t.callNoMatchOnInvalidRanges(e,r),o=i.start,a=i.end;i.valid&&(e.start=o,e.length=a-o,n.push(e),r=a)}),n}},{key:"callNoMatchOnInvalidRanges",value:function(e,t){var n=void 0,r=void 0,i=!1;return e&&void 0!==e.start?(r=(n=parseInt(e.start,10))+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&r-t>0&&r-n>0?i=!0:(this.log("Ignoring invalid or overlapping range: "+JSON.stringify(e)),this.opt.noMatch(e))):(this.log("Ignoring invalid range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:n,end:r,valid:i}}},{key:"checkWhitespaceRanges",value:function(e,t,n){var r=void 0,i=!0,o=n.length,a=t-o,s=parseInt(e.start,10)-a;return(r=(s=s>o?o:s)+parseInt(e.length,10))>o&&(r=o,this.log("End range automatically set to the max value of "+o)),s<0||r-s<0||s>o||r>o?(i=!1,this.log("Invalid range: "+JSON.stringify(e)),this.opt.noMatch(e)):""===n.substring(s,r).replace(/\s+/g,"")&&(i=!1,this.log("Skipping whitespace only range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:s,end:r,valid:i}}},{key:"getTextNodes",value:function(e){var t=this,n="",r=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,function(e){r.push({start:n.length,end:(n+=e.textContent).length,node:e})},function(e){return t.matchesExclude(e.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},function(){e({value:n,nodes:r})})}},{key:"matchesExclude",value:function(e){return i.matches(e,this.opt.exclude.concat(["script","style","title","head","html"]))}},{key:"wrapRangeInTextNode",value:function(e,t,n){var r=this.opt.element?this.opt.element:"mark",i=e.splitText(t),o=i.splitText(n-t),a=document.createElement(r);return a.setAttribute("data-markjs","true"),this.opt.className&&a.setAttribute("class",this.opt.className),a.textContent=i.textContent,i.parentNode.replaceChild(a,i),o}},{key:"wrapRangeInMappedTextNode",value:function(e,t,n,r,i){var o=this;e.nodes.every(function(a,s){var c=e.nodes[s+1];if(void 0===c||c.start>t){if(!r(a.node))return!1;var u=t-a.start,l=(n>a.end?a.end:n)-a.start,h=e.value.substr(0,a.start),f=e.value.substr(l+a.start);if(a.node=o.wrapRangeInTextNode(a.node,u,l),e.value=h+f,e.nodes.forEach(function(t,n){n>=s&&(e.nodes[n].start>0&&n!==s&&(e.nodes[n].start-=l),e.nodes[n].end-=l)}),n-=l,i(a.node.previousSibling,a.start),!(n>a.end))return!1;t=a.end}return!0})}},{key:"wrapMatches",value:function(e,t,n,r,i){var o=this,a=0===t?0:t+1;this.getTextNodes(function(t){t.nodes.forEach(function(t){t=t.node;for(var i=void 0;null!==(i=e.exec(t.textContent))&&""!==i[a];)if(n(i[a],t)){var s=i.index;if(0!==a)for(var c=1;c 2 | 3 | 4 | 5 | 6 | 7 | 8 | Create a tile of logos for loaded packages • hexsession 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Skip to contents 26 | 27 | 28 |
    54 |
    55 |
    56 | 60 | 61 | 62 |

    The goal of hexsession is to create a tile of hexagonal logos for packages installed on your machine. Tiles can be created for a set of packages specified with a character vector, or for the loaded packages in your session (all packages attached to the search path except for base packages).

    63 |
    64 |

    Installation 65 |

    66 |

    You can install the development version of hexsession like so:

    67 |
     68 | # install.packages("remotes)
     69 | remotes::install_github("luisdva/hexsession")
    70 |
    71 |
    72 |

    Using hexsession 73 |

    74 |

    With hexsession installed, we can create a self-contained HTML file with tiled hex logos for all loaded packages in a session. If a package does not have a logo bundled in man/figures/ or if the image cannot be found easily, a generic-looking logo with the package name will be generated.

    75 |
      76 |
    • svg files are internally converted to png
    • 77 |
    • If the images bundled with a package do not match ‘logo’, a users are prompted to specify which file to use.
    • 78 |
    79 |

    For a given session with libraries loaded in addition to base packages:

    80 |
     81 | library(hexsession)
     82 | make_tile()
     83 | 
     84 | # custom set of packages
     85 | make_tile(packages=c("terra","sf","tidyr"))
    86 |

    The make_tile() function will render the HTML output in a new folder in the working directory using a Quarto template file that will also be copied to this new directory.

    87 |

    For a session with the following packages loaded:

    88 |
     89 | library(annotater)
     90 | library(ggforce)
     91 | library(purrr)
     92 | library(forcats)
     93 | library(unheadr)
     94 | library(sdmTMB)
     95 | library(parsnip)
     96 | library(DBI)
     97 | library(broom)
     98 | library(vctrs)
     99 | library(patchwork)
    100 | 
    101 | 
    102 | hexsession::make_tile()
    103 |

    The output would look like this: I don’t know how to show the rendered interactive file on the GitHub readme, if anyone does please let me know 😅.

    104 |

    Once downloaded to your machine and opened in a browser, the hexout_example.html shows the interactive, responsive HTML version with cool hover effects that adapts to the size of the browser window and includes hyperlinks to each package website.

    105 |

    To save a static version of the hex tile, we call snap_tile() with a path to the output image and optionally, height and width values to change the viewport size.

    106 |

    The result:

    107 |

    108 |
    109 |

    Dark mode 110 |

    111 |

    To draw the tiles on a dark background, set dark_mode to TRUE when creating or capturing your hex logos.

    112 |
    113 | hexsession::make_tile(dark_mode = TRUE)
    114 | hexsession::snap_tile("test.png",dark_mode = TRUE)
    115 |
    116 |
    117 |
    118 |

    Notes 119 |

    120 |

    This packages depends on working installations of magick, Quarto, and chromote and thus needs a Chromium-based web browser (e.g., Chrome, Chromium, Opera, or Vivaldi) installation.

    121 |

    hexsession is very much work in progress and highly experimental. I am still learning good-practices for packages that create files and directories, use system commands, and launch browser sessions.

    122 |

    All feedback is welcome in any form (issues, pull requests, etc.)

    123 |
    124 |

    Credit and LLM disclosure statement 125 |

    126 |
      127 |
    • css and html code for the responsive hex grid comes from this tutorial by Temani Afif.

    • 128 |
    • the javascript code to populate the divs in the Quarto template was written with input from the Claude 3.5 Sonnet LLM running in the Continue extension in the Positron IDE.

    • 129 |
    130 |
    131 |
    132 |
    133 |
    173 |
    174 | 175 | 176 |
    179 | 180 | 183 | 184 |
    185 |
    186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | -------------------------------------------------------------------------------- /docs/katex-auto.js: -------------------------------------------------------------------------------- 1 | // https://github.com/jgm/pandoc/blob/29fa97ab96b8e2d62d48326e1b949a71dc41f47a/src/Text/Pandoc/Writers/HTML.hs#L332-L345 2 | document.addEventListener("DOMContentLoaded", function () { 3 | var mathElements = document.getElementsByClassName("math"); 4 | var macros = []; 5 | for (var i = 0; i < mathElements.length; i++) { 6 | var texText = mathElements[i].firstChild; 7 | if (mathElements[i].tagName == "SPAN") { 8 | katex.render(texText.data, mathElements[i], { 9 | displayMode: mathElements[i].classList.contains("display"), 10 | throwOnError: false, 11 | macros: macros, 12 | fleqn: false 13 | }); 14 | }}}); 15 | -------------------------------------------------------------------------------- /docs/lightswitch.js: -------------------------------------------------------------------------------- 1 | 2 | /*! 3 | * Color mode toggler for Bootstrap's docs (https://getbootstrap.com/) 4 | * Copyright 2011-2023 The Bootstrap Authors 5 | * Licensed under the Creative Commons Attribution 3.0 Unported License. 6 | * Updates for {pkgdown} by the {bslib} authors, also licensed under CC-BY-3.0. 7 | */ 8 | 9 | const getStoredTheme = () => localStorage.getItem('theme') 10 | const setStoredTheme = theme => localStorage.setItem('theme', theme) 11 | 12 | const getPreferredTheme = () => { 13 | const storedTheme = getStoredTheme() 14 | if (storedTheme) { 15 | return storedTheme 16 | } 17 | 18 | return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' 19 | } 20 | 21 | const setTheme = theme => { 22 | if (theme === 'auto') { 23 | document.documentElement.setAttribute('data-bs-theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) 24 | } else { 25 | document.documentElement.setAttribute('data-bs-theme', theme) 26 | } 27 | } 28 | 29 | function bsSetupThemeToggle () { 30 | 'use strict' 31 | 32 | const showActiveTheme = (theme, focus = false) => { 33 | var activeLabel, activeIcon; 34 | 35 | document.querySelectorAll('[data-bs-theme-value]').forEach(element => { 36 | const buttonTheme = element.getAttribute('data-bs-theme-value') 37 | const isActive = buttonTheme == theme 38 | 39 | element.classList.toggle('active', isActive) 40 | element.setAttribute('aria-pressed', isActive) 41 | 42 | if (isActive) { 43 | activeLabel = element.textContent; 44 | activeIcon = element.querySelector('span').classList.value; 45 | } 46 | }) 47 | 48 | const themeSwitcher = document.querySelector('#dropdown-lightswitch') 49 | if (!themeSwitcher) { 50 | return 51 | } 52 | 53 | themeSwitcher.setAttribute('aria-label', activeLabel) 54 | themeSwitcher.querySelector('span').classList.value = activeIcon; 55 | 56 | if (focus) { 57 | themeSwitcher.focus() 58 | } 59 | } 60 | 61 | window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => { 62 | const storedTheme = getStoredTheme() 63 | if (storedTheme !== 'light' && storedTheme !== 'dark') { 64 | setTheme(getPreferredTheme()) 65 | } 66 | }) 67 | 68 | window.addEventListener('DOMContentLoaded', () => { 69 | showActiveTheme(getPreferredTheme()) 70 | 71 | document 72 | .querySelectorAll('[data-bs-theme-value]') 73 | .forEach(toggle => { 74 | toggle.addEventListener('click', () => { 75 | const theme = toggle.getAttribute('data-bs-theme-value') 76 | setTheme(theme) 77 | setStoredTheme(theme) 78 | showActiveTheme(theme, true) 79 | }) 80 | }) 81 | }) 82 | } 83 | 84 | setTheme(getPreferredTheme()); 85 | bsSetupThemeToggle(); 86 | -------------------------------------------------------------------------------- /docs/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /docs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/docs/logo.png -------------------------------------------------------------------------------- /docs/pkgdown.js: -------------------------------------------------------------------------------- 1 | /* http://gregfranko.com/blog/jquery-best-practices/ */ 2 | (function($) { 3 | $(function() { 4 | 5 | $('nav.navbar').headroom(); 6 | 7 | Toc.init({ 8 | $nav: $("#toc"), 9 | $scope: $("main h2, main h3, main h4, main h5, main h6") 10 | }); 11 | 12 | if ($('#toc').length) { 13 | $('body').scrollspy({ 14 | target: '#toc', 15 | offset: $("nav.navbar").outerHeight() + 1 16 | }); 17 | } 18 | 19 | // Activate popovers 20 | $('[data-bs-toggle="popover"]').popover({ 21 | container: 'body', 22 | html: true, 23 | trigger: 'focus', 24 | placement: "top", 25 | sanitize: false, 26 | }); 27 | 28 | $('[data-bs-toggle="tooltip"]').tooltip(); 29 | 30 | /* Clipboard --------------------------*/ 31 | 32 | function changeTooltipMessage(element, msg) { 33 | var tooltipOriginalTitle=element.getAttribute('data-bs-original-title'); 34 | element.setAttribute('data-bs-original-title', msg); 35 | $(element).tooltip('show'); 36 | element.setAttribute('data-bs-original-title', tooltipOriginalTitle); 37 | } 38 | 39 | if(ClipboardJS.isSupported()) { 40 | $(document).ready(function() { 41 | var copyButton = ""; 42 | 43 | $("div.sourceCode").addClass("hasCopyButton"); 44 | 45 | // Insert copy buttons: 46 | $(copyButton).prependTo(".hasCopyButton"); 47 | 48 | // Initialize tooltips: 49 | $('.btn-copy-ex').tooltip({container: 'body'}); 50 | 51 | // Initialize clipboard: 52 | var clipboard = new ClipboardJS('[data-clipboard-copy]', { 53 | text: function(trigger) { 54 | return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); 55 | } 56 | }); 57 | 58 | clipboard.on('success', function(e) { 59 | changeTooltipMessage(e.trigger, 'Copied!'); 60 | e.clearSelection(); 61 | }); 62 | 63 | clipboard.on('error', function(e) { 64 | changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); 65 | }); 66 | 67 | }); 68 | } 69 | 70 | /* Search marking --------------------------*/ 71 | var url = new URL(window.location.href); 72 | var toMark = url.searchParams.get("q"); 73 | var mark = new Mark("main#main"); 74 | if (toMark) { 75 | mark.mark(toMark, { 76 | accuracy: { 77 | value: "complementary", 78 | limiters: [",", ".", ":", "/"], 79 | } 80 | }); 81 | } 82 | 83 | /* Search --------------------------*/ 84 | /* Adapted from https://github.com/rstudio/bookdown/blob/2d692ba4b61f1e466c92e78fd712b0ab08c11d31/inst/resources/bs4_book/bs4_book.js#L25 */ 85 | // Initialise search index on focus 86 | var fuse; 87 | $("#search-input").focus(async function(e) { 88 | if (fuse) { 89 | return; 90 | } 91 | 92 | $(e.target).addClass("loading"); 93 | var response = await fetch($("#search-input").data("search-index")); 94 | var data = await response.json(); 95 | 96 | var options = { 97 | keys: ["what", "text", "code"], 98 | ignoreLocation: true, 99 | threshold: 0.1, 100 | includeMatches: true, 101 | includeScore: true, 102 | }; 103 | fuse = new Fuse(data, options); 104 | 105 | $(e.target).removeClass("loading"); 106 | }); 107 | 108 | // Use algolia autocomplete 109 | var options = { 110 | autoselect: true, 111 | debug: true, 112 | hint: false, 113 | minLength: 2, 114 | }; 115 | var q; 116 | async function searchFuse(query, callback) { 117 | await fuse; 118 | 119 | var items; 120 | if (!fuse) { 121 | items = []; 122 | } else { 123 | q = query; 124 | var results = fuse.search(query, { limit: 20 }); 125 | items = results 126 | .filter((x) => x.score <= 0.75) 127 | .map((x) => x.item); 128 | if (items.length === 0) { 129 | items = [{dir:"Sorry 😿",previous_headings:"",title:"No results found.",what:"No results found.",path:window.location.href}]; 130 | } 131 | } 132 | callback(items); 133 | } 134 | $("#search-input").autocomplete(options, [ 135 | { 136 | name: "content", 137 | source: searchFuse, 138 | templates: { 139 | suggestion: (s) => { 140 | if (s.title == s.what) { 141 | return `${s.dir} >
    ${s.title}
    `; 142 | } else if (s.previous_headings == "") { 143 | return `${s.dir} >
    ${s.title}
    > ${s.what}`; 144 | } else { 145 | return `${s.dir} >
    ${s.title}
    > ${s.previous_headings} > ${s.what}`; 146 | } 147 | }, 148 | }, 149 | }, 150 | ]).on('autocomplete:selected', function(event, s) { 151 | window.location.href = s.path + "?q=" + q + "#" + s.id; 152 | }); 153 | }); 154 | })(window.jQuery || window.$) 155 | 156 | document.addEventListener('keydown', function(event) { 157 | // Check if the pressed key is '/' 158 | if (event.key === '/') { 159 | event.preventDefault(); // Prevent any default action associated with the '/' key 160 | document.getElementById('search-input').focus(); // Set focus to the search input 161 | } 162 | }); 163 | -------------------------------------------------------------------------------- /docs/pkgdown.yml: -------------------------------------------------------------------------------- 1 | pandoc: 3.1.11 2 | pkgdown: 2.1.1.9000 3 | pkgdown_sha: 0cb9d38d1dc25946f01ee7500be9665985d8784e 4 | articles: {} 5 | last_built: 2024-10-30T23:29Z 6 | urls: 7 | reference: https://luisdva.github.io/hexsession/reference 8 | article: https://luisdva.github.io/hexsession/articles 9 | -------------------------------------------------------------------------------- /docs/reference/encode_image.html: -------------------------------------------------------------------------------- 1 | 2 | Encode image to Base64 — encode_image • hexsession 3 | Skip to contents 4 | 5 | 6 |
    27 |
    28 |
    33 | 34 |
    35 |

    Encode image to Base64

    36 |
    37 | 38 |
    39 |

    Usage

    40 |
    encode_image(file_path)
    41 |
    42 | 43 |
    44 |

    Arguments

    45 | 46 | 47 |
    file_path
    48 |

    Path to an image file

    49 | 50 |
    51 |
    52 |

    Value

    53 |

    Base64 encoded string of the image

    54 |
    55 | 56 |
    58 | 59 | 60 |
    63 | 64 | 67 | 68 |
    69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /docs/reference/figures/exampletile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/docs/reference/figures/exampletile.png -------------------------------------------------------------------------------- /docs/reference/figures/hsdemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/docs/reference/figures/hsdemo.gif -------------------------------------------------------------------------------- /docs/reference/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/docs/reference/figures/logo.png -------------------------------------------------------------------------------- /docs/reference/find_imgpaths.html: -------------------------------------------------------------------------------- 1 | 2 | Find image paths — find_imgpaths • hexsession 3 | Skip to contents 4 | 5 | 6 |
    27 |
    28 |
    33 | 34 |
    35 |

    Find image paths

    36 |
    37 | 38 |
    39 |

    Usage

    40 |
    find_imgpaths(pkgnames)
    41 |
    42 | 43 |
    44 |

    Arguments

    45 | 46 | 47 |
    pkgnames
    48 |

    Character vector of package names

    49 | 50 |
    51 |
    52 |

    Value

    53 |

    A list of image file paths for each package

    54 |
    55 |
    56 |

    Details

    57 |

    Images in svg format will be converted to png. When no image matches 'logo' 58 | in the file name the used is will be prompted to select likely logos.

    59 |
    60 | 61 |
    63 | 64 | 65 |
    68 | 69 | 72 | 73 |
    74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /docs/reference/find_logopaths.html: -------------------------------------------------------------------------------- 1 | 2 | Find logo paths — find_logopaths • hexsession 3 | Skip to contents 4 | 5 | 6 |
    27 |
    28 |
    33 | 34 |
    35 |

    Find logo paths

    36 |
    37 | 38 |
    39 |

    Usage

    40 |
    find_logopaths(imagepaths, pkgnames)
    41 |
    42 | 43 |
    44 |

    Arguments

    45 | 46 | 47 |
    imagepaths
    48 |

    List of image paths

    49 | 50 | 51 |
    pkgnames
    52 |

    Character vector of package names

    53 | 54 |
    55 |
    56 |

    Value

    57 |

    A vector of logo paths

    58 |
    59 | 60 |
    62 | 63 | 64 |
    67 | 68 | 71 | 72 |
    73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /docs/reference/generate_hexsession_js.html: -------------------------------------------------------------------------------- 1 | 2 | Generate JavaScript file for hexsession — generate_hexsession_js • hexsession 3 | Skip to contents 4 | 5 | 6 |
    27 |
    28 |
    33 | 34 |
    35 |

    Generate JavaScript file for hexsession

    36 |
    37 | 38 |
    39 |

    Usage

    40 |
    generate_hexsession_js(logopaths, urls, dark_mode, output_js)
    41 |
    42 | 43 |
    44 |

    Arguments

    45 | 46 | 47 |
    logopaths
    48 |

    Vector of image paths

    49 | 50 | 51 |
    urls
    52 |

    Vector of URLs

    53 | 54 | 55 |
    dark_mode
    56 |

    Use dark mode, inherited from make_tile

    57 | 58 | 59 |
    output_js
    60 |

    Path to save the JavaScript file

    61 | 62 |
    63 | 64 |
    66 | 67 | 68 |
    71 | 72 | 75 | 76 |
    77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /docs/reference/getLoaded.html: -------------------------------------------------------------------------------- 1 | 2 | Get loaded packages — getLoaded • hexsession 3 | Skip to contents 4 | 5 | 6 |
    27 |
    28 |
    33 | 34 |
    35 |

    Get loaded packages

    36 |
    37 | 38 |
    39 |

    Usage

    40 |
    getLoaded()
    41 |
    42 | 43 |
    44 |

    Value

    45 |

    A character vector of the attached packages (excludes base packages)

    46 |
    47 | 48 |
    50 | 51 | 52 |
    55 | 56 | 59 | 60 |
    61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /docs/reference/get_pkg_data.html: -------------------------------------------------------------------------------- 1 | 2 | Get package data — get_pkg_data • hexsession 3 | Skip to contents 4 | 5 | 6 |
    27 |
    28 |
    33 | 34 |
    35 |

    Get package data

    36 |
    37 | 38 |
    39 |

    Usage

    40 |
    get_pkg_data(packages = NULL)
    41 |
    42 | 43 |
    44 |

    Arguments

    45 | 46 | 47 |
    packages
    48 |

    Character vector of package names (default is NULL, uses loaded packages)

    49 | 50 |
    51 |
    52 |

    Value

    53 |

    A list containing logopaths and urls for the packages

    54 |
    55 | 56 |
    58 | 59 | 60 |
    63 | 64 | 67 | 68 |
    69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /docs/reference/index.html: -------------------------------------------------------------------------------- 1 | 2 | Package index • hexsession 3 | Skip to contents 4 | 5 | 6 |
    27 |
    28 |
    31 | 32 |
    33 |

    All functions

    34 | 35 | 36 | 37 | 38 |
    39 | 40 | 41 | 42 | 43 |
    44 | 45 | encode_image() 46 | 47 |
    48 |
    Encode image to Base64
    49 |
    50 | 51 | find_imgpaths() 52 | 53 |
    54 |
    Find image paths
    55 |
    56 | 57 | find_logopaths() 58 | 59 |
    60 |
    Find logo paths
    61 |
    62 | 63 | generate_hexsession_js() 64 | 65 |
    66 |
    Generate JavaScript file for hexsession
    67 |
    68 | 69 | getLoaded() 70 | 71 |
    72 |
    Get loaded packages
    73 |
    74 | 75 | get_pkg_data() 76 | 77 |
    78 |
    Get package data
    79 |
    80 | 81 | make_missingLogos() 82 | 83 |
    84 |
    Create missing logos
    85 |
    86 | 87 | make_tile() 88 | 89 |
    90 |
    Generate tile of package logos
    91 |
    92 | 93 | pkgurls() 94 | 95 |
    96 |
    Get package URLs
    97 |
    98 | 99 | snap_tile() 100 | 101 |
    102 |
    Take screenshot of html image tile
    103 |
    104 |
    105 | 106 | 107 |
    110 | 111 | 114 | 115 |
    116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /docs/reference/make_missingLogos.html: -------------------------------------------------------------------------------- 1 | 2 | Create missing logos — make_missingLogos • hexsession 3 | Skip to contents 4 | 5 | 6 |
    27 |
    28 |
    33 | 34 |
    35 |

    Create missing logos

    36 |
    37 | 38 |
    39 |

    Usage

    40 |
    make_missingLogos(attached_pkgs, logopaths)
    41 |
    42 | 43 |
    44 |

    Arguments

    45 | 46 | 47 |
    attached_pkgs
    48 |

    Character vector of attached package names

    49 | 50 | 51 |
    logopaths
    52 |

    Vector of existing logo paths

    53 | 54 |
    55 |
    56 |

    Value

    57 |

    Vector of paths to new logos

    58 |
    59 | 60 |
    62 | 63 | 64 |
    67 | 68 | 71 | 72 |
    73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /docs/reference/make_tile.html: -------------------------------------------------------------------------------- 1 | 2 | Generate tile of package logos — make_tile • hexsession 3 | Skip to contents 4 | 5 | 6 |
    27 |
    28 |
    33 | 34 |
    35 |

    Generate tile of package logos

    36 |
    37 | 38 |
    39 |

    Usage

    40 |
    make_tile(dark_mode = FALSE, packages = NULL)
    41 |
    42 | 43 |
    44 |

    Arguments

    45 | 46 | 47 |
    dark_mode
    48 |

    Draw the tile on a dark background?

    49 | 50 | 51 |
    packages
    52 |

    Character vector of package names to include (default: NULL, which uses loaded packages)

    53 | 54 |
    55 |
    56 |

    Value

    57 |

    Path to the output file

    58 |
    59 | 60 |
    62 | 63 | 64 |
    67 | 68 | 71 | 72 |
    73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /docs/reference/pkgurls.html: -------------------------------------------------------------------------------- 1 | 2 | Get package URLs — pkgurls • hexsession 3 | Skip to contents 4 | 5 | 6 |
    27 |
    28 |
    33 | 34 |
    35 |

    Get package URLs

    36 |
    37 | 38 |
    39 |

    Usage

    40 |
    pkgurls(pkgnames)
    41 |
    42 | 43 |
    44 |

    Arguments

    45 | 46 | 47 |
    pkgnames
    48 |

    Character vector of package names

    49 | 50 |
    51 |
    52 |

    Value

    53 |

    A vector of package URLs

    54 |
    55 | 56 |
    58 | 59 | 60 |
    63 | 64 | 67 | 68 |
    69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /docs/reference/snap_tile.html: -------------------------------------------------------------------------------- 1 | 2 | Take screenshot of html image tile — snap_tile • hexsession 3 | Skip to contents 4 | 5 | 6 |
    27 |
    28 |
    33 | 34 |
    35 |

    Take screenshot of html image tile

    36 |
    37 | 38 |
    39 |

    Usage

    40 |
    snap_tile(
    41 |   output_path,
    42 |   screen_width = 800,
    43 |   screen_height = 700,
    44 |   dark_mode = FALSE
    45 | )
    46 |
    47 | 48 |
    49 |

    Arguments

    50 | 51 | 52 |
    output_path
    53 |

    Path to image file

    54 | 55 | 56 |
    screen_width
    57 |

    Width of the browser window

    58 | 59 | 60 |
    screen_height
    61 |

    Height of the browser window

    62 | 63 | 64 |
    dark_mode
    65 |

    Is the tile being saved dark or light mode?

    66 | 67 |
    68 |
    69 |

    Value

    70 |

    Path to the saved image

    71 |
    72 | 73 |
    75 | 76 | 77 |
    80 | 81 | 84 | 85 |
    86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /docs/search.json: -------------------------------------------------------------------------------- 1 | [{"path":"https://luisdva.github.io/hexsession/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 hexsession authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://luisdva.github.io/hexsession/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Luis D. Verde Arregoitia. Author, maintainer.","code":""},{"path":"https://luisdva.github.io/hexsession/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Verde Arregoitia L (2024). hexsession: Create tile logos loaded packages. R package version 0.0.0.9000, https://luisdva.github.io/hexsession/, https://github.com/luisDVA/hexsession.","code":"@Manual{, title = {hexsession: Create a tile of logos for loaded packages}, author = {Luis D. {Verde Arregoitia}}, year = {2024}, note = {R package version 0.0.0.9000, https://luisdva.github.io/hexsession/}, url = {https://github.com/luisDVA/hexsession}, }"},{"path":"https://luisdva.github.io/hexsession/index.html","id":"hexsession-","dir":"","previous_headings":"","what":"Create a tile of logos for loaded packages","title":"Create a tile of logos for loaded packages","text":"goal hexsession create tile hexagonal logos packages installed machine. Tiles can created set packages specified character vector, loaded packages session (packages attached search path except base packages).","code":""},{"path":"https://luisdva.github.io/hexsession/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Create a tile of logos for loaded packages","text":"can install development version hexsession like :","code":"# install.packages(\"remotes) remotes::install_github(\"luisdva/hexsession\")"},{"path":"https://luisdva.github.io/hexsession/index.html","id":"using-hexsession","dir":"","previous_headings":"","what":"Using hexsession","title":"Create a tile of logos for loaded packages","text":"hexsession installed, can create self-contained HTML file tiled hex logos loaded packages session. package logo bundled man/figures/ image found easily, generic-looking logo package name generated. svg files internally converted png images bundled package match ‘logo’, users prompted specify file use. given session libraries loaded addition base packages: make_tile() function render HTML output new folder working directory using Quarto template file also copied new directory. session following packages loaded: output look like : don’t know show rendered interactive file GitHub readme, anyone please let know 😅. downloaded machine opened browser, hexout_example.html shows interactive, responsive HTML version cool hover effects adapts size browser window includes hyperlinks package website. save static version hex tile, call snap_tile() path output image optionally, height width values change viewport size. result:","code":"library(hexsession) make_tile() # custom set of packages make_tile(packages=c(\"terra\",\"sf\",\"tidyr\")) library(annotater) library(ggforce) library(purrr) library(forcats) library(unheadr) library(sdmTMB) library(parsnip) library(DBI) library(broom) library(vctrs) library(patchwork) hexsession::make_tile()"},{"path":"https://luisdva.github.io/hexsession/index.html","id":"dark-mode","dir":"","previous_headings":"Using hexsession","what":"Dark mode","title":"Create a tile of logos for loaded packages","text":"draw tiles dark background, set dark_mode TRUE creating capturing hex logos.","code":"hexsession::make_tile(dark_mode = TRUE) hexsession::snap_tile(\"test.png\",dark_mode = TRUE)"},{"path":"https://luisdva.github.io/hexsession/index.html","id":"notes","dir":"","previous_headings":"","what":"Notes","title":"Create a tile of logos for loaded packages","text":"packages depends working installations magick, Quarto, chromote thus needs Chromium-based web browser (e.g., Chrome, Chromium, Opera, Vivaldi) installation. hexsession much work progress highly experimental. still learning good-practices packages create files directories, use system commands, launch browser sessions. feedback welcome form (issues, pull requests, etc.)","code":""},{"path":"https://luisdva.github.io/hexsession/index.html","id":"credit-and-llm-disclosure-statement","dir":"","previous_headings":"Notes","what":"Credit and LLM disclosure statement","title":"Create a tile of logos for loaded packages","text":"css html code responsive hex grid comes tutorial Temani Afif. javascript code populate divs Quarto template written input Claude 3.5 Sonnet LLM running Continue extension Positron IDE.","code":""},{"path":"https://luisdva.github.io/hexsession/reference/encode_image.html","id":null,"dir":"Reference","previous_headings":"","what":"Encode image to Base64 — encode_image","title":"Encode image to Base64 — encode_image","text":"Encode image Base64","code":""},{"path":"https://luisdva.github.io/hexsession/reference/encode_image.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Encode image to Base64 — encode_image","text":"","code":"encode_image(file_path)"},{"path":"https://luisdva.github.io/hexsession/reference/encode_image.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Encode image to Base64 — encode_image","text":"file_path Path image file","code":""},{"path":"https://luisdva.github.io/hexsession/reference/encode_image.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Encode image to Base64 — encode_image","text":"Base64 encoded string image","code":""},{"path":"https://luisdva.github.io/hexsession/reference/find_imgpaths.html","id":null,"dir":"Reference","previous_headings":"","what":"Find image paths — find_imgpaths","title":"Find image paths — find_imgpaths","text":"Find image paths","code":""},{"path":"https://luisdva.github.io/hexsession/reference/find_imgpaths.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find image paths — find_imgpaths","text":"","code":"find_imgpaths(pkgnames)"},{"path":"https://luisdva.github.io/hexsession/reference/find_imgpaths.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find image paths — find_imgpaths","text":"pkgnames Character vector package names","code":""},{"path":"https://luisdva.github.io/hexsession/reference/find_imgpaths.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find image paths — find_imgpaths","text":"list image file paths package","code":""},{"path":"https://luisdva.github.io/hexsession/reference/find_imgpaths.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Find image paths — find_imgpaths","text":"Images svg format converted png. image matches 'logo' file name used prompted select likely logos.","code":""},{"path":"https://luisdva.github.io/hexsession/reference/find_logopaths.html","id":null,"dir":"Reference","previous_headings":"","what":"Find logo paths — find_logopaths","title":"Find logo paths — find_logopaths","text":"Find logo paths","code":""},{"path":"https://luisdva.github.io/hexsession/reference/find_logopaths.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find logo paths — find_logopaths","text":"","code":"find_logopaths(imagepaths, pkgnames)"},{"path":"https://luisdva.github.io/hexsession/reference/find_logopaths.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find logo paths — find_logopaths","text":"imagepaths List image paths pkgnames Character vector package names","code":""},{"path":"https://luisdva.github.io/hexsession/reference/find_logopaths.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find logo paths — find_logopaths","text":"vector logo paths","code":""},{"path":"https://luisdva.github.io/hexsession/reference/generate_hexsession_js.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate JavaScript file for hexsession — generate_hexsession_js","title":"Generate JavaScript file for hexsession — generate_hexsession_js","text":"Generate JavaScript file hexsession","code":""},{"path":"https://luisdva.github.io/hexsession/reference/generate_hexsession_js.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate JavaScript file for hexsession — generate_hexsession_js","text":"","code":"generate_hexsession_js(logopaths, urls, dark_mode, output_js)"},{"path":"https://luisdva.github.io/hexsession/reference/generate_hexsession_js.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate JavaScript file for hexsession — generate_hexsession_js","text":"logopaths Vector image paths urls Vector URLs dark_mode Use dark mode, inherited make_tile output_js Path save JavaScript file","code":""},{"path":"https://luisdva.github.io/hexsession/reference/getLoaded.html","id":null,"dir":"Reference","previous_headings":"","what":"Get loaded packages — getLoaded","title":"Get loaded packages — getLoaded","text":"Get loaded packages","code":""},{"path":"https://luisdva.github.io/hexsession/reference/getLoaded.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get loaded packages — getLoaded","text":"","code":"getLoaded()"},{"path":"https://luisdva.github.io/hexsession/reference/getLoaded.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get loaded packages — getLoaded","text":"character vector attached packages (excludes base packages)","code":""},{"path":"https://luisdva.github.io/hexsession/reference/get_pkg_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Get package data — get_pkg_data","title":"Get package data — get_pkg_data","text":"Get package data","code":""},{"path":"https://luisdva.github.io/hexsession/reference/get_pkg_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get package data — get_pkg_data","text":"","code":"get_pkg_data(packages = NULL)"},{"path":"https://luisdva.github.io/hexsession/reference/get_pkg_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get package data — get_pkg_data","text":"packages Character vector package names (default NULL, uses loaded packages)","code":""},{"path":"https://luisdva.github.io/hexsession/reference/get_pkg_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get package data — get_pkg_data","text":"list containing logopaths urls packages","code":""},{"path":"https://luisdva.github.io/hexsession/reference/make_missingLogos.html","id":null,"dir":"Reference","previous_headings":"","what":"Create missing logos — make_missingLogos","title":"Create missing logos — make_missingLogos","text":"Create missing logos","code":""},{"path":"https://luisdva.github.io/hexsession/reference/make_missingLogos.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create missing logos — make_missingLogos","text":"","code":"make_missingLogos(attached_pkgs, logopaths)"},{"path":"https://luisdva.github.io/hexsession/reference/make_missingLogos.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create missing logos — make_missingLogos","text":"attached_pkgs Character vector attached package names logopaths Vector existing logo paths","code":""},{"path":"https://luisdva.github.io/hexsession/reference/make_missingLogos.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create missing logos — make_missingLogos","text":"Vector paths new logos","code":""},{"path":"https://luisdva.github.io/hexsession/reference/make_tile.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate tile of package logos — make_tile","title":"Generate tile of package logos — make_tile","text":"Generate tile package logos","code":""},{"path":"https://luisdva.github.io/hexsession/reference/make_tile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate tile of package logos — make_tile","text":"","code":"make_tile(dark_mode = FALSE, packages = NULL)"},{"path":"https://luisdva.github.io/hexsession/reference/make_tile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate tile of package logos — make_tile","text":"dark_mode Draw tile dark background? packages Character vector package names include (default: NULL, uses loaded packages)","code":""},{"path":"https://luisdva.github.io/hexsession/reference/make_tile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate tile of package logos — make_tile","text":"Path output file","code":""},{"path":"https://luisdva.github.io/hexsession/reference/pkgurls.html","id":null,"dir":"Reference","previous_headings":"","what":"Get package URLs — pkgurls","title":"Get package URLs — pkgurls","text":"Get package URLs","code":""},{"path":"https://luisdva.github.io/hexsession/reference/pkgurls.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get package URLs — pkgurls","text":"","code":"pkgurls(pkgnames)"},{"path":"https://luisdva.github.io/hexsession/reference/pkgurls.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get package URLs — pkgurls","text":"pkgnames Character vector package names","code":""},{"path":"https://luisdva.github.io/hexsession/reference/pkgurls.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get package URLs — pkgurls","text":"vector package URLs","code":""},{"path":"https://luisdva.github.io/hexsession/reference/snap_tile.html","id":null,"dir":"Reference","previous_headings":"","what":"Take screenshot of html image tile — snap_tile","title":"Take screenshot of html image tile — snap_tile","text":"Take screenshot html image tile","code":""},{"path":"https://luisdva.github.io/hexsession/reference/snap_tile.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Take screenshot of html image tile — snap_tile","text":"","code":"snap_tile( output_path, screen_width = 800, screen_height = 700, dark_mode = FALSE )"},{"path":"https://luisdva.github.io/hexsession/reference/snap_tile.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Take screenshot of html image tile — snap_tile","text":"output_path Path image file screen_width Width browser window screen_height Height browser window dark_mode tile saved dark light mode?","code":""},{"path":"https://luisdva.github.io/hexsession/reference/snap_tile.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Take screenshot of html image tile — snap_tile","text":"Path saved image","code":""}] 2 | -------------------------------------------------------------------------------- /docs/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MyWebSite", 3 | "short_name": "MySite", 4 | "icons": [ 5 | { 6 | "src": "/web-app-manifest-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png", 9 | "purpose": "maskable" 10 | }, 11 | { 12 | "src": "/web-app-manifest-512x512.png", 13 | "sizes": "512x512", 14 | "type": "image/png", 15 | "purpose": "maskable" 16 | } 17 | ], 18 | "theme_color": "#ffffff", 19 | "background_color": "#ffffff", 20 | "display": "standalone" 21 | } -------------------------------------------------------------------------------- /docs/sitemap.xml: -------------------------------------------------------------------------------- 1 | 2 | https://luisdva.github.io/hexsession/404.html 3 | https://luisdva.github.io/hexsession/LICENSE-text.html 4 | https://luisdva.github.io/hexsession/LICENSE.html 5 | https://luisdva.github.io/hexsession/authors.html 6 | https://luisdva.github.io/hexsession/index.html 7 | https://luisdva.github.io/hexsession/reference/encode_image.html 8 | https://luisdva.github.io/hexsession/reference/find_imgpaths.html 9 | https://luisdva.github.io/hexsession/reference/find_logopaths.html 10 | https://luisdva.github.io/hexsession/reference/generate_hexsession_js.html 11 | https://luisdva.github.io/hexsession/reference/getLoaded.html 12 | https://luisdva.github.io/hexsession/reference/get_pkg_data.html 13 | https://luisdva.github.io/hexsession/reference/index.html 14 | https://luisdva.github.io/hexsession/reference/make_missingLogos.html 15 | https://luisdva.github.io/hexsession/reference/make_tile.html 16 | https://luisdva.github.io/hexsession/reference/pkgurls.html 17 | https://luisdva.github.io/hexsession/reference/snap_tile.html 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/web-app-manifest-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/docs/web-app-manifest-192x192.png -------------------------------------------------------------------------------- /docs/web-app-manifest-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/docs/web-app-manifest-512x512.png -------------------------------------------------------------------------------- /hexsession.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | ProjectId: 55690bc3-5546-4215-940d-fe2e140071cb 3 | 4 | RestoreWorkspace: No 5 | SaveWorkspace: No 6 | AlwaysSaveHistory: Default 7 | 8 | EnableCodeIndexing: Yes 9 | UseSpacesForTab: Yes 10 | NumSpacesForTab: 2 11 | Encoding: UTF-8 12 | 13 | RnwWeave: Sweave 14 | LaTeX: pdfLaTeX 15 | 16 | AutoAppendNewline: Yes 17 | StripTrailingWhitespace: Yes 18 | LineEndingConversion: Posix 19 | 20 | BuildType: Package 21 | PackageUseDevtools: Yes 22 | PackageInstallArgs: --no-multiarch --with-keep.source 23 | PackageRoxygenize: rd,collate,namespace 24 | -------------------------------------------------------------------------------- /inst/extdata/blankhexsm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/inst/extdata/blankhexsm.png -------------------------------------------------------------------------------- /inst/extdata/rectDark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/inst/extdata/rectDark.png -------------------------------------------------------------------------------- /inst/extdata/rectLight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/inst/extdata/rectLight.png -------------------------------------------------------------------------------- /inst/extdata/rectMed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/inst/extdata/rectMed.png -------------------------------------------------------------------------------- /inst/templates/_hexout.qmd: -------------------------------------------------------------------------------- 1 | --- 2 | execute: 3 | echo: false 4 | params: 5 | temp_file_path: "package_data.rds" 6 | js_file_path: "hexsession.js" 7 | dark_mode: false 8 | resources: 9 | - images 10 | embed-resources: true 11 | --- 12 | 13 | ```{r} 14 | #| echo: false 15 | 16 | 17 | 18 | library(htmltools) 19 | 20 | # Include the JavaScript file 21 | htmltools::tagList( 22 | htmltools::tags$script(src = params$js_file_path) 23 | ) 24 | ``` 25 | 26 | ```{=html} 27 |
    28 |
    29 | 30 |
    31 |
    32 | created with hexsession 33 |
    34 |
    35 | 36 | 138 | 139 | ``` 140 | -------------------------------------------------------------------------------- /man/col_arrange.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/image_arrange.R 3 | \name{col_arrange} 4 | \alias{col_arrange} 5 | \title{Arrange Images by Color} 6 | \usage{ 7 | col_arrange(image_paths) 8 | } 9 | \arguments{ 10 | \item{image_paths}{Character vector. A vector of file paths to the images.} 11 | } 12 | \value{ 13 | A character vector of image paths, sorted by the lightness of their 14 | main color. 15 | } 16 | \description{ 17 | Takes a vector of image paths, extracts the main color from each image using 18 | k-means clustering, converts the colors to the LAB color space, and sorts the 19 | images based on the lightness (L) component of their dominant color. 20 | } 21 | \examples{ 22 | img1 <- system.file("extdata/rectLight.png", package = "hexsession") 23 | img2 <- system.file("extdata/rectMed.png", package = "hexsession") 24 | img3 <- system.file("extdata/rectDark.png", package = "hexsession") 25 | sorted_paths <- col_arrange(c(img1,img3,img2)) 26 | 27 | } 28 | -------------------------------------------------------------------------------- /man/encode_image.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/helpers.R 3 | \name{encode_image} 4 | \alias{encode_image} 5 | \title{Encode image to Base64} 6 | \usage{ 7 | encode_image(file_path) 8 | } 9 | \arguments{ 10 | \item{file_path}{Path to an image file} 11 | } 12 | \value{ 13 | Base64 encoded string of the image 14 | } 15 | \description{ 16 | Encode image to Base64 17 | } 18 | -------------------------------------------------------------------------------- /man/figures/exampletile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/man/figures/exampletile.png -------------------------------------------------------------------------------- /man/figures/hsdemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/man/figures/hsdemo.gif -------------------------------------------------------------------------------- /man/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/man/figures/logo.png -------------------------------------------------------------------------------- /man/find_imgpaths.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/helpers.R 3 | \name{find_imgpaths} 4 | \alias{find_imgpaths} 5 | \title{Find image paths} 6 | \usage{ 7 | find_imgpaths(pkgnames) 8 | } 9 | \arguments{ 10 | \item{pkgnames}{Character vector of package names} 11 | } 12 | \value{ 13 | A list of image file paths for each package 14 | } 15 | \description{ 16 | Find image paths 17 | } 18 | \details{ 19 | Images in svg format will be converted to png. When no image matches 'logo' 20 | in the file name the used is will be prompted to select likely logos. 21 | } 22 | -------------------------------------------------------------------------------- /man/find_logopaths.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/helpers.R 3 | \name{find_logopaths} 4 | \alias{find_logopaths} 5 | \title{Find logo paths} 6 | \usage{ 7 | find_logopaths(imagepaths, pkgnames) 8 | } 9 | \arguments{ 10 | \item{imagepaths}{List of image paths} 11 | 12 | \item{pkgnames}{Character vector of package names} 13 | } 14 | \value{ 15 | A vector of logo paths 16 | } 17 | \description{ 18 | Find logo paths 19 | } 20 | -------------------------------------------------------------------------------- /man/generate_hexsession_js.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/generate_jsBlock.R 3 | \name{generate_hexsession_js} 4 | \alias{generate_hexsession_js} 5 | \title{Generate JavaScript file for hexsession} 6 | \usage{ 7 | generate_hexsession_js(logopaths, urls, dark_mode, output_js) 8 | } 9 | \arguments{ 10 | \item{logopaths}{Vector of image paths} 11 | 12 | \item{urls}{Vector of URLs} 13 | 14 | \item{dark_mode}{Use dark mode, inherited from make_tile} 15 | 16 | \item{output_js}{Path to save the JavaScript file} 17 | } 18 | \description{ 19 | Generate JavaScript file for hexsession 20 | } 21 | -------------------------------------------------------------------------------- /man/getLoaded.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/helpers.R 3 | \name{getLoaded} 4 | \alias{getLoaded} 5 | \title{Get loaded packages} 6 | \usage{ 7 | getLoaded() 8 | } 9 | \value{ 10 | A character vector of the attached packages (excludes base packages) 11 | } 12 | \description{ 13 | Get loaded packages 14 | } 15 | -------------------------------------------------------------------------------- /man/get_pkg_data.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/get_package_data.R 3 | \name{get_pkg_data} 4 | \alias{get_pkg_data} 5 | \title{Get package data} 6 | \usage{ 7 | get_pkg_data(packages = NULL) 8 | } 9 | \arguments{ 10 | \item{packages}{Character vector of package names (default is NULL, uses loaded packages)} 11 | } 12 | \value{ 13 | A list containing logopaths and urls for the packages 14 | } 15 | \description{ 16 | Get package data 17 | } 18 | -------------------------------------------------------------------------------- /man/maincolorRGB.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/image_arrange.R 3 | \name{maincolorRGB} 4 | \alias{maincolorRGB} 5 | \title{Extract the Most Frequent Color from an Image} 6 | \usage{ 7 | maincolorRGB(imgpath) 8 | } 9 | \arguments{ 10 | \item{imgpath}{Character string. File path to the image.} 11 | } 12 | \value{ 13 | A data frame with one row containing the RGB values of the dominant color. 14 | The column name is set to the input image path. 15 | } 16 | \description{ 17 | Internal helper. For a given image path, this functions uses k-means 18 | clustering to identify the most dominant color in the image. 19 | } 20 | -------------------------------------------------------------------------------- /man/make_missingLogos.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/helpers.R 3 | \name{make_missingLogos} 4 | \alias{make_missingLogos} 5 | \title{Create missing logos} 6 | \usage{ 7 | make_missingLogos(attached_pkgs, logopaths) 8 | } 9 | \arguments{ 10 | \item{attached_pkgs}{Character vector of attached package names} 11 | 12 | \item{logopaths}{Vector of existing logo paths} 13 | } 14 | \value{ 15 | Vector of paths to new logos 16 | } 17 | \description{ 18 | Create missing logos 19 | } 20 | -------------------------------------------------------------------------------- /man/make_tile.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/make_tile.R 3 | \name{make_tile} 4 | \alias{make_tile} 5 | \title{Generate tile of package logos} 6 | \usage{ 7 | make_tile( 8 | packages = NULL, 9 | local_images = NULL, 10 | local_urls = NULL, 11 | dark_mode = FALSE, 12 | color_arrange = FALSE 13 | ) 14 | } 15 | \arguments{ 16 | \item{packages}{Character vector of package names to include (default: NULL, which uses loaded packages)} 17 | 18 | \item{local_images}{Optional character vector of local image paths to add to the tile} 19 | 20 | \item{local_urls}{Optional character vector of URLs for each of the local images passed} 21 | 22 | \item{dark_mode}{Draw the tile on a dark background?} 23 | 24 | \item{color_arrange}{Logical, whether to arrange the images by color along the 'Lab' color space (defaults to FALSE)} 25 | } 26 | \value{ 27 | Path to the output file 28 | } 29 | \description{ 30 | This function returns an interactive html tile view of the packages either 31 | listed in the \code{packages} option, or all of the loaded packages. When rendered 32 | interactively, the result is output in the viewer. When rendered in Quarto or 33 | RMarkdown, the tile becomes part of the rendered html. If local images are provided, 34 | only these images will be used, excluding loaded packages. 35 | } 36 | -------------------------------------------------------------------------------- /man/pkgurls.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/helpers.R 3 | \name{pkgurls} 4 | \alias{pkgurls} 5 | \title{Get package URLs} 6 | \usage{ 7 | pkgurls(pkgnames) 8 | } 9 | \arguments{ 10 | \item{pkgnames}{Character vector of package names} 11 | } 12 | \value{ 13 | A vector of package URLs 14 | } 15 | \description{ 16 | Get package URLs 17 | } 18 | -------------------------------------------------------------------------------- /man/snap_tile.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/snap_tile.R 3 | \name{snap_tile} 4 | \alias{snap_tile} 5 | \title{Take screenshot of html image tile} 6 | \usage{ 7 | snap_tile( 8 | output_path, 9 | screen_width = 800, 10 | screen_height = 700, 11 | dark_mode = FALSE 12 | ) 13 | } 14 | \arguments{ 15 | \item{output_path}{Path to image file} 16 | 17 | \item{screen_width}{Width of the browser window} 18 | 19 | \item{screen_height}{Height of the browser window} 20 | 21 | \item{dark_mode}{Is the tile being saved dark or light mode?} 22 | } 23 | \value{ 24 | Path to the saved image 25 | } 26 | \description{ 27 | Take screenshot of html image tile 28 | } 29 | -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/pkgdown/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/pkgdown/favicon/favicon-48x48.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/pkgdown/favicon/favicon.ico -------------------------------------------------------------------------------- /pkgdown/favicon/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "MyWebSite", 3 | "short_name": "MySite", 4 | "icons": [ 5 | { 6 | "src": "/web-app-manifest-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png", 9 | "purpose": "maskable" 10 | }, 11 | { 12 | "src": "/web-app-manifest-512x512.png", 13 | "sizes": "512x512", 14 | "type": "image/png", 15 | "purpose": "maskable" 16 | } 17 | ], 18 | "theme_color": "#ffffff", 19 | "background_color": "#ffffff", 20 | "display": "standalone" 21 | } -------------------------------------------------------------------------------- /pkgdown/favicon/web-app-manifest-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/pkgdown/favicon/web-app-manifest-192x192.png -------------------------------------------------------------------------------- /pkgdown/favicon/web-app-manifest-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/hexsession/bffc487103a16ad59f322eaa52a1fd12b5faec23/pkgdown/favicon/web-app-manifest-512x512.png --------------------------------------------------------------------------------