Skip to content

Commit ef31a6d

Browse files
committed
R2C3
1 parent 05e216c commit ef31a6d

32 files changed

+17827
-0
lines changed

R2C3/.bowerrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"directory": "inst/htmlwidgets/lib"}

R2C3/.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# History files
2+
.Rhistory
3+
4+
# Example code in package build process
5+
*-Ex.R
6+
7+
# R data files from past sessions
8+
.Rdata
9+
10+
# RStudio files
11+
.Rproj.user/

R2C3/DESCRIPTION

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Package: R2C3
2+
Title: What the package does (one line)
3+
Version: 0.1
4+
Authors@R: "First Last <[email protected]> [aut, cre]"
5+
Description: What the package does (one paragraph)
6+
Depends: R (>= 3.1.2)
7+
License: What license is it under?
8+
LazyData: true

R2C3/LICENSE

+340
Large diffs are not rendered by default.

R2C3/NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exportPattern("^[^\\.]")

R2C3/R/R2C3-package.r

Whitespace-only changes.

R2C3/R/R2C3.R

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#' <Add Title>
2+
#'
3+
#' <Add Description>
4+
#'
5+
#' @import htmlwidgets
6+
#'
7+
#' @export
8+
R2C3 <- function(data, width = NULL, height = NULL) {
9+
10+
# forward options using x
11+
12+
x = list(
13+
data = data
14+
)
15+
16+
# create widget
17+
htmlwidgets::createWidget(
18+
name = 'R2C3',
19+
x,
20+
width = width,
21+
height = height,
22+
package = 'R2C3',
23+
elementId = 'chart'
24+
)
25+
}
26+
27+
#' Widget output function for use in Shiny
28+
#'
29+
#' @export
30+
R2C3Output <- function(outputId, width = '100%', height = '400px'){
31+
shinyWidgetOutput(outputId, 'R2C3', width, height, package = 'R2C3')
32+
}
33+
34+
#' Widget render function for use in Shiny
35+
#'
36+
#' @export
37+
renderR2C3 <- function(expr, env = parent.frame(), quoted = FALSE) {
38+
if (!quoted) { expr <- substitute(expr) } # force quoted
39+
shinyRenderWidget(expr, R2C3Output, env, quoted = TRUE)
40+
}

R2C3/R/test

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
oJdata: {
2+
columns: [
3+
['sample', 30, 200, 100, 400, 150, 250, 120, 200]
4+
]
5+
},
6+
grid: {
7+
x: {
8+
show: true
9+
},
10+
y: {
11+
show: true
12+
}
13+
}
14+
}

R2C3/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# R2C3
2+
Create C3 graphics with R

R2C3/inst/htmlwidgets/R2C3.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
HTMLWidgets.widget({
2+
3+
name: 'R2C3',
4+
5+
type: 'output',
6+
7+
initialize: function(el, width, height) {
8+
9+
return {
10+
};
11+
12+
},
13+
14+
renderValue: function(el, x, instance) {
15+
16+
x.data.bindto = "#" + el.id;
17+
18+
var chart = c3.generate(x.data);
19+
},
20+
21+
resize: function(el, width, height, instance) {
22+
23+
}
24+
25+
});

R2C3/inst/htmlwidgets/R2C3.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
dependencies:
2+
- name: d3
3+
version: 3.5.0
4+
src: htmlwidgets/lib/d3
5+
script: d3.js
6+
- name: c3
7+
version: 0.4.9
8+
src: htmlwidgets/lib/c3
9+
script: c3.js
10+
style: c3.css
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "c3",
3+
"main": [
4+
"c3.css",
5+
"c3.js"
6+
],
7+
"version": "0.4.9",
8+
"homepage": "https://github.com/masayuki0812/c3",
9+
"authors": [
10+
"Masayuki Tanaka <[email protected]>"
11+
],
12+
"description": "D3-based reusable chart library",
13+
"keywords": [
14+
"chart",
15+
"d3"
16+
],
17+
"license": "MIT",
18+
"ignore": [
19+
"**/.*",
20+
"node_modules",
21+
"bower_components",
22+
"htdocs",
23+
"spec",
24+
"src",
25+
"package.json",
26+
"component.json",
27+
"Gruntfile.*"
28+
],
29+
"dependencies": {
30+
"d3": "<=3.5.0"
31+
},
32+
"_release": "0.4.9",
33+
"_resolution": {
34+
"type": "version",
35+
"tag": "0.4.9",
36+
"commit": "76d2df973f99d8b76d20df9400cd32603f14f473"
37+
},
38+
"_source": "git://github.com/masayuki0812/c3.git",
39+
"_target": "~0.4.9",
40+
"_originalSource": "c3",
41+
"_direct": true
42+
}

R2C3/inst/htmlwidgets/lib/c3/LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2013 Masayuki Tanaka
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
c3 [![Build Status](https://travis-ci.org/masayuki0812/c3.svg?branch=master)](https://travis-ci.org/masayuki0812/c3) [![Dependency Status](https://david-dm.org/masayuki0812/c3.svg)](https://david-dm.org/masayuki0812/c3) [![devDependency Status](https://david-dm.org/masayuki0812/c3/dev-status.svg)](https://david-dm.org/masayuki0812/c3#info=devDependencies) [![license](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/masayuki0812/c3/blob/master/LICENSE)
2+
==
3+
4+
c3 is a D3-based reusable chart library that enables deeper integration of charts into web applications.
5+
6+
Follow the link for more information: [http://c3js.org](http://c3js.org/)
7+
8+
## Tutorial and Examples
9+
10+
+ [Getting Started](http://c3js.org/gettingstarted.html)
11+
+ [Examples](http://c3js.org/examples.html)
12+
13+
Additional samples can be found in this repository:
14+
+ [https://github.com/masayuki0812/c3/tree/master/htdocs/samples](https://github.com/masayuki0812/c3/tree/master/htdocs/samples)
15+
16+
You can run these samples as:
17+
```
18+
$ cd c3/htdocs
19+
$ python -m SimpleHTTPServer 8080
20+
```
21+
22+
## Google Group
23+
For general C3.js-related discussion, please visit our [Google Group at https://groups.google.com/forum/#!forum/c3js](https://groups.google.com/forum/#!forum/c3js).
24+
25+
## Using the issue queue
26+
The [issue queue](https://github.com/masayuki0812/c3/issues) is to be used for reporting defects and problems with C3.js, in addition to feature requests and ideas. It is **not** a catch-all support forum. **For general support enquiries, please use the [Google Group](https://groups.google.com/forum/#!forum/c3js) at https://groups.google.com/forum/#!forum/c3js.** All questions involving the interplay between C3.js and any other library (such as AngularJS) should be posted there first!
27+
28+
Before reporting an issue, please do the following:
29+
1. [Search for existing issues](https://github.com/masayuki0812/c3/issues) to ensure you're not posting a duplicate.
30+
31+
1. [Search the Google Group](https://groups.google.com/forum/#!forum/c3js) to ensure it hasn't been addressed there already.
32+
33+
1. Create a JSFiddle or Plunkr highlighting the issue. Please don't include any unnecessary dependencies so we can isolate that the issue is in fact with C3. *Please be advised that custom CSS can modify C3.js output!*
34+
35+
1. When posting the issue, please use a descriptive title and include the version of C3 (or, if cloning from Git, the commit hash — C3 is under active development and the master branch contains the latest dev commits!), along with any platform/browser/OS information that may be relevant.
36+
37+
## Pull requests
38+
Pull requests are welcome, though please post an issue first to see whether such a change is desirable.
39+
If you choose to submit a pull request, please do not bump the version number unless asked to, and please include test cases for any new features!
40+
41+
## Playground
42+
Please fork this fiddle:
43+
+ [http://jsfiddle.net/masayuki0812/7kYJu/](http://jsfiddle.net/masayuki0812/7kYJu/)
44+
45+
## Dependency
46+
+ [D3.js](https://github.com/mbostock/d3) `<=3.5.0`
47+
48+
## License
49+
MIT
50+
51+
[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=masayuki0812&url=https://github.com/masayuki0812/c3&title=c3&language=javascript&tags=github&category=software)
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "c3",
3+
"main": [
4+
"c3.css",
5+
"c3.js"
6+
],
7+
"version": "0.4.9",
8+
"homepage": "https://github.com/masayuki0812/c3",
9+
"authors": [
10+
"Masayuki Tanaka <[email protected]>"
11+
],
12+
"description": "D3-based reusable chart library",
13+
"keywords": [
14+
"chart",
15+
"d3"
16+
],
17+
"license": "MIT",
18+
"ignore": [
19+
"**/.*",
20+
"node_modules",
21+
"bower_components",
22+
"htdocs",
23+
"spec",
24+
"src",
25+
"package.json",
26+
"component.json",
27+
"Gruntfile.*"
28+
],
29+
"dependencies": {
30+
"d3": "<=3.5.0"
31+
}
32+
}

0 commit comments

Comments
 (0)