GithubHelp home page GithubHelp logo

Add Shiny to d2b about sunburstr HOT 3 OPEN

timelyportfolio avatar timelyportfolio commented on June 5, 2024 1
Add Shiny to d2b

from sunburstr.

Comments (3)

stefanavey avatar stefanavey commented on June 5, 2024

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?

from sunburstr.

timelyportfolio avatar timelyportfolio commented on June 5, 2024

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

from sunburstr.

stefanavey avatar stefanavey commented on June 5, 2024

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?

from sunburstr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.