Changeset 19

Show
Ignore:
Timestamp:
01/05/06 11:37:55 (2 years ago)
Author:
al
Message:

Adding dynamic loading and packed versions just like MochiKit?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plotkit/trunk/PlotKit/Canvas.js

    r18 r19  
    11/*  
    22    PlotKit Canvas 
    3     -------------- 
     3    ============== 
    44     
    55    Provides HTML Canvas Renderer. This is supported under: 
     
    2323 
    2424try {     
    25     if (typeof(PlotKit.Layout) == 'undefined') 
     25    if ((typeof(PlotKit.Base) == 'undefined') || 
     26        (typeof(PlotKit.Layout) == 'undefined')) 
    2627    { 
    2728        throw "";     
     
    2930}  
    3031catch (e) {     
    31     throw "PlotKit.Layout depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.Base and PlotKit.Layout
     32    throw "PlotKit.Layout depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.{Base,Layout}
    3233} 
    3334 
     
    9495    this.isIE = PlotKit.Base.excanvasSupported(); 
    9596 
    96     if (this.isIE) { 
     97    if (this.isIE && !isNil(G_vmlCanvasManager)) { 
    9798        this.IEDelay = 0.5; 
    9899        this.maxTries = 5; 
     
    649650    return true; 
    650651}; 
     652 
     653// Namespace Iniitialisation 
     654 
     655PlotKit.Canvas = {} 
     656PlotKit.Canvas.CanvasRenderer = PlotKit.CanvasRenderer; 
     657 
     658PlotKit.Canvas.EXPORT = [ 
     659    "CanvasRenderer" 
     660]; 
     661 
     662PlotKit.Canvas.EXPORT_OK = [ 
     663    "CanvasRenderer" 
     664]; 
     665 
     666PlotKit.Canvas.__new__ = function() { 
     667    var m = MochiKit.Base; 
     668     
     669    m.nameFunctions(this); 
     670     
     671    this.EXPORT_TAGS = { 
     672        ":common": this.EXPORT, 
     673        ":all": m.concat(this.EXPORT, this.EXPORT_OK) 
     674    }; 
     675}; 
     676 
     677PlotKit.Canvas.__new__(); 
     678MochiKit.Base._exportSymbols(this, PlotKit.Canvas); 
     679 
  • plotkit/trunk/PlotKit/Layout.js

    r12 r19  
    11/*  
    22    PlotKit Layout 
    3     -------------- 
     3    ============== 
    44     
    55    Handles laying out data on to a virtual canvas square canvas between 0.0  
     
    587587// -------------------------------------------------------------------- 
    588588 
     589 
     590// Namespace Iniitialisation 
     591 
     592PlotKit.LayoutModule = {}; 
     593PlotKit.LayoutModule.Layout = PlotKit.Layout; 
     594 
     595PlotKit.LayoutModule.EXPORT = [ 
     596    "Layout" 
     597]; 
     598 
     599PlotKit.LayoutModule.EXPORT_OK = []; 
     600 
     601PlotKit.LayoutModule.__new__ = function() { 
     602    var m = MochiKit.Base; 
     603     
     604    m.nameFunctions(this); 
     605     
     606    this.EXPORT_TAGS = { 
     607        ":common": this.EXPORT, 
     608        ":all": m.concat(this.EXPORT, this.EXPORT_OK) 
     609    }; 
     610}; 
     611 
     612PlotKit.LayoutModule.__new__(); 
     613MochiKit.Base._exportSymbols(this, PlotKit.LayoutModule); 
     614 
     615 
  • plotkit/trunk/PlotKit/SVG.js

    r12 r19  
    5151} 
    5252 
    53 PlotKit.SVGRenderer.isSupported = function() { 
    54     // TODO 
    55     return true; 
    56 }; 
    5753 
    5854PlotKit.SVGRenderer.prototype.__init__ = function(element, layout, options) { 
     
    626622         
    627623        var html = '<svg:svg width="' + width + '" height="' + height + '" '; 
    628         html += 'id="' + eid + '" version="1.1" baseProfile="full">'; 
     624        html += 'id="' + eid + '" version="1.1" baseProfile="full" />'; 
    629625 
    630626        var canvas = document.createElement(html); 
     
    676672    return false; 
    677673}; 
     674 
     675// Namespace Iniitialisation 
     676 
     677PlotKit.SVG = {} 
     678PlotKit.SVG.SVGRenderer = PlotKit.SVGRenderer; 
     679 
     680PlotKit.SVG.EXPORT = [ 
     681    "SVGRenderer" 
     682]; 
     683 
     684PlotKit.SVG.EXPORT_OK = [ 
     685    "SVGRenderer" 
     686]; 
     687 
     688PlotKit.SVG.__new__ = function() { 
     689    var m = MochiKit.Base; 
     690     
     691    m.nameFunctions(this); 
     692     
     693    this.EXPORT_TAGS = { 
     694        ":common": this.EXPORT, 
     695        ":all": m.concat(this.EXPORT, this.EXPORT_OK) 
     696    }; 
     697}; 
     698 
     699PlotKit.SVG.__new__(); 
     700MochiKit.Base._exportSymbols(this, PlotKit.SVG); 
     701 
  • plotkit/trunk/PlotKit/SweetCanvas.js

    r15 r19  
    284284    } 
    285285}; 
     286 
     287// Namespace Iniitialisation 
     288 
     289PlotKit.SweetCanvas = {} 
     290PlotKit.SweetCanvas.SweetCanvasRenderer = PlotKit.SweetCanvasRenderer; 
     291 
     292PlotKit.SweetCanvas.EXPORT = [ 
     293    "SweetCanvasRenderer" 
     294]; 
     295 
     296PlotKit.SweetCanvas.EXPORT_OK = [ 
     297    "SweetCanvasRenderer" 
     298]; 
     299 
     300PlotKit.SweetCanvas.__new__ = function() { 
     301    var m = MochiKit.Base; 
     302     
     303    m.nameFunctions(this); 
     304     
     305    this.EXPORT_TAGS = { 
     306        ":common": this.EXPORT, 
     307        ":all": m.concat(this.EXPORT, this.EXPORT_OK) 
     308    }; 
     309}; 
     310 
     311PlotKit.SweetCanvas.__new__(); 
     312MochiKit.Base._exportSymbols(this, PlotKit.SweetCanvas); 
     313 
  • plotkit/trunk/PlotKit/SweetSVG.js

    r12 r19  
    195195     
    196196}; 
     197 
     198// Namespace Iniitialisation 
     199 
     200PlotKit.SweetSVG = {} 
     201PlotKit.SweetSVG.SweetSVGRenderer = PlotKit.SweetSVGRenderer; 
     202 
     203PlotKit.SweetSVG.EXPORT = [ 
     204    "SweetSVGRenderer" 
     205]; 
     206 
     207PlotKit.SweetSVG.EXPORT_OK = [ 
     208    "SweetSVGRenderer" 
     209]; 
     210 
     211PlotKit.SweetSVG.__new__ = function() { 
     212    var m = MochiKit.Base; 
     213     
     214    m.nameFunctions(this); 
     215     
     216    this.EXPORT_TAGS = { 
     217        ":common": this.EXPORT, 
     218        ":all": m.concat(this.EXPORT, this.EXPORT_OK) 
     219    }; 
     220}; 
     221 
     222PlotKit.SweetSVG.__new__(); 
     223MochiKit.Base._exportSymbols(this, PlotKit.SweetSVG); 
  • plotkit/trunk/doc/PlotKit.SVG.txt

    r13 r19  
    3434        xmlns:xlink="http://www.w3.org/1999/xlink"> 
    3535        <head>         
    36           <object id="AdobeSVG" classid="clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2"></object> 
     36          <object id="AdobeSVG" classid="clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2" width="1" height="1"></object> 
    3737          <?import namespace="svg" implementation="#AdobeSVG"?> 
    3838        ...