Explorar el Código

Infinite emoji scroll

plus datatable tweaks and improvements
tags/v0.1.3
Garrick Aden-Buie hace 7 años
padre
commit
c69f833ab2
Se han modificado 2 ficheros con 41 adiciones y 23 borrados
  1. +16
    -15
      DESCRIPTION
  2. +25
    -8
      R/ermoji_gadget.R

+ 16
- 15
DESCRIPTION Ver fichero

@@ -1,22 +1,23 @@
Package: ermoji
Version: 0.1.2
Title: RStudio Addin to Search and Copy Emoji
Description: RStudio addin to search through emoji and copy the emoji name,
unicode string or gliph to the clipboard.
Authors@R: "Garrrick Aden-Buie <g.adenbuie@gmail.com> [aut, cre]"
Version: 0.1.3
Authors@R: "Garrrick Aden-Buie <garrick@adenbuie.com> [aut, cre]"
Description: RStudio addin to search through emoji and copy the
emoji name, unicode string or glyph to the clipboard.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
ByteCompile: true
URL: https://github.com/gadenbuie/ermoji
BugReports: https://github.com/gadenbuie/ermoji/issues
Depends:
miniUI,
shiny
Imports:
emo,
clipr,
DT,
clipr
Remotes: hadley/emo
Depends:
shiny,
miniUI
emo
Remotes:
hadley/emo
ByteCompile: true
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 6.1.0
URL: https://github.com/gadenbuie/ermoji
BugReports: https://github.com/gadenbuie/ermoji/issues

+ 25
- 8
R/ermoji_gadget.R Ver fichero

@@ -38,12 +38,20 @@ ermoji_ui <- miniPage(
background-color: transparent;
border: 0;
}

.dropdown-menu {
color: #212529;
text-align: left;
list-style: none;
}
@media (min-height: 600px) {
td.big { font-size: 2em; }
}
@media (max-height: 599px) {
td.big { font-size: 1.5em; }
}
table.dataTable tbody td {
vertical-align: middle;
}
")
)
),
@@ -75,6 +83,7 @@ ermoji_server <- function(clipout = clipr::clipr_available()) {
output$emojis <- DT::renderDataTable({
emojis <- emo::jis
emojis <- emojis[, c('emoji', 'name', "group", "keywords", "aliases")]
emojis$group <- factor(emojis$group)
emojis$keywords <- vapply(emojis$keywords, function(x) paste(x, collapse = ", "), character(1))
emojis$aliases <- vapply(emojis$aliases, function(x) paste(x, collapse = ", "), character(1))
DT::datatable(
@@ -84,16 +93,24 @@ ermoji_server <- function(clipout = clipr::clipr_available()) {
filter = "top",
selection = "single",
fillContainer = TRUE,
# style = 'bootstrap',
class = 'compact stripe nowrap hover',
style = 'bootstrap',
class = 'compact stripe hover',
extensions = c("Scroller"),
options = list(
dom = "<'row'<'col-sm-6 col-sm-offset-2 text-center'f>>tir",
searchHighlight = TRUE,
search = list(regex = TRUE, caseInsensitive = FALSE),
columnDefs = list(list(
className = "dt-center", targets = 0
)),
pageLength = 10,
lengthMenu = c(4, 5, 10)
autoWidth = FALSE,
columnDefs = list(
list(
className = "dt-center big", searchable = FALSE, width = "10%", targets = 0
),
list(width = "20%", targets = c(1, 3, 4)),
list(width = "10%", targets = 2)
),
deferRender = TRUE,
scrollY = 500,
scroller = TRUE
)
)
})

Cargando…
Cancelar
Guardar