Giter Site home page Giter Site logo

dygraph-extra's Introduction

dygraph-extra

A modified version of the original dygraph-extra JavaScript library that adds the ability to export dygraph plots as a png image, among other things. Intended to be used in shiny with dygraphs for R, but dygraph-extra.js does work as a standalone.

Refer to the shiny-example for the actual files and an example of basic usage.

Dependencies:

  • jQuery (loaded by shiny automatically)
  • JSZip (only required if downloading multiple dygraphs in a single link)

License:

dygraph-extra.js

This is a modified version of dygraph-extra.js originally released in 2011 by Juan Manuel Caicedo Carvajal.

The modifications are:

  • Fixed y label positioning.
  • Automatic detectection of fonts for the labels, rather than relying on predefined or user-supplied fonts. This still isn't perfect, but should be closer to the actual dygraph.
  • Fix overflow of legends for too many series (legends now wrap).
  • A method for registering dygraphs via a drawcallback, primarily useful for those using the R version of dygraphs.
  • A function for downloading one or more registered dygraphs where the dygraphs to download are identified by their id and where multiple plots are zipped together using JSZip.
  • Functions to address some bugs/annoyances with dygraphs:
    • correct automatic resize on visiblity change.
    • correct clearance of selection on mouseleave.

dygraph-extra-shiny.R

Contains a number of R functions that make it easier to use dygraph-extra.js in shiny.

Example: dyDownload

dyDownload-Button.png

dyDownload("dyout", "Download Plot", asbutton = TRUE)

Example: dyDownloadGroup

dyDownloadGroup.png

dyDownloadGroup("oecoDyDownloads", "Download Plots:", c(
      "Value added by tourism as a percentage of GDP" = "oecogdpperc",
      "Value added by tourism" = "oecogdp",
      "Tourism employment as a percentage of total employment" = "oecoempperc",
      "Tourism employment" = "oecoemp",
      "International tourism as a percentage of total exports" = "oecoexpperc",
      "Total expenditure" = "oecospend"
   ))

dygraph-extra's People

Contributors

joh024 avatar jstagge avatar

Watchers

James Cloos avatar

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.