https://github.com/jpmarindiaz/isotope
https://github.com/jpmarindiaz/isotope
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jpmarindiaz/isotope
- Owner: jpmarindiaz
- Created: 2015-04-20T13:47:28.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-22T21:02:33.000Z (over 9 years ago)
- Last Synced: 2024-11-13T16:42:49.276Z (7 months ago)
- Language: HTML
- Size: 1.44 MB
- Stars: 13
- Watchers: 4
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - jpmarindiaz/isotope - (HTML)
README
# Isotope Htmlwidget for R
[Isotope](http://isotope.metafizzy.co/) layout library straight from R to render Data Frames as interactive galleries.
It handles sortings, filtering and custom item html templates.
Uses basscss.# How to
If you provide filterCols you can select which columns to use as filters.
If you provide sortCols you can select which columns to use to sort the items.
You can also provide custom html templates to render the items.
```{r, message=FALSE}
# devtools::install_github("jpmarindiaz/isotope")
library(isotope)
d <- read.csv(system.file("data/candidatos.csv",package="isotope"), stringsAsFactors = FALSE)filterCols <- c("genero","profesiones", "niveldeestudios","talante", "pragmaticoideologico","visionpais")
sortCols <- c("nombre","apoyosenadores","apoyorepresentantes")tpl <- '
{{nombre}}
![]()
Profesión: {{profesiones}}, Género: {{genero}},Nivel de estudios: {{niveldeestudios}}
Apoyo Senadores: {{apoyosenadores}}
Apoyo Representantes: {{apoyorepresentantes}}
'
isotope(d, filterCols = filterCols, sortCols = sortCols, lang = 'es', elemTpl = tpl)```
# Todo
- Sort opts: Button names, original-order(add/remove, lang)
- style sort buttons
- Add width/height properties for elements
- add custom css
- Fix some layoutModes by adding height property to each item
- Warn about sort buttons not present in template
- Add more separators for multiple values per column currently only "," is supported.