-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Appsilon/uirender
Uirender
- Loading branch information
Showing
9 changed files
with
537 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(SUPPORTED_THEMES) | ||
export(uirender) | ||
import(htmlwidgets) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# semantic.assets 1.1.0 | ||
|
||
- `uirender` added. | ||
|
||
# semantic.assets 1.0.0 | ||
|
||
First release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#' Render semanticui htmlwidget | ||
#' | ||
#' htmlwidget that adds semanticui dependencies and | ||
#' renders in viewer or rmarkdown. | ||
#' | ||
#' @import htmlwidgets | ||
#' | ||
#' @param ui UI, which will be wrapped in an htmlwidget. | ||
#' @param width Fixed width for widget (in css units). The default is NULL, | ||
#' which results in intelligent automatic sizing. | ||
#' @param height Fixed height for widget (in css units). The default is NULL, | ||
#' which results in intelligent automatic sizing. | ||
#' @param element_id Use an explicit element ID for the widget | ||
#' (rather than an automatically generated one). | ||
#' @examples | ||
#' library(shiny) | ||
#' library(shiny.semantic) | ||
#' library(semantic.assets) | ||
#' uirender( | ||
#' card( | ||
#' div( | ||
#' class = "content", | ||
#' div(class = "header", "Elliot Fu"), | ||
#' div(class = "meta", "Friend"), | ||
#' div(class = "description", "Elliot Fu is a film-maker from New York.") | ||
#' ) | ||
#' ) | ||
#' ) | ||
#' | ||
#' @export | ||
uirender <- function(ui, width = NULL, height = NULL, element_id = NULL) { | ||
|
||
# forward options using x | ||
args <- list( | ||
ui = toString(ui) | ||
) | ||
|
||
# create widget | ||
htmlwidgets::createWidget( | ||
name = "uirender", | ||
args, | ||
width = width, | ||
height = height, | ||
package = "semantic.assets", | ||
elementId = element_id | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,10 @@ Appsilon | |
CMD | ||
RStudio | ||
Rhinoverse | ||
UI | ||
appsilon | ||
css | ||
htmlwidget | ||
rmarkdown | ||
semanticui | ||
wraped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
dependencies: | ||
- name: uirender | ||
version: 1.1.0 | ||
src: www/shared/semantic | ||
script: | ||
- semantic.min.js | ||
- uirender.js | ||
stylesheet: | ||
- semantic.uirender.min.css |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
HTMLWidgets.widget({ | ||
name: 'uirender', | ||
type: 'output', | ||
|
||
factory: function(el, width, height) { | ||
console.log('uirender'); | ||
return { | ||
renderValue: function(x) { | ||
el.innerHTML = x.ui; | ||
}, | ||
|
||
resize: function(width, height) { | ||
// TODO: code to re-render the widget with a new size | ||
} | ||
}; | ||
} | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.