Skip to content

Commit

Permalink
Updated tests to the new API. TM tests not working
Browse files Browse the repository at this point in the history
Will check that later.
  • Loading branch information
philogb committed Feb 5, 2010
1 parent bb8b50f commit e4af22e
Show file tree
Hide file tree
Showing 27 changed files with 558 additions and 585 deletions.
3 changes: 1 addition & 2 deletions Source/Core/Canvas.js
Expand Up @@ -116,14 +116,13 @@
The _init_ method is only called once, at the instanciation of the background canvas.
The _plot_ method is called for plotting a Canvas image.
*/
this.Canvas = (function(){
var Canvas = (function(){
var config = {
'injectInto': 'id',
'width': false,
'height': false,
'useCanvas': false,
'labels': 'HTML', //can also be 'SVG' or 'Native'

'backgroundCanvas': false
};

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core.js
Expand Up @@ -364,7 +364,7 @@ var Event = {
};

//common json manipulation methods
$jit.$json = {
$jit.json = {

/*
Method: prune
Expand Down
2 changes: 1 addition & 1 deletion Source/Graph/Graph.js
Expand Up @@ -46,7 +46,7 @@
*/

this.Graph = new Class({
var Graph = new Class({

initialize: function(opt, Node, Edge) {
var innerOptions = {
Expand Down
9 changes: 7 additions & 2 deletions Source/Visualizations/ForceDirected.js
Expand Up @@ -144,8 +144,13 @@ $jit.ForceDirected = new Class( {
"Fx", "Tips", "NodeStyles", "Controller"), config, controller);

var canvasConfig = this.config;
this.config.labelContainer = canvasConfig.injectInto + '-label';
this.canvas = new Canvas(canvasConfig);
if(canvasConfig.useCanvas) {
this.canvas = canvasConfig.useCanvas;
this.config.labelContainer = this.canvas.id + '-label';
} else {
this.canvas = new Canvas(canvasConfig);
this.config.labelContainer = canvasConfig.injectInto + '-label';
}

this.graphOptions = {
'complex': true,
Expand Down
9 changes: 7 additions & 2 deletions Source/Visualizations/Hypertree.js
Expand Up @@ -255,8 +255,13 @@ $jit.Hypertree = new Class( {
"Fx", "Tips", "NodeStyles", "Controller"), config, controller);

var canvasConfig = this.config;
this.config.labelContainer = canvasConfig.injectInto + '-label';
this.canvas = new Canvas(canvasConfig);
if(canvasConfig.useCanvas) {
this.canvas = canvasConfig.useCanvas;
this.config.labelContainer = this.canvas.id + '-label';
} else {
this.canvas = new Canvas(canvasConfig);
this.config.labelContainer = canvasConfig.injectInto + '-label';
}

this.graphOptions = {
'complex': false,
Expand Down
9 changes: 7 additions & 2 deletions Source/Visualizations/RGraph.js
Expand Up @@ -153,8 +153,13 @@ $jit.RGraph = new Class( {
"Fx", "Controller", "Tips", "NodeStyles"), config, controller);

var canvasConfig = this.config;
this.config.labelContainer = canvasConfig.injectInto + '-label';
this.canvas = new Canvas(canvasConfig);
if(canvasConfig.useCanvas) {
this.canvas = canvasConfig.useCanvas;
this.config.labelContainer = this.canvas.id + '-label';
} else {
this.canvas = new Canvas(canvasConfig);
this.config.labelContainer = canvasConfig.injectInto + '-label';
}

this.graphOptions = {
'complex': false,
Expand Down
10 changes: 8 additions & 2 deletions Source/Visualizations/Spacetree.js
Expand Up @@ -221,8 +221,14 @@ $jit.ST= (function() {
"Tips", "NodeStyles"), config, controller);

var canvasConfig = this.config;
this.config.labelContainer = canvasConfig.injectInto + '-label';
this.canvas = new Canvas(canvasConfig);
if(canvasConfig.useCanvas) {
this.canvas = canvasConfig.useCanvas;
this.config.labelContainer = this.canvas.id + '-label';
} else {
this.canvas = new Canvas(canvasConfig);
this.config.labelContainer = canvasConfig.injectInto + '-label';
}

this.graphOptions = {
'complex': true
};
Expand Down
13 changes: 9 additions & 4 deletions Source/Visualizations/Sunburst.js
Expand Up @@ -157,8 +157,13 @@ $jit.Sunburst = new Class({
"Fx", "Tips", "NodeStyles", "Controller"), config, controller);

var canvasConfig = this.config;
this.config.labelContainer = canvasConfig.injectInto + '-label';
this.canvas = new Canvas(canvasConfig);
if(canvasConfig.useCanvas) {
this.canvas = canvasConfig.useCanvas;
this.config.labelContainer = this.canvas.id + '-label';
} else {
this.canvas = new Canvas(canvasConfig);
this.config.labelContainer = canvasConfig.injectInto + '-label';
}

this.graphOptions = {
'complex': false,
Expand Down Expand Up @@ -389,7 +394,7 @@ $jit.Sunburst.$extend = true;
*/
Sunburst.Label.Native = new Class( {
Extends: Graph.Label.Native,
Implements: Graph.Label.Native,

initialize: function(viz) {
this.viz = viz;
Expand Down Expand Up @@ -644,9 +649,9 @@ $jit.Sunburst.$extend = true;

var ctx = canvas.getCtx();
ctx.moveTo(0, 0);
ctx.beginPath();
ctx.arc(0, 0, polarNode.rho, begin, end, false);
ctx.arc(0, 0, polarNode.rho + ldist, end, begin, true);
ctx.beginPath();
ctx.moveTo(p1coord.x, p1coord.y);
ctx.lineTo(p4coord.x, p4coord.y);
ctx.moveTo(p2coord.x, p2coord.y);
Expand Down

0 comments on commit e4af22e

Please sign in to comment.