Coder Social home page Coder Social logo

jumpingrivers / ibmsunburst Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 1.0 734 KB

R ๐Ÿ“ฆ for the IBM โ˜€๐Ÿ“ˆ for the Personality Insights data

Home Page: https://jumpingrivers.github.io/ibmsunburst

License: Other

R 84.63% JavaScript 15.37%
htmlwidgets personality-insights personality-profile r r-package rstats sunburst-chart

ibmsunburst's People

Contributors

dependabot[bot] avatar maelle avatar minerobber9000 avatar osheen1 avatar stephlocke avatar timelyportfolio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

minerobber9000

ibmsunburst's Issues

Fonts

You might notice that the fonts look a little ugly. In general, I leave fonts as default, so that a user can specify through CSS or with a framework, such as Bootstrap, Semantic. Please let me know if you would like me to change.

IBM's example uses Bootstrap which in turn uses Helvetica Neue.

image

Add tests checking the content of the widget

At the moment the tests check the class of the output of ibmsunburst.

It'd be nice to add tests that check the output against a saved output like what vdiffr does for ggplot2 objects.

Tasks:

  • Identify an example or examples of htmlwidget package(s) testing in the wild.

  • Apply the setup to this package.

Add events for Shiny communication

Unfortunately, the source js library does not currently provide event communication. I generally try not to fork and modify the source js, since the maintenance burden then shifts to the R package author. However, we might be able to add some code to communicate events such as click, expand, etc. to the htmlwidget binding to allow for limited integration with Shiny.

Use the vignette to explore how to do an API call and visualise the results

We should show people in the vignette how to do an API call to get data, what sort of things they may need in order to do so, and how to interpret the resulting chart.

Resources

Things to remember

  • Any extra libraries like httr mentioned in a vignette need to be added to the DESCRIPTION in the Suggests section

documentation of changes required in source library

So that we don't forget I wanted to add some documentation of the changes that I made to the source sunburst-chart. The dist version of the library points to the d3v3 version, which also pollutes the global namespace with d3. This means that we will likely conflict with other htmlwidgets that use other versions of d3.

To resolve, I made commits

  1. timelyportfolio/sunburst-chart@4b1ef69 - use d3v4 version
  2. timelyportfolio/sunburst-chart@8aa4f37 - RStudio Viewer will be updated but as of now requires es5 JavaScript since it is a very outdated. Change .babelrc to target es5 and transpile Object.assign.
  3. timelyportfolio/sunburst-chart@97a5c13 - babel the dist version which we use in htmlwidgets/lib

These steps ended up being quite straightforward and minimal but took a little longer than I expected. If we encouter again with an update of the source library, this should be quick and easy.

Make v3 the default

The v3 API has been in use since early 2017. The ibmsunburst() function should therefore use "v3" as the default in the event of someone not providing a value to the version argument.

Roadmap

Moved from the README

Typical htmlwidgets workflow

  • Identify JS source
  • Use htmlwidgets starter package
  • Add relevant JS files to inst
  • Include a sample dataset
  • Adjust templates to incorporate JS lib
  • Prep any data transformation or specifications needed
  • Add testing and documentation
  • Prepare for CRAN

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.