Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ramnathv/rChartsCalmap
An htmlwidgets binding for calendar heat maps using d3
https://github.com/ramnathv/rChartsCalmap
Last synced: 3 months ago
JSON representation
An htmlwidgets binding for calendar heat maps using d3
- Host: GitHub
- URL: https://github.com/ramnathv/rChartsCalmap
- Owner: ramnathv
- License: other
- Created: 2015-01-06T19:22:03.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-29T21:08:16.000Z (over 7 years ago)
- Last Synced: 2024-05-14T11:33:06.678Z (6 months ago)
- Language: JavaScript
- Size: 309 KB
- Stars: 31
- Watchers: 4
- Forks: 8
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-shiny-extensions - rChartsCalmap - An htmlwidgets binding for calendar heatmaps using D3. (Visualization / Heatmap)
- jimsghstars - ramnathv/rChartsCalmap - An htmlwidgets binding for calendar heat maps using d3 (JavaScript)
README
## rChartsCalmap
This is an [htmlwidgets](http://htmlwidgets.org) binding for the excellent [Cal-Heatmap](http://kamisama.github.io/cal-heatmap/) plugin, developed by [Wan Qi Chen](https://github.com/kamisama). This binding was motivated by a tweet by [Alex Bresler](https://twitter.com/abresler/status/412314310782644224/photo/1) and uses data provided by him on points scored by Paul George.
You can install it from `github` using `devtools`.
```S
library(devtools)
install.packages('htmlwidgets')
install_github("ramnathv/rChartsCalmap")
```### Quick Start
Let us start with some data on points scored by Paul George.
```r
dat <- read.csv('http://t.co/mN2RgcyQFc')[,c('date', 'pts')]
library(rChartsCalmap)
r1 <- calheatmap(x = 'date', y = 'pts',
data = dat,
domain = 'month',
start = "2012-10-27",
legend = seq(10, 50, 10),
itemName = 'point',
range = 7
)
r1
```![calmap1](http://i.imgur.com/abBCyk8.png)
Here is another example showing stock price of APPLE.
```r
library(quantmod)
getSymbols("AAPL")
xts_to_df <- function(xt){
data.frame(
date = format(as.Date(index(xt)), '%Y-%m-%d'),
coredata(xt)
)
}dat = xts_to_df(AAPL)
calheatmap('date', 'AAPL.Adjusted',
data = dat,
domain = 'month',
legend = seq(500, 700, 40),
start = '2014-01-01',
itemName = '$$'
)
```![apple](http://i.imgur.com/G5xvsFk.png)