summaryrefslogtreecommitdiff
path: root/js/dojo-1.6/dojox/charting/plot3d
diff options
context:
space:
mode:
Diffstat (limited to 'js/dojo-1.6/dojox/charting/plot3d')
-rw-r--r--js/dojo-1.6/dojox/charting/plot3d/Bars.js73
-rw-r--r--js/dojo-1.6/dojox/charting/plot3d/Bars.xd.js78
-rw-r--r--js/dojo-1.6/dojox/charting/plot3d/Base.js31
-rw-r--r--js/dojo-1.6/dojox/charting/plot3d/Base.xd.js36
-rw-r--r--js/dojo-1.6/dojox/charting/plot3d/Cylinders.js77
-rw-r--r--js/dojo-1.6/dojox/charting/plot3d/Cylinders.xd.js82
6 files changed, 377 insertions, 0 deletions
diff --git a/js/dojo-1.6/dojox/charting/plot3d/Bars.js b/js/dojo-1.6/dojox/charting/plot3d/Bars.js
new file mode 100644
index 0000000..12e8b80
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/plot3d/Bars.js
@@ -0,0 +1,73 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.charting.plot3d.Bars"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot3d.Bars"] = true;
+dojo.provide("dojox.charting.plot3d.Bars");
+
+dojo.require("dojox.charting.plot3d.Base");
+
+(function(){
+
+ // reduce function borrowed from dojox.fun
+ var reduce = function(/*Array*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: repeatedly applies a binary function to an array from left
+ // to right; returns the final value.
+ a = typeof a == "string" ? a.split("") : a; o = o || dojo.global;
+ var z = a[0];
+ for(var i = 1; i < a.length; z = f.call(o, z, a[i++]));
+ return z; // Object
+ };
+
+ dojo.declare("dojox.charting.plot3d.Bars", dojox.charting.plot3d.Base, {
+ constructor: function(width, height, kwArgs){
+ this.depth = "auto";
+ this.gap = 0;
+ this.data = [];
+ this.material = {type: "plastic", finish: "dull", color: "lime"};
+ if(kwArgs){
+ if("depth" in kwArgs){ this.depth = kwArgs.depth; }
+ if("gap" in kwArgs){ this.gap = kwArgs.gap; }
+ if("material" in kwArgs){
+ var m = kwArgs.material;
+ if(typeof m == "string" || m instanceof dojo.Color){
+ this.material.color = m;
+ }else{
+ this.material = m;
+ }
+ }
+ }
+ },
+ getDepth: function(){
+ if(this.depth == "auto"){
+ var w = this.width;
+ if(this.data && this.data.length){
+ w = w / this.data.length;
+ }
+ return w - 2 * this.gap;
+ }
+ return this.depth;
+ },
+ generate: function(chart, creator){
+ if(!this.data){ return this; }
+ var step = this.width / this.data.length, org = 0,
+ depth = this.depth == "auto" ? step - 2 * this.gap : this.depth,
+ scale = this.height / reduce(this.data, Math.max);
+ if(!creator){ creator = chart.view; }
+ for(var i = 0; i < this.data.length; ++i, org += step){
+ creator
+ .createCube({
+ bottom: {x: org + this.gap, y: 0, z: 0},
+ top: {x: org + step - this.gap, y: this.data[i] * scale, z: depth}
+ })
+ .setFill(this.material);
+ }
+ }
+ });
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/charting/plot3d/Bars.xd.js b/js/dojo-1.6/dojox/charting/plot3d/Bars.xd.js
new file mode 100644
index 0000000..80f8e4e
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/plot3d/Bars.xd.js
@@ -0,0 +1,78 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.charting.plot3d.Bars"],
+["require", "dojox.charting.plot3d.Base"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.charting.plot3d.Bars"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot3d.Bars"] = true;
+dojo.provide("dojox.charting.plot3d.Bars");
+
+dojo.require("dojox.charting.plot3d.Base");
+
+(function(){
+
+ // reduce function borrowed from dojox.fun
+ var reduce = function(/*Array*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: repeatedly applies a binary function to an array from left
+ // to right; returns the final value.
+ a = typeof a == "string" ? a.split("") : a; o = o || dojo.global;
+ var z = a[0];
+ for(var i = 1; i < a.length; z = f.call(o, z, a[i++]));
+ return z; // Object
+ };
+
+ dojo.declare("dojox.charting.plot3d.Bars", dojox.charting.plot3d.Base, {
+ constructor: function(width, height, kwArgs){
+ this.depth = "auto";
+ this.gap = 0;
+ this.data = [];
+ this.material = {type: "plastic", finish: "dull", color: "lime"};
+ if(kwArgs){
+ if("depth" in kwArgs){ this.depth = kwArgs.depth; }
+ if("gap" in kwArgs){ this.gap = kwArgs.gap; }
+ if("material" in kwArgs){
+ var m = kwArgs.material;
+ if(typeof m == "string" || m instanceof dojo.Color){
+ this.material.color = m;
+ }else{
+ this.material = m;
+ }
+ }
+ }
+ },
+ getDepth: function(){
+ if(this.depth == "auto"){
+ var w = this.width;
+ if(this.data && this.data.length){
+ w = w / this.data.length;
+ }
+ return w - 2 * this.gap;
+ }
+ return this.depth;
+ },
+ generate: function(chart, creator){
+ if(!this.data){ return this; }
+ var step = this.width / this.data.length, org = 0,
+ depth = this.depth == "auto" ? step - 2 * this.gap : this.depth,
+ scale = this.height / reduce(this.data, Math.max);
+ if(!creator){ creator = chart.view; }
+ for(var i = 0; i < this.data.length; ++i, org += step){
+ creator
+ .createCube({
+ bottom: {x: org + this.gap, y: 0, z: 0},
+ top: {x: org + step - this.gap, y: this.data[i] * scale, z: depth}
+ })
+ .setFill(this.material);
+ }
+ }
+ });
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/charting/plot3d/Base.js b/js/dojo-1.6/dojox/charting/plot3d/Base.js
new file mode 100644
index 0000000..61e9c28
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/plot3d/Base.js
@@ -0,0 +1,31 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.charting.plot3d.Base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot3d.Base"] = true;
+dojo.provide("dojox.charting.plot3d.Base");
+
+dojo.require("dojox.charting.Chart3D");
+
+dojo.declare("dojox.charting.plot3d.Base", null, {
+ constructor: function(width, height, kwArgs){
+ this.width = width;
+ this.height = height;
+ },
+ setData: function(data){
+ this.data = data ? data : [];
+ return this;
+ },
+ getDepth: function(){
+ return this.depth;
+ },
+ generate: function(chart, creator){
+ }
+});
+
+
+}
diff --git a/js/dojo-1.6/dojox/charting/plot3d/Base.xd.js b/js/dojo-1.6/dojox/charting/plot3d/Base.xd.js
new file mode 100644
index 0000000..309d7b2
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/plot3d/Base.xd.js
@@ -0,0 +1,36 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.charting.plot3d.Base"],
+["require", "dojox.charting.Chart3D"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.charting.plot3d.Base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot3d.Base"] = true;
+dojo.provide("dojox.charting.plot3d.Base");
+
+dojo.require("dojox.charting.Chart3D");
+
+dojo.declare("dojox.charting.plot3d.Base", null, {
+ constructor: function(width, height, kwArgs){
+ this.width = width;
+ this.height = height;
+ },
+ setData: function(data){
+ this.data = data ? data : [];
+ return this;
+ },
+ getDepth: function(){
+ return this.depth;
+ },
+ generate: function(chart, creator){
+ }
+});
+
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/charting/plot3d/Cylinders.js b/js/dojo-1.6/dojox/charting/plot3d/Cylinders.js
new file mode 100644
index 0000000..60a4d0e
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/plot3d/Cylinders.js
@@ -0,0 +1,77 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.charting.plot3d.Cylinders"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot3d.Cylinders"] = true;
+dojo.provide("dojox.charting.plot3d.Cylinders");
+
+dojo.require("dojox.charting.plot3d.Base");
+
+(function(){
+
+ // reduce function borrowed from dojox.fun
+ var reduce = function(/*Array*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: repeatedly applies a binary function to an array from left
+ // to right; returns the final value.
+ a = typeof a == "string" ? a.split("") : a; o = o || dojo.global;
+ var z = a[0];
+ for(var i = 1; i < a.length; z = f.call(o, z, a[i++]));
+ return z; // Object
+ };
+
+ dojo.declare("dojox.charting.plot3d.Cylinders", dojox.charting.plot3d.Base, {
+ constructor: function(width, height, kwArgs){
+ this.depth = "auto";
+ this.gap = 0;
+ this.data = [];
+ this.material = {type: "plastic", finish: "shiny", color: "lime"};
+ this.outline = null;
+ if(kwArgs){
+ if("depth" in kwArgs){ this.depth = kwArgs.depth; }
+ if("gap" in kwArgs){ this.gap = kwArgs.gap; }
+ if("material" in kwArgs){
+ var m = kwArgs.material;
+ if(typeof m == "string" || m instanceof dojo.Color){
+ this.material.color = m;
+ }else{
+ this.material = m;
+ }
+ }
+ if("outline" in kwArgs){ this.outline = kwArgs.outline; }
+ }
+ },
+ getDepth: function(){
+ if(this.depth == "auto"){
+ var w = this.width;
+ if(this.data && this.data.length){
+ w = w / this.data.length;
+ }
+ return w - 2 * this.gap;
+ }
+ return this.depth;
+ },
+ generate: function(chart, creator){
+ if(!this.data){ return this; }
+ var step = this.width / this.data.length, org = 0,
+ scale = this.height / reduce(this.data, Math.max);
+ if(!creator){ creator = chart.view; }
+ for(var i = 0; i < this.data.length; ++i, org += step){
+ creator
+ .createCylinder({
+ center: {x: org + step / 2, y: 0, z: 0},
+ radius: step / 2 - this.gap,
+ height: this.data[i] * scale
+ })
+ .setTransform(dojox.gfx3d.matrix.rotateXg(-90))
+ .setFill(this.material).setStroke(this.outline);
+ }
+ }
+ });
+})();
+
+
+}
diff --git a/js/dojo-1.6/dojox/charting/plot3d/Cylinders.xd.js b/js/dojo-1.6/dojox/charting/plot3d/Cylinders.xd.js
new file mode 100644
index 0000000..b9bd2df
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/plot3d/Cylinders.xd.js
@@ -0,0 +1,82 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.charting.plot3d.Cylinders"],
+["require", "dojox.charting.plot3d.Base"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.charting.plot3d.Cylinders"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.plot3d.Cylinders"] = true;
+dojo.provide("dojox.charting.plot3d.Cylinders");
+
+dojo.require("dojox.charting.plot3d.Base");
+
+(function(){
+
+ // reduce function borrowed from dojox.fun
+ var reduce = function(/*Array*/ a, /*Function|String|Array*/ f, /*Object?*/ o){
+ // summary: repeatedly applies a binary function to an array from left
+ // to right; returns the final value.
+ a = typeof a == "string" ? a.split("") : a; o = o || dojo.global;
+ var z = a[0];
+ for(var i = 1; i < a.length; z = f.call(o, z, a[i++]));
+ return z; // Object
+ };
+
+ dojo.declare("dojox.charting.plot3d.Cylinders", dojox.charting.plot3d.Base, {
+ constructor: function(width, height, kwArgs){
+ this.depth = "auto";
+ this.gap = 0;
+ this.data = [];
+ this.material = {type: "plastic", finish: "shiny", color: "lime"};
+ this.outline = null;
+ if(kwArgs){
+ if("depth" in kwArgs){ this.depth = kwArgs.depth; }
+ if("gap" in kwArgs){ this.gap = kwArgs.gap; }
+ if("material" in kwArgs){
+ var m = kwArgs.material;
+ if(typeof m == "string" || m instanceof dojo.Color){
+ this.material.color = m;
+ }else{
+ this.material = m;
+ }
+ }
+ if("outline" in kwArgs){ this.outline = kwArgs.outline; }
+ }
+ },
+ getDepth: function(){
+ if(this.depth == "auto"){
+ var w = this.width;
+ if(this.data && this.data.length){
+ w = w / this.data.length;
+ }
+ return w - 2 * this.gap;
+ }
+ return this.depth;
+ },
+ generate: function(chart, creator){
+ if(!this.data){ return this; }
+ var step = this.width / this.data.length, org = 0,
+ scale = this.height / reduce(this.data, Math.max);
+ if(!creator){ creator = chart.view; }
+ for(var i = 0; i < this.data.length; ++i, org += step){
+ creator
+ .createCylinder({
+ center: {x: org + step / 2, y: 0, z: 0},
+ radius: step / 2 - this.gap,
+ height: this.data[i] * scale
+ })
+ .setTransform(dojox.gfx3d.matrix.rotateXg(-90))
+ .setFill(this.material).setStroke(this.outline);
+ }
+ }
+ });
+})();
+
+
+}
+
+}};});