Skip to content
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 Shiny to d2b #64

Open
timelyportfolio opened this issue Mar 1, 2018 · 3 comments
Open

Add Shiny to d2b #64

timelyportfolio opened this issue Mar 1, 2018 · 3 comments
Assignees

Comments

@timelyportfolio
Copy link
Owner

Add Shiny to d2b. Most likely will push this to a future release > 2.0.0.

@stefanavey
Copy link

yes, please! This is exactly what I need. I'm using a Shiny app where I want to use the Sunburst created by sund2b() as a way to select nodes and then get that value back in R. I know I can do this with add_shiny() on sunburst() plots. Is there any workaround for sund2b() currently?

@timelyportfolio
Copy link
Owner Author

I'll circle back to this over the next couple of days. Thanks @stefanavey for the nudge.

@stefanavey
Copy link

stefanavey commented Mar 4, 2019

Tested the example below with code on master branch (0c6274a). Works great for this example!

---
output:
  flexdashboard::flex_dashboard
runtime: shiny
---

### Sunburst

```{r}

library(shiny)
library(flexdashboard)
library(sunburstR)

sequences <- read.csv(
    system.file("examples/visit-sequences.csv",
                package="sunburstR"),
    header = FALSE, stringsAsFactors = FALSE)

sund2bOutput("sb")

output$sb <- renderSund2b({
    sequences <- sequences[sample(nrow(sequences),100),]
    add_shiny(sund2b(sequences))
})


```

### Selection

```{r}

selection <- reactive({
    input$sb_click
})

renderText({selection()})

```

I see you added an event for click_center. How would it work to get the current "parent" of the hierarchy when users click on the center?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants