Skip to content

Commit

Permalink
Merge branch 'release/1.1.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitb4 committed Sep 2, 2014
2 parents 563c498 + 6e9e3b3 commit d003e52
Show file tree
Hide file tree
Showing 10 changed files with 449 additions and 163 deletions.
45 changes: 22 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
# RedRapha�l - A JavaScript graphics library on steroids!
# RedRaphael - A JavaScript graphics library on steroids!

[![Build Status](https://travis-ci.org/fusioncharts/redraphael.png?branch=master)](https://travis-ci.org/fusioncharts/redraphael)

## Getting started

- `git clone https://github.com/fusioncharts/redraphael.git`

- `git submodule init && git init && npm install`


## Dependencies

- [eve](https://github.com/adobe-webplatform/eve)
- [grunt](https://github.com/gruntjs/grunt)


## Usage
RedRaphael is a fork of Raphael with a number of added features and slightly changed development philosophy.
The best place to start is the API and usage docuentation.

To learn how to use Rapha�l visit their [documentation page](http://raphaeljs.com/reference.html)
To learn how to use RedRaphael visit [documentation page](http://fusioncharts.github.io/redraphael/)

## RedRaphael specific features

## RedRapha�l specific features
Here is a brief overview of added benefits of using RedRaphael.

### Group

Creating a RedRapha�l group
Creating a RedRaphael group
```js
var mygroup = paper.group([optional_group_name]);
```
Expand Down Expand Up @@ -57,7 +47,7 @@ Groups come in especially handy when you have to perform transformations on the

### Followers & Stalkers

Any element in RedRapha�l can be converted into a follower element (or stalker element) by invoking the
Any element in RedRaphael can be converted into a follower element (or stalker element) by invoking the
`follow` method.

`element.follow(<target_element>, [supervisor_function], ['before' || 'after']);`
Expand All @@ -68,15 +58,15 @@ are changed using the `element.attr` method.

The third argument, when provided will make the follower element position the itself w.r.t to the target
element based on the value of the parameter. If the target element is now moved around the DOM tree using
Rapha�l methods `insertBefore` or `insertAfter` etc, the follower (now a stalker) will also move along with
Raphael methods `insertBefore` or `insertAfter` etc, the follower (now a stalker) will also move along with
it.

[Check out a demo here](http://jsfiddle.net/sushantbs/xZrwe/4/)


### Custom Attributes

With RedRapha�l, custom attributes can be added per element using `element.ca` object.
With RedRaphaelel, custom attributes can be added per element using `element.ca` object.

```js
var rectEl = paper.rect(x, y, width, height);
Expand All @@ -93,12 +83,12 @@ rectEl.ca.borderWidth = function (value) {
rectEl.attr('borderWidth', '5');
```

Note: The original Rapha�l way of adding [custom attributes](http://raphaeljs.com/reference.html#Paper.ca) is also supported.
Note: The original Raphael way of adding [custom attributes](http://raphaeljs.com/reference.html#Paper.ca) is also supported.


### Raphael.define

RedRaph�l has encapsulated all the ways of extending the framework in the `define` API.
RedRaphel has encapsulated all the ways of extending the framework in the `define` API.

```js
Raphael.define(
Expand All @@ -108,6 +98,15 @@ Raphael.define(
element_specific_methods,
pre_defined_eventlisteners
);

Raphael.define({
name: 'componentName',
componentName: initializing_funciton,
ca: { /* custom_attributes */ },
fn: { /* element_specific_methods */ },
e: { /* pre_defined_eventlisteners */ },
data: { /* element_specific_data */ }
});
```

[See it in action](http://jsfiddle.net/sushantbs/khBQj/6/)
Expand Down Expand Up @@ -135,7 +134,7 @@ Raphael.define(

## Guidelines for contribution

- To be added
Fork and send PR!


[![Analytics](https://ga-beacon.appspot.com/UA-45124206-2/redraphael/index)](https://github.com/igrigorik/ga-beacon)
10 changes: 5 additions & 5 deletions docs/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>RedRaphaël API Reference</title>
<meta name="viewport" content="user-scalable=no,initial-scale = 1.0,maximum-scale = 1.0">
<link rel="stylesheet" href="fonts/stylesheet.css"><link rel="stylesheet" href="css/topcoat-desktop-light.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/dr.css">
<link rel="stylesheet" href="css/prism.css"><!--[if lt IE 9]>
<link rel="stylesheet" href="docs/fonts/stylesheet.css"><link rel="stylesheet" href="docs/css/topcoat-desktop-light.css">
<link rel="stylesheet" href="docs/css/main.css">
<link rel="stylesheet" href="docs/css/dr.css">
<link rel="stylesheet" href="docs/css/prism.css"><!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body class="light">
Expand Down Expand Up @@ -2375,7 +2375,7 @@ <h3> Arguments</h3><p>*
</div>
</div>
<script src="//use.edgefonts.net/source-sans-pro:n3,n4,n6;source-code-pro:n3.js"></script>
<script src="js/prism.js"></script>
<script src="docs/js/prism.js"></script>
<script>!function(e){if(e){for(var t=function(e,t){var n=t.toUpperCase().split(""),r=n.shift(),a=RegExp("^["+r.toLowerCase()+r+"][a-z]*"+n.join("[a-z]*")+"[a-z]*$")
return!!(e+"").match(a)},n=function(e,n){e+="",n+=""
var r,a=0
Expand Down
155 changes: 87 additions & 68 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,71 +1,90 @@
{
"name": "redraphael",
"filename": "raphael",
"version": "1.1.10",
"rversion": "2.1.0",
"description": "RedRaphael",
"main": "index.js",
"scripts": {
"test": "init"
},
"repository": {
"type": "git",
"url": "https://github.com/fusioncharts/redraphael.git"
},
"author": "FusionCharts Technologies",
"license": "MIT",
"devDependencies": {
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-jasmine": "~0.5.2",
"yui-benchmark": "~0.3.1"
},
"name": "redraphael",
"filename": "raphael",
"version": "1.1.11",
"rversion": "2.1.0",
"description": "RedRaphael",
"scripts": {
"test": "grunt",
"benchmark": "tests/benchmark/run.sh"
},
"repository": {
"type": "git",
"url": "https://github.com/fusioncharts/redraphael.git"
},
"author": "FusionCharts Technologies",
"bugs": {
"url": "https://github.com/fusioncharts/redraphael/issues"
},
"license": "MIT",
"devDependencies": {
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-jasmine": "~0.5.2",
"yui-benchmark": "~0.3.1"
},
"homepage": "https://github.com/fusioncharts/redraphael",
"main": "package/raphael.js",
"directories": {
"doc": "docs",
"test": "tests"
},
"dependencies": {
"grunt": "^0.4.2",
"grunt-contrib-jasmine": "^0.5.2",
"grunt-contrib-concat": "^0.3.0",
"grunt-contrib-uglify": "^0.2.7",
"yui-benchmark": "^0.3.1"
},
"keywords": [
"svg",
"vml",
"graphics-library"
],

"jshintConfig": {
"bitwise": false,
"camelcase": true,
"curly": true,
"eqeqeq": false,
"es3": true,
"forin": false,
"freeze": true,
"immed": true,
"indent": 4,
"latedef": true,
"newcap": true,
"noarg": true,
"noempty": false,
"nonew": false,
"plusplus": false,
"quotmark": "double",
"undef": true,
"unused": true,
"trailing": false,

"asi": false,
"boss": true,
"debug": false,
"eqnull": true,
"evil": false,
"expr": true,
"funcscope": false,
"globalstrict": false,
"iterator": false,
"lastsemic": false,
"laxbreak": false,
"laxcomma": false,
"loopfunc": false,
"multistr": false,
"notypeof": false,
"proto": false,
"scripturl": false,
"smarttabs": false,
"shadow": false,
"sub": false,
"supernew": false,

"browser": false,
"devel": false,
"node": true
}
"jshintConfig": {
"bitwise": false,
"camelcase": true,
"curly": true,
"eqeqeq": false,
"es3": true,
"forin": false,
"freeze": true,
"immed": true,
"indent": 4,
"latedef": true,
"newcap": true,
"noarg": true,
"noempty": false,
"nonew": false,
"plusplus": false,
"quotmark": "double",
"undef": true,
"unused": true,
"trailing": false,
"asi": false,
"boss": true,
"debug": false,
"eqnull": true,
"evil": false,
"expr": true,
"funcscope": false,
"globalstrict": false,
"iterator": false,
"lastsemic": false,
"laxbreak": false,
"laxcomma": false,
"loopfunc": false,
"multistr": false,
"notypeof": false,
"proto": false,
"scripturl": false,
"smarttabs": false,
"shadow": false,
"sub": false,
"supernew": false,
"browser": false,
"devel": false,
"node": true
}
}
54 changes: 33 additions & 21 deletions package/raphael-fusioncharts.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ window.FusionCharts && window.FusionCharts.register('module', ['private', 'vendo


/**!
* RedRaphael 1.1.10 - JavaScript Vector Library
* RedRaphael 1.1.11 - JavaScript Vector Library
* Copyright (c) 2012-2013 FusionCharts Technologies <http://www.fusioncharts.com>
*
* Raphael 2.1.0
Expand Down Expand Up @@ -531,6 +531,10 @@ window.FusionCharts && window.FusionCharts.register('module', ['private', 'vendo
objectToStr = "[object Object]",
arraySlice = Array.prototype.slice,
arraySplice = Array.prototype.splice,
hasPrototypeBug = (function () {
var a = function () {};
return a.hasOwnProperty("prototype");
}()),
g = {
doc: document,
win: window
Expand Down Expand Up @@ -1077,26 +1081,7 @@ window.FusionCharts && window.FusionCharts.register('module', ['private', 'vendo
(type == "array" && Array.isArray && Array.isArray(o)) ||
objectToString.call(o).slice(8, -1).toLowerCase() == type;
},

/*\
* Raphael.clone
[ method ]
**
* Returns a recursively cloned version of an object.
\*/
clone = R.clone = function (obj) {
if (Object(obj) !== obj) {
return obj;
}
var res = new obj.constructor;
for (var key in obj)
if (obj[has](key)) {
res[key] = clone(obj[key]);
}
return res;
},

/*\
* Raphael.createUUID
[ method ]
**
Expand All @@ -1110,7 +1095,34 @@ window.FusionCharts && window.FusionCharts.register('module', ['private', 'vendo
var r = math.random() * 16 | 0,
v = c == "x" ? r : (r & 3 | 8);
return v.toString(16);
});
}),
/*\
* Raphael.clone
[ method ]
**
* Returns a recursively cloned version of an object.
\*/
clone = R.clone = hasPrototypeBug ? function (obj) {
if (Object(obj) !== obj) {
return obj;
}
var res = new obj.constructor;
for (var key in obj)
if (key !== "prototype" && obj[has](key)) {
res[key] = clone(obj[key]);
}
return res;
} : function (obj) {
if (Object(obj) !== obj) {
return obj;
}
var res = new obj.constructor;
for (var key in obj)
if (obj[has](key)) {
res[key] = clone(obj[key]);
}
return res;
};

R._g = g;

Expand Down
10 changes: 5 additions & 5 deletions package/raphael-min.js

Large diffs are not rendered by default.

Loading

0 comments on commit d003e52

Please sign in to comment.