What cool javascript libraries should become HTMLwidgets?

Hi all,

I was wondering what cool javascript libraries exist that would benefit the shiny community if they were made as an htmlwidget (gallery.htmlwidgets.org)?

For example, the SimpleMDE library (https://simplemde.com/) would fill a gap as it would allow the users to fill in forms using markdown which can then be displayed in an RMarkdown report.

Thoughts welcome :slight_smile:
Cheers,

Iain

2 Likes

No answer, only the suggestion that you seek out the wisdom of @timelyportfolio (who, as I mentioned this morning, sneezes JS library integrations)! Cool idea— mad props! :raised_hands:

That's actually a much harder question than it seems!

Last year I wanted to learn htmlwidgets, so instead of blindly following the tutorial, I tried to find an htmlwidget I thought would be useful. I spent several days looking for cool javascript libraries that would make sense to bring to R. I literally searched for DAYS! Eventually I made timevis, but it really isn't easy finding a suitable library. I'd love to hear answers too :slight_smile:

1 Like

Holy grail?

A full fledged r interface for the construction of custom d3.js visualizations. I've been putting off diving full bore into d3 simply due to the time commitment. I'm aware that @timelyportfolio has been working on d3r and there are some other packages as well, but I'm thinking more bespoke and artistic visualizations as opposed to more scientific visualizations.

I've also been waiting for a package that really tackles vega, a successor or continuance of the in-roads that ggvis started. Like a full featured package similar to ggplot2 that works in @hrbmstrs vega-lite with the good pieces of ggivs into a well thought out API.

A man can dream.

7 Likes

Glad you found timevis, your implementation is really great :slight_smile:

Speaking of graph libraries, I came across this (courtesy of Phil@rstudio) today https://canvasxpress.org/html/index.html which looks very interesting and different from what I had seen before. It tracks all the changes that a user makes to visualization.

Another thought I had is that it would be nice to have a library to help validate forms (https://www.sitepoint.com/10-jquery-form-validation-plugins/) or to move labels (http://labs.mikemitchell.co.uk/FloatLabelJS/)

I'd vote for a full fledged d3 R interface all day.

1 Like

Just started on timevis, once I grok'ed the data structure simple easy and cool - Thanks
If enhancing HTML widgets is in the question - (how hard is it to make items select-ably editable ?)

Upvote on both d3 and vega observations.
@hadley - Some form of roadmap for ggvis (even to know it is a dead-end) would be most helpful

1 Like

@JamesF the future of ggvis was discussed in this thread:

2 Likes

Thanks - Seems there are a few with the same sentiments.

I really like ggvis and clearly others do too, but there does seem to be an obdurate - refusal to even say NO ! (which is always OK from developers of an open-source solution

A great many people (myself included) really appreciate what the RStudio team are doing generally, and @hadley in particular but this attitude increasingly whiffs of don't give a damn.

There may be good reasons, and there may be other priorities - but there is uncertainty which could be clarified.

The very act of clarifying that uncertainty is not insubstantial (and I don't mean to suggest that it's not worth doing…sorry for the quadruple negative there, albeit intentional). Obdurate* suggests some sort of stubborn refusal, and I really don't think that's the case. @milesmcbain pointed to an rOpenSci working group in the ggvis thread, which can hopefully help bring clarification, in the absence of any sort of "resolution." That's not intended as a brush off— there's a lot of overlap between RStudio and rOpenSci, and (true to OSS-form) these conversations are kind of inherently a part of the evolution.

* Stephen King uses the word to describe "the past" seemingly hundreds of times over the course of 11/22/63, and I'll never be able to think of the word in the same way again.

3 Likes

I'd love to see what projects like d3r are doing. I've decided to start learning d3 from scratch in order to make some visualisations that just going to happen with the existing R vis toolset (in particular, visualisations using d3's force capabilities), but my impression it that it's a pretty large API. Which isn't to say that it would be impossible to do, but I wonder whether there is a point at which it just becomes more efficient to just work in d3 yourself.

I'm hoping to turn some of these into htmlwidgets (or at least just use the knowledge I pick up to extend some existing widgets), so I daresay I'll change my mind once I learn more :slight_smile:

1 Like

Mara thanks for feedback. I used the word obdurate precisely because the ggvis story seems to contrast with the wonderful general ethos of the Studio ecosystem. It's also clear that even here intentions are good if ill-defined.

So - I'm not unappreciative of all that is done, but I would appreciate a better understanding of what is not. :wink:

2 Likes

I hear you, and will do my best to help with the clarification process! rstudio::conf (happening in the first days of February) might provide a good opening to talk to a bunch of people involved in this space . @cpsievert— whom I think of as the :crown: of R plotly —is giving a talk on interactive graphics in R, which I'll sadly :cry: miss (I'm speaking in a parallel session), but I'd be gobsmacked if this didn't come up!

I use plotly and ggiraph if I'm doing anything interactive. I prefer ggiraph due to the ease in using ggplot and basic html to create really nice interactive graphics with tooltips. @hrbrmstr pretty much sold me on it with this.

There are also things like idyll and semiotic that while they may not be something that exactly fit the htmlwidgets framework I see them having a big influence. Semiotic fits, but I'm not so sure about Idyll, but I see idyll being an interesting companion in R markdown.

1 Like

I know @timelyportfolio's been working on some sort of Semiotic integration, so definitely worth reaching out, if you decide to go in that direction.

(I like Semiotic because Elijah lets me give feedback in crayon scribbles :stuck_out_tongue_winking_eye:!)

1 Like

So ggvis is now officially "dormant," with some additional discussion in the updated status section in the vignette.

2 Likes

I didn't realise that ggvis was built on vega. I'm aware of the vegalite and rVega packages. Can anyone point me to some good resources on them?

In the mean time, I've decided to learn d3 using Scott Murray's Interactive Data Visualization for the Web, 2nd Edition. There're a few interesting things I want to do with d3, like its forcing simulations, that I doubt will ever be possible with ggplot-derived solutions due to their philosophical differences. And learning it will help me build htmlwidgets :smile:

I had assembled a list as I worked through an htmlwidget/week project at buildingwidgets. These are issues at https://github.com/timelyportfolio/buildingwidgets/issues if anyone has interest.

Regarding Semiotic, I have found react libraries particularly difficult to squeeze into an htmlwidget wrapper, but @mara is right that I plan to demonstrate how we can use Semiotic and other React libraries in R in my next post at https://jsinr.me.

Also, I have not spent much time working on the htmlwidgets I built since there has been little interest. The most popular have been listviewer, sunburstR, and parcoords. Happy to discuss supporting any more fully as long as there is a real interest and an actual application.

Kent

4 Likes