Quellcode durchsuchen

Infinite emoji scroll

plus datatable tweaks and improvements
tags/v0.1.3
Garrick Aden-Buie vor 7 Jahren
Ursprung
Commit
c69f833ab2
2 geänderte Dateien mit 41 neuen und 23 gelöschten Zeilen
  1. +16
    -15
      DESCRIPTION
  2. +25
    -8
      R/ermoji_gadget.R

+ 16
- 15
DESCRIPTION Datei anzeigen

Package: ermoji Package: ermoji
Version: 0.1.2
Title: RStudio Addin to Search and Copy Emoji 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 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: Imports:
emo,
clipr,
DT, DT,
clipr
Remotes: hadley/emo
Depends:
shiny,
miniUI
emo
Remotes:
hadley/emo
ByteCompile: true
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE) Roxygen: list(markdown = TRUE)
RoxygenNote: 6.1.0 RoxygenNote: 6.1.0
URL: https://github.com/gadenbuie/ermoji
BugReports: https://github.com/gadenbuie/ermoji/issues

+ 25
- 8
R/ermoji_gadget.R Datei anzeigen

background-color: transparent; background-color: transparent;
border: 0; border: 0;
} }

.dropdown-menu { .dropdown-menu {
color: #212529; color: #212529;
text-align: left; text-align: left;
list-style: none; 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;
}
") ")
) )
), ),
output$emojis <- DT::renderDataTable({ output$emojis <- DT::renderDataTable({
emojis <- emo::jis emojis <- emo::jis
emojis <- emojis[, c('emoji', 'name', "group", "keywords", "aliases")] 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$keywords <- vapply(emojis$keywords, function(x) paste(x, collapse = ", "), character(1))
emojis$aliases <- vapply(emojis$aliases, function(x) paste(x, collapse = ", "), character(1)) emojis$aliases <- vapply(emojis$aliases, function(x) paste(x, collapse = ", "), character(1))
DT::datatable( DT::datatable(
filter = "top", filter = "top",
selection = "single", selection = "single",
fillContainer = TRUE, fillContainer = TRUE,
# style = 'bootstrap',
class = 'compact stripe nowrap hover',
style = 'bootstrap',
class = 'compact stripe hover',
extensions = c("Scroller"),
options = list( options = list(
dom = "<'row'<'col-sm-6 col-sm-offset-2 text-center'f>>tir",
searchHighlight = TRUE, searchHighlight = TRUE,
search = list(regex = TRUE, caseInsensitive = FALSE), 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
) )
) )
}) })

Laden…
Abbrechen
Speichern