Skip to content

Commit

Permalink
Merge bee5c9f into c15d29a
Browse files Browse the repository at this point in the history
  • Loading branch information
bryant1410 committed Apr 17, 2017
2 parents c15d29a + bee5c9f commit cdc8d1f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -17,7 +17,7 @@ Demo [http://github.alfredkam.com/yakojs](http://github.alfredkam.com/yakojs) or

Supports Chrome, Firefox, Safari, and IE 9+;

###Note on upgrading 0.4.X to 0.5.X
### Note on upgrading 0.4.X to 0.5.X
- Deprecate the old bubble usage and with a new interface
- Simplify ```<graph>.timeseries``` require usage - It is now no longer needed to include ```.timeseries``` to use those graphs
- Simplify chart configuration by flattern out ```<graph>.attr({})```
Expand Down
2 changes: 1 addition & 1 deletion demo/example/react-bubble-hover-tooltip/README.md
@@ -1,6 +1,6 @@
An example of the code usage could be found here that takes full advantage of tooltip hovering with events

###Usage
### Usage
In terminal run
```bash
../../../../node_modules/webpack-dev-server/bin/webpack-dev-server.js --hot
Expand Down
2 changes: 1 addition & 1 deletion demo/example/react-line-hover-tooltip/README.md
@@ -1,6 +1,6 @@
An example of the code usage could be found here that takes full advantage of tooltip hovering with events

###Usage
### Usage
In terminal run
```bash
../../../node_modules/webpack-dev-server/bin/webpack-dev-server.js --hot
Expand Down
30 changes: 15 additions & 15 deletions doc.md
@@ -1,4 +1,4 @@
##Content
## Content
- [General Usage](#Usage)
- [Spark Graph Attributes](#spark-graph-attributes)
- [Line Graph Attributes](#line-graph-attributes)
Expand All @@ -24,7 +24,7 @@

[External Link: Visual Examples](http://alfredkam.com/yakojs/example.html)

##General Usage
## General Usage
To use any of the graphs you could access them through these entry points.
``` javascript
var yako = require('yako'); // or window.yako on the browser
Expand All @@ -37,15 +37,15 @@ var line = yako.line; // Line graph
var pie = yako.pie; // Pie chart
```

####Initializing
#### Initializing
<i>graph</i>().attr(<i>attributes</i>) <br>
&nbsp;&nbsp; => returns a string ```<svg>...</svg>``` <br>
<i>graph</i>("#graph").attr(<i>attributes</i>) <br>
&nbsp;&nbsp; => returns a string ```<div id='graph'><svg>...</svg></div>```<br>
<i>graph</i>(".graph").attr(<i>attributes</i>) <br>
&nbsp;&nbsp; => returns a string ```<div class='graph'><svg>...</svg></div>```<br>

####Spark Graph Attributes
#### Spark Graph Attributes
```javascript
var set = [
{
Expand Down Expand Up @@ -106,7 +106,7 @@ spark().attr({
});
```

####Line Graph Attributes
#### Line Graph Attributes
Line graph - a spark graph with labels support

```javascript
Expand Down Expand Up @@ -178,7 +178,7 @@ line().attr({
points: dataSet
});
```
####Pie Chart Attributes
#### Pie Chart Attributes
```javascript
var set = [123,1233,1231,123]; // An array of numbers
pie('.graph').attr({
Expand All @@ -202,7 +202,7 @@ pie('.graph').attr({
});
```

####Donut Chart Attributes
#### Donut Chart Attributes
```javascript
var set = []; // An array of numbers
donut('.graph').attr({
Expand Down Expand Up @@ -233,7 +233,7 @@ var outerRadius = chart.outerRadius || (circumference / 2);
var innerRadius = chart.innerRadius || (outerRadius / 2);
```

####Bar Graph Attributes
#### Bar Graph Attributes
```javascript
var set = [
{
Expand All @@ -254,7 +254,7 @@ bar('.graph').attr({
points: set
});
```
####Bubble Graph Attributes
#### Bubble Graph Attributes
A bubble graph, best use to represnet a cohort's sample size and consumes a data object

```javascript
Expand Down Expand Up @@ -291,7 +291,7 @@ bubbleScatter().attr({
});
```

####Bubble Point (Bubble Line) Attributes
#### Bubble Point (Bubble Line) Attributes
A time series graph and uses bubble to represent a sample size happening a cross a series.
```javascript
var bubblePoint = requrie('yako').bubble.point
Expand Down Expand Up @@ -332,7 +332,7 @@ bubblePoint().attr({

```

##API & Mixin
## API & Mixin
Instances of the graph component are created internally, and each component could be re-used subsequently. Once you've picked your entry point, you could access the component api. Within each component, you could access your component with ```javascript this```
```javascript
/* Example */
Expand All @@ -354,18 +354,18 @@ var result = instance.attr({
})
```

#####mixin: [{...}]
##### mixin: [{...}]
Sometimes common components / functions may share some common functionality with other graph components. Mixin allows you to enable the magic to happen.

#####make(tagName, attribute, dataAttribute)
##### make(tagName, attribute, dataAttribute)
```make``` is called everytime to create a svg element with the provided attributes and data attributes, and expects to return a string or object that ```append``` function can consume.

The super class of ```make``` is referenced [here](https://github.com/alfredkam/yakojs/blob/d5ef0c5072d8b952e66929c5bc9a5f40171b6e1b/lib/base/common.js#L41-L52)

#####append(parent, childs)
```append``` is called everytime to append the childs into the parent element. ```childs``` is the result of an array of ```make``` and ```parent``` is either empty or a result of a ```make``` function call to create the parent element. It expects to return a string or object.

#####preRender(immutableScale) [Beta]
##### preRender(immutableScale) [Beta]
Expects an array of svg elements in string format, unless the ```make``` and ```append``` format is changed up by you.
```javascript
return {
Expand All @@ -386,7 +386,7 @@ return {

The super class of ```append``` is referenced [here](https://github.com/alfredkam/yakojs/blob/d5ef0c5072d8b952e66929c5bc9a5f40171b6e1b/lib/base/common.js#L31-L39)

#####postRender(result)
##### postRender(result)
```render``` provides the result of the component, you could intercept the result before it passes back up to the chain

##SVG API
Expand Down
8 changes: 4 additions & 4 deletions src/API_DRAFT_README.md
@@ -1,7 +1,7 @@
#Yako's next version graphing api (draft)
# Yako's next version graphing api (draft)
Building upon v0.3.X experiences and feedbacks.

##Usage
## Usage
Simplifying the entry point and consumable entry points. To define a graph in a chart, simpily include the chart prefix as your key and its data set into the mix. The avaliable charts are listed below.

```javascript
Expand Down Expand Up @@ -38,7 +38,7 @@ yako({
})
```

##Spark
## Spark
Spark is designed for simple trivial graph, and works with a simple set of data.

```javascript
Expand All @@ -60,7 +60,7 @@ spark: [
]
```

##Bubble
## Bubble
Bubble graph, best for representing a cohort of sample size

```javascript
Expand Down

0 comments on commit cdc8d1f

Please sign in to comment.