X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=plotkit_v091%2FPlotKit%2FCanvas.js;h=a3a1e09be077c3dc865051b8de22161cf897702e;hb=5709f0d5571980cae539ebb94533dee5c6b405c1;hp=5370cb67bf98a12c076f922b81f900f9ccd68f88;hpb=74c4d45c7c3de4feba9eb8be0631cef5ad206622;p=dygraphs.git diff --git a/plotkit_v091/PlotKit/Canvas.js b/plotkit_v091/PlotKit/Canvas.js index 5370cb6..a3a1e09 100644 --- a/plotkit_v091/PlotKit/Canvas.js +++ b/plotkit_v091/PlotKit/Canvas.js @@ -1,57 +1,3 @@ -/* - PlotKit Canvas - ============== - - Provides HTML Canvas Renderer. This is supported under: - - - Safari 2.0 - - Mozilla Firefox 1.5 - - Opera 9.0 preview 2 - - IE 6 (via VML Emulation) - - It uses DIVs for labels. - - Copyright - --------- - Copyright 2005,2006 (c) Alastair Tse - For use under the BSD license. - -*/ -// -------------------------------------------------------------------- -// Check required components -// -------------------------------------------------------------------- - -try { - if ((typeof(PlotKit.Base) == 'undefined') || - (typeof(PlotKit.Layout) == 'undefined')) - { - throw ""; - } -} -catch (e) { - throw "PlotKit.Layout depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.{Base,Layout}" -} - - -// ------------------------------------------------------------------------ -// Defines the renderer class -// ------------------------------------------------------------------------ - -if (typeof(PlotKit.CanvasRenderer) == 'undefined') { - PlotKit.CanvasRenderer = {}; -} - -PlotKit.CanvasRenderer.NAME = "PlotKit.CanvasRenderer"; -PlotKit.CanvasRenderer.VERSION = PlotKit.VERSION; - -PlotKit.CanvasRenderer.__repr__ = function() { - return "[" + this.NAME + " " + this.VERSION + "]"; -}; - -PlotKit.CanvasRenderer.toString = function() { - return this.__repr__(); -} - PlotKit.CanvasRenderer = function(element, layout, options) { if (arguments.length > 0) this.__init__(element, layout, options); @@ -63,14 +9,7 @@ PlotKit.CanvasRenderer.prototype.__init__ = function(element, layout, options) { // default options this.options = { - "drawBackground": true, - "backgroundColor": Color.whiteColor(), - "colorScheme": PlotKit.Base.palette(PlotKit.Base.baseColors()[0]), - "strokeColor": Color.whiteColor(), - "strokeColorTransform": "asStrokeColor", "strokeWidth": 0.5, - "shouldFill": true, - "shouldStroke": true, "drawXAxis": true, "drawYAxis": true, "axisLineColor": Color.blackColor(), @@ -79,9 +18,7 @@ PlotKit.CanvasRenderer.prototype.__init__ = function(element, layout, options) { "axisLabelColor": Color.blackColor(), "axisLabelFont": "Arial", "axisLabelFontSize": 9, - "axisLabelWidth": 50, - "pieRadius": 0.4, - "enableEvents": true + "axisLabelWidth": 50, }; MochiKit.Base.update(this.options, options ? options : {}); @@ -117,7 +54,6 @@ PlotKit.CanvasRenderer.prototype.__init__ = function(element, layout, options) { // internal state this.xlabels = new Array(); this.ylabels = new Array(); - this.isFirstRender = true; this.area = { x: this.options.yAxisLabelWidth + 2 * this.options.axisTickSize, @@ -266,7 +202,6 @@ PlotKit.CanvasRenderer.prototype.clear = function() { var context = this.element.getContext("2d"); } catch (e) { - this.isFirstRender = false; this.clearDelay = MochiKit.Async.wait(this.IEDelay); this.clearDelay.addCallback(bind(this.clear, this)); return; @@ -305,31 +240,3 @@ PlotKit.CanvasRenderer.isSupported = function(canvasName) { } return true; }; - -// Namespace Iniitialisation - -PlotKit.Canvas = {} -PlotKit.Canvas.CanvasRenderer = PlotKit.CanvasRenderer; - -PlotKit.Canvas.EXPORT = [ - "CanvasRenderer" -]; - -PlotKit.Canvas.EXPORT_OK = [ - "CanvasRenderer" -]; - -PlotKit.Canvas.__new__ = function() { - var m = MochiKit.Base; - - m.nameFunctions(this); - - this.EXPORT_TAGS = { - ":common": this.EXPORT, - ":all": m.concat(this.EXPORT, this.EXPORT_OK) - }; -}; - -PlotKit.Canvas.__new__(); -MochiKit.Base._exportSymbols(this, PlotKit.Canvas); -