-
Notifications
You must be signed in to change notification settings - Fork 5
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 Breadcrumbs and more #16
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d2c2f25
feat: Add Breadcrumbs
kamilzyla d232c3f
chore: Remove TODO for deprecated CollapsibleList
kamilzyla 3b3314c
feat: Add OverflowList
kamilzyla 19e3099
feat: Add PanelStack2
kamilzyla 8ed47a7
chore: Remove TODO for Skeleton which is not a component
kamilzyla 4cbf46e
feat: Add ResizeSensor
kamilzyla b1ca6da
feat: Add Label
kamilzyla 8574cc3
feat: Add Checkbox and Checkbox.shinyInput
kamilzyla 5b7e8b6
feat: Add Radio, RadioGroup and RadioGroup.shinyInput
kamilzyla 85747e1
chore: Update generated JS
kamilzyla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,13 @@ | ||
library(shiny) | ||
library(appsilon.blueprint) | ||
|
||
items <- list( | ||
list(icon = "folder-close", text = "Users"), | ||
list(icon = "folder-close", text = "Janet"), | ||
list(icon = "document", text = "image.jpg") | ||
) | ||
|
||
if (interactive()) shinyApp( | ||
ui = Breadcrumbs(items = items), | ||
server = function(input, output) {} | ||
) |
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,23 @@ | ||
library(shiny) | ||
library(appsilon.blueprint) | ||
|
||
if (interactive()) shinyApp( | ||
ui = tagList( | ||
Checkbox( | ||
onChange = JS("(event) => Shiny.setInputValue('apples', event.target.checked)"), | ||
defaultChecked = TRUE, | ||
label = "Apples" | ||
), | ||
Checkbox.shinyInput( | ||
inputId = "bananas", | ||
value = TRUE, | ||
label = "Bananas" | ||
), | ||
textOutput("applesEnabled"), | ||
textOutput("bananasEnabled") | ||
), | ||
server = function(input, output) { | ||
output$applesEnabled <- renderText(paste("Apples:", deparse(input$apples))) | ||
output$bananasEnabled <- renderText(paste("Bananas:", deparse(input$bananas))) | ||
} | ||
) |
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,10 @@ | ||
library(shiny) | ||
library(appsilon.blueprint) | ||
|
||
if (interactive()) shinyApp( | ||
ui = Label( | ||
"Label", | ||
tags$input(class = "bp4-input") | ||
), | ||
server = function(input, output) {} | ||
) |
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,29 @@ | ||
library(shiny) | ||
library(appsilon.blueprint) | ||
|
||
boxStyle <- tags$style(" | ||
.box { | ||
margin: 0.5em; | ||
padding: 0.5em; | ||
background: silver; | ||
font-size: 4em; | ||
} | ||
") | ||
|
||
items <- lapply( | ||
list("Too", "many", "words", "to", "fit", "on", "your", "screen!"), | ||
function(text) div(text, class = "box") | ||
) | ||
|
||
if (interactive()) shinyApp( | ||
ui = tagList( | ||
boxStyle, | ||
OverflowList( | ||
items = items, | ||
visibleItemRenderer = JS("item => item"), | ||
overflowRenderer = JS("items => null"), | ||
collapseFrom = "end" | ||
) | ||
), | ||
server = function(input, output) {} | ||
) |
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,55 @@ | ||
library(shiny) | ||
library(appsilon.blueprint) | ||
|
||
customComponents <- tagList( | ||
tags$style(" | ||
.panel-stack { | ||
border: 1px solid lightgrey; | ||
width: 300px; | ||
height: 240px; | ||
} | ||
.panel { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
} | ||
"), | ||
tags$script(HTML("(() => { | ||
const React = jsmodule['react']; | ||
const Blueprint = jsmodule['@blueprintjs/core']; | ||
|
||
function createPanel(num) { | ||
return { | ||
title: `Panel ${num}`, | ||
renderPanel: Panel, | ||
props: { num }, | ||
}; | ||
} | ||
|
||
function Panel({ num, openPanel }) { | ||
const button = React.createElement( | ||
Blueprint.Button, | ||
{ | ||
onClick: () => openPanel(createPanel(num + 1)), | ||
intent: Blueprint.Intent.PRIMARY, | ||
}, | ||
'Open Panel' | ||
) | ||
return React.createElement('div', { className: 'panel' }, button); | ||
} | ||
|
||
window.createPanel = createPanel; | ||
})()")) | ||
) | ||
|
||
if (interactive()) shinyApp( | ||
ui = tagList( | ||
customComponents, | ||
PanelStack2( | ||
className = "panel-stack", | ||
initialPanel = JS("createPanel(1)") | ||
) | ||
), | ||
server = function(input, output) {} | ||
) |
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,34 @@ | ||
library(shiny) | ||
library(appsilon.blueprint) | ||
|
||
if (interactive()) shinyApp( | ||
ui = tagList( | ||
H3("Favorite animal"), | ||
RadioGroup.shinyInput( | ||
inputId = "animal", | ||
value = "dog", | ||
Radio(label = "Cat", value = "cat"), | ||
Radio(label = "Dog", value = "dog") | ||
), | ||
textOutput("favoriteAnimal"), | ||
H3("Favorite fruit"), | ||
reactOutput("fruitRadio"), | ||
textOutput("favoriteFruit") | ||
), | ||
server = function(input, output) { | ||
output$favoriteAnimal <- renderText(deparse(input$animal)) | ||
|
||
fruit <- reactiveVal() | ||
observeEvent(input$fruit, fruit(input$fruit)) | ||
output$fruitRadio <- renderReact({ | ||
RadioGroup( | ||
onChange = JS("event => Shiny.setInputValue('fruit', event.currentTarget.value)"), | ||
selectedValue = fruit(), | ||
Radio(label = "Apple", value = "a"), | ||
Radio(label = "Banana", value = "b"), | ||
Radio(label = "Cherry", value = "c") | ||
) | ||
}) | ||
output$favoriteFruit <- renderText(deparse(fruit())) | ||
} | ||
) |
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,29 @@ | ||
library(shiny) | ||
library(appsilon.blueprint) | ||
|
||
if (interactive()) shinyApp( | ||
ui = tagList( | ||
tags$style(" | ||
.resizable { | ||
overflow: auto; | ||
resize: both; | ||
width: 100px; | ||
height: 100px; | ||
background: silver; | ||
} | ||
"), | ||
ResizeSensor( | ||
kamilzyla marked this conversation as resolved.
Show resolved
Hide resolved
|
||
onResize = JS("entries => Shiny.setInputValue('resize', entries[0].contentRect)"), | ||
div( | ||
class = "resizable", | ||
textOutput("size") | ||
) | ||
) | ||
), | ||
server = function(input, output) { | ||
output$size <- renderText({ | ||
content <- req(input$resize) | ||
paste0(content$width, "x", content$height) | ||
}) | ||
} | ||
) |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, that's big :D (I've the issue you've submited).