dojox/charting/Chart3D.js

  • Provides:

    • dojox.charting.Chart3D
  • Requires:

    • dojox.gfx3d in common
  • dojox.charting.Chart3D

    • type
      Function
    • parameters:
      • node: (typeof )
      • lights: (typeof )
      • camera: (typeof )
      • theme: (typeof )
    • source: [view]
      dojo.provide("dojox.charting.Chart3D");


      dojo.require("dojox.gfx3d");


      (function(){
       var observerVector = {x: 0, y: 0, z: 1}, v = dojox.gfx3d.vector, n = dojox.gfx.normalizedLength;


       dojo.declare("dojox.charting.Chart3D", null, {
        constructor: function(node, lights, camera, theme){
         // setup a view
         this.node = dojo.byId(node);
         this.surface = dojox.gfx.createSurface(this.node, n(this.node.style.width), n(this.node.style.height));
         this.view = this.surface.createViewport();
         this.view.setLights(lights.lights, lights.ambient, lights.specular);
         this.view.setCameraTransform(camera);
         this.theme = theme;

         
         // initialize internal variables
         this.walls = [];
         this.plots = [];
    • summary
  • dojox.charting.Chart3D.generate

    • type
      Function
    • source: [view]
         return this._generateWalls()._generatePlots();
    • summary
  • dojox.charting.Chart3D.invalidate

    • type
      Function
    • source: [view]
         this.view.invalidate();
         return this;
    • summary
  • dojox.charting.Chart3D.render

    • type
      Function
    • source: [view]
         this.view.render();
         return this;
    • summary
  • dojox.charting.Chart3D.addPlot

    • type
      Function
    • parameters:
      • plot: (typeof )
    • source: [view]
         return this._add(this.plots, plot);
    • summary
  • dojox.charting.Chart3D.removePlot

    • type
      Function
    • parameters:
      • plot: (typeof )
    • source: [view]
         return this._remove(this.plots, plot);
    • summary
  • dojox.charting.Chart3D.addWall

    • type
      Function
    • parameters:
      • wall: (typeof )
    • source: [view]
         return this._add(this.walls, wall);
    • summary
  • dojox.charting.Chart3D.removeWall

    • type
      Function
    • parameters:
      • wall: (typeof )
    • source: [view]
         return this._remove(this.walls, wall);
    • summary
  • dojox.charting.Chart3D._add

    • type
      Function
    • parameters:
      • array: (typeof )
      • item: (typeof )
    • source: [view]
         if(!dojo.some(array, function(i){ return i == item; })){
          array.push(item);
          this.view.invalidate();
         }
         return this;
    • summary
  • dojox.charting.Chart3D._remove

    • type
      Function
    • parameters:
      • array: (typeof )
      • item: (typeof )
    • source: [view]
         var a = dojo.filter(array, function(i){ return i != item; });
         return a.length < array.length ? (array = a, this.invalidate()) : this;
    • summary
  • dojox.charting.Chart3D._generateWalls

    • type
      Function
    • source: [view]
         for(var i = 0; i < this.walls.length; ++i){
          if(v.dotProduct(observerVector, this.walls[i].normal) > 0){
           this.walls[i].generate(this);
          }
         }
         return this;
    • summary
  • dojox.charting.Chart3D._generatePlots

    • type
      Function
    • source: [view]
         var depth = 0, m = dojox.gfx3d.matrix, i = 0;
         for(; i < this.plots.length; ++i){
          depth += this.plots[i].getDepth();
         }
         for(--i; i >= 0; --i){
          var scene = this.view.createScene();
          scene.setTransform(m.translate(0, 0, -depth));
          this.plots[i].generate(this, scene);
          depth -= this.plots[i].getDepth();
         }
         return this;
    • summary
  • dojox.charting.Chart3D.node

    • summary
  • dojox.charting.Chart3D.surface

    • summary
  • dojox.charting.Chart3D.view

    • summary
  • dojox.charting.Chart3D.theme

    • summary
  • dojox.charting.Chart3D.walls

    • summary
  • dojox.charting.Chart3D.plots

    • summary
  • dojox.charting

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary