MayaGans / githubCalendar

Creating a visual in Observable, then turning it into a widget. All the R user will need to supply is a data frame of dates and values... I hope)
https://observablehq.com/@mayagans/a-github-inspired-calendar
Other
24 stars 1 forks source link

Suggestion: Add shiny input #5

Open JohnCoene opened 3 years ago

JohnCoene commented 3 years ago

Hi Maya, great package as usual!

An idea would be to set a shiny input value on click, probably somewhere here: https://github.com/MayaGans/githubCalendar/blob/f2dddaf15c74e873c577994dce4a46a0496e81e6/inst/htmlwidgets/js/makeChart.js#L101

.on("click", function(event){
    if(HTMLWidgets.shinyMode){
        Shiny.setInputValue(el.id + '_click', event);
    }
})

Not too familiar with d3 so I could be getting this totally wrong.

JohnCoene commented 3 years ago

Oh no. I just realised it comes later in the book (Chapter 18) :man_facepalming: