Skip to content

Commit

Permalink
add logo
Browse files Browse the repository at this point in the history
  • Loading branch information
dajmcdon committed Jul 5, 2024
1 parent 9324444 commit 9a79c98
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ knitr::opts_chunk$set(
)
```

# R-package `sparsegl`
# sparsegl <a href="https://dajmcdon.github.io/sparsegl/"><img src="man/figures/logo.png" align="right" height="139" alt="sparsegl website" /></a>

The goal of sparsegl is to fit regularization paths for sparse group-lasso
penalized learning problems. The model is typically fit for a sequence of regularization parameters $\lambda$. Such estimators minimize
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ status](https://www.r-pkg.org/badges/version/sparsegl)](https://CRAN.R-project.o

<!-- README.md is generated from README.Rmd. Please edit that file -->

# R-package `sparsegl`
# sparsegl <a href="https://dajmcdon.github.io/sparsegl/"><img src="man/figures/logo.png" align="right" height="139" alt="sparsegl website" /></a>

The goal of sparsegl is to fit regularization paths for sparse
group-lasso penalized learning problems. The model is typically fit for
Expand Down
Binary file added inst/logo/constraint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions inst/logo/logo.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
library(rgl)
rgl_orientation <- readRDS("inst/logo/rgl_view.rds")

f <- function(x, y) {
pmax(1 - 0.5 * sqrt(2 * (x^2 + y^2)) - 0.5 * (abs(x) + abs(y)), 0)
}

draw_constraint <- function(colour = "cornflowerblue", alpha = .6, bg = "white") {
persp3d(f, xlim = c(-1, 1), ylim = c(-1, 1), col = colour,
zlim = c(-1, 1), alpha = alpha, box = FALSE, axes = FALSE,
xlab = "", ylab = "", zlab = "")
persp3d(\(x,y) -f(x, y), xlim = c(-1, 1), ylim = c(-1, 1),
col = colour, add = TRUE, alpha = alpha,
box = FALSE, axes = FALSE)
par3d(userMatrix = rgl_orientation, zoom = .575)
bg3d(color = "white")
snapshot3d("inst/logo/constraint.png", webshot = FALSE)
close3d()
}

bg <- "#950f27"
border <- "#c41232"

draw_constraint("#284dab", alpha = .6) # need to crop it
rgl.quit()

library(hexSticker)
sysfonts::font_add_google("Montserrat")
sticker(
"inst/logo/constraint.png",
package = "sparsegl", filename = "man/figures/logo.png",
s_x = 1, s_y = .75, s_width = .6, s_height = .6,
p_size = 20, p_x = 1, p_family = "Montserrat", p_color = "white",
h_fill = bg, h_color = border, h_size = 1.5,
)


Binary file added inst/logo/rgl_view.rds
Binary file not shown.
Binary file added man/figures/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9a79c98

Please sign in to comment.