[moodle] / contrib / plugins / grade / report / visual / visualizations / visualization.php Repository:

View of /contrib/plugins/grade/report/visual/visualizations/visualization.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (annotate)
Sat Aug 2 12:19:16 2008 WST (15 months, 3 weeks ago) by dservos
Branch: MAIN
Changes since 1.1: +19 -1 lines
CONTRIB-497
*Added more visualizations
*Added selector UI Widget for flex/flare visualization
*Refactored some of flex actionscript code.
*Added defaults for selected group and items in visualizations.
*Improved removal of nodes and edges when an item or group is deselected in a legend.
*Fixed a memory leak realting to the removal and addtion of nodes.
*Added more options for and control of the flex/flare based visualization from the Moodle back end.
<?php
class selector {
    public $param;
    public $options;
    public $active;
    
    public function __construct($param, array $options, $active = null) {
        $this->param = $param;
        $this->options = $options;
        $this->active = $active;
    }
}

class edge {
    public $sortby;
    public $groupby;
    
    public function __construct($sortby = null, $groupby = null) {
        $this->sortby = $sortby;
        $this->groupby = $groupby;
    }
}

class encoder {
    const ENCODER_DEFUALT = 1;
    const ENCODER_COLOR = 1;
    const ENCODER_SHAPE = 2; 
    const ENCODER_SIZE = 3;
    
    private static $counter = 0;
    
    public $id;
    
    public $type;
    
    public $settings;
    
    public $datafield;
    
    public function __construct($type, $datafield, array $settings = null) {
        $this->type = $type;
        $this->settings = $settings;
        $this->datafield = $datafield;
        $this->id = self::$counter++;
    }
}

class legend {
    public $encoder;
    
    public $show;
    
    public function __construct($encoder, $show = null) {
        $this->encoder = $encoder;
        $this->show = $show;
    }
}

abstract class visualization {
    
    const LAYOUT_DEFAULT = 1;
    const LAYOUT_AXIS = 1;
    const LAYOUT_CIRCLE = 2;
    const LAYOUT_DENDROGRAM = 3;
    const LAYOUT_FORCEDIRECTED = 4;
    const LAYOUT_INDENTEDTREE = 5;
    const LAYOUT_NODELINKTREE = 6;
    const LAYOUT_PIE = 7;
    const LAYOUT_RADIALTREE = 8;
    const LAYOUT_RANDOM = 9;
    const LAYOUT_STACKEDAREA = 10;
    const LAYOUT_TREEMAP = 11;
    
    const SHAPE_BEZIER = 1;
    const SHAPE_BLOCK = -1;
    const SHAPE_CARDINAL = 2;
    const SHAPE_HORIZONTAL_BAR = -5;
    const SHAPE_LINE = 0;
    const SHAPE_POLYBLOB = -3;
    const SHAPE_POLYGON = -2;
    const SHAPE_VERTICAL_BAR = -4;
    const SHAPE_WEDGE = -6;
    

    public $name;
    
    public $layout = self::LAYOUT_DEFAULT;
   
    public $layoutsettings = null;
   
   public $usegroups = false;
   
    public $edges = null;
   
    public $nodeshape = null;
   
    public $edgeshape = null;
    
    public $selectors = null;
    
    public $font = 'monospace';
    
    public $fontsize = 20;
    
    public $legends = null;

    public $xaxis;
    
    public $yaxis;
    
    public $xaxislabelformat;
    
    public $yaxislabelformat;
    
    public $xaxismin;
    
    public $xaxismax;
    
    public $yaxismin;
    
    public $yaxismax;
    
    public $xaxislabel;
    
    public $yaxislabel;
    
    public $yaxisyoffset;
    
    public $yaxisxoffset;
    
    public $xaxisyoffset;
    
    public $xaxisxoffset;
    
    public $title;
    
    public $capabilities = null;
    
    public $encoders = null;
    
    public $backgroundcolor = 'ffffff';
    
    public $width = 800;
    
    public $height = 600;
    
    public $framerate = 30;
    
    public $quality = "high";

    public $popupbgcolor = '7777ff';

    public $popupbgalpha = 0.60;
    
    public $popuplinecolor = '0000ff';
    
    public $popuplinealpha = 0.3;
    
    public $popuplinesize = 3;
    
    public $popupfont = 'monospace';
    
    public $popupfontsize = 12;

    public $buttonbgcolor = '9999FF';
    
    public $buttonbgalpha = 0.6;
    
    public $buttonfont = 'monospace';
    
    public $buttonfontsize = 12;
    
    public $buttonlinesize = 1;
    
    public $buttonlinecolor = '4444FF';
    
    public $buttonlinealpha = 0.3;

    public function __construct($name) {
        $this->name = $name;
    }
    
    abstract public function report_data($visualreport);
}

?>

Moodle CVS Admin
ViewVC Help
Powered by ViewVC 1.0.7