GithubHelp home page GithubHelp logo

chordviz's People

Contributors

nredell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

chordviz's Issues

about fontsize

Great work!

I have a question about the font size. If I understand correctly, the font size is defined in ./inst/html/widgets/chordViz.css

so I downloaded the full code, and locally changed the font size in .css file, but found no change with displayed font size, could you provide some hints for this?

Thx!

Issue when using chordViz in shiny: does not reinitialize data

Hi,
Thank you for chordViz
I tried to used chordViz in a shiny app using the minimal code below

devtools::install_github("nredell/chordViz")
library(chordViz)
library(htmlwidgets)

#output
renderChorViz <- function (expr, env = parent.frame(), quoted = FALSE){
  if (!quoted) {expr <- substitute(expr)}
  shinyRenderWidget(expr, chordVizOutput, env, quoted = TRUE)
}
 
# #input
chordVizOutput <- function (outputId, width = "100%", height = "400px"){
  shinyWidgetOutput(outputId, "chordViz", width, height,
                    package = "chordViz")
}

ui <-   fluidPage(
  actionButton("NewGraph", "New Graph"),
  chordVizOutput("chord")
)

server <- function(input, output) {
  output$chord <- renderChorViz({  
    chordViz(m(), start = 3/2, groupNames = LETTERS[1:ncol(m())])
  })
  
  m <- reactive({
    input$NewGraph
    matrix(trunc(runif(100, 1, 20)), nrow = 10)
  })
  
}
  
shinyApp(ui, server)

The issue is that a new chord diagram is drawn each time you update the data, rather than replacing it.
I don't know enough about javascript to help. I found on the web a solution that work by placing

while (document.getElementById(el.id).hasChildNodes()) {
    document.getElementById(el.id).removeChild(document.getElementById(el.id).lastChild);
}

at the begining of the renderValue function.
Maybe you could fnd a better solution.
Thank you

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.