Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom svg icons collected in one sprite map #226

Closed
jchojna opened this issue Jul 17, 2020 · 4 comments
Closed

Add custom svg icons collected in one sprite map #226

jchojna opened this issue Jul 17, 2020 · 4 comments

Comments

@jchojna
Copy link
Contributor

jchojna commented Jul 17, 2020

As an enhancement feature, we could make users able to add their own custom svg icons, collected in one sprite map svg file and having unique ids. Embedding svg icons using a sprite-map ( elements), instead of tags with src attribute pointing to specific svg file, gives the possibility to manipulate svg element's css properties, like fill, stroke etc. Thus it's possible to add some nice visual effects on events, like hover, click etc, which is not so simple or sometimes impossible, when using elements.

Some example function I created and used as a helper function, to return svg icon based on icons.svg sprite map:

svg_icon <- function(id, class, width, height) {
  return(
    HTML(
      glue::glue("
        <svg class = '{class}', viewBox = '0 0 {width} {height}'>
          <use href = 'icons/icons.svg#{id}'></use>
        </svg>"
      )
    )
  )
}
@olgamie olgamie added this to Backlog in shiny.semantic 0.3.5 Jul 23, 2020
@osenan osenan mentioned this issue Nov 16, 2020
11 tasks
@gesorabill
Copy link

gesorabill commented Jan 5, 2021

How do we use the function, please?
Are there any examples?

@osenan
Copy link
Contributor

osenan commented Jan 6, 2021

Hi @Bill-Gesora,

This functionality is currently under development. #320
We will include an example shiny app using custom sprite map. At this development stage I cannot advice you about the code above for using custom sprite maps. It has not been fully yet tested and the function code probably will change before it is released.

@osenan osenan closed this as completed Jan 6, 2021
@osenan osenan reopened this Jan 6, 2021
@esraay
Copy link
Contributor

esraay commented Jul 22, 2022

@osenan Do you think there will be future development from your side on this issue? Currently, we are closing all the idle issues as a part of a general clean-up we started.

@esraay
Copy link
Contributor

esraay commented Oct 21, 2022

Closing. Feel free to reopen it

@esraay esraay closed this as completed Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

4 participants